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>; dated Tue, 25 Nov 2014 18:40:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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: Mon, 25 Nov 2019 12:00:02 UTC

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