Subject: bug#24309: 25.1; Problem in variable reference in docstrings.

From: Nathanael Schweers <[email-masked]>
Date: Fri, 26 Aug 2016 01:07:06 +0200

This bug applies to both the version given in the description
(i.e. 25.1-RC2) and version 24.5 distributed on fedora.

These are the steps to reproduce the bug:

- Start Emacs with “emacs -Q”.
- evaluate these forms:
  (defvar var "var" "docstring of var")
  (defvar var* "var*" "docstring of var*")
  (defvar *var "*var" "docstring of *var")
  (defvar *var* "*var*" "docstring of *var*")

  (defun fun0 () "see variable ‘var’." var)
  (defun fun1 () "see var*iable ‘var*’." var*)
  (defun fun2 () "see *variable ‘*var’." *var)
  (defun fun3 () "see *var*iable ‘*var*’." *var*)
- See the docstrings of the defined functions.  For fun0 and fun1 the
  reference to the variable is correct, for fun2 and fun3 they are not.

In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9)
 of 2016-08-22 built on reisefreund.localdomain
Windowing system distributor 'Fedora Project', version 11.0.11803000
Configured using:
 'configure --with-xml2 --with-imagemagick --with-x-toolkit=gtk3
 'CFLAGS=-O3 -march=native''

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

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8

Major mode: Outline

Minor modes in effect:
  goto-address-mode: t
  semantic-minor-modes-format: ((:eval (if (or semantic-highlight-edits-mode semantic-show-unmatched-syntax-mode)  S)))
  TeX-PDF-mode: t
  TeX-source-correlate-mode: t
  schweers-global-bindings-mode: t
  schweers-bindings-mode: t
  projectile-global-mode: t
  projectile-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  helm-mode: t
  jabber-activity-mode: t
  erc-highlight-nicknames-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  pyvenv-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  global-auto-complete-mode: t
  guide-key-mode: t
  desktop-save-mode: t
  diff-auto-refine-mode: t
  global-subword-mode: t
  subword-mode: t
  winner-mode: t
  savehist-mode: t
  recentf-mode: t
  delete-selection-mode: t
  xterm-mouse-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-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
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t
  view-mode: t

Recent messages:
nnimap read 0k from imap.mailbox.org
Decrypt (PGP) part? (y or n) y
nnimap read 0k from imap.mailbox.org
Decrypt (PGP) part? (y or n) y [7 times]
View mode: type C-h for help, h for commands, q to quit.
command-execute: Buffer is read-only: #<buffer *info*>
Type "q" in help window to restore its previous buffer.
Quit
Mark set
Auto-saving...

Load-path shadows:
/home/schweers/.emacs.d/elpa/helm-20160824.2154/helm-multi-match hides /home/schweers/.emacs.d/elpa/helm-core-20160821.110/helm-multi-match
/home/schweers/.emacs.d/code/misc hides /usr/local/share/emacs/25.1/lisp/misc
/home/schweers/.emacs.d/elpa/seq-2.16/seq hides /usr/local/share/emacs/25.1/lisp/emacs-lisp/seq

