emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: which-function-mode doesn't work when imenu--sort-by-name is used .


From: Richard . G . Bielawski
Subject: RE: which-function-mode doesn't work when imenu--sort-by-name is used .
Date: Fri, 14 Jan 2005 20:15:00 -0600

>-----Original Message-----
>From: Richard Stallman [mailto:address@hidden
>Sent: Tuesday, January 11, 2005 7:35 PM
>To: address@hidden
>Subject: Re: which-function-mode doesn't work when imenu--sort-by-name
>is used .
> 
> 
>It worked for me when I tried it.
>What Emacs version are you talking about?

I can't see how that's possible.  Two bugs appear to be independently
causing various imenu entries not to be reported by which-function.  Both
bugs were in the latest CVS versions as of yesterday morning.

The first seems to stem from the fact that imenu--split-menu uses sort.
Sort is destructive to the original imenu--index-alist value.  In the
example below, `Here' and `There' are no longer visible in that list 
after sorting because their position has been moved prior to the car.

Next, which-function assumes the list is in buffer sequence.  When point
is in the `text' definition `any' displays because the `line' entry is
seen before the `text' entry.  Since it's buffer position is after point
the search stops before examining the `text' entry.

        runemacs.exe -q
C-x b test
        Paste the following 5 lines into the test buffer.
(defcustom any )
(defcustom text )
(defcustom line )
(defcustom Here )
(defcustom There )

        Issue these commands:
M-x emacs-lisp-mode
M-x which-function-mode
        Notice which-function operates correctly.
        Now issue these commands
M-: (setq  imenu-sort-function 'imenu--sort-by-name)
M-: (imenu-add-menubar-index)
        which-function no longer displays `'text', `Here' or `There'.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]