emacs-devel
[Top][All Lists]
Advanced

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

(forward-comment -1) fails when line comment ends with a backslash


From: Alan Mackenzie
Subject: (forward-comment -1) fails when line comment ends with a backslash
Date: Thu, 27 Nov 2003 11:50:43 +0000 (GMT)

Emacs-21.1 (or .2 or .3):

C mode (or Emacs Lisp Mode, or many others):  When a backslash is the
last character of a line comment, and point is immediately after it (at
the beginning of the next line), (forward-comment -1) gets stuck at the
backslash.  It ought to move to the beginning of the comment.  e.g.:

// C Mode line-comment ending in backslash.  \
    a = b;
^
|
point

#########################################################################

The cause of the problem is in syntax.c (version 1.143) at L1931:

          quoted = char_quoted (from, from_byte);
          if (quoted)             <=================== L1931.
            {
              DEC_BOTH (from, from_byte);
              goto leave;
            }                     <=================== L1935

This was all fixed (thanks Stefan!) in version 1.145, by removing
L1931-1935, and instead checking `quoted' later on in the function.  I've
tried this patch, and it does indeed cope properly with backslashes in
line-comments at EOLs.

#########################################################################

However, syntax.c V1.145 appeared on 12th October 2001, over two years
ago.  Yet, even in Emacs 21.3, syntax.c is still at V1.143, unchanged
from Emacs 21.1.

Down at CC Mode (and possibly at Ada Mode, Emacs Lisp Mode, Shell Script
Mode, .....), we've been tearing our hair out, suffering sleepness
nights, risking our marriages (excuse the poetic licence) trying to
diagnose and work round this problem.  Yet it was apparently fixed over
two years ago.  :-(

Is there any good reason syntax.c hasn't been updated to a more recent
version in the last couple of years?  If not, I'd like to request that it
be updated for Emacs 21.4 (or 22.1 :-).

-- 
Alan Mackenzie (Munich, Germany)
address@hidden







reply via email to

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