[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark 56557549ec 16/75: refactor: Create macro to
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark 56557549ec 16/75: refactor: Create macro to add function-put |
Date: |
Fri, 6 Oct 2023 12:59:17 -0400 (EDT) |
branch: externals/org-remark
commit 56557549ec8bf7d562c3248ffe58f15a1a8aabcd
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
refactor: Create macro to add function-put
---
org-remark.el | 67 +++++++++++++++++++++++++++++++++--------------------------
1 file changed, 37 insertions(+), 30 deletions(-)
diff --git a/org-remark.el b/org-remark.el
index 225d54197d..cb2e997f02 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -6,7 +6,7 @@
;; URL: https://github.com/nobiot/org-remark
;; Version: 1.1.0
;; Created: 22 December 2020
-;; Last modified: 05 August 2023
+;; Last modified: 06 August 2023
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp,
@@ -219,11 +219,13 @@ property drawer from the highlighter pen. To do this,
prefix
property names with \"org-remark-\" or use \"CATEGORY\"."
(if (or (not label) (stringp label)
(user-error "org-remark-create: Label is missing or not string"))
- `(progn
- ;; Define custom pen function
- (defun ,(intern (format "org-remark-mark-%s" label))
- (beg end &optional id mode)
- ,(format "Apply the following face to the region selected by BEG and
END.
+ (let ((org-remark-type
+ (symbol-name (plist-get (eval properties) 'org-remark-type))))
+ `(progn
+ ;; Define custom pen function
+ (defun ,(intern (format "org-remark-mark-%s" label))
+ (beg end &optional id mode)
+ ,(format "Apply the following face to the region selected by BEG
and END.
%s
@@ -245,30 +247,35 @@ highlight. In this case, no new ID gets generated.
When the pen itself defines the help-echo property, it will have
the priority over the excerpt of the marginal notes."
- (or face "`org-remark-highlighter'") properties)
- (interactive (org-remark-beg-end
- (quote ,(plist-get (eval properties)
'org-remark-type))))
- (org-remark-highlight-mark beg end id mode ,label ,face ,properties))
-
- ;; Register to `org-remark-available-pens'
- (add-to-list 'org-remark-available-pens
- (intern (format "org-remark-mark-%s" ,label)))
-
- ;; Add the custom pen function to the minor-mode menu
- (define-key-after org-remark-pen-map
- [,(intern (format "org-remark-mark-%s" label))]
- '(menu-item ,(format "%s pen" label) ,(intern (format
"org-remark-mark-%s" label))))
-
- ;; Add the custom pen change function to the minor-mode menu
- (define-key-after org-remark-change-pen-map
- [,(intern (format "org-remark-change-to-%s" label))]
- '(menu-item ,(format "%s pen" label)
- (lambda ()
- (interactive)
- (org-remark-change
- #',(intern (format "org-remark-mark-%s" label))))
- :enable (org-remark-pen-same-type-at-point-p
- (quote ,(plist-get (eval properties)
'org-remark-type))))))))
+ (or face "`org-remark-highlighter'") properties)
+ (interactive (org-remark-beg-end (intern ,org-remark-type)))
+ (org-remark-highlight-mark beg end id mode ,label ,face
,properties))
+
+ ;; Register to `org-remark-available-pens'
+ (add-to-list 'org-remark-available-pens
+ (intern (format "org-remark-mark-%s" ,label)))
+
+ ;; Add function prop This is for `org-remark-change' to show
+ ;; only the pens of the same type
+ (when 'org-remark-type (function-put
+ (intern (format "org-remark-mark-%s"
,label))
+ 'org-remark-type
+ (intern ,org-remark-type)))
+
+ ;; Add the custom pen function to the minor-mode menu
+ (define-key-after org-remark-pen-map
+ [,(intern (format "org-remark-mark-%s" label))]
+ '(menu-item ,(format "%s pen" label) ,(intern (format
"org-remark-mark-%s" label))))
+
+ ;; Add the custom pen change function to the minor-mode menu
+ (define-key-after org-remark-change-pen-map
+ [,(intern (format "org-remark-change-to-%s" label))]
+ '(menu-item ,(format "%s pen" label)
+ (lambda ()
+ (interactive)
+ (org-remark-change
+ #',(intern (format "org-remark-mark-%s" label))))
+ :enable (org-remark-pen-same-type-at-point-p (intern
,org-remark-type))))))))
;;;; Minor mode
- [elpa] externals/org-remark 1a6745acce 71/75: fix(line): change some customizing options from integer to natnum, (continued)
- [elpa] externals/org-remark 1a6745acce 71/75: fix(line): change some customizing options from integer to natnum, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark bdd54cf237 57/75: Merge branch 'main' into dev/1.3.0, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark ceef4b537c 53/75: Merge branch 'main' into dev/line-highlight, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark 32b8699b12 64/75: doc: docstring for `org-remark-notes-auto-delete`, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark ace9570070 52/75: refactor: simply org-remark-open, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark 73766a03f0 69/75: docs: update NEWS, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark 52cf20297b 67/75: feat: #72 org-remark-open can open the marginal notes file, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark ca648a1876 18/75: fix: change now can only select pens from the same type, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark 2f7d16ef4e 31/75: refactor(line): remove unused functions, source comments, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark c7dc42bf30 28/75: fix: margin width, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark 56557549ec 16/75: refactor: Create macro to add function-put,
ELPA Syncer <=
- [elpa] externals/org-remark 94ba0ecea0 21/75: fix(line): When source narrowed, existing line-hls move wrongly, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark e7aae5e4f4 25/75: doc: docstring for org-remark-highlight-mark-overlay, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark f28dc7e7f5 62/75: docs: update docstrings for remove and delete, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark 18f39bf119 56/75: Merge branch 'main' into dev/1.3.0, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark 4ad2be30e4 13/75: fix(icon): the line icon not displaying, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark e136189485 34/75: fix(line): window margin wrongly sets minibuffer's margin, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark 8f9875f714 24/75: doc(line): Remove unused source comments (old code), ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark 6dbf1cca4a 35/75: fix(line): svg icon does not get the face correctly, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark 3f5ea6777b 32/75: fix(line): window selection is utterly confused, ELPA Syncer, 2023/10/06
- [elpa] externals/org-remark 533167091a 42/75: fix(line):Right margin expands every window-size-change-func call, ELPA Syncer, 2023/10/06