summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2020-04-12 14:25:33 +0200
committerPhilipp Stephani <phst@google.com>2020-04-12 14:27:33 +0200
commitaed427ece5c6e78633e08fd599d0cadeeb3d8d58 (patch)
treef6f0f9d7b9dbb1a74102e74b39d9803352f30c51 /lisp/emacs-lisp
parent4f197a5e79ef25bcbcb3bf50ab3071fd0f1fae9e (diff)
downloademacs-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.el16
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)