GNU bug report logs - #4030
forward-sexp parses character literal ?; as comment

Previous Next

Package: emacs;

Reported by: era+emacsbugs <at> iki.fi

Date: Tue, 4 Aug 2009 12:15:04 UTC

Severity: normal

Tags: wontfix

Found in version 23.1.50.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: era+emacsbugs <at> iki.fi, 4030 <at> debbugs.gnu.org
Cc: submit <at> debbugs.gnu.org
Subject: bug#4030: forward-sexp parses character literal ?; as comment
Date: Tue, 04 Aug 2009 14:43:44 +0200
> It seems that forward-sexp (and its underlying C implementation) does
> not cope correctly with a character literal semicolon, seeing instead
> (effectively) end of line.
>
> In the *scratch* buffer if you write (insert ?;) you can evaluate this
> Lisp code and it behaves as intended (inserts a semicolon in the current
> buffer) but doing M-x forward-sexp just before the expression results in
> an "Unbalanced parentheses" error.

A similar thing happens with (insert ?") so why don't you escape such a
character by writing (insert ?\;) instead?  From the Elisp manual:

    You can use the same syntax for punctuation characters, but it is
 often a good idea to add a `\' so that the Emacs commands for editing
 Lisp code don't get confused.  For example, `?\(' is the way to write
 the open-paren character.  If the character is `\', you _must_ use a
 second `\' to quote it: `?\\'.

martin



This bug report was last modified 8 years and 72 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.