summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-12-28 02:03:56 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-12-28 02:04:05 +0100
commit4ffb2ec357a75867a123b3571d622be184945dc5 (patch)
tree7227a677b1534f4b4298e1e0447b7d2d8fcecacf
parent8c383456291185b029b469061338b5b797a49747 (diff)
downloademacs-4ffb2ec357a75867a123b3571d622be184945dc5.tar.gz
Allow remember-notes to use the *scratch* buffer
* lisp/textmodes/remember.el (remember-notes): Allow the remember-notes buffer to use the *scratch* buffer (as documented) (bug#20740).
-rw-r--r--lisp/textmodes/remember.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el
index 7bc7dc1762e..599e8f69ba7 100644
--- a/lisp/textmodes/remember.el
+++ b/lisp/textmodes/remember.el
@@ -638,9 +638,14 @@ to turn the *scratch* buffer into your notes buffer."
(interactive "p")
(let ((buf (or (find-buffer-visiting remember-data-file)
(with-current-buffer (find-file-noselect remember-data-file)
- (and remember-notes-buffer-name
- (not (get-buffer remember-notes-buffer-name))
- (rename-buffer remember-notes-buffer-name))
+ (when remember-notes-buffer-name
+ (when (and (get-buffer remember-notes-buffer-name)
+ (equal remember-notes-buffer-name "*scratch*"))
+ (kill-buffer remember-notes-buffer-name))
+ ;; Rename the buffer to the requested name (if
+ ;; it's not already in use).
+ (unless (get-buffer remember-notes-buffer-name)
+ (rename-buffer remember-notes-buffer-name)))
(funcall (or remember-notes-initial-major-mode
initial-major-mode))
(remember-notes-mode 1)