branch: elpa/auto-dim-other-buffers commit 33b5f88b799a17947c266b04ad59462c5aeb4ed7 Author: Michal Nazarewicz <min...@mina86.com> Commit: Michal Nazarewicz <min...@mina86.com>
Correctly handle optional kill-all-local-variables argument in advice :around advice is passed the original function as well as all arguments passed when calling the function. This means that if ‘kill-all-local-variables’ is called with an argument, an advice :around it will be called with two arguments. Unfortunately, ‘adob--kill-all-local-variables-advice’ was not prepared to take that optional argument which resulted in the following error: apply: Wrong number of arguments: #<subr adob--kill-all-local-variables-advice>, 2 Fix by properly handling the optional argument. Fixes: https://github.com/mina86/auto-dim-other-buffers.el/issues/32 --- auto-dim-other-buffers.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auto-dim-other-buffers.el b/auto-dim-other-buffers.el index 0d9b54b5d4..084f9d0b35 100644 --- a/auto-dim-other-buffers.el +++ b/auto-dim-other-buffers.el @@ -2,7 +2,7 @@ ;; Author: Michal Nazarewicz <min...@mina86.com> ;; Maintainer: Michal Nazarewicz <min...@mina86.com> ;; URL: https://github.com/mina86/auto-dim-other-buffers.el -;; Version: 2.1.0 +;; Version: 2.1.1 ;; This file is not part of GNU Emacs. @@ -204,12 +204,12 @@ Return non-nil if remappings have been added to BUFFER." (force-window-update object) wants))) -(defun adob--kill-all-local-variables-advice (kill) +(defun adob--kill-all-local-variables-advice (kill &rest args) "Restores face remapping after killing all local variables. This is intended as an advice around ‘kill-all-local-variables’ function which removes all buffer face remapping which is something we don’t want." - (when (prog1 adob--face-mode-remapping (funcall kill)) + (when (prog1 adob--face-mode-remapping (apply kill args)) (adob--remap-add-relative) nil))