emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#19954: closed (python.el: more consistent sexp nav


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#19954: closed (python.el: more consistent sexp navigation)
Date: Mon, 13 Apr 2015 01:45:02 +0000

Your message dated Sun, 12 Apr 2015 22:44:52 -0300
with message-id <address@hidden>
and subject line python.el: more consistent sexp navigation
has caused the debbugs.gnu.org bug report #19954,
regarding python.el: more consistent sexp navigation
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
19954: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19954
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: python.el: more consistent sexp navigation Date: Thu, 26 Feb 2015 14:26:04 -0300
X-Debbugs-CC: address@hidden

If this is a feature I recognize I don't understand the rationally
behind it:

        [...]
            (and (not forward-p)
                 (eq (syntax-class (syntax-after (1- (point))))
                     (car (string-to-syntax ")")))))
        ;; Inside a paren or looking at it, lisp knows what to do.

Say * is the point. The inconsistency I find is that C-M-left will do
very different things while at the end of different lines:

A)
from sklearn.cross_validation import KFold*
-->
*from sklearn.cross_validation import KFold

B)
n = len(train.y)*
-->
n = len*(train.y)

I think the intention is to nav at the "statement/block level" when the point
is at the end of the line. The difference of behaviour between A and B
can't be reconciled at any level: sexp, list, statement, block. My
expectation would be:

B')
n = len(train.y)*
-->
*n = len(train.y)

B'')
n = len(train.y*)
-->
n = len(train.*y)

Notice that this is even more conspicuous at the end of a block:

C)
for x in range(0, 10):
    x = 2
    print("hello")*
-->
for x in range(0, 10):
    x = 2
    print*("hello")

D)
for x in range(0, 10):
    print("hello")
    x = 2*
-->
*for x in range(0, 10):
    print("hello")
    x = 2

I vote for removing the (syntax-after (1- (point)) special case as IMO
it only adds confussion to the already complex nav rules.

Cheers
--
Carlos



--- End Message ---
--- Begin Message --- Subject: python.el: more consistent sexp navigation Date: Sun, 12 Apr 2015 22:44:52 -0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Fixed at 659609d in the master branch.

Thanks,
Fabián.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]