unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 49592@debbugs.gnu.org
Subject: bug#49592: 28.0.50; lisp-current-defun-name and non-standard defuns
Date: Thu, 04 Aug 2022 18:31:22 +0200	[thread overview]
Message-ID: <87edxwezs5.fsf@gnus.org> (raw)
In-Reply-To: <878s279dfi.fsf@web.de> (Michael Heerdegen's message of "Fri, 16 Jul 2021 04:53:53 +0200")

Michael Heerdegen <michael_heerdegen@web.de> writes:

> consider a top-level expression like this (you might want to insert this
> snipped into *scratch* for testing):
>
> (progn
>   ;; comment
>   ;; about that
>   (define-key ...)
>   )
>
> With `which-function-mode' enabled, more or less the complete expression
> is shown in the mode-line (with newlines escaped) when moving into the
> expression.
>
> The reason: `lisp-current-defun-name' doesn't check for whether the
> second subexpression of a top-level expression is still on the same line
> - it just returns a string including everything (i.e. all comments) in
> between.

This function is documented as:

(defun lisp-current-defun-name ()
  "Return the name of the defun at point, or nil."

There is no defun at point in this situation, so perhaps it would make
sense to return nil here?  But this is also used by add-log, so perhaps
which-func should just use something completely different and more
strict.  I.e., skip back to the top-level form, and then use the edebug
spec to pick out the name?






  reply	other threads:[~2022-08-04 16:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16  2:53 bug#49592: 28.0.50; lisp-current-defun-name and non-standard defuns Michael Heerdegen
2022-08-04 16:31 ` Lars Ingebrigtsen [this message]
2022-08-05  2:11   ` Michael Heerdegen
2022-08-05  3:01     ` Michael Heerdegen
2022-08-05 11:57     ` Lars Ingebrigtsen
2022-08-06  0:17       ` Michael Heerdegen
2022-08-06 12:15         ` Lars Ingebrigtsen
2022-08-07  2:09           ` Michael Heerdegen
2022-08-08 12:32             ` Lars Ingebrigtsen
2022-08-09  2:12               ` Michael Heerdegen
2022-08-09 15:29                 ` Lars Ingebrigtsen
2022-08-12  5:28                   ` Michael Heerdegen
2022-08-12 15:06                     ` Lars Ingebrigtsen
2022-08-23 10:27                       ` Lars Ingebrigtsen
2022-08-23 22:57                         ` Michael Heerdegen
2022-08-24 10:23                           ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87edxwezs5.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=49592@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    /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 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).