diff options
author | Johan Claesson <[email protected]> | 2016-06-19 11:57:05 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2016-08-31 16:40:21 +0200 |
commit | 243a05c2474928786cf47ad06966cbf121ce8ea8 (patch) | |
tree | cfece175e32fb56bf83ca487910429749482386c /lib | |
parent | 688a58303ac827d3072aeba01e641cae2a48c041 (diff) | |
download | otp-243a05c2474928786cf47ad06966cbf121ce8ea8.tar.gz otp-243a05c2474928786cf47ad06966cbf121ce8ea8.tar.bz2 otp-243a05c2474928786cf47ad06966cbf121ce8ea8.zip |
Function instead of lambda in advice
Lambda advice cannot easily be updated.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tools/emacs/erlang.el | 11 |
1 files changed, 6 insertions, 5 deletions
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. |