unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30449: imenu contains redundant '*Rescan*' item with auto refresh
@ 2018-02-13 21:12 Campbell Barton
  2019-07-14 16:32 ` Lars Ingebrigtsen
  2019-09-19 21:36 ` Matthew Newton
  0 siblings, 2 replies; 5+ messages in thread
From: Campbell Barton @ 2018-02-13 21:12 UTC (permalink / raw)
  To: 30449

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#30449: imenu contains redundant '*Rescan*' item with auto refresh
  2018-02-13 21:12 bug#30449: imenu contains redundant '*Rescan*' item with auto refresh Campbell Barton
@ 2019-07-14 16:32 ` Lars Ingebrigtsen
  2019-09-16 23:38   ` Lars Ingebrigtsen
  2019-09-19 21:36 ` Matthew Newton
  1 sibling, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-14 16:32 UTC (permalink / raw)
  To: Campbell Barton; +Cc: 30449

Campbell Barton <ideasman42@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





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#30449: imenu contains redundant '*Rescan*' item with auto refresh
  2019-07-14 16:32 ` Lars Ingebrigtsen
@ 2019-09-16 23:38   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-16 23:38 UTC (permalink / raw)
  To: Campbell Barton; +Cc: 30449

Lars Ingebrigtsen <larsi@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#30449: imenu contains redundant '*Rescan*' item with auto refresh
  2018-02-13 21:12 bug#30449: imenu contains redundant '*Rescan*' item with auto refresh Campbell Barton
  2019-07-14 16:32 ` Lars Ingebrigtsen
@ 2019-09-19 21:36 ` Matthew Newton
  2019-09-20 13:02   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 5+ messages in thread
From: Matthew Newton @ 2019-09-19 21:36 UTC (permalink / raw)
  To: larsi; +Cc: 30449

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#30449: imenu contains redundant '*Rescan*' item with auto refresh
  2019-09-19 21:36 ` Matthew Newton
@ 2019-09-20 13:02   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-20 13:02 UTC (permalink / raw)
  To: Matthew Newton; +Cc: 30449

Matthew Newton <matt@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-20 13:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-13 21:12 bug#30449: imenu contains redundant '*Rescan*' item with auto refresh Campbell Barton
2019-07-14 16:32 ` Lars Ingebrigtsen
2019-09-16 23:38   ` Lars Ingebrigtsen
2019-09-19 21:36 ` Matthew Newton
2019-09-20 13:02   ` Lars Ingebrigtsen

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