From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: era+emacsbugs@iki.fi Newsgroups: gmane.emacs.bugs Subject: bug#4030: forward-sexp parses character literal ?; as comment Date: Wed, 05 Aug 2009 11:17:50 +0300 Message-ID: <1249460270.18460.1328376993@webmail.messagingengine.com> References: <1249387642.18128.1328220453@webmail.messagingengine.com> <4A782D00.4040808@gmx.at> Reply-To: era+emacsbugs@iki.fi, 4030@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249460829 10501 80.91.229.12 (5 Aug 2009 08:27:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Aug 2009 08:27:09 +0000 (UTC) To: "martin rudalics" , 4030@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 05 10:27:02 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MYbpt-0005di-Nv for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Aug 2009 10:27:02 +0200 Original-Received: from localhost ([127.0.0.1]:51765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYbps-0002Gd-SW for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Aug 2009 04:27:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MYbpo-0002FT-Ky for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2009 04:26:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYbpi-0002CM-Hv for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2009 04:26:56 -0400 Original-Received: from [199.232.76.173] (port=54429 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYbpi-0002C5-50 for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2009 04:26:50 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:59440) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MYbph-0001t6-M2 for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2009 04:26:49 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n758Ql6W015539; Wed, 5 Aug 2009 01:26:47 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n758P4TK015246; Wed, 5 Aug 2009 01:25:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: era+emacsbugs@iki.fi Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 05 Aug 2009 08:25:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4030 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4030-submit@emacsbugs.donarmstrong.com id=B4030.124946027514755 (code B ref 4030); Wed, 05 Aug 2009 08:25:04 +0000 Original-Received: (at 4030) by emacsbugs.donarmstrong.com; 5 Aug 2009 08:17:55 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n758Hogx014748 for <4030@emacsbugs.donarmstrong.com>; Wed, 5 Aug 2009 01:17:52 -0700 Original-Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 5D8D13BC399; Wed, 5 Aug 2009 04:17:50 -0400 (EDT) Original-Received: from web7.messagingengine.com ([10.202.2.216]) by compute1.internal (MEProxy); Wed, 05 Aug 2009 04:17:50 -0400 Original-Received: by web7.messagingengine.com (Postfix, from userid 99) id 3F8A754E88; Wed, 5 Aug 2009 04:17:50 -0400 (EDT) X-Sasl-Enc: TJwJQU7/5uZH/8CYpVv2igA7N3K2WG9ULY77CI7QmxGZ 1249460270 X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <4A782D00.4040808@gmx.at> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Wed, 05 Aug 2009 04:26:56 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29897 Archived-At: On Tue, 04 Aug 2009 14:43 +0200, "martin rudalics" wrote: > > 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? While the workaround is good (and documented in the Ubuntu bug as well), the ability of Customize depends on this code working correctly, and it should handle any nominally well-formed .emacs file. Perhaps there are other pieces of code which rely on forward-sexp et alii for Emacs Lisp parsing as well. I'll also point out that an "Unbalanced parentheses" error from deep inside Customize is not a very helpful error message (especially as it does not indicate in which buffer the unbalanced parentheses were found); but perhaps Customize should be adapted to cope if forward-sexp cannot easily be fixed. It appears that src/syntax.c could perhaps be adapted to take into account character literals as well as quoted strings, but I am not familiar enough with Emacs internals to tell whether this is really a feasible approach.