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

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

[elpa] externals/org-transclusion 367d519704 1/2: feat(src-lines.el/thin


From: ELPA Syncer
Subject: [elpa] externals/org-transclusion 367d519704 1/2: feat(src-lines.el/thing-at-point) allow :thingatpt
Date: Wed, 24 May 2023 15:59:04 -0400 (EDT)

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

    feat(src-lines.el/thing-at-point) allow :thingatpt
---
 org-transclusion-src-lines.el | 10 +++++-----
 test/things-at-point.org      |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/org-transclusion-src-lines.el b/org-transclusion-src-lines.el
index 60fd22d157..e07ffcb90d 100644
--- a/org-transclusion-src-lines.el
+++ b/org-transclusion-src-lines.el
@@ -17,7 +17,7 @@
 
 ;; Author: Noboru Ota <me@nobiot.com>
 ;; Created: 24 May 2021
-;; Last modified: 17 May 2023
+;; Last modified: 23 May 2023
 
 ;;; Commentary:
 ;;  This is an extension to `org-transclusion'.  When active, it adds features
@@ -127,7 +127,7 @@ it means from line 10 to the end of file."
          (entry-pos) (buf)
          (lines (plist-get plist :lines))
          (end-search-op (plist-get plist :end))
-         (thing-at-point (plist-get plist :thing-at-point))
+         (thing-at-point (cadr (split-string (plist-get plist 
:thing-at-point))))
          (thing-at-point (when thing-at-point (make-symbol thing-at-point))))
     (if (not (string= type "id")) (setq buf (find-file-noselect path))
       (let ((filename-pos (org-id-find path)))
@@ -268,7 +268,7 @@ abnormal hook
      (when src (format " :src %s" src))
      (when rest (format " :rest \"%s\"" rest))
      (when end (format " :end \"%s\"" end))
-     (when thing-at-point (format " :thing-at-point %s" thing-at-point)))))
+     (when thing-at-point (format " %s" thing-at-point)))))
 
 (defun org-transclusion-src-lines-p (type)
   "Return non-nil when TYPE is \"src\" or \"lines\".
@@ -311,8 +311,8 @@ It is meant to be used by 
`org-transclusion-get-string-to-plist'.
 It needs to be set in `org-transclusion-get-keyword-values-hook'.
 Double qutations are optional :thing-at-point \"sexp\".  The regex should
 match any valid elisp symbol (but please don't quote it)."
-  (when (string-match ":thing-at-point \\([[:alnum:][:punct:]]+\\)" string)
-    (list :thing-at-point (org-strip-quotes (match-string 1 string)))))
+  (when (string-match "\\(:thing-at-point\\|:thingatpt\\) 
\\([[:alnum:][:punct:]]+\\)" string)
+    (list :thing-at-point (org-strip-quotes (match-string 0 string)))))
 
 (defun org-transclusion-content-format-src-lines (type content indent)
   "Format text CONTENT from source before transcluding.
diff --git a/test/things-at-point.org b/test/things-at-point.org
index d36100acfa..81d1eb6caf 100644
--- a/test/things-at-point.org
+++ b/test/things-at-point.org
@@ -19,10 +19,10 @@ I expect these will be more common:
 
 #+transclude: [[./things-at-point-dir/story.txt::Once upon a time][story]]  
:end "2" :thing-at-point paragraph
 
-#+transclude: [[./things-at-point-dir/story.txt::Once upon a time][story]]  
:end "3" :thing-at-point sentence
+#+transclude: [[./things-at-point-dir/story.txt::Once upon a time][story]]  
:end "3":thing-at-point sentence
 
 #+transclude: [[./things-at-point-dir/baz.el::id:1234567890][barz-baz-fuzz]]  
:src elisp
 
-#+transclude: [[./things-at-point-dir/baz.el::foo][barz-baz-fuzz]]  :src elisp 
:thing-at-point sexp
+#+transclude: [[./things-at-point-dir/baz.el::foo][barz-baz-fuzz]]  :src elisp 
:thingatpt sexp
 
 #+transclude: [[./things-at-point-dir/baz.el::id:1234567890][barz-baz-fuzz]]  
:src elisp :thing-at-point defun



reply via email to

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