emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43558: closed ([PATCH]: Fix (forward-comment 1) when end delimiter i


From: GNU bug Tracking System
Subject: bug#43558: closed ([PATCH]: Fix (forward-comment 1) when end delimiter is escaped.)
Date: Wed, 23 Sep 2020 08:58:01 +0000

Your message dated Wed, 23 Sep 2020 08:57:46 +0000
with message-id <20200923085746.GA6178@ACM>
and subject line Re: bug#43558: [PATCH]: Fix (forward-comment 1) when end 
delimiter is escaped.
has caused the debbugs.gnu.org bug report #43558,
regarding [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
43558: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=43558
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped. Date: Tue, 22 Sep 2020 09:35:50 +0000
Hello, Emacs and Stefan.

In the following C comment:

1   /*
2     \*/
3   /**/

, with point at BOL 1, do M-: (forward-comment 1).  This leaves point
wrongly at EOL 2.  It should end up at EOL 3, since the apparent comment
ender on L2 is actually escaped.

The following patch fixes this.  Are there any objections to me
installing it?


diff --git a/src/syntax.c b/src/syntax.c
index e6af8a377b..066972e6d8 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2354,6 +2354,13 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, 
ptrdiff_t stop,
        /* We have encountered a nested comment of the same style
           as the comment sequence which began this comment section.  */
        nesting++;
+      if (comment_end_can_be_escaped
+          && (code == Sescape || code == Scharquote))
+        {
+          inc_both (&from, &from_byte);
+          UPDATE_SYNTAX_TABLE_FORWARD (from);
+          if (from == stop) continue; /* Failure */
+        }
       inc_both (&from, &from_byte);
       UPDATE_SYNTAX_TABLE_FORWARD (from);
 

-- 
Alan Mackenzie (Nuremberg, Germany).



--- End Message ---
--- Begin Message --- Subject: Re: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped. Date: Wed, 23 Sep 2020 08:57:46 +0000
Bug fixed in master.

-- 
Alan Mackenzie (Nuremberg, Germany).


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]