branch: externals/embark commit 71d260101ebd334ed707b7b81abd608589d26a35 Author: Omar Antolín <omar.anto...@gmail.com> Commit: Omar Antolín <omar.anto...@gmail.com>
Improve rules for promoting identifiers to Emacs Lisp symbols 1. In IELM buffers identifier are now symbols. 2. Previously an identifier in any mode not deriving from prog-mode that matched an interned Emacs symbol, was considered a symbol. I've tightened that up to just applying in special modes, text modes and Info. This is to prevent identifiers in (non-IELM) repls from being considered as Emacs Lisp symbols if they happen to match an interned symbol's name, --- embark.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/embark.el b/embark.el index 76a3394..ada6391 100644 --- a/embark.el +++ b/embark.el @@ -813,10 +813,12 @@ in one of those major modes." (defun embark-target-identifier-at-point () "Target identifier at point. -In Emacs Lisp 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 whose major mode does not inherit from `prog-mode'. +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). As a convenience, in Org Mode an initial ' or surrounding == or ~~ are removed." @@ -831,8 +833,9 @@ As a convenience, in Org Mode an initial ' or surrounding == or (cl-incf (car bounds)) (cl-decf (cdr bounds))))) `(,(if (or (derived-mode-p 'emacs-lisp-mode) + (derived-mode-p 'inferior-emacs-lisp-mode) (and (intern-soft name) - (not (derived-mode-p 'prog-mode)))) + (derived-mode-p 'special-mode 'Info-mode 'text-mode))) 'symbol 'identifier) ,name