Fix +org/refile-to-other-window in indirect buffer (#4721)

* Fix +org/refile-to-other-window in indirect buffer

* Extend fix to other refile commands

Co-authored-by: Henrik Lissner <accounts@v0.io>
This commit is contained in:
Rick Lupton 2021-03-03 04:48:42 +00:00 committed by GitHub
parent 9a5f860cd0
commit 468f308114
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,7 @@
(list current-prefix-arg
(read-file-name "Select file to refile to: "
default-directory
buffer-file-name
(buffer-file-name (buffer-base-buffer))
t nil
(lambda (f) (string-match-p "\\.org$" f)))))
(+org/refile-to-current-file arg file))
@ -33,10 +33,11 @@
current-prefix-arg)
(dolist (win (delq (selected-window) (window-list)))
(with-selected-window win
(and (eq major-mode 'org-mode)
buffer-file-name
(cl-pushnew (cons buffer-file-name (cons :maxlevel 10))
org-refile-targets))))
(let ((file (buffer-file-name (buffer-base-buffer))))
(and (eq major-mode 'org-mode)
file
(cl-pushnew (cons file (cons :maxlevel 10))
org-refile-targets)))))
(call-interactively #'org-refile)))
;;;###autoload
@ -47,10 +48,9 @@
org-refile-targets
current-prefix-arg)
(dolist (buf (delq (current-buffer) (doom-buffers-in-mode 'org-mode)))
(with-current-buffer buf
(and buffer-file-name
(cl-pushnew (cons buffer-file-name (cons :maxlevel 10))
org-refile-targets))))
(when-let (file (buffer-file-name (buffer-base-buffer buf)))
(cl-pushnew (cons file (cons :maxlevel 10))
org-refile-targets)))
(call-interactively #'org-refile)))
;;;###autoload