[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark 4554fc817a 132/173: rm: org-remark-pen-facto
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark 4554fc817a 132/173: rm: org-remark-pen-factory -> merged with org-remark-create |
Date: |
Fri, 28 Jan 2022 16:58:08 -0500 (EST) |
branch: externals/org-remark
commit 4554fc817a1f425572e0aad79a6dd02b956244e3
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
rm: org-remark-pen-factory -> merged with org-remark-create
---
org-remark.el | 109 ++++++++++++++++++++++++++--------------------------------
1 file changed, 48 insertions(+), 61 deletions(-)
diff --git a/org-remark.el b/org-remark.el
index 3db12f1433..933804c277 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -6,7 +6,7 @@
;; URL: https://github.com/nobiot/org-remark
;; Version: 0.1.0
;; Created: 22 December 2020
-;; Last modified: 16 January 2022
+;; Last modified: 17 January 2022
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, writing, note-taking, marginal-notes
@@ -119,17 +119,33 @@ It is meant to exist only one of these in each Emacs
session.")
;;;; Macros to create user-defined highlighter pen functions
-(defmacro org-remark-pen-factory (&optional label face properties)
- "Create a user-defined highlighter pen function.
+(defmacro org-remark-create (label &optional face properties)
+ "Create and register new highlighter pen functions.
+
+The newly created pen function will be registered to variable
+`org-remark-available-pens'. It is used by `org-remark-change'
+as a selection list.
-Use `org-remark-create' to create and register the new pen
-instead of this \"factory\" macro.
+LABEL is the name of the highlighter and mandatoryy. The function
+will be named `org-remark-mark-LABEL'.
+
+The highlighter pen function will apply FACE to the selected region.
+FACE can be an anonymous face. When FACE is nil, this macro uses
+the default face `org-remark-highlighter'.
-For LABEL, FACE, and PROPERTIES, refer to the docstring of
`org-remark-create'."
- `(defun ,(intern (or (when label (format "org-remark-mark-%s" label))
- "org-remark-mark"))
- (beg end &optional id load-only)
- ,(format "Apply the following face to the region selected by BEG and END.
+PROPERTIES is a plist of pairs of a symbol and value. Each
+highlighted text region will have a corresponding Org headline in
+the notes file, and it can have additional properties in the
+property drawer from the highlighter pen. To do this, prefix
+property names with \"org-remark-\" or use \"CATEGORY\"."
+ (if (not label) `(user-error "org-remark-create: Label is missing")
+ `(progn
+ (add-to-list 'org-remark-available-pens
+ (intern (or (when ,label (format "org-remark-mark-%s"
,label))
+ "org-remark-mark")))
+ (defun ,(intern (format "org-remark-mark-%s" label))
+ (beg end &optional id load-only)
+ ,(format "Apply the following face to the region selected by BEG and
END.
%s
@@ -139,48 +155,20 @@ text region:
%S
When this function is used interactively, it will generate a new
-ID, always assuming it is a new highlighted text region, and
-Org-remark will start tracking the highlight's location in the
-current buffer.
-
-The entry for the highlght will be created in the marginal notes
-file specified by `org-remark-notes-file-path'. If the file does
-not exist yet, it will be created.
+ID, always assuming it is working on a new highlighted text
+region, and Org-remark will start tracking the highlight's
+location in the current buffer.
When this function is called from Elisp, ID can be optionally
-passed. If so, no new ID gets generated.
+passed, indicating to Org-remark that it is an existing
+highlight. In this case, no new ID gets generated.
When LOAD-ONLY is non-nil, this function does not save the
highlight in the marginal notes file. This is meant to be for
`org-remark-load'."
- (or face "`org-remark-highlighter'") properties)
- (interactive "r")
- (org-remark-mark beg end ,label ,face ,properties id load-only)))
-
-(defmacro org-remark-create (&optional label face properties)
- "Create and register new highlighter pen functions.
-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 pen function will apply FACE to the selected region.
-FACE can be an anonymous face. When FACE is nil, this macro uses
-the default face `org-remark-highlighter'.
-
-PROPERTIES is a list of pairs of a symbol and value. Each
-highlighted text region will have a corresponding Org headline in
-the notes file, and it can have properties from the highlighter
-pen. To do this, prefix property names with \"org-remark-\" or use
-\"CATEGORY\".
-
-The newly created pen functions are registered to variable
-`org-remark-available-pens'. It is used by `org-remark-change'
-as a selection list."
- `(progn
- (org-remark-pen-factory ,label ,face ,properties)
- (add-to-list 'org-remark-available-pens
- (intern (or (when ,label (format "org-remark-mark-%s"
,label))
- "org-remark-mark")))))
+ (or face "`org-remark-highlighter'") properties)
+ (interactive "r")
+ (org-remark-mark beg end ,label ,face ,properties id load-only)))))
;; Don't use category (symbol) as a property -- it's a special one of text
;; properties. If you use it, the value also need to be a symbol; otherwise,
you
@@ -257,29 +245,28 @@ recommended to turn it on as part of Emacs initialization.
(add-to-list 'org-remark-available-pens #'org-remark-mark)
;;;###autoload
(defun org-remark-mark (beg end &optional label face properties id load-only)
- "Apply the following face to the region selected by BEG and END.
-
-LABEL
+ "Apply the FACE to the region selected by BEG and END.
This function will apply FACE to the selected region. When it is
-nil, this function uses the default face `org-remark-highlighter'
+nil, this function will use the default face `org-remark-highlighter'
-PROPERTIES is a plist of pairs of a symbol and value. This
-function adds them as overlay properties.
+This function will add LABEL and PROPERTIES as overlay
+properties. PROPERTIES is a plist of pairs of a symbol and value.
When this function is used interactively, it will generate a new
-ID, always assuming it is a new highlighted text region, and
-Org-remark will start tracking the highlight's location in the
-current buffer.
+ID, always assuming it is working on a new highlighted text
+region, and Org-remark will start tracking the highlight's
+location in the current buffer.
When this function is called from Elisp, ID can be optionally
-passed. If so, no new ID gets generated.
+passed, indicating to Org-remark that it is an existing
+highlight. In this case, no new ID gets generated.
-The entry for the highlght will be created in the marginal notes
-file specified by `org-remark-notes-file-path'. If the file does
-not exist yet, it will be created.
+A Org headline entry for the highlght will be created in the
+marginal notes file specified by `org-remark-notes-file-path'. If
+the file does not exist yet, it will be created.
-When LOAD-ONLY is non-nil, this function does not save the
+When LOAD-ONLY is non-nil, this function will not save the
highlight in the marginal notes file. This is meant to be for
`org-remark-load'."
(interactive "r")
@@ -709,7 +696,7 @@ Return t if an entry is removed or deleted."
(when delete-notes
;; TODO I would love to add the y-n prompt if there is any notes
written
(delete-region (point-min)(point-max))
- (message "Deleted the marginal notes."))
+ (message "Deleted the marginal notes entry"))
(when (buffer-modified-p) (save-buffer))))
t))
- [elpa] externals/org-remark 366b169e55 108/173: add: pen-factory & available pens for change, (continued)
- [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, 2022/01/28
- [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 <=
- [elpa] externals/org-remark 4042e9434f 137/173: doc: User Manual first draft, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark bee736f6e3 131/173: intrnl: refactor mark, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark a7de41bdfa 139/173: docs: NEWS and README (incomplete, WIP), ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 50bfb96d69 140/173: Merge branch 'dev/name-change', ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 0c7fd2d711 143/173: docs: README for Org-remark, update user manual and css, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 1b2db44fa7 145/173: docs: user manaul, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 69d0259e20 146/173: docs: user manaul, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 62cba0ec63 148/173: fix: change now updates the marginal notes, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark f43e4afc34 152/173: add: toggle to menu; intrnl: refactor, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark f353630ddd 153/173: fix:toggle: marking when toggle hidden confuses the state, ELPA Syncer, 2022/01/28