diff options
| author | Chong Yidong | 2011-03-05 16:10:03 -0500 |
|---|---|---|
| committer | Chong Yidong | 2011-03-05 16:10:03 -0500 |
| commit | d23ae2b03fdaaf6ff2015f177c0770792c409d96 (patch) | |
| tree | 4dd2954e80cdedbc13d6a0ec43b194f55b97de36 | |
| parent | b59a4335cd2e904d160323c9e00e1411c0d973bf (diff) | |
| download | emacs-d23ae2b03fdaaf6ff2015f177c0770792c409d96.tar.gz emacs-d23ae2b03fdaaf6ff2015f177c0770792c409d96.zip | |
Fix to help-buffer to ensure it returns a valid buffer (Bug#8147).
* lisp/help-mode.el (help-buffer): If we are to return the current
buffer, signal an error if it's not in Help mode.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/help-mode.el | 15 |
2 files changed, 14 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 707464670e9..55935189af6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-03-05 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * help-mode.el (help-buffer): If we are to return the current | ||
| 4 | buffer, signal an error if it's not in Help mode (Bug#8147). | ||
| 5 | |||
| 1 | 2011-03-05 Reuben Thomas <rrt@sc3d.org> | 6 | 2011-03-05 Reuben Thomas <rrt@sc3d.org> |
| 2 | 7 | ||
| 3 | * files.el (file-name-version-regexp): Handle backup files of the | 8 | * files.el (file-name-version-regexp): Handle backup files of the |
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 724b0186679..51d18235e1b 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -409,13 +409,16 @@ restore it properly when going back." | |||
| 409 | (defun help-buffer () | 409 | (defun help-buffer () |
| 410 | "Return the name of a buffer for inserting help. | 410 | "Return the name of a buffer for inserting help. |
| 411 | If `help-xref-following' is non-nil, this is the name of the | 411 | If `help-xref-following' is non-nil, this is the name of the |
| 412 | current buffer. | 412 | current buffer. Signal an error if this buffer is not derived |
| 413 | Otherwise, it is *Help*; if no buffer with that name currently | 413 | from `help-mode'. |
| 414 | exists, it is created." | 414 | Otherwise, return \"*Help*\", creating a buffer with that name if |
| 415 | it does not already exist." | ||
| 415 | (buffer-name ;for with-output-to-temp-buffer | 416 | (buffer-name ;for with-output-to-temp-buffer |
| 416 | (if help-xref-following | 417 | (if (not help-xref-following) |
| 417 | (current-buffer) | 418 | (get-buffer-create "*Help*") |
| 418 | (get-buffer-create "*Help*")))) | 419 | (unless (derived-mode-p 'help-mode) |
| 420 | (error "Current buffer is not in Help mode")) | ||
| 421 | (current-buffer)))) | ||
| 419 | 422 | ||
| 420 | (defvar help-xref-override-view-map | 423 | (defvar help-xref-override-view-map |
| 421 | (let ((map (make-sparse-keymap))) | 424 | (let ((map (make-sparse-keymap))) |