[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/sketch-mode 800cd1a 01/12: Create major mode (instead o
From: |
ELPA Syncer |
Subject: |
[elpa] externals/sketch-mode 800cd1a 01/12: Create major mode (instead of minor mode); better for Spacemacs |
Date: |
Tue, 26 Oct 2021 14:57:40 -0400 (EDT) |
branch: externals/sketch-mode
commit 800cd1a30978c1a022cdb8d5318101786dcae263
Author: Daniel Nicolai <dalanicolai@gmail.com>
Commit: Daniel Nicolai <dalanicolai@gmail.com>
Create major mode (instead of minor mode); better for Spacemacs
The only reason for this commit is that, in Spacemacs, evilifying a
major-mode
is much easier than evilifying a minor-mode
---
sketch-mode.el | 95 +++++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 64 insertions(+), 31 deletions(-)
diff --git a/sketch-mode.el b/sketch-mode.el
index 1fb2004..5deb44d 100644
--- a/sketch-mode.el
+++ b/sketch-mode.el
@@ -431,40 +431,73 @@ If value of variable ‘sketch-show-labels' is ‘layer',
create ..."
(define-key image-map "o" nil)
-(define-minor-mode sketch-mode
+(defvar sketch-mode-map
+ (let ((map (make-sparse-keymap))
+ (bindings `(([sketch down-mouse-1] . sketch-interactively)
+ ([sketch mouse-3] . sketch-text-interactively)
+ ([sketch C-S-drag-mouse-1] . sketch-crop)
+ ([sketch S-down-mouse-1] . sketch-select)
+ ("a" . sketch-set-action)
+ ("c" . sketch-set-colors)
+ ("w" . sketch-set-width)
+ ("sd" . sketch-set-dasharray)
+ ("fw" . sketch-set-font-with-keyboard)
+ ("fs" . sketch-set-font-size-by-keyboard)
+ ("fc" . sketch-set-font-color)
+ ("v" . sketch-keyboard-select)
+ ("m" . sketch-modify-object)
+ ("d" . sketch-remove-object)
+ ("tg" . sketch-toggle-grid)
+ ("ts" . sketch-toggle-snap)
+ ("tt" . sketch-toggle-toolbar)
+ ("." . sketch-toggle-key-hints)
+ ("tc" . sketch-toggle-coords)
+ ("l" . sketch-cycle-labels)
+ ("D" . sketch-show-definition)
+ ("u" . sketch-undo)
+ ("U" . sketch-redo)
+ ("S" . image-save)
+ (,(kbd "C-c C-c") . sketch-quick-insert-image)
+ ("?" . sketch-help)
+ ("Q" . sketch-quit))))
+ (dolist (b bindings)
+ (define-key map (car b) (cdr b)))
+ map))
+
+(define-derived-mode sketch-mode special-mode "sketch-mode"
"Create svg images using the mouse.
In sketch-mode buffer press \\[sketch-transient] to activate the
transient."
- :lighter "sketch-mode"
- :keymap
- `(
- ([sketch down-mouse-1] . sketch-interactively)
- ([sketch mouse-3] . sketch-text-interactively)
- ([sketch C-S-drag-mouse-1] . sketch-crop)
- ([sketch S-down-mouse-1] . sketch-select)
- ("a" . sketch-set-action)
- ("c" . sketch-set-colors)
- ("w" . sketch-set-width)
- ("sd" . sketch-set-dasharray)
- ("fw" . sketch-set-font-with-keyboard)
- ("fs" . sketch-set-font-size-by-keyboard)
- ("fc" . sketch-set-font-color)
- ("v" . sketch-keyboard-select)
- ("m" . sketch-modify-object)
- ("d" . sketch-remove-object)
- ("tg" . sketch-toggle-grid)
- ("ts" . sketch-toggle-snap)
- ("tt" . sketch-toggle-toolbar)
- ("." . sketch-toggle-key-hints)
- ("tc" . sketch-toggle-coords)
- ("l" . sketch-cycle-labels)
- ("D" . sketch-show-definition)
- ("u" . sketch-undo)
- ("U" . sketch-redo)
- ("S" . image-save)
- (,(kbd "C-c C-c") . sketch-quick-insert-image)
- ("?" . sketch-help)
- ("Q" . sketch-quit))
+ ;; :lighter "sketch-mode"
+ ;; :keymap
+ ;; `(
+ ;; ([sketch down-mouse-1] . sketch-interactively)
+ ;; ([sketch mouse-3] . sketch-text-interactively)
+ ;; ([sketch C-S-drag-mouse-1] . sketch-crop)
+ ;; ([sketch S-down-mouse-1] . sketch-select)
+ ;; ("a" . sketch-set-action)
+ ;; ("c" . sketch-set-colors)
+ ;; ("w" . sketch-set-width)
+ ;; ("sd" . sketch-set-dasharray)
+ ;; ("fw" . sketch-set-font-with-keyboard)
+ ;; ("fs" . sketch-set-font-size-by-keyboard)
+ ;; ("fc" . sketch-set-font-color)
+ ;; ("v" . sketch-keyboard-select)
+ ;; ("m" . sketch-modify-object)
+ ;; ("d" . sketch-remove-object)
+ ;; ("tg" . sketch-toggle-grid)
+ ;; ("ts" . sketch-toggle-snap)
+ ;; ("tt" . sketch-toggle-toolbar)
+ ;; ("." . sketch-toggle-key-hints)
+ ;; ("tc" . sketch-toggle-coords)
+ ;; ("l" . sketch-cycle-labels)
+ ;; ("D" . sketch-show-definition)
+ ;; ("u" . sketch-undo)
+ ;; ("U" . sketch-redo)
+ ;; ("S" . image-save)
+ ;; (,(kbd "C-c C-c") . sketch-quick-insert-image)
+ ;; ("?" . sketch-help)
+ ;; ("Q" . sketch-quit))
;; (,(kbd "C-c C-s") . sketch-transient))
(with-no-warnings
(if (boundp 'undo-tree-mode)
- [elpa] externals/sketch-mode updated (8e98379 -> ff42a58), ELPA Syncer, 2021/10/26
- [elpa] externals/sketch-mode 800cd1a 01/12: Create major mode (instead of minor mode); better for Spacemacs,
ELPA Syncer <=
- [elpa] externals/sketch-mode 570f977 03/12: Implement bbob(-transform), transform and rotate basics, ELPA Syncer, 2021/10/26
- [elpa] externals/sketch-mode 5631fef 06/12: Side-window behavior improvements (e.g. add no-other-win win-param), ELPA Syncer, 2021/10/26
- [elpa] externals/sketch-mode 55e1389 08/12: Change default grid format (grid-param 100, minor-grid-freq 5), ELPA Syncer, 2021/10/26
- [elpa] externals/sketch-mode ff42a58 12/12: Merge branch 'add-rotate-functionality', ELPA Syncer, 2021/10/26
- [elpa] externals/sketch-mode f356810 04/12: Use (temporary patched version of) list-colors-display, ELPA Syncer, 2021/10/26
- [elpa] externals/sketch-mode 443cc68 09/12: Add selection rotate-by-5 (right mouse button drag), ELPA Syncer, 2021/10/26
- [elpa] externals/sketch-mode bb2ee17 11/12: Add show XML command, ELPA Syncer, 2021/10/26
- [elpa] externals/sketch-mode 4fd7932 05/12: Fix (uncomment) labels, ELPA Syncer, 2021/10/26
- [elpa] externals/sketch-mode f901c50 10/12: Add/improve color keybindings (and fix show toolbar), ELPA Syncer, 2021/10/26
- [elpa] externals/sketch-mode 8111309 02/12: Add first sketch for simple rotate function, ELPA Syncer, 2021/10/26