]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Fix bug#68514
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 18 Jan 2024 19:05:16 +0000 (14:05 -0500)
committerEshel Yaron <me@eshelyaron.com>
Fri, 19 Jan 2024 06:58:09 +0000 (07:58 +0100)
Redo the commit 0db2126d7176 to try and avoid selecting more than
a mere symbol.

(cherry picked from commit a33f3947ea1ba429570e2ecb4c3167341dcae1a2)

lisp/progmodes/elisp-mode.el

index 2460025db013dced659b39b9233c99f77380b074..116188653257918717e19b133fba71f9da88407f 100644 (file)
@@ -656,12 +656,13 @@ functions are annotated with \"<f>\" via the
                    (save-excursion
                      (backward-sexp 1)
                      (skip-chars-forward "`',‘#")
-                     (point))
+                     (min (point) pos))
                  (scan-error pos)))
           (end
-           (unless (or (eq beg (point-max))
-                       (member (char-syntax (char-after beg))
-                                '(?\" ?\()))
+           (cond
+            ((and (< beg (point-max))
+                  (memq (char-syntax (char-after beg))
+                                  '(?w ?\\ ?_)))
              (condition-case nil
                  (save-excursion
                    (goto-char beg)
@@ -669,7 +670,11 @@ functions are annotated with \"<f>\" via the
                     (skip-chars-backward "'’")
                    (when (>= (point) pos)
                      (point)))
-               (scan-error pos))))
+               (scan-error pos)))
+             ((or (>= beg (point-max))
+                  (memq (char-syntax (char-after beg))
+                       '(?\) ?\s)))
+              beg)))
            ;; t if in function position.
            (funpos (eq (char-before beg) ?\())
            (quoted (elisp--form-quoted-p beg))