branch: externals/org-remark commit 1878b9ddce339f1a1d270ef70d66ca7e336eb919 Author: Noboru Ota <m...@nobiot.com> Commit: Noboru Ota <m...@nobiot.com>
fix: Error narrowed source for range Error when the source file is narrowed, and has a marker in the invisible part. Calling (buffer-substring-no-properties beg end) because the range was out of range. Fixes by widening with `org-with-wide-buffer` -- as it is a macro that uses only built-in function, it should work with non-Org source files. --- org-marginalia.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org-marginalia.el b/org-marginalia.el index e9aa8b4b48..745c0c6ceb 100644 --- a/org-marginalia.el +++ b/org-marginalia.el @@ -5,7 +5,7 @@ ;; Author: Noboru Ota <m...@nobiot.com> ;; URL: https://github.com/nobiot/org-marginalia ;; Version: 0.0.3 -;; Last modified: 2020-12-23T181303 +;; Last modified: 2020-12-24T140044 ;; Package-Requires: ((emacs "27.1") (org "9.4")) ;; Keywords: org-mode, annotation, writing, note-taking, margin-notes @@ -421,7 +421,8 @@ creat a new headline at the end of the buffer." (let* ((pos (cdr highlight)) (beg (marker-position (car pos))) (end (marker-position (cdr pos))) - (text (buffer-substring-no-properties beg end))) + ;;`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)))) ;; TODO Want to add a check if save is applicable here. (with-current-buffer (find-file-noselect om/notes-file-path) (org-with-wide-buffer