From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: xah lee Newsgroups: gmane.emacs.help Subject: Re: bug#1406: backward-up-list reports scan error incorrectly? Date: Thu, 27 Nov 2008 14:49:18 -0800 Message-ID: <8E7E4630-6D9D-4A22-81F3-47529CD82F5D@xahlee.org> 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> <20081122140446.GC3330@muc.de> <20081127121951.GA3137@muc.de> <20081127220925.GA1270@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1227826585 12823 80.91.229.12 (27 Nov 2008 22:56:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Nov 2008 22:56:25 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Alan Mackenzie Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 27 23:57:28 2008 Return-path: Envelope-to: geh-help-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 1L5pnW-0004Lp-6i for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Nov 2008 23:57:22 +0100 Original-Received: from localhost ([127.0.0.1]:53732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L5pmM-0006Vv-Jf for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Nov 2008 17:56:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L5pfx-0004Bw-Ls for help-gnu-emacs@gnu.org; Thu, 27 Nov 2008 17:49:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L5pfw-0004B5-Sj for help-gnu-emacs@gnu.org; Thu, 27 Nov 2008 17:49:33 -0500 Original-Received: from [199.232.76.173] (port=51247 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L5pfw-0004Ax-OT for help-gnu-emacs@gnu.org; Thu, 27 Nov 2008 17:49:32 -0500 Original-Received: from mout.perfora.net ([74.208.4.195]:51419) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L5pfw-0003Fb-AO for help-gnu-emacs@gnu.org; Thu, 27 Nov 2008 17:49:32 -0500 Original-Received: from [192.168.1.2] (c-24-6-185-159.hsd1.ca.comcast.net [24.6.185.159]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0MKp8S-1L5pfl3oRU-0006Jz; Thu, 27 Nov 2008 17:49:27 -0500 In-Reply-To: <20081127220925.GA1270@muc.de> X-Mailer: Apple Mail (2.753.1) X-Provags-ID: V01U2FsdGVkX19ZWDahb3lATsBKMssRh/yqbuf+X/4S755rnLM iTsp+iq2yecVp1eYlDMFtDXvCgF0GQSbvQjHZ8Pa8YN/nmmh4p mXpesFgdLodHpOKnkkIZg== X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6? (barebone, rare!) X-Mailman-Approved-At: Thu, 27 Nov 2008 17:55:51 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:60168 Archived-At: > Personally, I like being able to use the list commands inside a =20 > comment > or string. > > Don't forget that the list commands are also used a lot as > almost-primitive functions in other lisp code (they're certainly =20 > used a > lot in CC Mode), and redefining these the way you suggest would =20 > slow down > other code, possibly by a lot. I see. great info. Doh, i thought i was replying to the bug list. My prev post wast =20 intended for the bug list so that that the communication is unbroken =20 there but didn't notice it just went to help.gnu.emacs. but anyway, =20 you probably right. Xah =E2=88=91 http://xahlee.org/ =E2=98=84 On Nov 27, 2008, at 2:09 PM, Alan Mackenzie wrote: Hi, Xah. On Thu, Nov 27, 2008 at 07:56:17AM -0800, xah lee wrote: > On Nov 27, 4:19 am, Alan Mackenzie wrote: >> Hi, Xah! >>>> 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. >> I've amended the Emacs manual (.../doc/emacs/programs.texi) and the >> doc strings of `backward-up-list' and several similar functions >> (.../lisp/emacs-lisp/lisp.el). >> If you're interested, have a look at the changes in >> . > Thanks Alan. > I'd rather hope for a fix instead of change wording to reflect > current situation. Again, there isn't a bug, so there's nothing to fix. What I think =20 you're saying is that you'd prefer C-M-u to do something a bit different; or, put another way, you want a different function. Personally, I like being able to use the list commands inside a comment or string. Don't forget that the list commands are also used a lot as almost-primitive functions in other lisp code (they're certainly used a lot in CC Mode), and redefining these the way you suggest would slow =20 down other code, possibly by a lot. > You argued in bug list that the issue is not simple essentially due > to the fact that straight quote chars are not matching pairs. > That is true, but i think given today's tech and computing power, we > can over come this. Just assume that double quotes in the source code > are matched, since they are most of the time. In the few cases when > the backward-up-list went to the wrong place due to un-matched double > quote, i think that's ok. (as opposed to, it stops dead and utter a > beep.) The stopping dead is due to it not finding an enclosing paren. > alternatively, if the cursor is inside double quote, then issue a > warning in the messag area that the result may not be correct. Why don't you write the function you want? Then submit it to emacs-devel@gnu.org, and it could well become an option in Emacs 24. You have to decide what "inside a string" means. It could be as simple as the text at point being fontified with font-lock-string-face. Or, maybe you'd want to scan from the beginning of buffer to check this. `parse-partial-sexp' is your friend here. > Also, since this works in text-mode, so apparently this can work. A > implementation is to temporarily switch to that mode, do the cursor > move, then switch back. Or temp set the syntax table to whatever chat > that made text-mode work and emacs-lisp-mode not work. That's another way you could do it. In text mode, I don't think there are any string characters defined (we're talking about its "syntax =20 table" here). So if you did this (switching temporarily to Text Mode) in Elisp mode, you'd just get a very crude interpretation of parens. It might be what you want, it might not. > In general, my feeling is that moving around nested pairs is not a > some insurmountable issue, that given today's technology and > software, it seems wimpy to tell users that backward-up-list won't > work if it's inside double quotes. Much complex problems are solved > today in emacs, in other IDEs, etc. No, it's certainly surmountable. But first you've got to decide what =20= you want, then you've got to do the surmounting. > Just my opinions. Thanks. No problem! > Xah --=20 Alan Mackenzie (Nuremberg, Germany). =E2=98=84