From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jorgen Schaefer Newsgroups: gmane.emacs.bugs Subject: bug#13642: 24.3.50; python-nav-backward-sexp mishandles string movement Date: Fri, 8 Feb 2013 22:27:57 +0100 Message-ID: <20130208222757.3c39a21d@forcix.kollektiv-hamburg.de> References: <8762250zop.fsf@orion.kollektiv-hamburg.de> <5112F17B.5090808@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1360358939 10748 80.91.229.3 (8 Feb 2013 21:28:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Feb 2013 21:28:59 +0000 (UTC) Cc: 13642@debbugs.gnu.org To: Daniel Colascione Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 08 22:29:20 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U3vVY-000624-IB for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Feb 2013 22:29:20 +0100 Original-Received: from localhost ([::1]:37086 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3vVF-0002di-Lk for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Feb 2013 16:29:01 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3vVC-0002cm-C9 for bug-gnu-emacs@gnu.org; Fri, 08 Feb 2013 16:28:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3vVB-0000Xl-4Z for bug-gnu-emacs@gnu.org; Fri, 08 Feb 2013 16:28:58 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3vVB-0000Xg-14 for bug-gnu-emacs@gnu.org; Fri, 08 Feb 2013 16:28:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U3vVF-0004aL-Jo for bug-gnu-emacs@gnu.org; Fri, 08 Feb 2013 16:29:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jorgen Schaefer Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Feb 2013 21:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13642 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13642-submit@debbugs.gnu.org id=B13642.136035888917439 (code B ref 13642); Fri, 08 Feb 2013 21:29:01 +0000 Original-Received: (at 13642) by debbugs.gnu.org; 8 Feb 2013 21:28:09 +0000 Original-Received: from localhost ([127.0.0.1]:44804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3vUO-0004X9-0H for submit@debbugs.gnu.org; Fri, 08 Feb 2013 16:28:09 -0500 Original-Received: from istinn.electusmatari.com ([83.169.37.145]:58392) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3vUL-0004Wt-DF for 13642@debbugs.gnu.org; Fri, 08 Feb 2013 16:28:06 -0500 Original-Received: from forcix.kollektiv-hamburg.de (hmbg-4d069430.pool.mediaWays.net [77.6.148.48]) by istinn.electusmatari.com (Postfix) with ESMTPSA id 319FED10001D; Fri, 8 Feb 2013 22:27:59 +0100 (CET) In-Reply-To: <5112F17B.5090808@dancol.org> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; i486-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:70913 Archived-At: On Wed, 06 Feb 2013 16:12:43 -0800 Daniel Colascione wrote: > On 2/6/2013 3:50 PM, Jorgen Schaefer wrote: > > Hello! > > In python-mode, I get the following behavior (with _|_ being point): > > > > ----- > > def foo(): > > bar = "bar" > > baz = "baz"_|_ > > > > => > > > > _|_def foo(): > > bar = "bar" > > baz = "baz" > > ----- > > That's by design. python-mode tries to emulate lisp movement as much > as possible, so it considers point to be at the end of a "defun" and > tries to skip over the entire "defun", back to the beginning. It would seem that it would make sense to assume the point is at the end of the block only if it's *past* the last line of the block, not while it's still on it. > I also find the behavior more counter-intuitive than useful, and I > wish python-mode acted more like cc-mode here. cc-mode simply leaves `forward-sexp-function' nil. Setting that to nil in python-mode-hook makes python-mode behave "intuitively" for me again. I have no idea under which circumstances this is useful. There's C-M-a to go to the beginning of a defun if I want to, and python.el could bind python-nav-backward/forward-statement to M-a and M-e which would make a lot of sense. The current behavior is just ... weird. Who is the person to decide that this should change? :-) Regards, -- Jorgen