[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 54/287: Maps seem correct now
From: |
Matthew Fidler |
Subject: |
[elpa] 54/287: Maps seem correct now |
Date: |
Wed, 02 Jul 2014 14:44:34 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit 174c7e0a544a7d70ad22bb0be00a2f5a3634c784
Author: Matthew L. Fidler <address@hidden>
Date: Thu Jun 5 19:34:03 2014 +0800
Maps seem correct now
---
ergoemacs-theme-engine.el | 34 +++++++++++++++++++++++++++-------
1 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index a59396f..25f705e 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -1126,10 +1126,22 @@ When REMOVE-P is non-nil, remove hooks
"Defines KEY to be DEF in KEYMAP for object
`ergoemacs-theme-component-maps--curr-component'."
(if (not (ergoemacs-theme-component-maps-p
ergoemacs-theme-component-maps--curr-component))
(warn "`ergoemacs-define-key' is meant to be called in a theme
definition.")
- (ergoemacs-define-map
- ergoemacs-theme-component-maps--curr-component
- (or (and (memq keymap '(global-map ergoemacs-keymap))
ergoemacs-theme-component-maps--global-map) keymap)
- key def)))
+ (let* ((ergoemacs-theme-component-maps--hook
+ (or
+ ergoemacs-theme-component-maps--hook
+ (and (not (memq keymap '(global-map ergoemacs-keymap)))
+ (string-match-p "\\(mode\\|\\(key\\)?map\\)" (symbol-name
keymap))
+ (intern (if (string-match "mode" (symbol-name keymap))
+ (replace-regexp-in-string "mode.*" "mode-hook"
(symbol-name keymap))
+ (replace-regexp-in-string "\\(key\\)?map"
"mode-hook" (symbol-name keymap)))))))
+ (map (or (and (memq keymap '(global-map ergoemacs-keymap))
+ (or ergoemacs-theme-component-maps--global-map
+ (and ergoemacs-theme-component-maps--hook
+ (string-match "-mode\\'" (symbol-name
ergoemacs-theme-component-maps--hook))
+ ergoemacs-theme-component-maps--hook)))
keymap)))
+ (ergoemacs-define-map
+ ergoemacs-theme-component-maps--curr-component
+ map key def))))
(defun ergoemacs-set (symbol newval)
(if (not (ergoemacs-theme-component-maps-p
ergoemacs-theme-component-maps--curr-component))
@@ -1155,12 +1167,12 @@ When REMOVE-P is non-nil, remove hooks
(defun ergoemacs-theme-component--with-hook (hook plist body)
;; Adapted from Stefan Monnier
(let ((ergoemacs-theme-component-maps--hook
- (or (and (string-match-p "-hook\\'" (symbol-name hook)) hook)
- (and (string-match-p "mode.*" (symbol-name hook))
+ (or (and (string-match-p "-\\(hook\\|mode\\)\\'" (symbol-name hook))
hook)
+ (and (string-match-p "mode-.*" (symbol-name hook))
(save-match-data
(intern-soft
(replace-regexp-in-string
- "-mode.*" "mode-hook"
+ "-mode-.*" "mode-hook"
(symbol-name hook)))))
(and (string-match-p "(key)?map" (symbol-name hook))
(save-match-data
@@ -1308,7 +1320,15 @@ additional parsing routines defined by PARSE-FUNCTION."
(list plist remaining)))
(defun ergoemacs-theme-component--create-component (plist body)
+ ;; Reset variables.
(let* ((ergoemacs-theme-component-maps--versions '())
+ (ergoemacs-theme-component-maps--always nil)
+ (ergoemacs-theme-component-maps--full-map nil)
+ (ergoemacs-theme-component-maps--modify-map nil)
+ (ergoemacs-theme-component-maps--global-map nil)
+ (ergoemacs-theme-component-maps--curr-component nil)
+ (ergoemacs-theme-component-maps--versions '())
+ (ergoemacs-theme-component-maps--hook nil)
(ergoemacs-theme-component-maps--curr-component
(ergoemacs-theme-component-maps
(plist-get plist ':name)
- [elpa] 31/287: Created composite map list, (continued)
- [elpa] 31/287: Created composite map list, Matthew Fidler, 2014/07/02
- [elpa] 42/287: Push shortcuts to the bottom. Should allow overrides., Matthew Fidler, 2014/07/02
- [elpa] 49/287: Bug fix for substitute-command-keys, Matthew Fidler, 2014/07/02
- [elpa] 43/287: Be more conservative with substituting key commands., Matthew Fidler, 2014/07/02
- [elpa] 46/287: Fix Issue #7, Matthew Fidler, 2014/07/02
- [elpa] 50/287: Another bug-fix for substitute-command-keys, Matthew Fidler, 2014/07/02
- [elpa] 52/287: Debugging ergoemacs-theme obect, Matthew Fidler, 2014/07/02
- [elpa] 51/287: more substitute-command-keys fixes, Matthew Fidler, 2014/07/02
- [elpa] 58/287: Fix misplaced paren, Matthew Fidler, 2014/07/02
- [elpa] 57/287: Added basic variable/mode initialization routines., Matthew Fidler, 2014/07/02
- [elpa] 54/287: Maps seem correct now,
Matthew Fidler <=
- [elpa] 48/287: Unstage the incompatible, Matthew Fidler, 2014/07/02
- [elpa] 55/287: Nicer theme debugging display, Matthew Fidler, 2014/07/02
- [elpa] 56/287: Better key replacements., Matthew Fidler, 2014/07/02
- [elpa] 64/287: Replace either M-x or <execute> with M-x code., Matthew Fidler, 2014/07/02
- [elpa] 63/287: Fixed mapvar issues., Matthew Fidler, 2014/07/02
- [elpa] 47/287: Stage some components, Matthew Fidler, 2014/07/02
- [elpa] 62/287: Playing with object more., Matthew Fidler, 2014/07/02
- [elpa] 53/287: Better debug and modify keymaps fix bugs, Matthew Fidler, 2014/07/02
- [elpa] 59/287: Fix typo, Matthew Fidler, 2014/07/02
- [elpa] 61/287: Ergoemacs-mode setup with object almost complete., Matthew Fidler, 2014/07/02