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

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

[elpa] externals/org-remark a98120b18c 107/173: add ::line-number to fil


From: ELPA Syncer
Subject: [elpa] externals/org-remark a98120b18c 107/173: add ::line-number to file line
Date: Fri, 28 Jan 2022 16:58:06 -0500 (EST)

branch: externals/org-remark
commit a98120b18cbbe4d3d8a77b86b444d56c7ffccdcf
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>

    add ::line-number to file line
---
 NEWS          | 6 +++++-
 org-remark.el | 9 ++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 6264ddcdf3..7df97e34aa 100644
--- a/NEWS
+++ b/NEWS
@@ -8,4 +8,8 @@
 
   - When updating the existing headline and position properties, don't update
     the headline text when it already exists. Let the user decide how to manage
-    headlines.
\ No newline at end of file
+    headlines.
+
+- Add ::
+
+  - add ::line-number to file line
\ No newline at end of file
diff --git a/org-remark.el b/org-remark.el
index 7e2a10f6ba..7f9f78529e 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -5,7 +5,7 @@
 ;; Author: Noboru Ota <me@nobiot.com>
 ;; URL: https://github.com/nobiot/org-remark
 ;; Version: 0.0.7
-;; Last modified: 03 January 2022
+;; Last modified: 05 January 2022
 ;; Package-Requires: ((emacs "27.1") (org "9.4"))
 ;; Keywords: org-mode, annotation, writing, note-taking, marginal-notes
 
@@ -483,6 +483,7 @@ feature."
         (id (overlay-get highlight 'org-remark-id))
          ;;`org-with-wide-buffer is a macro that should work for non-Org file'
          (text (org-with-wide-buffer (buffer-substring-no-properties beg end)))
+         (line-num (unless (and orgid org-remark-use-org-id) 
(org-current-line)))
          (props (overlay-properties highlight)))
     ;; TODO Want to add a check if save is applicable here.
     (with-current-buffer (find-file-noselect org-remark-notes-file-path)
@@ -520,9 +521,11 @@ feature."
            ;; Add a properties
            (insert (concat "** " text "\n"))
            (org-remark-notes-set-properties id beg end props)
-          (if (and org-remark-use-org-id orgid)
+          (if (and orgid org-remark-use-org-id)
               (insert (concat "[[id:" orgid "]" "[" title "]]"))
-            (insert (concat "[[file:" path "]" "[" title "]]"))))))
+            (insert (concat "[[file:" path
+                             (when line-num (format "::%d" line-num))
+                             "][" title "]]"))))))
       (when (buffer-modified-p) (save-buffer) t))))
 
 (defun org-remark-single-highlight-remove (id &optional delete-notes)



reply via email to

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