From 243a05c2474928786cf47ad06966cbf121ce8ea8 Mon Sep 17 00:00:00 2001 From: Johan Claesson Date: Sun, 19 Jun 2016 11:57:05 +0200 Subject: Function instead of lambda in advice Lambda advice cannot easily be updated. --- lib/tools/emacs/erlang.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/tools/emacs') diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el index 466d37336a..c5904ff686 100644 --- a/lib/tools/emacs/erlang.el +++ b/lib/tools/emacs/erlang.el @@ -4777,11 +4777,7 @@ for a tag on the form `module:tag'." (if (fboundp 'advice-add) ;; Emacs 24.4+ (advice-add 'etags-tags-completion-table :around - (lambda (oldfun) - (if erlang-replace-etags-tags-completion-table - (erlang-etags-tags-completion-table) - (funcall oldfun))) - (list :name 'erlang-replace-tags-table)) + #'erlang-etags-tags-completion-table-advice) ;; Emacs 23.1-24.3 (defadvice etags-tags-completion-table (around erlang-replace-tags-table @@ -4790,6 +4786,11 @@ for a tag on the form `module:tag'." (setq ad-return-value (erlang-etags-tags-completion-table)) ad-do-it)))) +(defun erlang-etags-tags-completion-table-advice (oldfun) + (if erlang-replace-etags-tags-completion-table + (erlang-etags-tags-completion-table) + (funcall oldfun))) + (defun erlang-complete-tag () "Perform tags completion on the text around point. Completes to the set of names listed in the current tags table. -- cgit v1.2.3