From 826bf2b97a0fb4a34c5eb96ec2b172d682fd548f Mon Sep 17 00:00:00 2001 From: yuhan0 Date: Thu, 11 Apr 2024 00:21:28 +0800 Subject: [PATCH] Fix bug in advice around define-key define-key takes an optional 4th argument REMOVE, which this :around advice causes to be dropped completely. --- general.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/general.el b/general.el index bd702f3..800b2f3 100644 --- a/general.el +++ b/general.el @@ -2253,7 +2253,7 @@ with `general-translate-key') and optionally keyword arguments for `(general-translate-key ,states ,keymaps ,@args)) ;; ** Automatic Key Unbinding -(defun general-unbind-non-prefix-key (define-key keymap key def &rest _) +(defun general-unbind-non-prefix-key (define-key keymap key &rest args) "Use DEFINE-KEY in KEYMAP to unbind an existing non-prefix subsequence of KEY. When a general key definer is in use and a subsequnece of KEY is already bound in KEYMAP, unbind it using DEFINE-KEY. Always bind KEY to DEF using DEFINE-KEY." @@ -2264,7 +2264,7 @@ in KEYMAP, unbind it using DEFINE-KEY. Always bind KEY to DEF using DEFINE-KEY." (while (numberp (lookup-key keymap key)) (setq key (cl-subseq key 0 -1))) (funcall define-key keymap key nil))) - (funcall define-key keymap key def)) + (apply define-key keymap key args)) ;;;###autoload (defun general-auto-unbind-keys (&optional undo)