From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: bug/patch: python.el python-beginning-of-statement Date: Sun, 27 Jun 2004 22:23:26 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1088389418 22903 80.91.224.253 (28 Jun 2004 02:23:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Jun 2004 02:23:38 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Jun 28 04:23:33 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Belnx-0005Co-00 for ; Mon, 28 Jun 2004 04:23:33 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Belnw-0003C2-00 for ; Mon, 28 Jun 2004 04:23:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BelpX-0004UX-0L for emacs-devel@quimby.gnus.org; Sun, 27 Jun 2004 22:25:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BelpT-0004UF-A1 for emacs-devel@gnu.org; Sun, 27 Jun 2004 22:25:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BelpS-0004Tw-O0 for emacs-devel@gnu.org; Sun, 27 Jun 2004 22:25:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BelpS-0004Tm-Ln for emacs-devel@gnu.org; Sun, 27 Jun 2004 22:25:06 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Belnq-00087k-Kv for emacs-devel@gnu.org; Sun, 27 Jun 2004 22:23:26 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1Belnq-0003NY-7d; Sun, 27 Jun 2004 22:23:26 -0400 Original-To: Karl Chen In-reply-to: (message from Karl Chen on Sun, 27 Jun 2004 02:34:52 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25284 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25284 Does this version of the function work right? (defun python-beginning-of-statement () "Go to start of current statement. Accounts for continuation lines, multi-line strings, and multi-line bracketed expressions." (beginning-of-line) (python-beginning-of-string) (catch 'foo (while (python-continuation-line-p) (beginning-of-line) (if (python-backslash-continuation-line-p) (while (python-backslash-continuation-line-p) (forward-line -1)) (python-beginning-of-string) ;; Skip forward out of nested brackets. (condition-case () ; beware invalid syntax (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t) (error (throw 'foo)))))) (back-to-indentation))