GNU bug report logs - #30449
imenu contains redundant '*Rescan*' item with auto refresh

Previous Next

Package: emacs;

Reported by: Campbell Barton <ideasman42 <at> gmail.com>

Date: Tue, 13 Feb 2018 21:17:01 UTC

Severity: wishlist

Tags: fixed, moreinfo, patch

Merged with 37460

Found in version 27.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30449 in the body.
You can then email your comments to 30449 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#30449; Package emacs. (Tue, 13 Feb 2018 21:17:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Campbell Barton <ideasman42 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 13 Feb 2018 21:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Campbell Barton <ideasman42 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: imenu contains redundant '*Rescan*' item with auto refresh
Date: Wed, 14 Feb 2018 08:12:00 +1100
With imenu package when auto rescan is enabled:

  (setq imenu-auto-rescan t)

imenu shows a  '*Refresh*' option,
which should not be displayed when auto-rescan is used.

See reference: https://emacs.stackexchange.com/a/38808/2418

----

In GNU Emacs 25.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.26)
 of 2018-02-09 built on bisson
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-modules
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
 -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=0
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  highlight-numbers-mode: t
  global-auto-complete-mode: t
  auto-complete-mode: t
  drag-stuff-global-mode: t
  drag-stuff-mode: t
  fci-mode: t
  whitespace-mode: t
  global-hl-line-mode: t
  show-paren-mode: t
  ivy-mode: t
  savehist-mode: t
  global-evil-surround-mode: t
  evil-surround-mode: t
  evil-leader-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  flyspell-mode: t
  shell-dirtrack-mode: t
  evil-mode: t
  evil-local-mode: t
  visual-indentation-mode: t
  tooltip-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Loading visual-indentation-mode...done
Loading /home/ideasman42/.emacs.d/custom.el (source)...done
Starting new Ispell process /usr/bin/aspell with default dictionary...

Load-path shadows:
/home/ideasman42/.emacs.d/elpa/cmake-mode-20180104.1137/cmake-mode
hides /usr/share/emacs/site-lisp/cmake-mode
/home/ideasman42/.emacs.d/elpa/let-alist-1.0.5/let-alist hides
/usr/share/emacs/25.3/lisp/emacs-lisp/let-alist

Features:
(shadow sort mail-extr emacsbug message idna format-spec rfc822 mml
mml-sec epg mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils
colir color counsel dired esh-util etags xref project swiper
highlight-numbers parent-mode flymake compile company
auto-complete-config auto-complete popup smart-tabs-mode cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs drag-stuff inkpot-theme fill-column-indicator disp-table
whitespace hl-line paren ivy delsel ivy-overlay ffap url-parse
auth-source cl-seq eieio eieio-core cl-macs gnus-util mm-util help-fns
mail-prsvr password-cache url-vars savehist evil-surround evil-leader
evil evil-integration undo-tree diff evil-maps evil-commands reveal
flyspell ispell evil-jumps evil-command-window evil-types evil-search
evil-ex shell pcomplete comint ansi-color evil-macros evil-repeat
evil-states evil-core advice evil-common windmove thingatpt rect
evil-digraphs evil-vars ring edmacro kmacro visual-indentation-mode
finder-inf info package epg-config seq byte-opt gv bytecomp byte-compile
cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 288973 15259)
 (symbols 48 36176 0)
 (miscs 40 480 965)
 (strings 32 71477 10611)
 (string-bytes 1 2201254)
 (vectors 16 32691)
 (vector-slots 8 670043 7265)
 (floats 8 502 98)
 (intervals 56 597 0)
 (buffers 976 19))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30449; Package emacs. (Sun, 14 Jul 2019 16:33:02 GMT) Full text and rfc822 format available.

Message #8 received at 30449 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Campbell Barton <ideasman42 <at> gmail.com>
Cc: 30449 <at> debbugs.gnu.org
Subject: Re: bug#30449: imenu contains redundant '*Rescan*' item with auto
 refresh
Date: Sun, 14 Jul 2019 18:32:45 +0200
Campbell Barton <ideasman42 <at> gmail.com> writes:

> With imenu package when auto rescan is enabled:
>
>   (setq imenu-auto-rescan t)
>
> imenu shows a  '*Refresh*' option,
> which should not be displayed when auto-rescan is used.
>
> See reference: https://emacs.stackexchange.com/a/38808/2418

