]> git.eshelyaron.com Git - emacs.git/commitdiff
el.el: Add some commands
authorEshel Yaron <me@eshelyaron.com>
Mon, 26 Aug 2024 19:11:02 +0000 (21:11 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 4 Sep 2024 07:51:22 +0000 (09:51 +0200)
lisp/progmodes/el.el

index 7d5c8f981a715d183b1e0df4a681c0f417c82aa4..3da4164ae83290781871f8b6899280554920c4b2 100644 (file)
@@ -197,10 +197,14 @@ This is the `font-lock-fontify-region-function' for `emacs-lisp-mode'."
                        (add-hook 'completion-at-point-functions
                                  #'elisp-completion-at-point nil t)
                        (run-hooks 'eval-expression-minibuffer-setup-hook))
-                   (read-from-minibuffer "Edit: "  (cons (buffer-substring beg end) pos) read--expression-map nil))))
+                   (read-from-minibuffer "Edit: "  (cons (buffer-substring beg end) pos) read--expression-map))))
       (replace-region-contents beg end (lambda () str))
     (user-error "No expression at point")))
 
+(defun el-insert-sexp (&optional initial)
+  (interactive)
+  (insert (read-from-minibuffer "Insert: " initial read--expression-map)))
+
 (defun el-code-pos-p (&optional pos) (null (nth 8 (syntax-ppss pos))))
 
 (defun el-jump ()
@@ -222,6 +226,10 @@ This is the `font-lock-fontify-region-function' for `emacs-lisp-mode'."
   (down-list)
   (el-last))
 
+(defun el-insert-space ()
+  (interactive)
+  (insert " "))
+
 (defvar-keymap el-mode-map
   :suppress t
   "r" #'raise-sexp
@@ -234,6 +242,7 @@ This is the `font-lock-fontify-region-function' for `emacs-lisp-mode'."
   "y" #'yank
   "(" #'insert-pair
   ")" #'up-list
+  "n" #'up-list
   "\"" #'insert-pair
   "/" #'undo
   "c" #'el-insert-function-call
@@ -247,7 +256,8 @@ This is the `font-lock-fontify-region-function' for `emacs-lisp-mode'."
   "j" #'el-jump
   "m" #'mark-sexp
   "." #'xref-find-definitions
-  "," #'xref-go-back)
+  "," #'xref-go-back
+  "SPC" #'el-insert-space)
 
 ;;;###autoload
 (define-derived-mode el-mode prog-mode "EL"