From ecdf571291c3a598fa1c767c6a73604ab95bfd02 Mon Sep 17 00:00:00 2001 From: Mikhail Skorzhinskii Date: Mon, 21 Sep 2020 14:53:13 +0200 Subject: [PATCH 2/2] org-refile.el: allow to start refile targets with document title --- etc/ORG-NEWS | 2 ++ lisp/org-refile.el | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index e30336f45..6d3945d91 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -16,7 +16,9 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org. When set to 'title, will show document title in outline path in echo area instead of file name. +*** New option value for ~org-refile-use-outline-path~ +When set to 'title, will show document title in outline path of refile targets. * Version 9.4 ** Incompatible changes *** Possibly broken internal file links: please check and fix diff --git a/lisp/org-refile.el b/lisp/org-refile.el index 7eb0a9643..e3d17bc35 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. @@ -315,6 +316,8 @@ converted to a headline before refiling." (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)) + (when (eq org-refile-use-outline-path 'title) + (push (list (org-get-title-from-file (file-truename (buffer-file-name (buffer-base-buffer))))))) (org-with-wide-buffer (goto-char (point-min)) (setq org-outline-path-cache nil) -- 2.28.0