Subject: 24.3.50; imenu inconsistencies

From: Thierry Volpiatto <[email-masked]>
Date: Fri, 29 Nov 2013 08:44:27 +0100

Hi all,

here a sample file test.el:

--8<---------------cut here---------------start------------->8---
(defvar foo)
(defvar bar nil)
(defvar baz '((defmacro* . cl-defmacro)
              (defun* . cl-defun)))
(defun* test () nil)
(defmacro* test2 () nil)
(defmacro test3 () nil)
(cl-defmacro test4 () nil)
--8<---------------cut here---------------end--------------->8---

Here the output of `imenu--make-index-alist':

--8<---------------cut here---------------start------------->8---
(("*Rescan*" . -99)
 ("Variables"
  ("bar" . #<marker at 14 in test2.el>)
  ("baz" . #<marker at 31 in test2.el>))
 ("." . #<marker at 71 in test2.el>)
 ("test" . #<marker at 107 in test2.el>)
 ("test3" . #<marker at 153 in test2.el>)
 ("test4" . #<marker at 177 in test2.el>))
--8<---------------cut here---------------end--------------->8---

I see here some problems:

1) var `foo' is not listed, thus if we remove from file the vars `bar' and
`baz', we end up with ("Variables") only, which mean that the variable
`foo' is detected but not listed because it have no value.

2) The "defun*" in var `baz' is detected as a function with name `.',
but is not, it is just an element of var `baz'.

3) The function test defined with `defun*' from cl package is listed,
but the macro `test2' defined with `defmacro*' is not listed.
I expect the both listed if cl package is loaded or nothing listed if it
is not loaded.

In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10)
 of 2013-11-28 on dell-14z
