GNU bug report logs - #19182
24.4; which-function-mode end of function detection (easy suggestion for improvement)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Carlos Pita <carlosjosepita@HIDDEN>; Keywords: moreinfo; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug closed, send any further explanations to 19182 <at> debbugs.gnu.org and Carlos Pita <carlosjosepita@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 19182 <at> debbugs.gnu.org:


Received: (at 19182) by debbugs.gnu.org; 9 Jun 2022 14:09:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 09 10:09:58 2022
Received: from localhost ([127.0.0.1]:47150 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nzIrG-0006rH-4m
	for submit <at> debbugs.gnu.org; Thu, 09 Jun 2022 10:09:58 -0400
Received: from quimby.gnus.org ([95.216.78.240]:50160)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nzIrA-0006qm-Uj
 for 19182 <at> debbugs.gnu.org; Thu, 09 Jun 2022 10:09:56 -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:In-Reply-To:Date:
 References: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=jxxrLZBqCXHYd5KYtiJP1ooqazVolym3616PLDWP9q4=; b=e0OAeXX38yQv5VXsgsyG6con16
 p70kEsXHFwk+4+IEVBco50yXDvC3eVeoTNNN58wuRK4ZPgeOKTI2Ws/212e5o9NKlY/Sr+MdDD14i
 oBKiVvjEPmihvgJsrfyk0nDFJ8FotVLSfE3Kk27b+VFPNPQzmcbHIIw9ba4Wq/fnGz8Q=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nzIr1-0000gk-M0; Thu, 09 Jun 2022 16:09:46 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Carlos Pita <carlosjosepita@HIDDEN>
Subject: Re: bug#19182: 24.4; which-function-mode end of function detection
 (easy suggestion for improvement)
References: <CAELgYhdY8DQ3403MiJyACy0H6a-nuHo7uin-gq=VECasodwRiw@HIDDEN>
 <87a6bn33rc.fsf@HIDDEN>
X-Now-Playing: Prince's _Sign 'O' the Times (7): Live in Utrecht II_: "The
 Cross (Live In Utrecht)"
Date: Thu, 09 Jun 2022 16:09:41 +0200
In-Reply-To: <87a6bn33rc.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Thu,
 12 May 2022 04:04:39 +0200")
Message-ID: <87r13y2aje.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Lars Ingebrigtsen <larsi@HIDDEN> writes: > Do you have a
 recipe to reproduce this end-function detection failure? > I tried it in
 a couple of modes and didn't see anything odd. More information was requested, 
 but no response was given within a month, so I'm closing this bug report.
 If the problem still exists, please respond to this email and we'll reopen
 the bug report. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 19182
Cc: 19182 <at> debbugs.gnu.org, alexr@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Do you have a recipe to reproduce this end-function detection failure?
> I tried it in a couple of modes and didn't see anything odd.

More information was requested, but no response was given within a
month, so I'm closing this bug report.  If the problem still exists,
please respond to this email and we'll reopen the bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#19182; Package emacs. Full text available.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 19182 <at> debbugs.gnu.org:


Received: (at 19182) by debbugs.gnu.org; 12 May 2022 02:04:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 11 22:04:52 2022
Received: from localhost ([127.0.0.1]:38923 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1noyCC-0001u3-1L
	for submit <at> debbugs.gnu.org; Wed, 11 May 2022 22:04:52 -0400
Received: from quimby.gnus.org ([95.216.78.240]:47798)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1noyC9-0001tg-H5
 for 19182 <at> debbugs.gnu.org; Wed, 11 May 2022 22:04:49 -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:In-Reply-To:Date:
 References: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=azTr+Heny9c0Sd5WGGnFy2i7VPyXVWi0PSq/SzMGT90=; b=qlr1vs4FlayzWJrpDdyUGO7HZa
 0SL2gjfBJyQo2HC1o2MZFeCXscWNP/nibmtKhp+9IuZvgp8jNUreAS9NyJ8ddi05EZ/4OwVYkjVZ0
 UUnggcQdqIC2tKNwdcfEXqXrpxg3rlYl3GOYwbusCBJIjuf7FnqUSZfDt1qnoWDP7PC4=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1noyC0-0006s0-8P; Thu, 12 May 2022 04:04:42 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Carlos Pita <carlosjosepita@HIDDEN>
Subject: Re: bug#19182: 24.4; which-function-mode end of function detection
 (easy suggestion for improvement)
References: <CAELgYhdY8DQ3403MiJyACy0H6a-nuHo7uin-gq=VECasodwRiw@HIDDEN>
X-Now-Playing: Section 25's _The Key of Dreams_: "Sakura"
Date: Thu, 12 May 2022 04:04:39 +0200
In-Reply-To: <CAELgYhdY8DQ3403MiJyACy0H6a-nuHo7uin-gq=VECasodwRiw@HIDDEN>
 (Carlos Pita's message of "Tue, 25 Nov 2014 15:38:46 -0300")
Message-ID: <87a6bn33rc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Carlos Pita <carlosjosepita@HIDDEN> writes: > It's a known
 and documented limitation of which-function mode that it > doesn't detect
 the end of a function due to it's dependence on > imenu. (I'm going through
 old bug reports that unfortunately weren't resolved at the time.) 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 19182
Cc: 19182 <at> debbugs.gnu.org, alexr@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Carlos Pita <carlosjosepita@HIDDEN> writes:

> It's a known and documented limitation of which-function mode that it
> doesn't detect the end of a function due to it's dependence on
> imenu.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Do you have a recipe to reproduce this end-function detection failure?
I tried it in a couple of modes and didn't see anything odd.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#19182; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Nov 2014 18:39:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 13:39:24 2014
Received: from localhost ([127.0.0.1]:45223 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XtL1I-0003lU-2x
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2014 13:39:24 -0500
Received: from eggs.gnu.org ([208.118.235.92]:42441)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <carlosjosepita@HIDDEN>) id 1XtL1G-0003lM-Jc
 for submit <at> debbugs.gnu.org; Tue, 25 Nov 2014 13:39:23 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <carlosjosepita@HIDDEN>) id 1XtL1B-00060s-Ej
 for submit <at> debbugs.gnu.org; Tue, 25 Nov 2014 13:39:22 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:34552)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <carlosjosepita@HIDDEN>) id 1XtL1B-00060o-BT
 for submit <at> debbugs.gnu.org; Tue, 25 Nov 2014 13:39:17 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44157)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <carlosjosepita@HIDDEN>) id 1XtL16-0005It-Kr
 for bug-gnu-emacs@HIDDEN; Tue, 25 Nov 2014 13:39:17 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <carlosjosepita@HIDDEN>) id 1XtL11-0005y6-Ti
 for bug-gnu-emacs@HIDDEN; Tue, 25 Nov 2014 13:39:12 -0500
Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:50388)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <carlosjosepita@HIDDEN>) id 1XtL11-0005xi-Lf
 for bug-gnu-emacs@HIDDEN; Tue, 25 Nov 2014 13:39:07 -0500
