summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-09-25 14:47:58 +0200
committerBastien Guerry <bzg@altern.org>2012-09-25 14:47:58 +0200
commit4512f88c3c07c0fdc6c51824b2610ad5c0a5db73 (patch)
tree897af58af48353fa21e5e8fdc6c93ef6a061b641
parent9ebf9c169e4b65b47324d4ad82e34103758348dd (diff)
downloadorg-mode-4512f88c3c07c0fdc6c51824b2610ad5c0a5db73.tar.gz
org.el (org-display-outline-path): Allow a string value for the `as-string' parameter
* org.el (org-display-outline-path): Allow a string value for the `as-string' parameter. Such a value will replace the "/" separator in the output. Thanks to Sébastien Vauban for triggering this.
-rw-r--r--lisp/org.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el
index b5a7eda..ec2652b 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10871,7 +10871,13 @@ such as the file name."
path "/")))))
(defun org-display-outline-path (&optional file current as-string)
- "Display the current outline path in the echo area."
+ "Display the current outline path in the echo area.
+
+If FILE is non-nil, prepend the output with the file name.
+If CURRENT is non-nil, append the current heading to the output.
+If AS-STRING is non-nil, return a string, don't display a message.
+AS-STRING can also be a string which will then replace the \"/\"
+separator in the output."
(interactive "P")
(let* ((bfn (buffer-file-name (buffer-base-buffer)))
(case-fold-search nil)
@@ -10887,6 +10893,8 @@ such as the file name."
path
(1- (frame-width))
(and file bfn (concat (file-name-nondirectory bfn) "/"))))
+ (when (stringp as-string)
+ (setq res (replace-regexp-in-string "/" as-string res)))
(if as-string (org-no-properties res) (message "%s" res))))
(defvar org-refile-history nil