]> 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)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 18 Jan 2024 19:05:16 +0000 (14:05 -0500)
Redo the commit 0db2126d7176 to try and avoid selecting more than
a mere symbol.

lisp/progmodes/elisp-mode.el

index 00910fb67c7308414641503d972b3f3bef9916c4..da0cb96e1cfc277fd202beeafbcc3afde7a7748e 100644 (file)
@@ -657,12 +657,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)
@@ -670,7 +671,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))