From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#49592: 28.0.50; lisp-current-defun-name and non-standard defuns Date: Thu, 04 Aug 2022 18:31:22 +0200 Message-ID: <87edxwezs5.fsf@gnus.org> References: <878s279dfi.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9155"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 49592@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 04 18:37:39 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJdqt-0002Dk-J5 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Aug 2022 18:37:39 +0200 Original-Received: from localhost ([::1]:36342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJdqs-0004cc-HD for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Aug 2022 12:37:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJdlT-0000Qa-5v for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2022 12:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJdlS-00011A-Sv for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2022 12:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJdlS-0000wV-He for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2022 12:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Aug 2022 16:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49592 X-GNU-PR-Package: emacs Original-Received: via spool by 49592-submit@debbugs.gnu.org id=B49592.16596306953576 (code B ref 49592); Thu, 04 Aug 2022 16:32:02 +0000 Original-Received: (at 49592) by debbugs.gnu.org; 4 Aug 2022 16:31:35 +0000 Original-Received: from localhost ([127.0.0.1]:54498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJdl0-0000vc-Nt for submit@debbugs.gnu.org; Thu, 04 Aug 2022 12:31:34 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:54050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJdkz-0000vO-30 for 49592@debbugs.gnu.org; Thu, 04 Aug 2022 12:31:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=16xbZTeQXyGk5mD0PBYzyK/3ufDwV1Mhz89RPcJZnpU=; b=VgoJT6kRW6zncXWmGmJWEFPHdp ci4m15ns0F9r4ASwvOaXUicXk/qe+dBnb4pJAjKJpeAzuk8crtB12VMaT/7/ZGkb2J92VBVqv5R80 lCCHtzoGziGkR49mIRQpxf+Ss6APJyMoY4DUOnkpJcMz7XhQP8Yuh0VZqWunOb5CzK+U=; Original-Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJdkp-0000B4-Et; Thu, 04 Aug 2022 18:31:26 +0200 In-Reply-To: <878s279dfi.fsf@web.de> (Michael Heerdegen's message of "Fri, 16 Jul 2021 04:53:53 +0200") X-Now-Playing: Devadip Carlos Santana and Turiya Alice Coltrane's _Illuminations_: "Illuminations" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:238768 Archived-At: Michael Heerdegen 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?