feat(emacs): Library additions
- Fixes bug with TRAMP Eshell prompt
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
(require 'syd-buffers)
|
(require 'syd-buffers)
|
||||||
(require 'cl-lib)
|
(require 'cl-lib)
|
||||||
(eval-when-compile (require 'cl-lib))
|
(eval-when-compile (require 'cl-lib))
|
||||||
|
(eval-when-compile (require 'tramp))
|
||||||
|
|
||||||
(syd-define-stub
|
(syd-define-stub
|
||||||
syd/copy-this-file
|
syd/copy-this-file
|
||||||
@@ -149,7 +150,6 @@ If FORCE-P, delete without confirmation."
|
|||||||
(defun syd-split-tramp-file-name (file-name)
|
(defun syd-split-tramp-file-name (file-name)
|
||||||
"Split FILE-NAME into (TRAMP-PREFIX . LOCAL-NAME). Returns (nil . FILE-NAME)
|
"Split FILE-NAME into (TRAMP-PREFIX . LOCAL-NAME). Returns (nil . FILE-NAME)
|
||||||
if FILE-NAME has no TRAMP prefix."
|
if FILE-NAME has no TRAMP prefix."
|
||||||
(require 'tramp)
|
|
||||||
(if (tramp-tramp-file-p file-name)
|
(if (tramp-tramp-file-p file-name)
|
||||||
(let* ((dissected (tramp-dissect-file-name file-name t))
|
(let* ((dissected (tramp-dissect-file-name file-name t))
|
||||||
(localname (tramp-file-name-localname dissected)))
|
(localname (tramp-file-name-localname dissected)))
|
||||||
|
|||||||
@@ -484,10 +484,16 @@ be considered as part of the sexp."
|
|||||||
(general-def
|
(general-def
|
||||||
:keymaps 'syd-lisp-mode-map
|
:keymaps 'syd-lisp-mode-map
|
||||||
:states 'motion
|
:states 'motion
|
||||||
"C-h" #'sp-backward-up-sexp
|
"C-h" #'sp-backward-up-sexp ; Probably deprecated.
|
||||||
"C-j" #'syd-sexp-next
|
"C-j" #'syd-sexp-next ; Probably deprecated.
|
||||||
"C-k" #'syd-sexp-previous
|
"C-k" #'syd-sexp-previous ; Probably deprecated.
|
||||||
"C-l" #'sp-down-sexp
|
"C-l" #'sp-down-sexp ; Probably deprecated.
|
||||||
|
|
||||||
|
"M-h" #'sp-backward-up-sexp
|
||||||
|
"M-j" #'syd-sexp-next
|
||||||
|
"M-k" #'syd-sexp-previous
|
||||||
|
"M-l" #'sp-down-sexp
|
||||||
|
|
||||||
"(" #'syd-backward-up-sexp
|
"(" #'syd-backward-up-sexp
|
||||||
")" #'syd-forward-up-sexp
|
")" #'syd-forward-up-sexp
|
||||||
"{" #'syd-sexp-backward-opening
|
"{" #'syd-sexp-backward-opening
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ not mutated; a new plist is returned."
|
|||||||
(list prop* new-val)
|
(list prop* new-val)
|
||||||
(list prop* old-val))))
|
(list prop* old-val))))
|
||||||
|
|
||||||
;; TODO: Support (syd-add-hook 'hook (defun my-hook () ...))
|
|
||||||
(defmacro syd-add-hook (hooks &rest hforms)
|
(defmacro syd-add-hook (hooks &rest hforms)
|
||||||
(declare (indent defun))
|
(declare (indent defun))
|
||||||
(syd-lift-lambdas
|
(syd-lift-lambdas
|
||||||
|
|||||||
@@ -35,5 +35,16 @@ project\"."
|
|||||||
;; TODO: Prompt for path project root is not found.
|
;; TODO: Prompt for path project root is not found.
|
||||||
(syd-search-directory (syd-project-root)))
|
(syd-search-directory (syd-project-root)))
|
||||||
|
|
||||||
|
(defun syd-project-root-find-file (file-name)
|
||||||
|
"Just like `project-root-find-file', but allowing you to select the root
|
||||||
|
directory itself."
|
||||||
|
(declare (interactive-only find-file))
|
||||||
|
(interactive
|
||||||
|
(list (let ((root (project-root (project-current t))))
|
||||||
|
(read-file-name
|
||||||
|
"Find file in root: "
|
||||||
|
root root (confirm-nonexistent-file-or-buffer)))))
|
||||||
|
(find-file file-name t))
|
||||||
|
|
||||||
(provide 'syd-project)
|
(provide 'syd-project)
|
||||||
;;; syd-project.el ends here
|
;;; syd-project.el ends here
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
;; before. Each misspelling can be corrected from a list of dictionary words
|
;; before. Each misspelling can be corrected from a list of dictionary words
|
||||||
;; presented as a completion menu.
|
;; presented as a completion menu.
|
||||||
(use-package jinx
|
(use-package jinx
|
||||||
;; Managed by Nix.
|
;; Managed by Nix: libenchant dependency.
|
||||||
:straight nil
|
:straight nil
|
||||||
:commands (jinx-mode jinx-correct jinx-correct-word)
|
:commands (jinx-mode jinx-correct jinx-correct-word)
|
||||||
:init (defun syd-jinx--jinx-or-ispell ()
|
:init (defun syd-jinx--jinx-or-ispell ()
|
||||||
|
|||||||
Reference in New Issue
Block a user