[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark 8e558a3549 110/173: add browse-next/prev; op
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark 8e558a3549 110/173: add browse-next/prev; open/visit; change open to side window |
Date: |
Fri, 28 Jan 2022 16:58:06 -0500 (EST) |
branch: externals/org-remark
commit 8e558a3549dbf231ae7df0e903d23121a421464d
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
add browse-next/prev; open/visit; change open to side window
---
org-remark.el | 68 ++++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 49 insertions(+), 19 deletions(-)
diff --git a/org-remark.el b/org-remark.el
index 728f9cd52f..9ba903efd2 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: 10 January 2022
+;; Last modified: 11 January 2022
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, writing, note-taking, marginal-notes
@@ -155,7 +155,7 @@ LABEL is the name of the highlighter. The function will be
called
`org-remark-mark-LABEL', or, when LABEL is nil, the default
`org-remark-mark'.
-The highlighter function will apply FACE to the selected region.
+The highlighter pen function will apply FACE to the selected region.
FACE can be an anonymous face. When it is nil, this macro uses
the default face `org-remark-highlighter'.
@@ -228,7 +228,7 @@ runs `org-remark-load' for current buffer.
Otherwise, do not forget to turn on `org-remark-mode' manually to
load the highlights"
(interactive)
- (unless org-remark-mode (org-remark-mode 1+1))
+ (unless org-remark-mode (org-remark-mode +1))
(unless org-remark-loaded
;; Loop highilights and add them to the current buffer
(dolist (highlight (org-remark-highlights-get))
@@ -277,28 +277,48 @@ in the current buffer. Each highlight is represented by
an overlay."
(add-to-list 'org-remark-files-tracked
(abbreviate-file-name (buffer-file-name))))))
-(defun org-remark-open (point)
+(defun org-remark-open (point &optional arg)
"Open hightlight and annocation at POINT, narrowed to the relevant headline.
It creates a cloned indirect buffer of the notes file
\(`org-remark-notes-file-path'\). You can edit notes file as a in
a normal Org file. Once you have done editing, you can simply
save and kill the buffer.
+You will stay in the current buffer.
+
+You can visit the notes buffer opend for furhter editing when ARG
+is non-nil (e.g. by passing a universal argument with
+\\[universal-argument] \(ARG\).
+
This package ensures that there is only one cloned buffer for
notes file by tracking it."
- (interactive "d")
+ (interactive "d\nP")
(when (buffer-live-p org-remark-last-notes-buffer)
(kill-buffer org-remark-last-notes-buffer))
(when-let ((id (get-char-property point 'org-remark-id))
+ (cbuf (current-buffer))
(ibuf (make-indirect-buffer
(find-file-noselect org-remark-notes-file-path)
"*marginal notes*" 'clone)))
(setq org-remark-last-notes-buffer ibuf)
- (org-switch-to-buffer-other-window ibuf)
+ (display-buffer ibuf
+ '((display-buffer-in-side-window)
+ (side . left)
+ (slot . 1)
+ (dedicated . t)))
+ ;; Assuming the marginal-notes buffer is in another window
+ (switch-to-buffer-other-window ibuf)
(widen)(goto-char (point-min))
(when-let (p (or (org-find-property org-remark-prop-id id)
(org-find-property "marginalia-id" id)))
- (goto-char p)(org-narrow-to-subtree))))
+ (goto-char p)(org-narrow-to-subtree))
+ (unless arg (switch-to-buffer cbuf))))
+
+(defun org-remark-visit (point)
+ "Visit notes for hightlight and annocation at POINT.
+The notes file get narrowed to the relevant headline."
+ (interactive "d")
+ (org-remark-open point 'visit))
(defun org-remark-remove (point &optional arg)
"Remove the highlight at POINT.
@@ -307,11 +327,11 @@ marginalia, but will keep the headline and notes. This
is to
ensure to keep any notes you might have written intact.
You can let this command delete the entire heading subtree for
-the highlight, along with the annotations you have written, pass
-a universal argument with \\[universal-argument] \(ARG\). If you
-have done so by error, you could still `undo' it in the notes
-buffer, but not in the current buffer as adding and removing overlays
-are not part of the undo tree."
+the highlight, along with the annotations you have written, by
+passing a universal argument with \\[universal-argument] \(ARG\).
+If you have done so by error, you could still `undo' it in the
+notes buffer, but not in the current buffer as adding and
+removing overlays are not part of the undo tree."
(interactive "d\nP")
;; TODO There may be multiple overlays
(when-let* ((id (get-char-property point 'org-remark-id)))
@@ -334,7 +354,7 @@ buffer, cycle back to the first one.
After the point has moved to the next highlight, this command
lets you move further by re-entering only the last letter like
-this example:
+this example:v
C-n \] \] \] \] \] \(assuming this command is bound to C-n \]\)
@@ -395,9 +415,19 @@ the sequence like so:
t)
(message "Nothing done. No more visible highlights exist") nil))))
+(defun org-remark-browse-next ()
+ "."
+ (interactive)
+ (org-remark-next)(org-remark-open (point)))
+
+(defun org-remark-browse-prev ()
+ "."
+ (interactive)
+ (org-remark-prev)(org-remark-open (point)))
+
(defun org-remark-toggle ()
- "Toggle showing/hiding of highlighters in current buffer.
-It only affects the display of the highlighters. Their locations
+ "Toggle showing/hiding of highlights in current buffer.
+It only affects the display of the highlights. Their locations
are still kept tracked; upon buffer-save the correct locations
are still recorded in the marginalia file."
(interactive)
@@ -448,12 +478,12 @@ If there are more than one, returns CAR of the list"
This function performs the main work for the command created via
`org-remark-create-pen'.
-Create a user-defined highlighter function.
-LABEL is the name of the highlighter. The function will be called
+Create a user-defined highlighter pen function.
+LABEL is the name of the highlighter pen. The function will be called
`org-remark-mark-LABEL', or, when LABEL is nil, the default
`org-remark-mark'.
-The highlighter function will apply FACE to the selected
+The highlighter pen function will apply FACE to the selected
region. FACE can be an anonymous face. When it is nil, this
macro uses the default face `org-remark-highlight'.
@@ -484,7 +514,7 @@ passed. If so, no new ID gets generated."
;; returned by `overlay-lists' that lists any overlays.
(push ov org-remark-highlights)
;; Adding overlay to the buffer does not set the buffer modified. You
- ;; cannot use `undo' to undo highlighter, either.
+ ;; cannot use `undo' to undo highlights, either.
(deactivate-mark)
(unless (buffer-modified-p) (restore-buffer-modified-p t))))
(org-remark-housekeep)
- [elpa] externals/org-remark bdbde4eda8 093/173: refactor: macro to make different pen, (continued)
- [elpa] externals/org-remark bdbde4eda8 093/173: refactor: macro to make different pen, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark b3a8e3e2ec 097/173: add: Org-HANA: Org to Highlight & ANnotate Any text file (HANA), ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark f7e796cd6b 095/173: chg: don't update headline text; various refactors, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 4ee9e23e50 100/173: intrnl: refactor fn names, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark ecb82aebbe 101/173: intrnl correct some minor errors, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark fd5cab5ac2 102/173: rm: org-marginalia*.el, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 51b0c08f25 104/173: docs: NEWS, README etc. for name change, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 0c6aad188a 106/173: doc:README minor change for grammar, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark a98120b18c 107/173: add ::line-number to file line, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 366b169e55 108/173: add: pen-factory & available pens for change, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 8e558a3549 110/173: add browse-next/prev; open/visit; change open to side window,
ELPA Syncer <=
- [elpa] externals/org-remark 70cf67bc26 112/173: intrnl: refactor view, open, browse (view-next/prev), ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 84999b19c6 115/173: add: org-remark-convert-legacy-data as a standalone command, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark d2135790a7 114/173: intrnl: refactor empty-buffer-p, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark feb1dca006 118/173: intrnl: minor refactoring, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 424f5da60a 119/173: docs: major docstring updates; WIP for manual., ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 8e35852380 120/173: add: save notes on mark, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 52eee18951 128/173: intrnl: refactor org-remark-next-or-prev, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 42cbe6e18e 129/173: docs: manual, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 4554fc817a 132/173: rm: org-remark-pen-factory -> merged with org-remark-create, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 4042e9434f 137/173: doc: User Manual first draft, ELPA Syncer, 2022/01/28