branch: externals/embark commit ab6e9c185846b773caf162816ab8bd8551a6a315 Author: Omar Antolín <omar.anto...@gmail.com> Commit: Omar Antolín <omar.anto...@gmail.com>
Recognize Emacs Lisp symbols in Custom-mode buffers too This is useful for variable whose value is an Emacs Lisp function or expression. I thought I was already recognizing symbols in Custom-mode buffers, because I mistakenly thought that mode was derived from special-mode... --- embark.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/embark.el b/embark.el index 2679c2313f..146358b08a 100644 --- a/embark.el +++ b/embark.el @@ -886,8 +886,9 @@ In Emacs Lisp and IELM buffers the identifier is promoted to a symbol, for which more actions are available. Identifiers are also promoted to symbols if they are interned Emacs Lisp symbols and found in a buffer in a major mode derived from -`special-mode', `Info-mode' or `text-mode' (these are intended to -cover cases where you might be reading or writing about Emacs). +`special-mode', `Info-mode', `Custom-mode' or `text-mode' (these +are intended to cover cases where you might be reading or writing +about Emacs). As a convenience, in Org Mode an initial ' or surrounding == or ~~ are removed." @@ -901,10 +902,10 @@ As a convenience, in Org Mode an initial ' or surrounding == or (setq name (substring name 1 -1)) (cl-incf (car bounds)) (cl-decf (cdr bounds))))) - `(,(if (or (derived-mode-p 'emacs-lisp-mode) - (derived-mode-p 'inferior-emacs-lisp-mode) + `(,(if (or (derived-mode-p 'emacs-lisp-mode 'inferior-emacs-lisp-mode) (and (intern-soft name) - (derived-mode-p 'special-mode 'Info-mode 'text-mode))) + (derived-mode-p + 'special-mode 'Info-mode 'Custom-mode 'text-mode))) 'symbol 'identifier) ,name