emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org-real 180d374 014/160: Standardized pretty printing


From: ELPA Syncer
Subject: [elpa] externals/org-real 180d374 014/160: Standardized pretty printing for org-real-world and opening a link
Date: Wed, 6 Oct 2021 16:58:05 -0400 (EDT)

branch: externals/org-real
commit 180d374f1d865b65e6443d96ad20102c542247ea
Author: Tyler Grinn <tylergrinn@gmail.com>
Commit: Tyler Grinn <tylergrinn@gmail.com>

    Standardized pretty printing for org-real-world and opening a link
---
 org-real.el | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/org-real.el b/org-real.el
index d08e9cc..ff858f1 100644
--- a/org-real.el
+++ b/org-real.el
@@ -339,14 +339,10 @@ that the width of WORLD is kept below 80 characters if 
possible."
 (defun org-real-world ()
   "View all real links in the current buffer."
   (interactive)
-  (let* ((box (org-real--merge (mapcar 'org-real--create-box 
(org-real--parse-buffer))))
-         (width (org-real--get-width box))
-         (height (org-real--get-height box)))
-    (with-current-buffer-window "Org Real" nil nil
-      (dotimes (_ height) (insert (concat (make-string width ?\s) "\n")))
-      (org-real--draw box 0)
-      (toggle-truncate-lines t)
-      (special-mode))))
+  (org-real--pp
+   (org-real--merge
+    (mapcar 'org-real--create-box
+            (org-real--parse-buffer)))))
 
 ;;;; `org-insert-link' configuration
 
@@ -457,16 +453,20 @@ describing where BOX is."
         (height (org-real--get-height box))
         (inhibit-read-only t)
         (buffer (get-buffer-create "Org Real")))
-    (display-buffer buffer 'display-buffer-pop-up-window)
     (with-current-buffer buffer
       (erase-buffer)
       (goto-line 0)
       (toggle-truncate-lines t)
       (if containers (org-real--pp-text containers))
-      (let ((offset (line-number-at-pos)))
+      (let ((offset (- (line-number-at-pos)
+                       (cdr org-real--margin)
+                       (* 2 (cdr org-real--padding)))))
         (dotimes (_ (+ top height)) (insert (concat (make-string width ?\s) 
"\n")))
         (org-real--draw box offset)
-        (special-mode)))))
+        (special-mode)))
+    (display-buffer buffer `(display-buffer-pop-up-window
+                             (window-width . 80)
+                             (window-height . ,height)))))
 
 
 (defun org-real--pp-text (containers)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]