From 9e338b7456f652259d944d9973fe1790079dbb13 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 20 May 2022 02:02:12 +0200 Subject: [PATCH] Make completion in emacs-lisp-mode intern fewer symbols * lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Don't intern the string before point just to check whether we're looking at `ignore-error' (bug#55491). --- lisp/progmodes/elisp-mode.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 37fd4fdb3c8..70826b4c3a9 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -627,13 +627,13 @@ functions are annotated with \"\" via the ;; t if in function position. (funpos (eq (char-before beg) ?\()) (quoted (elisp--form-quoted-p beg)) - (fun-sym (condition-case nil - (save-excursion - (up-list -1) - (forward-char 1) - (and (memq (char-syntax (char-after)) '(?w ?_)) - (read (current-buffer)))) - (error nil)))) + (is-ignore-error + (condition-case nil + (save-excursion + (up-list -1) + (forward-char 1) + (looking-at-p "ignore-error\\>")) + (error nil)))) (when (and end (or (not (nth 8 (syntax-ppss))) (memq (char-before beg) '(?` ?‘)))) (let ((table-etc @@ -642,7 +642,7 @@ functions are annotated with \"\" via the ;; FIXME: We could look at the first element of ;; the current form and use it to provide a more ;; specific completion table in more cases. - ((eq fun-sym 'ignore-error) + (is-ignore-error (list t (elisp--completion-local-symbols) :predicate (lambda (sym) (get sym 'error-conditions)))) -- 2.39.2