diff options
author | Case Duckworth | 2022-06-15 10:26:10 -0500 |
---|---|---|
committer | Case Duckworth | 2022-06-15 10:26:10 -0500 |
commit | dbb6181a5d8b5aa14a46bb207ebaf6c7911c8ced (patch) | |
tree | 18b152655077e6519b491edeb76aa14f2cd10306 /lisp/+org.el | |
parent | Fix startup complaining (diff) | |
download | emacs-dbb6181a5d8b5aa14a46bb207ebaf6c7911c8ced.tar.gz emacs-dbb6181a5d8b5aa14a46bb207ebaf6c7911c8ced.zip |
aodifu
Diffstat (limited to 'lisp/+org.el')
-rw-r--r-- | lisp/+org.el | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lisp/+org.el b/lisp/+org.el index 0d6e300..6b956ae 100644 --- a/lisp/+org.el +++ b/lisp/+org.el | |||
@@ -729,5 +729,42 @@ When called with a prefix ARG, will still unconditionally call | |||
729 | ((org-at-table-p) #'org-table-wrap-region) | 729 | ((org-at-table-p) #'org-table-wrap-region) |
730 | (t #'org-return))))) | 730 | (t #'org-return))))) |
731 | 731 | ||
732 | |||
733 | ;;; el-patch | ||
734 | |||
735 | (el-patch-defun org-format-outline-path (path &optional width prefix separator) | ||
736 | "Format the outline path PATH for display. | ||
737 | WIDTH is the maximum number of characters that is available. | ||
738 | PREFIX is a prefix to be included in the returned string, | ||
739 | such as the file name. | ||
740 | SEPARATOR is inserted between the different parts of the path, | ||
741 | the default is \"/\"." | ||
742 | (setq width (or width 79)) | ||
743 | (setq path (delq nil path)) | ||
744 | (unless (> width 0) | ||
745 | (user-error "Argument `width' must be positive")) | ||
746 | (setq separator (or separator "/")) | ||
747 | (let* ((org-odd-levels-only nil) | ||
748 | (fpath (concat | ||
749 | prefix (and prefix path separator) | ||
750 | (mapconcat | ||
751 | (lambda (s) (replace-regexp-in-string "[ \t]+\\'" "" s)) | ||
752 | (cl-loop for head in path | ||
753 | for n from 0 | ||
754 | collect (el-patch-swap | ||
755 | (org-add-props | ||
756 | head nil 'face | ||
757 | (nth (% n org-n-level-faces) org-level-faces)) | ||
758 | head)) | ||
759 | separator)))) | ||
760 | (when (> (length fpath) width) | ||
761 | (if (< width 7) | ||
762 | ;; It's unlikely that `width' will be this small, but don't | ||
763 | ;; waste characters by adding ".." if it is. | ||
764 | (setq fpath (substring fpath 0 width)) | ||
765 | (setf (substring fpath (- width 2)) ".."))) | ||
766 | fpath)) | ||
767 | |||
768 | |||
732 | (provide '+org) | 769 | (provide '+org) |
733 | ;;; +org.el ends here | 770 | ;;; +org.el ends here |