GNU bug report logs - #24309
25.1; Problem in variable reference in docstrings.

Previous Next

Package: emacs;

Reported by: Nathanael Schweers <NSchweers <at> mailbox.org>

Date: Thu, 25 Aug 2016 23:20:01 UTC

Severity: minor

Tags: fixed, patch

Merged with 6601

Found in version 25.1

Fixed in version 28.1

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

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 24309 in the body.
You can then email your comments to 24309 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#24309; Package emacs. (Thu, 25 Aug 2016 23:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nathanael Schweers <NSchweers <at> mailbox.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 25 Aug 2016 23:20:02 GMT) Full text and rfc822 format available.

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

From: Nathanael Schweers <NSchweers <at> mailbox.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; Problem in variable reference in docstrings.
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))

-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24309; Package emacs. (Fri, 26 Aug 2016 08:56:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Nathanael Schweers <NSchweers <at> mailbox.org>
Cc: 24309 <at> debbugs.gnu.org
Subject: Re: bug#24309: 25.1; Problem in variable reference in docstrings.
Date: Fri, 26 Aug 2016 11:55:54 +0300
> From: Nathanael Schweers <NSchweers <at> mailbox.org>
> 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.

Actually, Emacs has behaved like that since creation of hyper-links to
quoted symbols in doc strings was introduced in Emacs 20.3.

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

See help-xref-symbol-regexp, it requires that the first character
after the opening quote has the word syntax, not the symbol syntax.  I
don't know why is that, perhaps to avoid too many false positives or
something.  The comment there says this was done deliberately.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24309; Package emacs. (Fri, 08 Nov 2019 03:49:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Nathanael Schweers <NSchweers <at> mailbox.org>, 24309 <at> debbugs.gnu.org
Subject: Re: bug#24309: 25.1; Problem in variable reference in docstrings.
Date: Fri, 08 Nov 2019 04:48:19 +0100
tags 24309 + wontfix
close 24309
thanks

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Nathanael Schweers <NSchweers <at> mailbox.org>
>> 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.
>
> Actually, Emacs has behaved like that since creation of hyper-links to
> quoted symbols in doc strings was introduced in Emacs 20.3.
>
>> - 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.
>
> See help-xref-symbol-regexp, it requires that the first character
> after the opening quote has the word syntax, not the symbol syntax.  I
> don't know why is that, perhaps to avoid too many false positives or
> something.  The comment there says this was done deliberately.

That was three years ago, and this discussion has seen no further
replies.  I take the above to mean that we don't want to change the
current behaviour, and I'm therefore closing this bug.

If anyone feels that this is indeed something we would like to
reconsider, please reopen the bug report.

Best regards,
Stefan Kangas




Added tag(s) wontfix. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Fri, 08 Nov 2019 03:49:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 24309 <at> debbugs.gnu.org and Nathanael Schweers <NSchweers <at> mailbox.org> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Fri, 08 Nov 2019 03:49: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. (Fri, 06 Dec 2019 12:24:05 GMT) Full text and rfc822 format available.

bug unarchived. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Sun, 27 Dec 2020 14:44:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24309; Package emacs. (Sun, 27 Dec 2020 19:52:02 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Nathanael Schweers <NSchweers <at> mailbox.org>, Eli Zaretskii <eliz <at> gnu.org>,
 24309 <at> debbugs.gnu.org
Subject: Re: bug#24309: 25.1; Problem in variable reference in docstrings.
Date: Sun, 27 Dec 2020 19:51:08 +0000
[Message part 1 (text/plain, inline)]
forcemerge 24309 6601
tags 24309 - wontfix
tags 24309 + patch
quit

Stefan Kangas <stefan <at> marxist.se> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: Nathanael Schweers <NSchweers <at> mailbox.org>
>>> 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.
>>
>> Actually, Emacs has behaved like that since creation of hyper-links to
>> quoted symbols in doc strings was introduced in Emacs 20.3.
>>
>>> - 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.
>>
>> See help-xref-symbol-regexp, it requires that the first character
>> after the opening quote has the word syntax, not the symbol syntax.  I
>> don't know why is that, perhaps to avoid too many false positives or
>> something.  The comment there says this was done deliberately.
>
> That was three years ago, and this discussion has seen no further
> replies.  I take the above to mean that we don't want to change the
> current behaviour, and I'm therefore closing this bug.
>
> If anyone feels that this is indeed something we would like to
> reconsider, please reopen the bug report.

I would like valid symbol names to be recognised more reliably, and I
don't see why allowing xrefs to start with symbol syntax would lead to
too many false positives, so long as help-make-xrefs filters matches
appropriately.

My personal motivation is that I would like functions from the Dash
package (that start with hyphens), as well as built-in arithmetic
operators, hyperlinked in Help buffers.

The attached patch matches quoted symbol names with one or more
characters starting with either word or symbol syntax in Lisp docstrings
and Help buffers.  WDYT?

Thanks,

-- 
Basil

[0001-Hyperlink-symbol-names-without-word-syntax-in-Help.patch (text/x-diff, inline)]
From 90213663582a9be9853209a49b2a9f977ead48c8 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Date: Sun, 27 Dec 2020 14:21:50 +0000
Subject: [PATCH] Hyperlink symbol names without word syntax in Help

* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2)
(lisp-cl-font-lock-keywords-2): Allow single-character symbol names.
* lisp/help-mode.el (help-xref-symbol-regexp): Also match symbol
names starting with symbol syntax (bug#6601, bug#24309).
* test/lisp/help-mode-tests.el (help-mode-tests-xref-button): Test
hyperlink creation for function names without symbol syntax.
---
 lisp/emacs-lisp/lisp-mode.el |  6 ++----
 lisp/help-mode.el            |  3 +--
 test/lisp/help-mode-tests.el | 22 ++++++++++++++--------
 3 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index e477ef1700..85309b3501 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -456,8 +456,7 @@ lisp--match-confusable-symbol-character
          ("\\(\\\\\\)\\([^\"\\]\\)"
           (1 (elisp--font-lock-backslash) prepend))
          ;; Words inside ‘’ and `' tend to be symbol names.
-         (,(concat "[`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)"
-                   lisp-mode-symbol-regexp "\\)['’]")
+         (,(concat "[`‘]\\(" lisp-mode-symbol-regexp "\\)['’]")
           (1 font-lock-constant-face prepend))
          ;; Constant values.
          (,(concat "\\_<:" lisp-mode-symbol-regexp "\\_>")
@@ -507,8 +506,7 @@ lisp--match-confusable-symbol-character
          (,(concat "(" cl-errs-re "\\_>")
            (1 font-lock-warning-face))
          ;; Words inside ‘’ and `' tend to be symbol names.
-         (,(concat "[`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)"
-                   lisp-mode-symbol-regexp "\\)['’]")
+         (,(concat "[`‘]\\(" lisp-mode-symbol-regexp "\\)['’]")
           (1 font-lock-constant-face prepend))
          ;; Uninterned symbols, e.g., (defpackage #:my-package ...)
          ;; must come before keywords below to have effect
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 025a67016b..e99df4a971 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -357,8 +357,7 @@ help-xref-symbol-regexp
  		    "\\(symbol\\|program\\|property\\)\\|" ; Don't link
 		    "\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)"
 		    "[ \t\n]+\\)?"
-		    ;; Note starting with word-syntax character:
-		    "['`‘]\\(\\sw\\(\\sw\\|\\s_\\)+\\|`\\)['’]"))
+                    "['`‘]\\(\\(?:\\sw\\|\\s_\\)+\\|`\\)['’]"))
   "Regexp matching doc string references to symbols.
 
 The words preceding the quoted symbol can be used in doc strings to
