branch: externals/boxy-headlines commit 001565aae01d54bd5fc25b339fd963a09dcc181e Author: Tyler Grinn <tylergr...@gmail.com> Commit: Tyler Grinn <tylergr...@gmail.com>
Added patch from Stefan Monnier --- boxy-headlines.el | 50 ++++++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/boxy-headlines.el b/boxy-headlines.el index 3654874..6c53286 100644 --- a/boxy-headlines.el +++ b/boxy-headlines.el @@ -59,63 +59,51 @@ (defcustom boxy-headlines-margin-x 2 "Horizontal margin to be used when displaying boxes." - :type 'number - :group 'boxy-headlines) + :type 'number) (defcustom boxy-headlines-margin-y 1 "Vertical margin to be used when displaying boxes." - :type 'number - :group 'boxy-headlines) + :type 'number) (defcustom boxy-headlines-padding-x 2 "Horizontal padding to be used when displaying boxes." - :type 'number - :group 'boxy-headlines) + :type 'number) (defcustom boxy-headlines-padding-y 1 "Vertical padding to be used when displaying boxes." - :type 'number - :group 'boxy-headlines) + :type 'number) (defcustom boxy-headlines-include-context t "Whether to show context when opening a real link." - :type 'boolean - :group 'boxy-headlines) + :type 'boolean) (defcustom boxy-headlines-flex-width 80 "When merging links, try to keep width below this." - :type 'number - :group 'boxy-headlines) + :type 'number) (defcustom boxy-headlines-default-visibility 1 "Default level to display boxes." - :type 'number - :group 'boxy-headlines) + :type 'number) (defcustom boxy-headlines-tooltips t "Show tooltips in a boxy diagram." - :type 'boolean - :group 'boxy-headlines) + :type 'boolean) (defcustom boxy-headlines-tooltip-timeout 0.5 "Idle time before showing tooltip in a boxy diagram." - :type 'number - :group 'boxy-headlines) + :type 'number) (defcustom boxy-headlines-tooltip-max-width 30 "Maximum width of all tooltips." - :type 'number - :group 'boxy-headlines) + :type 'number) ;;;; Faces (defface boxy-headlines-default nil - "Default face used in boxy mode." - :group 'boxy-headlines) + "Default face used in boxy mode.") (defface boxy-headlines-primary nil - "Face for highlighting the name of a box." - :group 'boxy-headlines) + "Face for highlighting the name of a box.") (face-spec-set 'boxy-headlines-primary @@ -124,8 +112,7 @@ 'face-defface-spec) (defface boxy-headlines-selected nil - "Face for the current box border under cursor." - :group 'boxy-headlines) + "Face for the current box border under cursor.") (face-spec-set 'boxy-headlines-selected @@ -133,8 +120,7 @@ 'face-defface-spec) (defface boxy-headlines-rel nil - "Face for the box which is related to the box under the cursor." - :group 'boxy-headlines) + "Face for the box which is related to the box under the cursor.") (face-spec-set 'boxy-headlines-rel @@ -142,8 +128,7 @@ 'face-defface-spec) (defface boxy-headlines-tooltip nil - "Face for tooltips in a boxy diagram." - :group 'boxy-headlines) + "Face for tooltips in a boxy diagram.") (face-spec-set 'boxy-headlines-tooltip @@ -227,11 +212,12 @@ diagram." ;;;; Commands +;;;###autoload (defun boxy-headlines () "View all org headlines as a boxy diagram." (interactive) (let ((path (seq-filter - 'identity + #'identity (append (list (org-entry-get nil "ITEM")) (reverse (org-get-outline-path))))) (world (save-excursion (boxy-headlines--parse-headlines))) @@ -266,7 +252,7 @@ diagram." (siblings (alist-get 'siblings partitioned)) (pos (org-element-property :begin headline)) (columns (save-excursion (goto-char pos) (org-columns--collect-values))) - (max-column-length (apply 'max 0 + (max-column-length (apply #'max 0 (mapcar (lambda (column) (length (cadr (car column))))