mlf176f2 pushed a commit to branch externals/ergoemacs-mode in repository elpa.
commit 77bac112ef19bb265ab8e3fb5f4dc88cc69c9714 Author: Matthew L. Fidler <[email protected]> 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)
