unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
Cc: bug-cc-mode@gnu.org
Subject: (forward-comment -1) fails when line comment ends with a backslash
Date: Thu, 27 Nov 2003 11:50:43 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.3.96.1031127111939.841A-100000@acm.acm> (raw)

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)
acm@muc.de





-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/


                 reply	other threads:[~2003-11-27 11:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Pine.LNX.3.96.1031127111939.841A-100000@acm.acm \
    --to=acm@muc.de \
    --cc=bug-cc-mode@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).