diff options
author | Philipp Stephani <phst@google.com> | 2020-04-12 14:25:33 +0200 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2020-04-12 14:27:33 +0200 |
commit | aed427ece5c6e78633e08fd599d0cadeeb3d8d58 (patch) | |
tree | f6f0f9d7b9dbb1a74102e74b39d9803352f30c51 /lisp/emacs-lisp | |
parent | 4f197a5e79ef25bcbcb3bf50ab3071fd0f1fae9e (diff) | |
download | emacs-aed427ece5c6e78633e08fd599d0cadeeb3d8d58.tar.gz emacs-aed427ece5c6e78633e08fd599d0cadeeb3d8d58.tar.bz2 emacs-aed427ece5c6e78633e08fd599d0cadeeb3d8d58.zip |
Also use named functions for the ‘gv’ declare forms (Bug#40491)
* lisp/emacs-lisp/gv.el (gv--expander-defun-declaration)
(gv--setter-defun-declaration): New helper functions; use them.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/gv.el | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index b43e53b9d27..3ab49293e90 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -166,15 +166,25 @@ arguments as NAME. DO is a function as defined in `gv-get'." ;; (`(expand ,expander) `(gv-define-expand ,name ,expander)) (_ (message "Unknown %s declaration %S" symbol handler) nil)))) +;; Additions for `declare'. We specify the values as named aliases so +;; that `describe-variable' prints something useful; cf. Bug#40491. + +;;;###autoload +(defsubst gv--expander-defun-declaration (&rest args) + (apply #'gv--defun-declaration 'gv-expander args)) + +;;;###autoload +(defsubst gv--setter-defun-declaration (&rest args) + (apply #'gv--defun-declaration 'gv-setter args)) + ;;;###autoload (or (assq 'gv-expander defun-declarations-alist) - (let ((x `(gv-expander - ,(apply-partially #'gv--defun-declaration 'gv-expander)))) + (let ((x (list 'gv-expander #'gv--expander-defun-declaration))) (push x macro-declarations-alist) (push x defun-declarations-alist))) ;;;###autoload (or (assq 'gv-setter defun-declarations-alist) - (push `(gv-setter ,(apply-partially #'gv--defun-declaration 'gv-setter)) + (push (list 'gv-setter #'gv--setter-defun-declaration) defun-declarations-alist)) ;; (defmacro gv-define-expand (name expander) |