Skip to content

Commit b7d4c5d

Browse files
committed
help-follow-symbol now complains if no symbol found (bug#38248)
* lisp/help-mode.el (help-follow-symbol): Signal 'user-error' if there's no symbol at POS. * etc/NEWS: Document it.
1 parent 0b4eec3 commit b7d4c5d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

etc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2588,6 +2588,10 @@ pointer is over. To change this behaviour, you can customize the user
25882588
option 'mouse-wheel-follow-mouse'. Note that this will also affect
25892589
scrolling.
25902590

2591+
---
2592+
** help-follow-symbol now signals 'user-error' if point (or the
2593+
position pointed to by the argument POS) is not in a symbol.
2594+
25912595

25922596
* Lisp Changes in Emacs 27.1
25932597

lisp/help-mode.el

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -749,10 +749,11 @@ Show all docs for that symbol as either a variable, function or face."
749749
(buffer-substring (point)
750750
(progn (skip-syntax-forward "w_")
751751
(point)))))))
752-
(when (or (boundp sym)
753-
(get sym 'variable-documentation)
754-
(fboundp sym) (facep sym))
755-
(help-do-xref pos #'describe-symbol (list sym)))))
752+
(if (or (boundp sym)
753+
(get sym 'variable-documentation)
754+
(fboundp sym) (facep sym))
755+
(help-do-xref pos #'describe-symbol (list sym))
756+
(user-error "No symbol here"))))
756757

757758
(defun help-mode-revert-buffer (_ignore-auto noconfirm)
758759
(when (or noconfirm (yes-or-no-p "Revert help buffer? "))

0 commit comments

Comments
 (0)