summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-05-07 12:46:55 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-05-07 12:46:55 +0200
commitea58276462d93f24c75473c69154ef7a4a47b63c (patch)
tree8f9b50ec8e5551d671ff1042ba3f284332e8b77b /lisp
parente13744780fea9c11a4fed3de08bd0384ce2de8e8 (diff)
downloademacs-ea58276462d93f24c75473c69154ef7a4a47b63c.tar.gz
Allow inhibiting linkification in *Help* buffers
* doc/lispref/help.texi (Keys in Documentation): Document it. lisp/help-mode.el (help-make-xrefs): Implement a new \+ syntax to inhibit buttonification.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/help-mode.el42
1 files changed, 22 insertions, 20 deletions
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index a0a587cd810..4a65f40507b 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -452,6 +452,7 @@ Commands:
"\\(symbol\\|program\\|property\\)\\|" ; Don't link
"\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)"
"[ \t\n]+\\)?"
+ "\\(\\\\\\+\\)?"
"['`‘]\\(\\(?:\\sw\\|\\s_\\)+\\|`\\)['’]"))
"Regexp matching doc string references to symbols.
@@ -628,27 +629,28 @@ that."
;; Quoted symbols
(save-excursion
(while (re-search-forward help-xref-symbol-regexp nil t)
- (let* ((data (match-string 8))
- (sym (intern-soft data)))
- (if sym
- (cond
- ((match-string 3) ; `variable' &c
- (and (or (boundp sym) ; `variable' doesn't ensure
+ (when-let ((sym (intern-soft (match-string 9))))
+ (if (match-string 8)
+ (delete-region (match-beginning 8)
+ (match-end 8))
+ (cond
+ ((match-string 3) ; `variable' &c
+ (and (or (boundp sym) ; `variable' doesn't ensure
; it's actually bound
- (get sym 'variable-documentation))
- (help-xref-button 8 'help-variable sym)))
- ((match-string 4) ; `function' &c
- (and (fboundp sym) ; similarly
- (help-xref-button 8 'help-function sym)))
- ((match-string 5) ; `face'
- (and (facep sym)
- (help-xref-button 8 'help-face sym)))
- ((match-string 6)) ; nothing for `symbol'
- ((match-string 7)
- (help-xref-button 8 'help-function-def sym))
- ((cl-some (lambda (x) (funcall (nth 1 x) sym))
- describe-symbol-backends)
- (help-xref-button 8 'help-symbol sym)))))))
+ (get sym 'variable-documentation))
+ (help-xref-button 9 'help-variable sym)))
+ ((match-string 4) ; `function' &c
+ (and (fboundp sym) ; similarly
+ (help-xref-button 9 'help-function sym)))
+ ((match-string 5) ; `face'
+ (and (facep sym)
+ (help-xref-button 9 'help-face sym)))
+ ((match-string 6)) ; nothing for `symbol'
+ ((match-string 7)
+ (help-xref-button 9 'help-function-def sym))
+ ((cl-some (lambda (x) (funcall (nth 1 x) sym))
+ describe-symbol-backends)
+ (help-xref-button 9 'help-symbol sym)))))))
;; An obvious case of a key substitution:
(save-excursion
(while (re-search-forward