diff options
| author | Juanma Barranquero | 2019-11-22 21:10:49 +0100 |
|---|---|---|
| committer | Juanma Barranquero | 2019-11-22 21:10:49 +0100 |
| commit | b7d4c5d1d1b55fea8382663f18263e2000678be5 (patch) | |
| tree | d6d0e7af6fc3a93152838f72b8a50352861e3154 | |
| parent | 0b4eec3169690dab5ffa5027770893fff87f505f (diff) | |
| download | emacs-b7d4c5d1d1b55fea8382663f18263e2000678be5.tar.gz emacs-b7d4c5d1d1b55fea8382663f18263e2000678be5.zip | |
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.
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/help-mode.el | 9 |
2 files changed, 9 insertions, 4 deletions
| @@ -2588,6 +2588,10 @@ pointer is over. To change this behaviour, you can customize the user | |||
| 2588 | option 'mouse-wheel-follow-mouse'. Note that this will also affect | 2588 | option 'mouse-wheel-follow-mouse'. Note that this will also affect |
| 2589 | scrolling. | 2589 | scrolling. |
| 2590 | 2590 | ||
| 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 | |||
| 2591 | 2595 | ||
| 2592 | * Lisp Changes in Emacs 27.1 | 2596 | * Lisp Changes in Emacs 27.1 |
| 2593 | 2597 | ||
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 054a1ef8c24..e70570c3eed 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -749,10 +749,11 @@ Show all docs for that symbol as either a variable, function or face." | |||
| 749 | (buffer-substring (point) | 749 | (buffer-substring (point) |
| 750 | (progn (skip-syntax-forward "w_") | 750 | (progn (skip-syntax-forward "w_") |
| 751 | (point))))))) | 751 | (point))))))) |
| 752 | (when (or (boundp sym) | 752 | (if (or (boundp sym) |
| 753 | (get sym 'variable-documentation) | 753 | (get sym 'variable-documentation) |
| 754 | (fboundp sym) (facep sym)) | 754 | (fboundp sym) (facep sym)) |
| 755 | (help-do-xref pos #'describe-symbol (list sym))))) | 755 | (help-do-xref pos #'describe-symbol (list sym)) |
| 756 | (user-error "No symbol here")))) | ||
| 756 | 757 | ||
| 757 | (defun help-mode-revert-buffer (_ignore-auto noconfirm) | 758 | (defun help-mode-revert-buffer (_ignore-auto noconfirm) |
| 758 | (when (or noconfirm (yes-or-no-p "Revert help buffer? ")) | 759 | (when (or noconfirm (yes-or-no-p "Revert help buffer? ")) |