Features:
(shadow emacsbug goto-addr tramp-cache url-queue shr dom mailalias
smtpmail nnir flow-fill sort smiley gnus-cite mail-extr gnus-async
gnus-bcklg gnus-ml disp-table el-reader eieio-opt qp mm-archive url-http
url-gw url-cache url-auth url-handlers nnrss nndraft nnmh nnfolder utf-7
bbdb-gnus bbdb-mua bbdb-com bbdb-message sendmail epa-file epa
network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp
gnus-cache gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap
nnmail mail-source utf7 netrc nnoo parse-time gnus-spec gnus-int
gnus-range gnus-win ert debug helm-command helm-elisp helm-eval tabify
face-remap calc calc-loaddefs calc-macs repeat misearch multi-isearch
linum texmathp macrostep-c cmacexp macrostep view ruby-mode-expansions
ruby-mode smie company-oddmuse company-keywords company-etags
company-gtags company-dabbrev-code company-dabbrev company-files
company-capf company-cmake company-xcode company-clang company-semantic
company-eclim company-template company-css company-nxml company-bbdb
asm-mode org-rmail org-mhe org-irc org-info org-gnus org-docview
doc-view image-mode org-bibtex bibtex org-bbdb org-w3m jka-compr preview
prv-emacs flyspell tex-buf font-latex latex-mode-expansions latex
tex-style tex tex-mode setup-binding-mode setup-projectile
helm-projectile projectile ibuf-ext ibuffer setup-clojure cider
cider-debug cider-browse-ns cider-inspector cider-mode cider-interaction
cider-repl cider-resolve cider-test cider-overlays cider-stacktrace
cider-doc org-table cider-grimoire cider-popup cider-eldoc cider-client
cider-common cider-util nrepl-client queue nrepl-dict cider-compat
spinner clojure-mode-expansions clojure-mode align setup-diminish
setup-undo-tree-mode undo-tree diff forth-mode info-look speedbar
sb-image ezimage dframe setup-dired setup-gud setup-clhs
setup-ace-jump-mode ace-jump-mode diminish setup-helm helm-mode
helm-files image-dired dired-x dired-aux helm-buffers helm-elscreen
helm-tags helm-bookmark helm-adaptive helm-info bookmark helm-locate
helm-grep helm-regexp helm-external helm-net helm-utils helm-help
helm-types helm-config helm-easymenu helm helm-source eieio-compat
helm-multi-match helm-lib jabber jabber-notifications notifications
jabber-libnotify dbus jabber-awesome jabber-osd jabber-wmii
jabber-xmessage jabber-festival jabber-sawfish jabber-ratpoison
jabber-tmux jabber-screen jabber-socks5 jabber-ft-server
jabber-si-server jabber-ft-client jabber-ft-common jabber-si-client
jabber-si-common jabber-feature-neg jabber-truncate jabber-time
jabber-autoaway jabber-vcard-avatars jabber-chatstates jabber-events
jabber-vcard jabber-avatar jabber-activity jabber-watch jabber-modeline
jabber-ahc-presence jabber-ahc jabber-version jabber-ourversion
jabber-muc-nick-completion hippie-exp jabber-browse jabber-search
jabber-register jabber-roster jabber-presence jabber-muc
jabber-bookmarks jabber-private jabber-muc-nick-coloring hexrgb
jabber-widget jabber-disco jabber-chat jabber-history jabber-chatbuffer
jabber-alert jabber-iq jabber-core jabber-console ewoc jabber-keymap
jabber-sasl sasl sasl-anonymous sasl-login sasl-plain fsm jabber-logon
jabber-conn srv dns starttls tls gnutls jabber-xml xml jabber-menu
jabber-util setup-eldoc setup-expand-region expand-region
text-mode-expansions cc-mode-expansions the-org-mode-expansions
python-el-fgallina-expansions js-mode-expansions html-mode-expansions
er-basic-expansions expand-region-core expand-region-custom setup-geiser
geiser setup-slime slime-repl slime-parse ac-slime slime arc-mode
archive-mode hyperspec browse-url setup-browse-kill-ring
browse-kill-ring derived cl setup-ace-link ace-link setup-erc
erc-highlight-nicknames erc-list erc-menu erc-join erc-ring erc-networks
erc-pcomplete erc-track erc-match erc-button erc-fill erc-stamp
erc-netsplit erc-goodies erc erc-backend erc-compat pp
setup-multiple-cursors multiple-cursors mc-hide-unmatched-lines-mode
mc-separate-operations rectangular-region-mode mc-mark-pop mc-mark-more
mc-cycle-cursors mc-edit-lines setup-gnus mm-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap gnus gnus-ems nnheader setup-bbdb bbdb bbdb-site
timezone setup-auctex setup-ispell ispell setup-org ox-man ox-md ox-odt
rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse
nxml-ns nxml-enc xmltok nxml-util ox-texinfo ox-beamer ox-latex
ox-icalendar ox-html ox-ascii ox-publish ox org-element org org-macro
org-footnote org-pcomplete org-list org-faces org-entities org-version
ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys
ob-comint ob-core ob-eval org-compat org-macs org-loaddefs cal-menu
calendar cal-loaddefs setup-ace-window ace-window setup-elpy yasnippet
highlight-indentation company elpy pyvenv elpy-refactor python ido grep
files-x cus-edit cus-start cus-load setup-keybindings windmove
setup-magit magit-blame magit-stash magit-bisect magit-remote
magit-commit magit-sequence magit magit-apply magit-wip magit-log
magit-diff smerge-mode magit-core magit-autorevert autorevert filenotify
magit-process magit-popup magit-mode magit-git crm magit-section
magit-utils git-commit log-edit message dired rfc822 mml mml-sec epg
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log
with-editor async-bytecomp async tramp-sh tramp tramp-compat
tramp-loaddefs trampver shell pcomplete format-spec server
setup-autocomplete flymake compile comint ansi-color
auto-complete-config auto-complete popup setup-lispy lispy swiper ivy
ffap url-parse auth-source gnus-util mm-util mail-prsvr password-cache
url-vars iedit edmacro kmacro iedit-lib multiple-cursors-core rect
lispy-inline avy semantic/db eieio-base semantic/util-modes
semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local
find-func cedet noutline outline etags xref cl-seq project eieio
eieio-core cl-macs ediff-merg ediff-wind ediff-diff ediff-mult
ediff-help ediff-init ediff-util ediff edebug help-fns lispy-tags
setup-guide-keys guide-key popwin saveplace misc desktop frameset vc-git
diff-mode easy-mmode setup-hydra hydra lv setup-dash dash-functional pc
json-mode json-reformat subr-x json-snatcher rx js sgml-mode json map
imenu thingatpt cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs f s ucs-normalize setup-package dash
sane-defaults advice cap-words superword subword winner ring savehist
recentf tree-widget wid-edit delsel appearance xt-mouse paren finder-inf
tex-site slime-autoloads 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 1323413 404955)
 (symbols 48 84988 20)
 (miscs 40 3946 6791)
 (strings 32 496951 44309)
 (string-bytes 1 10118029)
 (vectors 16 128038)
 (vector-slots 8 2696037 232959)
 (floats 8 1833 4761)
 (intervals 56 25719 3193)
 (buffers 976 154)
 (heap 1024 176436 45161))

--