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

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

[elpa] externals/org-transclusion 252ec67 1/2: fix:Remove extra space/li


From: ELPA Syncer
Subject: [elpa] externals/org-transclusion 252ec67 1/2: fix:Remove extra space/line added to Org elements transcluded
Date: Fri, 24 Dec 2021 13:57:28 -0500 (EST)

branch: externals/org-transclusion
commit 252ec6752a08fa40941dc9c40d3b48440a5c415a
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>

    fix:Remove extra space/line added to Org elements transcluded
---
 docs/index.html           |  2 --
 docs/org-transclusion.org |  2 +-
 org-transclusion.el       | 19 +++++++++++--------
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/docs/index.html b/docs/index.html
index 3d2c2ba..bca8816 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -65,7 +65,6 @@ Next: <a href="#Example-Use-Cases-_0026-Main-Features" 
accesskey="n" rel="next">
 <p>Last updated 24 December 2021.
 </p>
 <p>Org-transclusion lets you insert a copy of text content via a file link or 
ID link within an Org file. It lets you have the same content present in 
different buffers at the same time without copy-and-pasting it. Edit the source 
of the content, and you can refresh the transcluded copies to the up-to-date 
state. Org-transclusion keeps your files clear of the transcluded copies, 
leaving only the links to the original content.<span id="whatis"></span></p>
-
 <p>Copyright (C) 2021  Free Software Foundation, Inc.
 </p>
 <blockquote>
@@ -936,7 +935,6 @@ o               org-transclusion-open-source
 C-c C-c         org-ctrl-c-ctrl-c
 </pre></div>
 
-
 <ul>
 <li> &lsquo;<samp>org-transclusion-live-sync-map</samp>&rsquo;
 </li></ul>
diff --git a/docs/org-transclusion.org b/docs/org-transclusion.org
index 02b65d1..a3e67e3 100644
--- a/docs/org-transclusion.org
+++ b/docs/org-transclusion.org
@@ -1,6 +1,6 @@
 #+title: Org-transclusion User Manual
 #+author: Noboru Ota <me@nobiot.com>
-#+modified: 2021-12-24T180026
+#+modified: 2021-12-24T193446
 #+language: en
 #+export_file_name: org-transclusion.texi
 #+texinfo_dir_category: Emacs
diff --git a/org-transclusion.el b/org-transclusion.el
index 8c0088c..ec6a850 100644
--- a/org-transclusion.el
+++ b/org-transclusion.el
@@ -1,4 +1,4 @@
-;;; org-transclusion.el --- transclude text contents of linked target -*- 
lexical-binding: t; -*-
+;;; org-transclusion.el --- Transclude text content via links -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2021  Free Software Foundation, Inc.
 
@@ -17,7 +17,7 @@
 
 ;; Author: Noboru Ota <me@nobiot.com>
 ;; Created: 10 Oct 2020
-;; Last modified: 4 December 2021
+;; Last modified: 24 December 2021
 
 ;; URL: https://github.com/nobiot/org-transclusion
 ;; Keywords: org-mode, transclusion, writing
@@ -760,7 +760,7 @@ turned off (removed)."
   ;; --, check is done for `buffer-file-name' to see if there is a file visited
   ;; by the buffer. If a "temp" buffer, there is no file being visited.
   (when (and (org-transclusion-remove-all)
-            (buffer-file-name))
+             (buffer-file-name))
     (set-buffer-modified-p t)
     (save-buffer)))
 
@@ -1165,11 +1165,14 @@ etc.)."
           (setq obj (org-element-map obj org-element-all-elements
                       #'org-transclusion-content-filter-org-only-contents
                       nil nil '(section) nil)))
-       
-        (list :src-content (org-element-interpret-data obj)
+        ;; For Org content, an extra +1 point seems to be added to the end of
+        ;; each element in the normalized content. This adds an extra empty
+        ;; line, which we would like to remove; hence content and src-end gets
+        ;; -1 here.
+        (list :src-content (substring (org-element-interpret-data obj) 0 -1)
               :src-buf (current-buffer)
               :src-beg (point-min)
-              :src-end (point-max))))))
+              :src-end (1- (point-max)))))))
 
 (defun org-transclusion-content-filter-org-exclude-elements (data)
   "Exclude specific elements from DATA.
@@ -1196,7 +1199,7 @@ is non-nil."
       nil
     data))
 
-;;;;-----------------------------------------------------------------------------
+;;;;---------------------------------------------------------------------------
 ;;;; Functions to support non-Org-mode link types
 
 (defun org-transclusion-content-others-default (link _plist)
@@ -1305,7 +1308,7 @@ Case 2. #+transclude inside another transclusion"
    ;; Case 1. Element at point is NOT #+transclude:
    ((let ((elm (org-element-at-point)))
       (not (and (string= "keyword" (org-element-type elm))
-               (string= "TRANSCLUDE" (org-element-property :key elm)))))
+                (string= "TRANSCLUDE" (org-element-property :key elm)))))
     (user-error (format "Not at a transclude keyword at point %d, line %d"
                         (point) (org-current-line))))
    ;; Case 2. #+transclude inside another transclusion



reply via email to

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