[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/svg-tag-mode 85aed73bc6 58/63: Added custom option to l
From: |
ELPA Syncer |
Subject: |
[elpa] externals/svg-tag-mode 85aed73bc6 58/63: Added custom option to let user decide on action at point. |
Date: |
Mon, 27 Dec 2021 15:58:01 -0500 (EST) |
branch: externals/svg-tag-mode
commit 85aed73bc6d96d0d198860f41772b1f12a03e0e5
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Added custom option to let user decide on action at point.
---
svg-tag-mode.el | 33 ++++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/svg-tag-mode.el b/svg-tag-mode.el
index c292d42728..bc0c84da96 100644
--- a/svg-tag-mode.el
+++ b/svg-tag-mode.el
@@ -124,10 +124,16 @@
:group 'convenience
:prefix "svg-tag-")
-(setq svg-tag-tags `((" TODO " . ((svg-tag-make "TODO") nil nil))))
+(defcustom svg-tag-action-at-point 'echo
+ "Action to be executed when the cursor enter a tag area"
+ :type '(radio (const :tag "Edit tag" edit)
+ (const :tag "Echo tag" echo)
+ (const :tag "No action" nil))
+ :group 'svg-tag)
+
(defcustom svg-tag-tags
- `((" TODO " . ((svg-tag-make "TODO") nil nil)))
+ `(("^TODO" . ((svg-tag-make "TODO") nil nil)))
"An alist mapping keywords to tags used to display them.
Each entry has the form (keyword . tag). Keyword is used as part
@@ -196,15 +202,20 @@ allows to create dynamic tags."
(end (if (eq direction 'entered)
(next-property-change (point))
(next-property-change position))))
- (if (eq direction 'left)
- (font-lock-flush beg end )
- (if (and (not view-read-only) (not buffer-read-only))
- (font-lock-unfontify-region beg end)))
- ;; (if (eq direction 'entered)
- ;; (message (concat "TAG: "
- ;; (substring-no-properties
- ;; (buffer-substring beg end )))))
- ))
+
+ (if (eq svg-tag-action-at-point 'edit)
+ (if (eq direction 'left)
+ (font-lock-flush beg end )
+ (if (and (not view-read-only) (not buffer-read-only))
+ (font-lock-unfontify-region beg end))))
+
+ (if (eq svg-tag-action-at-point 'echo)
+ (if (eq direction 'entered)
+ (let ((message-log-max nil))
+ (message (concat "TAG: "
+ (substring-no-properties
+ (string-trim
+ (buffer-substring beg end ))))))))))
(defun svg-tag--build-keywords (item)
"Process an item in order to install it as a new keyword."
- [elpa] externals/svg-tag-mode 95b5404997 35/63: Merge pull request #13 from tarsiiformes/cleanup, (continued)
- [elpa] externals/svg-tag-mode 95b5404997 35/63: Merge pull request #13 from tarsiiformes/cleanup, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 861c68af89 40/63: Updated example 1 to new tags format., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode ee16277655 42/63: Added examples from documentation, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 8533c6c174 50/63: Added progress bar example., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode d9a803a92e 49/63: Added date without time format example., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 3e49ddcee2 57/63: Cancel tag editing in read-only or view mode., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 7266de9f9c 61/63: Simplified advice on org fontify blocks., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 1d0d91bb00 46/63: Fixed layout, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 02d60e0a86 55/63: Fixed cursor selection., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode b5a00a5746 56/63: Bumped version number and fixed some documentation., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 85aed73bc6 58/63: Added custom option to let user decide on action at point.,
ELPA Syncer <=
- [elpa] externals/svg-tag-mode e2481ae15a 63/63: Modified example to highlight real org tags., ELPA Syncer, 2021/12/27