Received: by mail-la0-f42.google.com with SMTP id s18so1121696lam.15
 for <bug-gnu-emacs@HIDDEN>; Tue, 25 Nov 2014 10:39:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:from:date:message-id:subject:to:cc:content-type;
 bh=5IVnqUNmlnHiY4dwx186gE1zJMOS3oSNYvvCqykoQ3s=;
 b=DPCZHgDa87sEmxgFXJ80uX8F+rSEWM/dxJBrWQMXK43cfrhLuHouJwMbgRdXpYFP2s
 w2yNQqRRt8BnpQUpaP6511RnCRmhaT43l4v6bqW7evIvV2+Qk8I+EOF9LNpl8GCaobdM
 SvLkPrSQVq/z8aIdzsEsuRoQHaCQhXBIQQ2qcUcSHolBD2rcJVDF787MD513M4km7Kwa
 AillO0ALBo3fwg15LSdjiy7/08rQT9x2foY3ADuc0RQQip2bUi558k8tBb164TZW+XTu
 bQ7G/mYz37bwyAZerX1Q8etfrn7hZ68lMVYg8QzyZitujjXOsBTateCQbHmT5XiXKfVG
 prWw==
X-Received: by 10.112.141.233 with SMTP id rr9mr29741491lbb.1.1416940746266;
 Tue, 25 Nov 2014 10:39:06 -0800 (PST)
MIME-Version: 1.0
Received: by 10.112.252.101 with HTTP; Tue, 25 Nov 2014 10:38:46 -0800 (PST)
From: Carlos Pita <carlosjosepita@HIDDEN>
Date: Tue, 25 Nov 2014 15:38:46 -0300
Message-ID: <CAELgYhdY8DQ3403MiJyACy0H6a-nuHo7uin-gq=VECasodwRiw@HIDDEN>
Subject: 24.4; which-function-mode end of function detection (easy suggestion
 for improvement)
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
Cc: alexr@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

It's a known and documented limitation of which-function mode that it
doesn't detect the end of a function due to it's dependence on
imenu. The following quotes are taken from which-func.el:

;; Really this package shows not "function where the current point is
;; located now", but "nearest function which defined above the current

;;     1. Dependence on imenu package should be removed.  Separate
;; function determination mechanism should be used to determine the end

What do you think about the following strategy which avoids to remove
the dependence on imenu and, instead, leverages imenu and the
end-of-defun functionality already provided by many major modes (in one
way or another)?

1) Detect the beginning of function using imenu, as it's currently done.

2) Detect the end of function using the end-of-defun variant for the
current major mode. The function implementing the corresponding
functionality for the current major mode should be configured explicitly
on a per-mode basis, but an *unsafe* option (disabled by default) could
also be provided to take it automatically from the M-C-e binding.

This is not to say that a separate mechanism would be undesirable but to
improve which-function support for many major modes out of the box in
the short term and in a very easy way.

Cheers
--
Carlos




Acknowledgement sent to Carlos Pita <carlosjosepita@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#19182; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 9 Jun 2022 14:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.