From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#1406: backward-up-list reports scan error incorrectly? Date: Sat, 22 Nov 2008 14:04:46 +0000 Message-ID: <20081122140446.GC3330@muc.de> References: <20081121231944.GB2089@muc.de> <5F3AB054-C158-4518-9C93-6938EB2D123D@xahlee.org> <20081122123644.GA3330@muc.de> <12CBE034-485F-49CE-9EF6-2C33A51AF0C1@xahlee.org> <9331FB10-71C6-4B1B-94B6-B5C9B3667B74@xahlee.org> Reply-To: Alan Mackenzie , 1406@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1227363035 19086 80.91.229.12 (22 Nov 2008 14:10:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Nov 2008 14:10:35 +0000 (UTC) Cc: 1406@emacsbugs.donarmstrong.com, bug-gnu-emacs@gnu.org To: xah lee Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 22 15:11:35 2008 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 1L3tCw-0006Mn-Bk for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Nov 2008 15:11:34 +0100 Original-Received: from localhost ([127.0.0.1]:50698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3tBk-00081d-1G for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Nov 2008 09:10:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3tBe-0007w6-CV for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 09:10:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3tBd-0007us-AD for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 09:10:13 -0500 Original-Received: from [199.232.76.173] (port=40798 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3tBd-0007uM-14 for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 09:10:13 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:40723) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L3tBc-0001wf-IO for bug-gnu-emacs@gnu.org; Sat, 22 Nov 2008 09:10:12 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAMEAAmg018716; Sat, 22 Nov 2008 06:10:10 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mAME04c5014809; Sat, 22 Nov 2008 06:00:04 -0800 X-Loop: don@donarmstrong.com Resent-From: Alan Mackenzie Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 22 Nov 2008 14:00:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1406 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1406-submit@emacsbugs.donarmstrong.com id=B1406.122736192513412 (code B ref 1406); Sat, 22 Nov 2008 14:00:04 +0000 Original-Received: (at 1406) by emacsbugs.donarmstrong.com; 22 Nov 2008 13:52:05 +0000 Original-Received: from mail.muc.de (qmailr@colin.muc.de [193.149.48.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAMDq1AB013405 for <1406@emacsbugs.donarmstrong.com>; Sat, 22 Nov 2008 05:52:03 -0800 Original-Received: (qmail 13283 invoked by uid 3782); 22 Nov 2008 13:52:00 -0000 Original-Received: from acm.muc.de (pD9E532CC.dip.t-dialin.net [217.229.50.204]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 22 Nov 2008 14:51:53 +0100 Original-Received: (qmail 5459 invoked by uid 1000); 22 Nov 2008 14:04:46 -0000 Content-Disposition: inline In-Reply-To: <9331FB10-71C6-4B1B-94B6-B5C9B3667B74@xahlee.org> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sat, 22 Nov 2008 09:10:13 -0500 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:22586 Archived-At: Hi, Xah! On Sat, Nov 22, 2008 at 05:01:10AM -0800, xah lee wrote: > i was able to duplicate your error. Some of my testing in previous > post went wrong because i was in text-mode. > though, isn't this something easy to fix? No, because it isn't a bug. It's the way the function is meant to work. If there is a bug, it's that the doc-string (and maybe the elisp manual, I haven't looked) is vague and incomplete. It seems that you really want a slightly different function. > I mean, it surely is easy to determine if cursor is in inside double > quotes, therefore it can simply move out the quote then do > backward-up-list? Well, it's easy, but very slow. You first have to define what "inside" and "outside" mean. For example, you might scan from BOB, and point is inside a string if there've been an odd number of string-quotes up to now (taking comments, etc. into account). Emacs Lisp Mode defines "inside a string" as an odd number of string-quotes since the last "(" in column-0. Try going into a large Elisp file and deleting one of the "s. It throws the fontification out for the rest of the function, but then "recovers" for the rest of the file. > In any case, thanks. You're welcome! > Xah > ??? http://xahlee.org/ -- Alan Mackenzie (Nuremberg, Germany). > On Nov 22, 2008, at 4:53 AM, xah lee wrote: > hi Alan, > >(defun foo (arg) > > "foo does nothing." > > (interactive "P")) > >Put point inside "P", and do C-M-u `backward-up-list'. You get the > >error. > (defun foo (arg) > "foo does nothing. (" > (interactive "P")) > , and do the same again. It finds that paren. Why? Because > backward-up-list assumes its starting point is NOT in a string. It > jumps backwards over (what it thinks is) the string > "\n(interactive " > , and then finds the ?\(. > This is exactly what is happening in your somewhat larger example. > In text mode, presumably the syntax table doesn't define ?\" as a string > quote. In fundamental mode, presumably it does. "(syntax-after > (point))" is your friend here.