diff --git a/test/lisp/help-mode-tests.el b/test/lisp/help-mode-tests.el
index 2b9552a8d8..016f4d4965 100644
--- a/test/lisp/help-mode-tests.el
+++ b/test/lisp/help-mode-tests.el
@@ -72,14 +72,20 @@ help-mode-tests-make-xrefs
                   #'info)))))
 
 (ert-deftest help-mode-tests-xref-button ()
-  (with-temp-buffer
-    (insert "See also the function ‘interactive’.")
-    (string-match help-xref-symbol-regexp (buffer-string))
-    (help-xref-button 8 'help-function)
-    (should-not (button-at 22))
-    (should-not (button-at 35))
-    (let ((button (button-at 30)))
-      (should (eq (button-type button) 'help-function)))))
+  (let* ((fmt "See also the function ‘%s’.")
+         ;; 1+ translates string index to buffer position.
+         (beg (1+ (string-search "%" fmt))))
+    (with-temp-buffer
+      ;; (display-buffer (current-buffer))
+      (dolist (fn '(interactive \` = + - * / %))
+        (erase-buffer)
+        (insert (format fmt fn))
+        (goto-char (point-min))
+        (re-search-forward help-xref-symbol-regexp)
+        (help-xref-button 8 'help-function)
+        (should-not (button-at (1- beg)))
+        (should-not (button-at (+ beg (length (symbol-name fn)))))
+        (should (eq (button-type (button-at beg)) 'help-function))))))
 
 (ert-deftest help-mode-tests-insert-xref-button ()
   (with-temp-buffer
-- 
2.29.2


Forcibly Merged 6601 24309. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Sun, 27 Dec 2020 19:52:02 GMT) Full text and rfc822 format available.

Removed tag(s) wontfix. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Sun, 27 Dec 2020 19:52:02 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Sun, 27 Dec 2020 19:52:02 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 27 Dec 2020 19:56:01 GMT) Full text and rfc822 format available.

Removed tag(s) patch. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Sun, 27 Dec 2020 19:56:02 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Sun, 27 Dec 2020 19:57:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24309; Package emacs. (Sun, 27 Dec 2020 20:02:02 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Nathanael Schweers <NSchweers <at> mailbox.org>, Eli Zaretskii <eliz <at> gnu.org>,
 24309 <at> debbugs.gnu.org
Subject: Re: bug#24309: 25.1; Problem in variable reference in docstrings.
Date: Sun, 27 Dec 2020 20:01:24 +0000
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:

>  (ert-deftest help-mode-tests-xref-button ()
> -  (with-temp-buffer
> -    (insert "See also the function ‘interactive’.")
> -    (string-match help-xref-symbol-regexp (buffer-string))
> -    (help-xref-button 8 'help-function)
> -    (should-not (button-at 22))
> -    (should-not (button-at 35))
> -    (let ((button (button-at 30)))
> -      (should (eq (button-type button) 'help-function)))))
> +  (let* ((fmt "See also the function ‘%s’.")
> +         ;; 1+ translates string index to buffer position.
> +         (beg (1+ (string-search "%" fmt))))
> +    (with-temp-buffer
> +      ;; (display-buffer (current-buffer))

Oops, will remove this debugging leftover.

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24309; Package emacs. (Sun, 27 Dec 2020 22:17:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: Nathanael Schweers <NSchweers <at> mailbox.org>, 24309 <at> debbugs.gnu.org,
 Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#24309: 25.1; Problem in variable reference in docstrings.
Date: Sun, 27 Dec 2020 23:15:53 +0100
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:

> My personal motivation is that I would like functions from the Dash
> package (that start with hyphens), as well as built-in arithmetic
> operators, hyperlinked in Help buffers.
>
> The attached patch matches quoted symbol names with one or more
> characters starting with either word or symbol syntax in Lisp docstrings
> and Help buffers.  WDYT?

Makes sense to me.

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




Added tag(s) fixed. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Sun, 10 Jan 2021 13:51:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 24309 <at> debbugs.gnu.org and Nathanael Schweers <NSchweers <at> mailbox.org> Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Sun, 10 Jan 2021 13:51:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24309; Package emacs. (Sun, 10 Jan 2021 13:51:02 GMT) Full text and rfc822 format available.

Message #47 received at 24309-done <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Nathanael Schweers <NSchweers <at> mailbox.org>,
 Stefan Kangas <stefan <at> marxist.se>, 24309-done <at> debbugs.gnu.org
Subject: Re: bug#24309: 25.1; Problem in variable reference in docstrings.
Date: Sun, 10 Jan 2021 13:50:08 +0000
tags 24309 fixed
close 24309 28.1
quit

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

> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>
>> My personal motivation is that I would like functions from the Dash
>> package (that start with hyphens), as well as built-in arithmetic
>> operators, hyperlinked in Help buffers.
>>
>> The attached patch matches quoted symbol names with one or more
>> characters starting with either word or symbol syntax in Lisp docstrings
>> and Help buffers.  WDYT?
>
> Makes sense to me.

Thanks, pushed to master.

Hyperlink symbol names without word syntax in Help
25dadca0d1 2021-01-10 13:37:38 +0000
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=25dadca0d175aa7f9f1654314f90af64cdcb68fd

-- 
Basil




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 08 Feb 2021 12:24:03 GMT) Full text and rfc822 format available.

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

Previous Next


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