[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/svg-tag-mode 3e49ddcee2 57/63: Cancel tag editing in re
From: |
ELPA Syncer |
Subject: |
[elpa] externals/svg-tag-mode 3e49ddcee2 57/63: Cancel tag editing in read-only or view mode. |
Date: |
Mon, 27 Dec 2021 15:58:01 -0500 (EST) |
branch: externals/svg-tag-mode
commit 3e49ddcee288750cf1403a90308f4bb25a94bc3d
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Cancel tag editing in read-only or view mode.
---
examples/example-1.el | 11 +++++++----
svg-tag-mode.el | 8 ++++++--
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/examples/example-1.el b/examples/example-1.el
index 143b2378a2..a1e0988318 100644
--- a/examples/example-1.el
+++ b/examples/example-1.el
@@ -16,14 +16,17 @@
(require 'svg-tag-mode)
(setq svg-tag-tags
- '((":TODO:" . ((svg-tag-make "TODO" :face 'org-tag :inverse t :margin
0)))
- (":NOTE:" . ((svg-tag-make "NOTE" :margin 0)))
+ '((":TODO:" . ((svg-tag-make "TODO" :face 'org-tag
+ :radius 0 :inverse t :margin 0)))
+ (":NOTE:" . ((svg-tag-make "NOTE" :face 'font-lock-comment-face
+ :inverse nil :margin 0 :radius 0)))
("\([0-9a-zA-Z]\)" . ((lambda (tag)
(svg-tag-make tag :beg 1 :end -1 :radius 12))))
("\([0-9a-zA-Z][0-9a-zA-Z]\)" . ((lambda (tag)
(svg-tag-make tag :beg 1 :end -1
:radius 8))))
("|[0-9a-zA-Z- ]+?|" . ((lambda (tag)
- (svg-tag-make tag :margin 0 :beg 1 :end
-1))))))
+ (svg-tag-make tag :face
'font-lock-comment-face
+ :margin 0 :beg 1 :end -1))))))
(svg-tag-mode t)
;; :NOTE: SVG tag is a minor mode that displays a rounded box with outer
@@ -40,7 +43,7 @@
;; Save as .............. |C-x| |C-w| Cancel ............. |C-g|
;; Open a new file ...... |C-x| |C-f| Undo ............... |C-z|
;; Open recent .......... |C-x| |C-r| Close buffer ....... |C-x| |k|
-;; Browse directory ......|C-x| |d| Quit ............... |C-x| |C-c|
+;; Browse directory ..... |C-x| |d| Quit ............... |C-x| |C-c|
;;
;; ------------------------------------------------------------------------
;; (1)(2)(3)(4)(5)(Z)(W)(12)(99) (A)(B)(C)
diff --git a/svg-tag-mode.el b/svg-tag-mode.el
index 2ea4b04801..c292d42728 100644
--- a/svg-tag-mode.el
+++ b/svg-tag-mode.el
@@ -198,8 +198,8 @@ allows to create dynamic tags."
(next-property-change position))))
(if (eq direction 'left)
(font-lock-flush beg end )
- (font-lock-unfontify-region 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
@@ -264,6 +264,10 @@ allows to create dynamic tags."
(advice-add 'org-fontify-meta-lines-and-blocks
:after #'svg-tag--remove-text-properties-off)
+ ;; Flush buffer when entering read-only
+ (add-hook 'read-only-mode-hook
+ #'(lambda () (font-lock-flush (point-min) (point-max))))
+
;; Redisplay everything to show tags
(message "SVG tag mode on")
(cursor-sensor-mode 1)
- [elpa] externals/svg-tag-mode aca351185b 52/63: Fixed documentation., (continued)
- [elpa] externals/svg-tag-mode aca351185b 52/63: Fixed documentation., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 558ac3d3bd 54/63: Added edit mode (tag is hidden) when pointer is over a tag., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 72068052ff 19/63: Fixed default height, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 9ddf0e4f13 38/63: Rename screenshot, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode b865793671 53/63: Updated copyright notices., ELPA Syncer, 2021/12/27
- [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 <=
- [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, 2021/12/27
- [elpa] externals/svg-tag-mode e2481ae15a 63/63: Modified example to highlight real org tags., ELPA Syncer, 2021/12/27