emacs-devel
[Top][All Lists]
Advanced

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

Re: python.el: improve sexp-based navigation or make it optional?


From: immerrr again
Subject: Re: python.el: improve sexp-based navigation or make it optional?
Date: Sat, 16 May 2020 22:46:13 +0200

On Sat, May 16, 2020 at 9:04 PM Andreas Röhler
<address@hidden> wrote:
>
>
> 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)))
>

Yep, it works, thanks! I have forgotten about that variable.

I wonder if it would be hard to implement the sexp visualisation mode
that would show "virtual parentheses".

Overlays perhaps would be  a tad slow, if there was a parenthesis pair
shown for every sexp out there. Maybe I could limit it only to the
sexps that immediately surround point...

Properties would be much better performance wise, but looks like
"display" characters are added as a block, and one cannot enter a
sequence of virtual parentheses with point. I could try adding spaces
or whatnot, but then I'd have to be extra careful that they are
cleaned up before saving or copying buffer contents.

Any recommendations on what could be the starting point here?



reply via email to

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