emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-refile.el: show refile targets with doc. title
@ 2021-12-25 15:23 Mikhail Skorzhinskii
  2021-12-26 13:59 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Mikhail Skorzhinskii @ 2021-12-25 15:23 UTC (permalink / raw)
  To: Org Mode


* lisp/org-refile.el (org-refile-use-outline-path): add an option
'title
* lisp/org-refile.el (org-refile-get-targets): start refile target
outline with document title (#+title) instead of file name
---
 lisp/org-refile.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/org-refile.el b/lisp/org-refile.el
index 678759e10..8ff1b2f5b 100644
--- a/lisp/org-refile.el
+++ b/lisp/org-refile.el
@@ -158,7 +158,8 @@ When `buffer-name', use the buffer name."
          (const :tag "Yes" t)
          (const :tag "Start with file name" file)
          (const :tag "Start with full file path" full-file-path)
-         (const :tag "Start with buffer name" buffer-name)))
+         (const :tag "Start with buffer name" buffer-name)
+         (const :tag "Start with document title" title)))
 
 (defcustom org-outline-path-complete-in-steps t
   "Non-nil means complete the outline path in hierarchical steps.
@@ -317,6 +318,8 @@ converted to a headline before refiling."
                 (push (list (and (buffer-file-name (buffer-base-
buffer))
                                   (file-truename (buffer-file-name
(buffer-base-buffer))))
                              f nil nil) tgs))
+              (when (eq org-refile-use-outline-path 'title)
+                (push (list (org-get-title-from-file (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)



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-30 16:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-25 15:23 [PATCH] org-refile.el: show refile targets with doc. title Mikhail Skorzhinskii
2021-12-26 13:59 ` Ihor Radchenko
2021-12-28 11:59   ` Mikhail Skorzhinskii
2022-05-28  2:33     ` Ihor Radchenko
2022-08-30 13:53       ` Mikhail Skorzhisnkii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).