[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 144/287: Generate image based on options
From: |
Matthew Fidler |
Subject: |
[elpa] 144/287: Generate image based on options |
Date: |
Wed, 02 Jul 2014 14:45:26 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit 77bac112ef19bb265ab8e3fb5f4dc88cc69c9714
Author: Matthew L. Fidler <address@hidden>
Date: Wed Jun 18 12:15:34 2014 -0500
Generate image based on options
---
ergoemacs-extras.el | 7 ++++++-
ergoemacs-functions.el | 6 +++++-
ergoemacs-theme-engine.el | 8 ++++++++
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/ergoemacs-extras.el b/ergoemacs-extras.el
index 89a7ad8..cfba5ef 100644
--- a/ergoemacs-extras.el
+++ b/ergoemacs-extras.el
@@ -1333,6 +1333,8 @@ Files are generated in the dir 〔ergoemacs-extras〕 at
`user-emacs-directory'.
(defvar ergoemacs-translation-from)
(defvar ergoemacs-inkscape)
(defvar ergoemacs-convert)
+(declare-function ergoemacs-theme-component-map-list-md5
"ergoemacs-theme-engine.el")
+(defvar ergoemacs-theme--object)
(defun ergoemacs-gen-svg (layout &optional file-name extra is-prefix)
"Generates a SVG picture of the layout
FILE-NAME represents the SVG template
@@ -1376,7 +1378,10 @@ IS-PREFIX tell ergoemacs if this is a prefix diagram."
(setq lay (symbol-value lay))
(setq file (expand-file-name
(concat "ergoemacs-layout-" layout
- (if is-prefix "-prefix" "") ".svg")
+ (if is-prefix "-prefix" "")
+ (if ergoemacs-theme--object
+ (concat "-"
(ergoemacs-theme-component-map-list-md5 ergoemacs-theme--object))
+ "")".svg")
extra-dir))
(with-temp-file file
;;(set-buffer-file-coding-system 'utf-8)
diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index 4fd325b..4fe43c2 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -249,7 +249,9 @@ C-u C=u deletes old byte compilde `ergoemacs-mode' files."
"\"")))
full-exe))
+(defvar ergoemacs-theme--object)
(declare-function ergoemacs-gen-svg "ergoemacs-extras.el")
+(declare-function ergoemacs-theme-component-map-list-md5
"ergoemacs-theme-engine.el")
(defun ergoemacs-cheat-sheet-file ()
"Cheet sheet file for ergoemacs."
(let ((var-dir "") extra-dir)
@@ -258,7 +260,9 @@ C-u C=u deletes old byte compilde `ergoemacs-mode' files."
(setq var-dir (concat ergoemacs-theme "/"))
(setq extra-dir (expand-file-name ergoemacs-theme extra-dir)))
(setq extra-dir (expand-file-name "ergo-layouts" extra-dir))
- (setq extra-dir (expand-file-name (concat "ergoemacs-layout-"
ergoemacs-keyboard-layout ".svg")))
+ (setq extra-dir (expand-file-name (concat "ergoemacs-layout-"
ergoemacs-keyboard-layout (if ergoemacs-theme--object
+
(concat "-" (ergoemacs-theme-component-map-list-md5
ergoemacs-theme--object))
+
"") ".svg")))
(when (not (file-exists-p extra-dir))
(ergoemacs-gen-svg ergoemacs-theme "kbd-ergo.svg" (concat var-dir
"ergo-layouts")))
extra-dir))
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index 4e8816e..739de00 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -1058,6 +1058,14 @@ Assumes maps are orthogonal."
:type hash-table))
"`ergoemacs-mode' theme-component maps")
+(defmethod ergoemacs-theme-component-map-list-md5 ((obj
ergoemacs-theme-component-map-list))
+ (with-slots (map-list) obj
+ (let (ret)
+ (dolist (map map-list)
+ (with-slots (object-name) map
+ (push object-name ret)))
+ (md5 (mapconcat #'(lambda(x) x) ret ",")))))
+
(defmethod ergoemacs-variable-layout-list ((obj
ergoemacs-theme-component-map-list))
(with-slots (map-list) obj
(let (ret)
- [elpa] 79/287: Fix final map to be a composed keymap that works with ergoemacs-rm-key, (continued)
- [elpa] 79/287: Fix final map to be a composed keymap that works with ergoemacs-rm-key, Matthew Fidler, 2014/07/02
- [elpa] 76/287: Only Issue 86 still persists., Matthew Fidler, 2014/07/02
- [elpa] 77/287: Ensure ergoemacs-global-override-rm-keys is a list of vectors, Matthew Fidler, 2014/07/02
- [elpa] 80/287: Reverse order to allow <apps> h z processing., Matthew Fidler, 2014/07/02
- [elpa] 82/287: Ignored keys shouldn't be in the shortcut hash, Matthew Fidler, 2014/07/02
- [elpa] 83/287: Allow ergoemacs-rm-key to remove a list, Matthew Fidler, 2014/07/02
- [elpa] 84/287: Break-out sending unread-command events, Matthew Fidler, 2014/07/02
- [elpa] 85/287: Keep track of shortcut key prefixes, Matthew Fidler, 2014/07/02
- [elpa] 81/287: Added version menu back, Matthew Fidler, 2014/07/02
- [elpa] 87/287: Remove "Z" in theme component, Matthew Fidler, 2014/07/02
- [elpa] 144/287: Generate image based on options,
Matthew Fidler <=
- [elpa] 86/287: Always suppress shortcuts in read-key-lookup, Matthew Fidler, 2014/07/02
- [elpa] 88/287: Apply defered variables/modes. Fix Issue #216, Matthew Fidler, 2014/07/02
- [elpa] 147/287: Allow emacs23 to fail., Matthew Fidler, 2014/07/02
- [elpa] 78/287: Faster ignore globally defined key, Matthew Fidler, 2014/07/02
- [elpa] 149/287: Backport `make-composed-keymap'., Matthew Fidler, 2014/07/02
- [elpa] 148/287: Fix more compiler issues and typos, Matthew Fidler, 2014/07/02
- [elpa] 145/287: pushnew instead of add-to-list, Matthew Fidler, 2014/07/02
- [elpa] 152/287: Remove emacs23 testing, Matthew Fidler, 2014/07/02
- [elpa] 150/287: Note that ergoemacs-mode requires emacs 24.1, Matthew Fidler, 2014/07/02
- [elpa] 153/287: Update expections., Matthew Fidler, 2014/07/02