[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] lisp/org-capture.el: Simplify 'org-capture-get-indirect-buffer'
From: |
Morgan Smith |
Subject: |
[PATCH] lisp/org-capture.el: Simplify 'org-capture-get-indirect-buffer' |
Date: |
Sun, 31 Mar 2024 17:00:25 -0400 |
* lisp/org-capture.el (org-capture-get-indirect-buffer): Simplify by
using 'generate-new-buffer-name'.
---
lisp/org-capture.el | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 8ce11cb75..5d9ae4947 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1585,10 +1585,7 @@ If TEMPLATE-KEY is nil, the user is queried for the
template."
"Make an indirect BUFFER for a capture process.
Use PREFIX as a prefix for the name of the indirect buffer."
(setq buffer (or buffer (current-buffer)))
- (let ((n 1) (base (buffer-name buffer)) bname)
- (setq bname (concat prefix "-" base))
- (while (buffer-live-p (get-buffer bname))
- (setq bname (concat prefix "-" (number-to-string (cl-incf n)) "-" base)))
+ (let ((bname (generate-new-buffer-name (concat prefix "-" (buffer-name
buffer)))))
(condition-case nil
(make-indirect-buffer buffer bname 'clone)
(error
--
2.41.0
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] lisp/org-capture.el: Simplify 'org-capture-get-indirect-buffer',
Morgan Smith <=