GNU bug report logs - #41361
Fwd: Re: python.el: improve sexp-based navigation or make it optional?

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> online.de>

Date: Sun, 17 May 2020 14:06:01 UTC

Severity: wishlist

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41361 in the body.
You can then email your comments to 41361 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41361; Package emacs. (Sun, 17 May 2020 14:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Röhler <andreas.roehler <at> online.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 17 May 2020 14:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> online.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Fwd: Re: python.el: improve sexp-based navigation or make it optional?
Date: Sun, 17 May 2020 16:12:45 +0200
[Message part 1 (text/plain, inline)]
Hi,

maybe make forward-sexp-function customizable. Currently that var is set 
inside the derived mode:

  (set (make-local-variable 'forward-sexp-function)
       'python-nav-forward-sexp)

and comment section in python.el head contains:


If you prefer `cc-mode'-like
;; `forward-sexp' movement, setting `forward-sexp-function' to nil is
;; enough, You can do that using the `python-mode-hook':

;; (add-hook 'python-mode-hook
;;           (lambda () (setq forward-sexp-function nil)))

Thread is here:

https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg02196.html

Thanks,
Andreas

-------- Forwarded Message --------
Subject: 	Re: python.el: improve sexp-based navigation or make it optional?
Date: 	Sat, 16 May 2020 21:11:51 +0200
From: 	Andreas Röhler <andreas.roehler <at> online.de>
To: 	emacs-devel <at> gnu.org
CC: 	immerrr again <immerrr <at> gmail.com>, Stefan Kangas 
<stefankangas <at> gmail.com>




On 16.05.20 15:16, immerrr again wrote:
> In absence of such mode, I wonder if it would be a welcome addition to
> introduce a configuration parameter that at least disables the smart
> navigation, making sexp skip one symbol or explicitly
> parenthesized/bracketed expression at a time.

Maybe that does it?: (from python.el)

If you prefer `cc-mode'-like
;; `forward-sexp' movement, setting `forward-sexp-function' to nil is
;; enough, You can do that using the `python-mode-hook':

;; (add-hook 'python-mode-hook
;;           (lambda () (setq forward-sexp-function nil)))


[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41361; Package emacs. (Wed, 20 May 2020 01:07:02 GMT) Full text and rfc822 format available.

Message #8 received at 41361 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Andreas Röhler <andreas.roehler <at> online.de>
Cc: 41361 <at> debbugs.gnu.org
Subject: Re: bug#41361: Fwd: Re: python.el: improve sexp-based navigation or
 make it optional?
Date: Tue, 19 May 2020 18:06:35 -0700
Andreas Röhler <andreas.roehler <at> online.de> writes:

> maybe make forward-sexp-function customizable. Currently that var is
> set inside the derived mode:

I agree that this should be customizable.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41361; Package emacs. (Thu, 21 May 2020 13:43:01 GMT) Full text and rfc822 format available.

Message #11 received at 41361 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 41361 <at> debbugs.gnu.org, immerrr <at> gmail.com,
 Andreas Röhler <andreas.roehler <at> online.de>
Subject: Re: bug#41361: Fwd: Re: python.el: improve sexp-based navigation or
 make it optional?
Date: Thu, 21 May 2020 14:42:35 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> Andreas Röhler <andreas.roehler <at> online.de> writes:
>
>> maybe make forward-sexp-function customizable. Currently that var is
>> set inside the derived mode:
>
> I agree that this should be customizable.

I too am a fan of sexp navigation (C-M-f, C-M-b, etc.)  If this
navigation in indeed superior, we could consider making it the default
for python-mode?  Something similar thing was done recently for
nxml-mode, by changing nxml-sexp-element-flag from nil to t.  I liked
this change very much.

João








Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41361; Package emacs. (Sat, 20 Mar 2021 02:52:01 GMT) Full text and rfc822 format available.

Message #14 received at 41361 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: João Távora <joaotavora <at> gmail.com>
Cc: 41361 <at> debbugs.gnu.org,
 Andreas Röhler <andreas.roehler <at> online.de>, immerrr <at> gmail.com
Subject: Re: bug#41361: Fwd: Re: python.el: improve sexp-based navigation or
 make it optional?
Date: Fri, 19 Mar 2021 21:51:52 -0500
João Távora <joaotavora <at> gmail.com> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> Andreas Röhler <andreas.roehler <at> online.de> writes:
>>
>>> maybe make forward-sexp-function customizable. Currently that var is
>>> set inside the derived mode:
>>
>> I agree that this should be customizable.
>
> I too am a fan of sexp navigation (C-M-f, C-M-b, etc.)  If this
> navigation in indeed superior, we could consider making it the default
> for python-mode?  Something similar thing was done recently for
> nxml-mode, by changing nxml-sexp-element-flag from nil to t.  I liked
> this change very much.

I have been back to coding a bunch of Python lately, and having
experimented with this I think making it the default behavior is indeed
a good idea.

In the linked emacs-devel thread, I said that the old behavior was fine,
which I guess is true.  I have now come to the conclusion that it is
also worse than the alternative.  :-)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41361; Package emacs. (Sat, 31 Jul 2021 16:45:02 GMT) Full text and rfc822 format available.

Message #17 received at 41361 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Andreas Röhler <andreas.roehler <at> online.de>
Cc: 41361 <at> debbugs.gnu.org
Subject: Re: bug#41361: Fwd: Re: python.el: improve sexp-based navigation or
 make it optional?
Date: Sat, 31 Jul 2021 18:44:44 +0200
Andreas Röhler <andreas.roehler <at> online.de> writes:

> maybe make forward-sexp-function customizable.

Makes sense to me, so I've now added that to Emacs 28.  It was also
suggested to change the default to nil, but that seems too annoying, so
I didn't do that.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 41361 <at> debbugs.gnu.org and Andreas Röhler <andreas.roehler <at> online.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 31 Jul 2021 16:46:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 29 Aug 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 233 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.