I don't use imenu, so I can't really test, but does the following fix
the problem?

diff --git a/lisp/imenu.el b/lisp/imenu.el
index 5084fe61ef..9df597b4d6 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -510,8 +510,9 @@ imenu--make-index-alist
        "No items suitable for an index found in this buffer"))
   (or imenu--index-alist
       (setq imenu--index-alist (list nil)))
-  ;; Add a rescan option to the index.
-  (cons imenu--rescan-item imenu--index-alist))
+  (unless imenu-auto-rescan
+    ;; Add a rescan option to the index.
+    (cons imenu--rescan-item imenu--index-alist)))
 
 (defvar imenu--cleanup-seen nil)
 


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




Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 26 Jul 2019 06:42:02 GMT) Full text and rfc822 format available.

Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 26 Jul 2019 06:42:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30449; Package emacs. (Mon, 16 Sep 2019 23:39:01 GMT) Full text and rfc822 format available.

Message #15 received at 30449 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Campbell Barton <ideasman42 <at> gmail.com>
Cc: 30449 <at> debbugs.gnu.org
Subject: Re: bug#30449: imenu contains redundant '*Rescan*' item with auto
 refresh
Date: Tue, 17 Sep 2019 01:38:49 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> With imenu package when auto rescan is enabled:
>>
>>   (setq imenu-auto-rescan t)
>>
>> imenu shows a  '*Refresh*' option,

[...]

> I don't use imenu, so I can't really test, but does the following fix
> the problem?

[...]

> -  ;; Add a rescan option to the index.
> -  (cons imenu--rescan-item imenu--index-alist))
> +  (unless imenu-auto-rescan
> +    ;; Add a rescan option to the index.
> +    (cons imenu--rescan-item imenu--index-alist)))

There was no response, but it seems "obviously correct", so I'm applying
the patch.  Feel free to revert if it's the wrong thing to do.

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Sep 2019 23:41:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 30449 <at> debbugs.gnu.org and Campbell Barton <ideasman42 <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Sep 2019 23:41:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30449; Package emacs. (Thu, 19 Sep 2019 21:37:02 GMT) Full text and rfc822 format available.

Message #22 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Matthew Newton <matt <at> mnewton.com>
To: larsi <at> gnus.org
Cc: bug-gnu-emacs <at> gnu.org
Subject: bug#30449: imenu contains redundant '*Rescan*' item with auto refresh
Date: Thu, 19 Sep 2019 14:36:47 -0700
Hi Lars,

I found this issue after finding a downstream problem in the counsel package. See the related issue I started:

https://github.com/abo-abo/swiper/issues/2241

I don’t know the codebase at all and I just spent a couple minutes looking at it. But shouldn’t imenu--make-index-alist always return a list? So the last lines would be:

(if imenu-auto-rescan
      imenu--index-alist
    ;; Add a rescan option to the index.
    (cons imenu--rescan-item imenu--index-alist))

Cheers,
Matt



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30449; Package emacs. (Fri, 20 Sep 2019 13:03:02 GMT) Full text and rfc822 format available.

Message #25 received at 30449 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Matthew Newton <matt <at> mnewton.com>
Cc: 30449 <at> debbugs.gnu.org
Subject: Re: bug#30449: imenu contains redundant '*Rescan*' item with auto
 refresh
Date: Fri, 20 Sep 2019 15:02:18 +0200
Matthew Newton <matt <at> mnewton.com> writes:

> I don’t know the codebase at all and I just spent a couple minutes looking at it. But shouldn’t imenu--make-index-alist always return a list? So the last lines would be:
>
> (if imenu-auto-rescan
>       imenu--index-alist
>     ;; Add a rescan option to the index.
>     (cons imenu--rescan-item imenu--index-alist))

Yes, that looks like the correct fix.  I've now applied it to the Emacs
trunk.

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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 19 Oct 2019 11:24:08 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Tue, 25 Aug 2020 23:51:02 GMT) Full text and rfc822 format available.

Forcibly Merged 30449 37460. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Tue, 25 Aug 2020 23:51:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 23 Sep 2020 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 227 days ago.

Previous Next


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