unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 24542@debbugs.gnu.org, npostavs@users.sourceforge.net
Subject: bug#24542: 25.1.50; The symbol `@' and sexp scanning
Date: Fri, 04 Sep 2020 15:05:36 +0200	[thread overview]
Message-ID: <874kodbskf.fsf@gnus.org> (raw)
In-Reply-To: <87pok48g65.fsf@web.de> (Michael Heerdegen's message of "Tue, 03 Jan 2017 13:46:26 +0100")

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Thanks for the patch.  Can anyone judge whether we can do this?

I tried the patch, and it fixes the

(setq a '@)

problem for me.  I don't really have a great overview of where
scan_lists is used for -- it seems like a very general solution to a
very specific problem.

Does anybody have any comments here?

diff --git a/src/syntax.c b/src/syntax.c
index 7f0fc341f6..10912dd5f2 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2693,7 +2693,17 @@ scan_lists (EMACS_INT from0, EMACS_INT count, EMACS_INT depth, bool sexpflag)
 	    }
 
 	  if (prefix)
-	    continue;
+            {
+              int next_c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
+              int next_syntax = SYNTAX_WITH_FLAGS (next_c);
+              bool next_prefix = SYNTAX_FLAGS_PREFIX (next_syntax);
+              enum syntaxcode next_code =
+		syntax_multibyte (next_c, multibyte_symbol_p);
+              if (next_prefix
+                  || next_code == Ssymbol
+                  || next_code == Sword)
+                continue;
+            }
 
 	  switch (code)
 	    {


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  parent reply	other threads:[~2020-09-04 13:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-25 17:42 bug#24542: 25.1.50; The symbol `@' and sexp scanning Michael Heerdegen
2017-01-02 16:58 ` Michael Heerdegen
2017-01-02 20:37   ` npostavs
2017-01-03 12:46     ` Michael Heerdegen
2017-01-03 13:03       ` npostavs
2020-09-04 13:05       ` Lars Ingebrigtsen [this message]
2020-09-04 13:31         ` Eli Zaretskii
2020-09-04 14:22           ` Stefan Monnier
2024-04-10 23:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-11  3:42   ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-12 17:29     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-12 21:32       ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-13  1:55         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=874kodbskf.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=24542@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=npostavs@users.sourceforge.net \
    /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).