unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Alex Branham <alex.branham@gmail.com>
Cc: 33695@debbugs.gnu.org
Subject: bug#33695: 27.0.50; which-function reports wrong imenu information
Date: Thu, 13 Dec 2018 10:01:18 +0100	[thread overview]
Message-ID: <5C121FDE.5070705@gmx.at> (raw)
In-Reply-To: <87o99qcq60.fsf@gmail.com>

 >> 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





  reply	other threads:[~2018-12-13  9:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 18:58 bug#33695: 27.0.50; which-function reports wrong imenu information Alex Branham
2018-12-11  8:35 ` martin rudalics
2018-12-11 14:32   ` Alex Branham
2018-12-12  8:31     ` martin rudalics
2018-12-12 22:53       ` Alex Branham
2018-12-13  9:01         ` martin rudalics [this message]
2018-12-19 15:42 ` bug#33695: [PATCH] Fix which-function reporting outdated information Alex Branham
2019-01-10 19:55 ` Alex Branham
2019-02-19 21:29   ` Alex Branham
2019-02-22 21:28   ` Alex Branham

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=5C121FDE.5070705@gmx.at \
    --to=rudalics@gmx.at \
    --cc=33695@debbugs.gnu.org \
    --cc=alex.branham@gmail.com \
    /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).