diff --git a/lisp/org.el b/lisp/org.el index 3a7cab0b0..6b782b2b0 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10870,22 +10870,24 @@ such as the file name." h) path "/"))))) -(defun org-display-outline-path (&optional file current) +(defun org-display-outline-path (&optional file current as-string) "Display the current outline path in the echo area." (interactive "P") (let* ((bfn (buffer-file-name (buffer-base-buffer))) (case-fold-search nil) - (path (and (derived-mode-p 'org-mode) (org-get-outline-path)))) + (path (and (derived-mode-p 'org-mode) (org-get-outline-path))) + res) (if current (setq path (append path (save-excursion (org-back-to-heading t) (if (looking-at org-complex-heading-regexp) (list (match-string 4))))))) - (message "%s" - (org-format-outline-path - path - (1- (frame-width)) - (and file bfn (concat (file-name-nondirectory bfn) "/")))))) + (setq res + (org-format-outline-path + path + (1- (frame-width)) + (and file bfn (concat (file-name-nondirectory bfn) "/")))) + (if as-string (org-no-properties res) (message "%s" res)))) (defvar org-refile-history nil "History for refiling operations.")