From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas =?UTF-8?Q?R=C3=B6hler?= Newsgroups: gmane.emacs.bugs Subject: bug#3416: down-list Date: Fri, 29 May 2009 20:04:48 +0200 Message-ID: <4A2023C0.4050700@easy-emacs.de> References: <4A1FDF6B.3040208@online.de> <4A1FF5E7.3080709@gmx.at> <4A201255.2050204@easy-emacs.de> <4A20170F.5030909@gmx.at> Reply-To: Andreas =?UTF-8?Q?R=C3=B6hler?= , 3416@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1243621058 15828 80.91.229.12 (29 May 2009 18:17:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 May 2009 18:17:38 +0000 (UTC) Cc: 3416@emacsbugs.donarmstrong.com To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 29 20:17:35 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 1MA6e5-00079c-Cn for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 May 2009 20:17:34 +0200 Original-Received: from localhost ([127.0.0.1]:53581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MA6e4-00011J-JQ for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 May 2009 14:17:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MA6dy-0000yZ-7C for bug-gnu-emacs@gnu.org; Fri, 29 May 2009 14:17:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MA6ds-0000ro-Le for bug-gnu-emacs@gnu.org; Fri, 29 May 2009 14:17:25 -0400 Original-Received: from [199.232.76.173] (port=40761 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MA6ds-0000rb-I1 for bug-gnu-emacs@gnu.org; Fri, 29 May 2009 14:17:20 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:43101) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MA6ds-0001l7-1e for bug-gnu-emacs@gnu.org; Fri, 29 May 2009 14:17:20 -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 n4TIHH0s009634; Fri, 29 May 2009 11:17:17 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n4TIA4u5008125; Fri, 29 May 2009 11:10:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 29 May 2009 18:10:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3416 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3416-submit@emacsbugs.donarmstrong.com id=B3416.12436201936480 (code B ref 3416); Fri, 29 May 2009 18:10:04 +0000 Original-Received: (at 3416) by emacsbugs.donarmstrong.com; 29 May 2009 18:03:13 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n4TI38uH006468 for <3416@emacsbugs.donarmstrong.com>; Fri, 29 May 2009 11:03:10 -0700 Original-Received: from [192.168.178.27] (p54BEAB89.dip0.t-ipconnect.de [84.190.171.137]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MKsym-1MA6Q71EuP-000dok; Fri, 29 May 2009 20:03:08 +0200 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: <4A20170F.5030909@gmx.at> X-Provags-ID: V01U2FsdGVkX18ysJtgGlTgf4neAdgxBTd+ztLpLxsQ9XoC+g8 pKiRV652UyAZoQIhYtBLRl+OOItQiGDwt6e2EgANjQLKuckRIq 3PEA3oRwUaqrwtowv/A0b3RLn/ePERPWkdNw0RVm0g= X-MIME-Autoconverted: from 8bit to quoted-printable by rzlab.ucr.edu id n4TIHH0s009634 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 29 May 2009 14:17:24 -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:28302 Archived-At: martin rudalics wrote: > > you are right. Nonetheless, as strings are common > > elements of lists, not just in Python, its such an > > inconvenience, it qualifies as bug in my eyes. > > > > If you don't want to dig into scan-list, that trivial > > line I've sent is enough to cure it. > > IIUC you want to skip anything but a left paren before starting the > scan. This means you might skip the start of a comment or string and > end up before the first left paren within that comment or string. > > The only right way to do that is to parse the syntax until point first > and handle the case where you are in a comment or string=20 OK, but checking for string seems enough, as we are inside a list. > appropriately. > That approach has been suggested a number of times but so far no one ha= s > implemented it. > > martin > Very bad, as going down a list is a very basic task for any editor. This should work: (defun down-list (&optional arg) "Move forward down one level of parentheses. With ARG, do this that many times. A negative argument means move backward but still go down a level. This command assumes point is not in a string or comment." (interactive "^p") (or arg (setq arg 1)) (let ((inc (if (> arg 0) 1 -1))) (while (/=3D arg 0) ;; 2009-05-29 a.roehler@web.de changed section start =20 (while (or (not (looking-at "\\s(")) (and (looking-at "\\s(")(in-string-p))) (forward-char 1) (skip-syntax-forward "^\\s(")) ;; 2009-05-29 a.roehler@web.de changed section end =20 (goto-char (or (scan-lists (point) inc -1) (buffer-end arg))) (setq arg (- arg inc))))) (defun in-string-p (&optional pos) (let ((orig (or pos (point)))) (save-excursion (save-restriction (widen) (beginning-of-defun) (numberp (nth 3 (parse-partial-sexp (point) orig))))))) Gr=FC=DFe Andreas