all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Tomas Nordin <tomasn@posteo.net>
Cc: 45226@debbugs.gnu.org
Subject: bug#45226: Avoid redundant calls in narrow-to-defun
Date: Thu, 11 Nov 2021 06:57:59 +0100	[thread overview]
Message-ID: <87h7cj8c9k.fsf@gnus.org> (raw)
In-Reply-To: <87mtyhwozr.fsf@posteo.net> (Tomas Nordin's message of "Sun, 13 Dec 2020 19:16:24 +0100")

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





      reply	other threads:[~2021-11-11  5:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-13 18:16 bug#45226: Avoid redundant calls in narrow-to-defun Tomas Nordin
2021-11-11  5:57 ` Lars Ingebrigtsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7cj8c9k.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=45226@debbugs.gnu.org \
    --cc=tomasn@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.