emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil f6866b5d2b: `evil-ex': `eval-expression' auto-complet


From: ELPA Syncer
Subject: [nongnu] elpa/evil f6866b5d2b: `evil-ex': `eval-expression' auto-completion (#1398)
Date: Tue, 3 May 2022 09:58:36 -0400 (EDT)

branch: elpa/evil
commit f6866b5d2b85a38ad8029f83b113371d1b3aecd1
Author: nbfalcon <nikblos@outlook.com>
Commit: GitHub <noreply@github.com>

    `evil-ex': `eval-expression' auto-completion (#1398)
    
    Add auto-completion for `evil-ex' LISP expressions leveraging
    `elisp-completion-at-point' if available.
---
 evil-ex.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/evil-ex.el b/evil-ex.el
index c58ea130de..3120e791e4 100644
--- a/evil-ex.el
+++ b/evil-ex.el
@@ -238,6 +238,12 @@ Otherwise behaves like `delete-backward-char'."
   (insert result)
   (exit-minibuffer))
 
+(defun evil-ex-elisp-completion-at-point ()
+  "Complete an `evil-ex' Elisp expression."
+  (when (and (fboundp 'elisp-completion-at-point)
+             (string-prefix-p "(" (minibuffer-contents-no-properties)))
+    (elisp-completion-at-point)))
+
 (defun evil-ex-setup ()
   "Initialize Ex minibuffer.
 This function registers several hooks that are used for the
@@ -251,7 +257,8 @@ interactive actions during ex state."
   (with-no-warnings
     (make-variable-buffer-local 'completion-at-point-functions))
   (setq completion-at-point-functions
-        '(evil-ex-command-completion-at-point
+        '(evil-ex-elisp-completion-at-point
+          evil-ex-command-completion-at-point
           evil-ex-argument-completion-at-point)))
 (put 'evil-ex-setup 'permanent-local-hook t)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]