From: Dmitry Gutov <dgutov@yandex.ru>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 55491@debbugs.gnu.org, Richard Stallman <rms@gnu.org>,
jdtsmith@gmail.com
Subject: bug#55491: All completion fragments get added to obarray
Date: Tue, 7 Jun 2022 00:30:00 +0300 [thread overview]
Message-ID: <110782b2-e3b0-70e4-7991-e8e71b9ff4c2@yandex.ru> (raw)
In-Reply-To: <87czfmx8ps.fsf@gnus.org>
[-- Attachment #1: Type: text/plain, Size: 652 bytes --]
On 06.06.2022 15:44, Lars Ingebrigtsen wrote:
> Dmitry Gutov<dgutov@yandex.ru> writes:
>
>> Looking at the possible problems, I guess the regexp doesn't account
>> for possible escapings? Like a symbol 'let\ s\ go\ to\ the\ mall',
>> which shouldn't be mistaken for 'let'. That would require a more
>> complex regexp.
> Yes, so that won't be the right thing. It'd be nice if we had a version
> of `read' that's more like "read the next symbol but return nil if it's
> not interned already" for these cases.
How about this, then?
Too bad 'forward-symbol' doesn't handle escapings, otherwise we could
just do (intern-soft (thing-at-point 'symbol)).
[-- Attachment #2: elisp-c-a-p-no-read-v2.diff --]
[-- Type: text/x-patch, Size: 999 bytes --]
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 77bf3f1ed1..44f4c012ef 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -697,7 +697,11 @@ elisp-completion-at-point
(let ((c (char-after)))
(if (eq c ?\() ?\(
(if (memq (char-syntax c) '(?w ?_))
- (read (current-buffer))))))
+ (let ((pt (point)))
+ (ignore-errors
+ (forward-sexp)
+ (intern-soft
+ (buffer-substring pt (point)))))))))
(error nil))))
(pcase parent
;; FIXME: Rather than hardcode special cases here,
next prev parent reply other threads:[~2022-06-06 21:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-17 20:22 bug#55491: All completion fragments get added to obarray JD Smith
2022-05-17 20:30 ` Lars Ingebrigtsen
2022-05-17 22:50 ` JD Smith
2022-05-18 11:03 ` Lars Ingebrigtsen
2022-05-18 11:07 ` Lars Ingebrigtsen
2022-05-18 22:19 ` Richard Stallman
2022-05-20 0:03 ` Lars Ingebrigtsen
2022-06-04 17:59 ` Dmitry Gutov
2022-06-05 14:15 ` Lars Ingebrigtsen
2022-06-05 23:36 ` Dmitry Gutov
2022-06-06 12:44 ` Lars Ingebrigtsen
2022-06-06 21:30 ` Dmitry Gutov [this message]
2022-06-07 9:30 ` Lars Ingebrigtsen
2022-06-11 0:46 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=110782b2-e3b0-70e4-7991-e8e71b9ff4c2@yandex.ru \
--to=dgutov@yandex.ru \
--cc=55491@debbugs.gnu.org \
--cc=jdtsmith@gmail.com \
--cc=larsi@gnus.org \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).