[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-transclusion fb947f5a83 4/7: fix: conditions in org
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-transclusion fb947f5a83 4/7: fix: conditions in org-transclusion-add-src-lines |
Date: |
Tue, 23 Aug 2022 15:57:54 -0400 (EDT) |
branch: externals/org-transclusion
commit fb947f5a83e99810777a1f32bf81c78b0089b425
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
fix: conditions in org-transclusion-add-src-lines
The conditions commented during the development were put back in.
Treating an org-id target as a normal text buffer means that even when
the ID points to an Org headline, the ending of the transclusion will be
dictated by the `:lines` or `:end` properties, not the end of
headline. This means that if the `:lines` property is set to ":line 0-",
the resultant transclusion will be from the initial line of the headline
to the end of the buffer, going beyond the boundary of the headline.
---
org-transclusion-src-lines.el | 6 +++---
test/test-2.1-lines.org | 5 ++++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/org-transclusion-src-lines.el b/org-transclusion-src-lines.el
index f22ab37a57..eeae4f716c 100644
--- a/org-transclusion-src-lines.el
+++ b/org-transclusion-src-lines.el
@@ -73,11 +73,11 @@ Return nil if PLIST does not contain \":src\" or \":lines\"
properties."
(org-transclusion-content-src-lines link plist)))
;; :lines needs to be the last condition to check because :src INCLUDE
:lines
((or (plist-get plist :lines)
- (plist-get plist :end))
+ (plist-get plist :end)
;; Link contains a search-option ::<string>
;; and NOT for an Org file
-;; (and (org-element-property :search-option link)
-;; (not (org-transclusion-org-file-p (org-element-property :path
link)))))
+ (and (org-element-property :search-option link)
+ (not (org-transclusion-org-file-p (org-element-property :path
link)))))
(append '(:tc-type "lines")
(org-transclusion-content-range-of-lines link plist)))))
diff --git a/test/test-2.1-lines.org b/test/test-2.1-lines.org
index 144e9ba7c6..49d8820017 100644
--- a/test/test-2.1-lines.org
+++ b/test/test-2.1-lines.org
@@ -6,7 +6,10 @@ Including lines of source code
[[file:./paragraph.org::/Lorem/]]
-#+transclude: [[id:2022-06-26T141859]]
+#+transclude: [[id:2022-06-26T141859]]
+#+transclude: [[file:./paragraph.org]] :lines 1-5
+#+transclude: [[id:2022-06-26T141859]] :lines 0-5
+#+transclude: [[id:2022-06-26T141859]] :end "Heading 1"
#+name: source code 1
#+transclude: [[file:../org-transclusion-src-lines.el]] :lines 1-10 :src elisp
- [elpa] externals/org-transclusion updated (5cb94542e1 -> b6c7bcb632), ELPA Syncer, 2022/08/23
- [elpa] externals/org-transclusion c49dcbd440 5/7: (intrnl) fix source comment, ELPA Syncer, 2022/08/23
- [elpa] externals/org-transclusion d479bec65a 1/7: add: #147 support :lines for org-id link, ELPA Syncer, 2022/08/23
- [elpa] externals/org-transclusion fb947f5a83 4/7: fix: conditions in org-transclusion-add-src-lines,
ELPA Syncer <=
- [elpa] externals/org-transclusion 5f7e300f04 2/7: (internal) change line ending from CRLF to LF, ELPA Syncer, 2022/08/23
- [elpa] externals/org-transclusion e3b588be07 6/7: intrnl: test file, ELPA Syncer, 2022/08/23
- [elpa] externals/org-transclusion b6c7bcb632 7/7: chg: visit file as RAWFILE, ELPA Syncer, 2022/08/23
- [elpa] externals/org-transclusion 65f74f4666 3/7: (internal) update test file for lines, ELPA Syncer, 2022/08/23