Windowing system distributor `The X.Org Foundation', version 11.0.11103000
System Description:	Ubuntu 12.04.3 LTS

Important settings:
  value of $LC_MONETARY: fr_FR.UTF-8
  value of $LC_NUMERIC: fr_FR.UTF-8
  value of $LC_TIME: fr_FR.UTF-8
  value of $LANG: fr_FR.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  psession-mode: t
  global-semanticdb-minor-mode: t
  global-semantic-idle-scheduler-mode: t
  semantic-mode: t
  golden-ratio-mode: t
  winner-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  auto-image-file-mode: t
  eldoc-in-minibuffer-mode: t
  show-paren-mode: t
  display-time-mode: t
  recentf-mode: t
  savehist-mode: t
  eldoc-mode: t
  minibuffer-depth-indicate-mode: t
  helm-mode: t
  helm-descbinds-mode: t
  shell-dirtrack-mode: t
  helm-adaptative-mode: t
  helm-match-plugin-mode: t
  helm-occur-match-plugin-mode: t
  tooltip-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 input:
<left> <left> <left> <left> <left> <left> <left> C-M-SPC 
M-w C-< <down> <return> <return> <return> C-y <up> 
<up> <up> <up> <up> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <up> <up> 
M-( d e f m a c r o * SPC t e s t 2 SPC M-( <right> 
SPC n i l C-x C-s M-: M-p M-p <return> <return> <down> 
<down> <down> <down> <down> <down> <up> <up> <up> <up> 
<up> M-( d e f m a c r o SPC t e s t 3 SPC M-( <right> 
SPC n i l <right> <return> M-( c l - d e f m a c r 
o SPC t e s t 4 SPC M-( <right> SPC n i l <down> C-a 
C-SPC C-n C-n C-n C-n C-n C-n C-d C-x C-s M-: M-p M-p 
<return> <return> <up> <up> <up> <up> <up> <up> <up> 
<up> <down> <down> <down> <down> <down> <down> C-x 
C-² C-x C-b <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <return> C-x c i w i t 
h <down> <down> <down> <down> <down> <return> C-x C-b 
<down> <down> <return> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> C-M-SPC M-w C-x C-b <down> <return> 
M-: C-y C-y <return> <return> M-: M-p M-p M-p <return> 
<return> C-x c i <down> <return> C-< <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> C-SPC C-n C-n C-n C-n C-n C-n C-n C-n M-w C-< 
<down> <down> <down> <down> <down> <down> <down> <return> 
<return> C-y C-x C-x M-; C-x C-s C-x C-² M-x r e p 
o r t <return>

Recent messages:
Here is not Git work tree
nil
Evaluating...
Here is not Git work tree
See buffer *Pp Eval Output*.
Mark activated
End of buffer
Mark set
Saving file /home/thierry/labo/tmp/test2.el...
Wrote /home/thierry/labo/tmp/test2.el

Load-path shadows:
/usr/local/share/emacs/24.3.50/lisp/gnus/.dir-locals hides ~/elisp/magit/.dir-locals
~/elisp/auctex/lpath hides ~/elisp/emacs-wget/lpath
/usr/local/share/emacs/24.3.50/lisp/emacs-lisp/tq hides ~/elisp/emms/lisp/tq
~/.emacs.d/.gnus hides ~/.emacs.d/emacs-config-laptop/.gnus

Features:
(shadow gnus-dired nnir mail-extr gnus-msg gnus-art mm-uu mml2015
mm-view mml-smime smime dig gnus-sum nnoo gnus-group gnus-undo nnmail
mail-source gnus-start gnus-spec gnus-int gnus-range gnus-win emacsbug
helm-command cl-indent help-mode helm-dabbrev magit-cherry magit-bisect
magit-log-edit log-edit add-log magit-key-mode magit view iswitchb
ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init
ediff-util ediff diff-mode magit-compat ido helm-semantic helm-imenu
imenu semantic/bovine/c hideif semantic/bovine/c-by semantic/lex-spp
semantic/bovine/gcc semantic/bovine semantic/analyze semantic/sort
semantic/scope semantic/analyze/fcn cc-langs cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs vc-hg
semantic/tag-file semantic/db-file data-debug cedet-files
semantic/wisent/python semantic/decorate/include semantic/db-find
semantic/db-ref semantic/decorate/mode semantic/decorate pulse
semantic/dep semantic/wisent/python-wy semantic/wisent
semantic/wisent/wisent vc-git naquadah-theme em-unix em-script em-prompt
em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner
em-alias align-let git-gutter server persistent-sessions
semantic/db-mode semantic/db eieio-base semantic/idle semantic/format
ezimage semantic/tag-ls semantic/find semantic/ctxt semantic/util-modes
semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local
cedet package golden-ratio winner undo-tree diff image-file newsticker
newst-treeview newst-plainview newst-reader newst-ticker newst-backend
xdvi-search preview-latex tex-site auto-loads pcomplete-extension
em-term term disp-table ehelp electric helm-ipython helm-elisp helm-eval
python rx eldoc-eval warnings whitespace paren time avoid recentf
tree-widget savehist smtpmail-async smtpmail sendmail helm-async
iterator simple-call-tree iedit-rect rect iedit iedit-lib smallurl
mm-url gnus gnus-ems nnheader wid-edit rectangle-utils ledger-config
ledger esh-var esh-io esh-cmd esh-opt esh-ext esh-proc eldoc esh-groups
eshell esh-module esh-mode esh-arg esh-util tv-utils async pcvs vc-cvs
pcvs-parse pcvs-info pcvs-defs pcvs-util ewoc mb-depth cl-info
slime-autoloads esh-toggle flymake no-word htmlize dired-extension
emms-mpd-config emms-playlist-limit emms-volume emms-volume-amixer
emms-i18n emms-history emms-score emms-stream-info
emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon
emms-browser sort emms-playlist-sort emms-last-played emms-player-xine
emms-player-mpd tq emms-playing-time emms-lyrics emms-url hl-line
emms-tag-editor emms-mark emms-mode-line emms-cache emms-info-ogginfo
emms-info-mp3info emms-playlist-mode emms-player-vlc emms-player-mplayer
emms-info emms-streams later-do emms-source-playlist emms-source-file
emms-player-simple emms-setup emms emms-compat org-config-thierry ob-sh
cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays
hol-loaddefs appt diary-lib diary-loaddefs org-element org-rmail org-mhe
org-irc org-info org-gnus org-docview org-bibtex bibtex org-bbdb org-w3m
org-agenda org-annotation-helper addressbook-bookmark message rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev mail-utils gmm-utils mailheader firefox-protocol
bookmark-firefox-handler bookmark-extensions bookmark pp
init-helm-thierry helm-mode helm-ls-git helm-descbinds helm-ls-hg
helm-files image-dired tramp tramp-compat tramp-loaddefs trampver shell
dired-x dired-aux ffap thingatpt helm-buffers helm-elscreen helm-tags
helm-bookmark helm-adaptative helm-info helm-net browse-url xml url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-parse url-vars mailcap helm-plugin helm-help
helm-match-plugin helm-grep wgrep-helm wgrep helm-regexp grep
helm-external helm-utils dired compile helm-locate helm vc vc-dispatcher
helm-config helm-aliases epa-file epa derived epg epg-config auth-source
eieio eieio-core gnus-util mm-util mail-prsvr password-cache info
cl-macs gv edmacro kmacro org-crypt org byte-opt bytecomp byte-compile
cconv advice help-fns org-macro org-footnote org-pcomplete pcomplete
org-list org-faces org-entities time-date noutline outline easy-mmode
org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table
ob-keys ob-exp ob-comint comint ansi-color ring ob-core ob-eval
org-compat org-macs org-loaddefs format-spec find-func cal-menu easymenu
calendar cal-loaddefs net-utils cl cl-loaddefs cl-lib tooltip ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer 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 make-network-process dbusbind
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997