branch: externals/org-real commit 89c1120f42dbf1048a7f787dbb886e57318005d6 Author: Tyler Grinn <tylergr...@gmail.com> Commit: Tyler Grinn <tylergr...@gmail.com>
Linting, rearranging --- org-real.el | 51 ++++++++++++++++++++++----------------------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/org-real.el b/org-real.el index 4114ed1..8a37b6a 100644 --- a/org-real.el +++ b/org-real.el @@ -55,7 +55,7 @@ (require 'cl-lib) (require 'ispell) -;;;; Customization variables +;;;; Options (defgroup org-real nil "Customization options for org-real" @@ -229,6 +229,27 @@ diagram." :rel-face rel-face :selected-face selected-face)) +(defun org-real--get-header (containers) + "Get a textual representation of CONTAINERS." + (let* ((reversed (reverse containers)) + (container (pop reversed)) + (primary-name (plist-get container :name)) + (header "")) + (put-text-property 0 (length primary-name) 'face 'org-real-primary + primary-name) + (cl-flet ((append-str (&rest strings) + (setq header (apply 'concat header strings)))) + (append-str (make-string org-real-margin-y ?\n) + (make-string org-real-margin-x ?\s) + "The " primary-name) + (if reversed (append-str (if (org-real--is-plural primary-name) " are" " is"))) + (while reversed + (append-str " " (plist-get container :rel)) + (setq container (pop reversed)) + (append-str " the " (plist-get container :name))) + (append-str ".") + header))) + ;;;; Interactive functions (defun org-real-world () @@ -258,7 +279,6 @@ diagram." (with-current-buffer (get-buffer "*Boxy*") (boxy-jump-to-box match))))))) - (defun org-real-apply () "Apply any change from the real link at point to the current buffer." (interactive) @@ -335,33 +355,6 @@ diagram." (pop new-containers))))) (message nil)) -;;;; Pretty printing - -(defun org-real--append-str (str place) - "Append string STR to generalized variable PLACE." - (set place (concat (eval place) str))) - -(defun org-real--get-header (containers) - "Get a textual representation of CONTAINERS." - (let* ((reversed (reverse containers)) - (container (pop reversed)) - (primary-name (plist-get container :name)) - (header "")) - (put-text-property 0 (length primary-name) 'face 'org-real-primary - primary-name) - (cl-flet ((append-str (&rest strings) - (setq header (apply 'concat header strings)))) - (append-str (make-string org-real-margin-y ?\n) - (make-string org-real-margin-x ?\s) - "The " primary-name) - (if reversed (append-str (if (org-real--is-plural primary-name) " are" " is"))) - (while reversed - (append-str " " (plist-get container :rel)) - (setq container (pop reversed)) - (append-str " the " (plist-get container :name))) - (append-str ".") - header))) - ;;;; `org-insert-link' configuration (org-link-set-parameters "real"