[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#45226: Avoid redundant calls in narrow-to-defun
From: |
Lars Ingebrigtsen |
Subject: |
bug#45226: Avoid redundant calls in narrow-to-defun |
Date: |
Thu, 11 Nov 2021 06:57:59 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Tomas Nordin <tomasn@posteo.net> writes:
> `narrow-to-defun' fixup
>
> * emacs-lisp/lisp.el (narrow-to-defun): `beginning-of-defun' goes
> to previous function when point is on the first character of a
> function. Take care of that in `narrow-to-defun'.
>
[...]
> With the attached patch I suggest a partial revert of the above commit,
> keeping only the forward-char service. I have been experimenting with it
> a lot and see no problem. I made 'make check' and see no failures FWIW.
> As a bonus, in combination with a patch I submitted with bug#40563,
> python nested defuns can be narrowed.
>
> What do you think, maybe I am missing something. Or do you agree the
> check and the additional call is redundant?
I think the use case is if you have a language where you can define
several function definitions on the same line. Like something like:
(defun foo ())(defun bar ())(defun zot ())
Unfortunately the original bug report didn't have a case for
reproduction, so I don't know what the language in question where the
problem may have been in. (There should have been a test case, of
course.)
(And in Emacs Lisp, this doesn't work anyway)
So I'd prefer not to revert the change (it's a defensive change), unless
we know what it's not really doing anything useful. So I'm closing this
bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#45226: Avoid redundant calls in narrow-to-defun,
Lars Ingebrigtsen <=