[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] org-refile.el: Fix the case of emtpy buffer name
From: |
satotake |
Subject: |
[PATCH] org-refile.el: Fix the case of emtpy buffer name |
Date: |
Fri, 14 May 2021 03:20:52 +0900 |
* lisp/org-refile.el (org-refile-get-targets): Ensure
arg of `file-name-non' and `file-truename' is non-nil.
If you set `org-refile-use-outline-path' `file' or `full-file-path',
and call `org-refile' in the buffer before visiting file,
errors are raised at these point. To fix them,
check if they are nil or not.
TINYCHANGE
---
lisp/org-refile.el | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/lisp/org-refile.el b/lisp/org-refile.el
index 24a1bde51..2900be27e 100644
--- a/lisp/org-refile.el
+++ b/lisp/org-refile.el
@@ -310,11 +310,13 @@ converted to a headline before refiling."
(setq f (buffer-file-name (buffer-base-buffer f))))
(setq f (and f (expand-file-name f)))
(when (eq org-refile-use-outline-path 'file)
- (push (list (file-name-nondirectory f) f nil nil) tgs))
+ (push (list (and f (file-name-nondirectory f)) f nil nil) tgs))
(when (eq org-refile-use-outline-path 'buffer-name)
(push (list (buffer-name (buffer-base-buffer)) f nil nil) tgs))
(when (eq org-refile-use-outline-path 'full-file-path)
- (push (list (file-truename (buffer-file-name
(buffer-base-buffer))) f nil nil) tgs))
+ (push (list (and (buffer-file-name (buffer-base-buffer))
+ (file-truename (buffer-file-name
(buffer-base-buffer))))
+ f nil nil) tgs))
(org-with-wide-buffer
(goto-char (point-min))
(setq org-outline-path-cache nil)
@@ -337,9 +339,10 @@ converted to a headline before refiling."
#'identity
(append
(pcase org-refile-use-outline-path
- (`file (list (file-name-nondirectory
- (buffer-file-name
- (buffer-base-buffer)))))
+ (`file (list
+ (and (buffer-file-name
(buffer-base-buffer))
+ (file-name-nondirectory
+ (buffer-file-name
(buffer-base-buffer))))))
(`full-file-path
(list (buffer-file-name
(buffer-base-buffer))))
--
2.30.0
- org-refile.el: Fix the case of emtpy buffer name, satotake, 2021/05/09
- [PATCH] org-refile.el: Fix the case of emtpy buffer name, satotake, 2021/05/09
- Re: org-refile.el: Fix the case of emtpy buffer name, satotake, 2021/05/09
- [PATCH 2/2] org-refile.el: Fix test case, satotake, 2021/05/09
- [PATCH 2/2] org-refile.el: Fix test case, satotake, 2021/05/09
- Re: [PATCH 2/2] org-refile.el: Fix test case, Maxim Nikulin, 2021/05/11
- Re: org-refile.el: Fix test case (Squashed), satotake, 2021/05/13
- [PATCH] org-refile.el: Fix the case of emtpy buffer name,
satotake <=
- Re: [PATCH] org-refile.el: Fix the case of emtpy buffer name, Maxim Nikulin, 2021/05/14
- Re: [PATCH] org-refile.el: Fix the case of emtpy buffer name, Bastien, 2021/05/15
- Re: [PATCH] org-refile.el: Fix the case of emtpy buffer name, satotake, 2021/05/15
- [PATCH] org-refile.el: Fix the case of *scratch* buffer, satotake, 2021/05/15