From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: backward-up-list Date: Fri, 19 Jul 2002 13:52:41 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200207191752.g6JHqfY16870@rum.cs.yale.edu> References: <3D3574F6.7030405@isogmbh.de> <200207181455.g6IEtMD25024@aztec.santafe.edu> <87d6tkvrhh.fsf@enberg.org> <200207191654.g6JGsBY26949@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1027101208 21125 127.0.0.1 (19 Jul 2002 17:53:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 19 Jul 2002 17:53:28 +0000 (UTC) Cc: henrik@enberg.org, stl@isogmbh.de, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17VbwV-0005Uc-00 for ; Fri, 19 Jul 2002 19:53:27 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17Vc8z-0003Bb-00 for ; Fri, 19 Jul 2002 20:06:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17VbwV-00061f-00; Fri, 19 Jul 2002 13:53:28 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17Vbvl-0005xe-00; Fri, 19 Jul 2002 13:52:42 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g6JHqfY16870; Fri, 19 Jul 2002 13:52:41 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Richard Stallman Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:5917 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5917 > (defun inside-comment-or-string-p () > "Return non-nil if `point' is inside a comment or string." > (let ((state (syntax-ppss (point)))) > (or (nth 3 state) (nth 4 state)))) > > Stefan, do you see any reason this would be wrong? No particular reason, no. > (Depending on font lock would not be a general solution.) Indeed. It's a convenient hack, but no more. > If Stefan sees no basic flaw in this, then would one of you like to > try modifying some of the functions in lisp.el to test this criterion? > I guess backward-up-list could move backward out of the string > constant and treat that as one level of list. Same-level motion > commands could move to the beginning or end of the string and count > that as having moved over one sexp. Of course if backward-up-list can work all within the string (in which it currently already DTRT), it should still DTRT. So it should first try "within the string/comment" and only if that fails, should it move out. I'm sure there are more special cases to think of, Stefan