From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#33695: 27.0.50; which-function reports wrong imenu information Date: Thu, 13 Dec 2018 10:01:18 +0100 Message-ID: <5C121FDE.5070705@gmx.at> References: <87tvjlmcoe.fsf@gmail.com> <5C0F76BC.6080001@gmx.at> <87mupcm8vd.fsf@gmail.com> <5C10C76D.2090702@gmx.at> <87o99qcq60.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1544691626 4886 195.159.176.226 (13 Dec 2018 09:00:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 13 Dec 2018 09:00:26 +0000 (UTC) Cc: 33695@debbugs.gnu.org To: Alex Branham Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 13 10:00:22 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gXMqx-00016y-FS for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Dec 2018 10:00:19 +0100 Original-Received: from localhost ([::1]:51230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXMt3-0004Ha-Ba for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Dec 2018 04:02:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXMsj-0004HT-Ii for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2018 04:02:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXMsd-0007Yb-BO for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2018 04:02:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41533) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXMsc-0007XV-9T for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2018 04:02:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gXMsc-0006GH-2f for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2018 04:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Dec 2018 09:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33695 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33695-submit@debbugs.gnu.org id=B33695.154469169724039 (code B ref 33695); Thu, 13 Dec 2018 09:02:02 +0000 Original-Received: (at 33695) by debbugs.gnu.org; 13 Dec 2018 09:01:37 +0000 Original-Received: from localhost ([127.0.0.1]:45791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gXMsD-0006Ff-0Y for submit@debbugs.gnu.org; Thu, 13 Dec 2018 04:01:37 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:60963) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gXMsA-0006FO-Rp for 33695@debbugs.gnu.org; Thu, 13 Dec 2018 04:01:35 -0500 Original-Received: from [192.168.1.101] ([213.162.73.124]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MgXCF-1glR5L0ECt-00NzJS; Thu, 13 Dec 2018 10:01:28 +0100 In-Reply-To: <87o99qcq60.fsf@gmail.com> X-Provags-ID: V03:K1:cgBG+qfJVxztQEae5klYlT5aP1RfJzx6F+uTm05SgDOs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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153397 Archived-At: >> For me the idea of calculating all function position in a buffer and >> afterwards have 'which-func-mode' scan them to find out which function >> point is in, strikes me as enormous over-kill. In particular with >> 'syntax-ppss' around which usually should, without any additional >> cost, provide the position where the current functions starts via the >> 9th element of its return value. But don't let these rantings >> distract you. > > That won't help with non-lispy languages like R or python though, I > don't think. IIUC 'python-info-looking-at-beginning-of-defun' uses 'syntax-ppss' while for example 'c-beginning-of-defun' doesn't. I understand that the implementors of which-func chose the most simple existing way to get the function point is in. But it amounts to having 'beginning-of-defun' always construct a list of the positions of all function definitions in a buffer to find the first one before point. With wich-func a user won't notice the effect because it's done when Emacs is idle. Still it's not ecological. > Perhaps we should reverse the order of what which-function checks? It > currently looks at: > > 1. which-func-functions > 2. imenu--index-alist > 3. add-log-current-defun > > but we could switch those last two. add-log-current-defun should be > faster than reconstructing imenu--index-alist. I think so. But I'm afraid it's not well supported everywhere. Anyway, as I already said don't let my remarks distract you. martin