unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19954: python.el: more consistent sexp navigation
@ 2015-02-26 17:26 Carlos Pita
  2015-04-13  1:44 ` Fabián Ezequiel Gallina
  0 siblings, 1 reply; 2+ messages in thread
From: Carlos Pita @ 2015-02-26 17:26 UTC (permalink / raw)
  To: 19954

X-Debbugs-CC: fgallina@gnu.org

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#19954: python.el: more consistent sexp navigation
  2015-02-26 17:26 bug#19954: python.el: more consistent sexp navigation Carlos Pita
@ 2015-04-13  1:44 ` Fabián Ezequiel Gallina
  0 siblings, 0 replies; 2+ messages in thread
From: Fabián Ezequiel Gallina @ 2015-04-13  1:44 UTC (permalink / raw)
  To: 19954-done

Fixed at 659609d in the master branch.

Thanks,
Fabián.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-13  1:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-26 17:26 bug#19954: python.el: more consistent sexp navigation Carlos Pita
2015-04-13  1:44 ` Fabián Ezequiel Gallina

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).