[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 113/117: Only check for globally defined keys when setting up erg
From: |
Matthew Fidler |
Subject: |
[elpa] 113/117: Only check for globally defined keys when setting up ergoemacs-mode keymaps |
Date: |
Fri, 25 Jul 2014 13:24:41 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit dd68353e07b2a42d135093125814871b6aedce76
Author: Matthew L. Fidler <address@hidden>
Date: Thu Jul 24 17:19:16 2014 -0500
Only check for globally defined keys when setting up ergoemacs-mode keymaps
---
ergoemacs-theme-engine.el | 42 +++++++++++++++++++++++++++++-------------
1 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index 01505cc..0bb99f6 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -1,4 +1,4 @@
-;; ergoemacs-theme-engine.el --- Engine for ergoemacs-themes -*-
lexical-binding: t -*-
+;; ergoemacs-theme-engine.el --- Engine for ergoemacs-themes -*-
lexical-binding: t -*-
;; Copyright © 2014 Free Software Foundation, Inc.
@@ -432,7 +432,7 @@ Key sequences starting with `ergoemacs-ignored-prefixes'
are not added."
(oset obj read-list read-list)
(define-key read-map new-key #'ergoemacs-read-key-default)
(oset obj read-map read-map))))))
-
+(defvar ergoemacs-define-map--deferred nil)
(defgeneric ergoemacs-define-map (obj key def &optional no-unbind)
"Method to define a key in an `ergoemacs-mode' key class.
@@ -572,6 +572,8 @@ This will return if the map object was modified.
(dolist (command def)
(if (not (commandp command t))
(push command tmp)
+ (when ergoemacs-define-map--deferred
+ (message "Found deferred %s, applying to
ergoemacs-mode" command))
(define-key map key-vect command)
(ergoemacs-define-map--cmd-list obj key-desc def)
(oset obj map map)
@@ -587,7 +589,8 @@ This will return if the map object was modified.
(defmethod ergoemacs-apply-deferred ((obj ergoemacs-fixed-map))
"Apply deferred keys.
Return if the map object has been modified."
- (let (ret)
+ (let (ret
+ (ergoemacs-define-map--deferred t))
(with-slots (deferred-keys) obj
(dolist (key-list deferred-keys)
(setq ret (or (ergoemacs-define-map obj (nth 0 key-list) (nth 1
key-list)) ret))))
@@ -753,7 +756,9 @@ Optionally use DESC when another description isn't found in
`ergoemacs-function-
(maphash
(lambda(_key fixed-obj)
(setq ret (or (ergoemacs-apply-deferred fixed-obj) ret)))
- keymap-hash))
+ keymap-hash)
+ (when ret
+ (oset obj keymap-hash (make-hash-table))))
ret))
(defclass ergoemacs-composite-map (eieio-named)
@@ -853,10 +858,12 @@ Optionally use DESC when another description isn't found
in `ergoemacs-function-
(defmethod ergoemacs-apply-deferred ((obj ergoemacs-composite-map))
(ergoemacs-composite-map--ini obj)
- (with-slots (fixed variable) obj
- (let ((fixed-changed (ergoemacs-apply-deferred fixed))
- (var-changed (ergoemacs-apply-deferred variable)))
- (or fixed-changed var-changed))))
+ (when (with-slots (fixed variable) obj
+ (let ((fixed-changed (ergoemacs-apply-deferred fixed))
+ (var-changed (ergoemacs-apply-deferred variable)))
+ (or fixed-changed var-changed)))
+ (oset obj keymap-hash (make-hash-table))
+ t))
(defmethod ergoemacs-copy-obj ((obj ergoemacs-composite-map))
(with-slots (fixed variable keymap-hash) obj
@@ -990,7 +997,9 @@ Assumes maps are orthogonal."
(setq ret (or (ergoemacs-apply-deferred composite-map) ret)))
maps)
(when ret ;; Reset fixed-maps hash
- (oset obj fixed-maps (make-hash-table)))
+ (oset obj hooks (make-hash-table))
+ (oset obj fixed-maps (make-hash-table))
+ (ergoemacs-theme-component-maps--save-hash obj))
ret)))
(defmethod ergoemacs-variable-layout-list ((obj
ergoemacs-theme-component-maps))
@@ -1213,7 +1222,9 @@ Assumes maps are orthogonal."
(let (ret)
(with-slots (map-list) obj
(dolist (map map-list)
- (setq ret (or (ergoemacs-apply-deferred map) ret))))
+ (setq ret (or (ergoemacs-apply-deferred map) ret)))
+ (when ret
+ (oset obj hooks (make-hash-table :test 'equal))))
ret))
(defmethod ergoemacs-theme-component-map-list-md5 ((obj
ergoemacs-theme-component-map-list))
@@ -1406,6 +1417,7 @@ FULL-SHORTCUT-MAP-P "
full-shortcut-map-p))))
(declare-function ergoemacs-shortcut-remap-list "ergoemacs-shortcuts.el")
+(defvar ergoemacs-theme--install-shortcut-item--global nil)
(defun ergoemacs-theme--install-shortcut-item (key args keymap lookup-keymap
full-shortcut-map-p)
(let (fn-lst)
@@ -1414,17 +1426,20 @@ FULL-SHORTCUT-MAP-P "
(setq fn-lst (ergoemacs-shortcut-remap-list (nth 0 args) lookup-keymap))
(if fn-lst
(ignore-errors
- (ergoemacs-theme-component--ignore-globally-defined-key key)
+ (when ergoemacs-theme--install-shortcut-item--global
+ (ergoemacs-theme-component--ignore-globally-defined-key key))
(define-key keymap key (nth 0 (nth 0 fn-lst))))
(when full-shortcut-map-p
(ignore-errors
- (ergoemacs-theme-component--ignore-globally-defined-key key)
+ (when ergoemacs-theme--install-shortcut-item--global
+ (ergoemacs-theme-component--ignore-globally-defined-key key))
(when (or (commandp (nth 0 args) t)
(keymapp (nth 0 args)))
(define-key keymap key (nth 0 args)))))))
(full-shortcut-map-p
(ignore-errors
- (ergoemacs-theme-component--ignore-globally-defined-key key)
+ (when ergoemacs-theme--install-shortcut-item--global
+ (ergoemacs-theme-component--ignore-globally-defined-key key))
(define-key keymap key
`(lambda(&optional arg)
(interactive "P")
@@ -1480,6 +1495,7 @@ FULL-SHORTCUT-MAP-P "
shortcut-list
rm-keys) (ergoemacs-get-fixed-map obj)
(let ((hook-map-list '())
+ (ergoemacs-theme--install-shortcut-item--global t)
;; (read-map (or read-map (make-spase-keymap)))
;; (shortcut-map (or shortcut-map (make-sparse-keymap)))
;; (map (or map (make-sparse-keymap)))
- [elpa] 104/117: Respect global keys only if true global map, (continued)
- [elpa] 104/117: Respect global keys only if true global map, Matthew Fidler, 2014/07/25
- [elpa] 107/117: Make sure the read-input-keymap has M-O and M-[. Possibly fix Issue #280, Matthew Fidler, 2014/07/25
- [elpa] 109/117: Fix extracting of prefixes, Matthew Fidler, 2014/07/25
- [elpa] 110/117: Add partial support of customize-set-variable, Matthew Fidler, 2014/07/25
- [elpa] 112/117: Add deferred keys for emulation-maps, Matthew Fidler, 2014/07/25
- [elpa] 111/117: Make sure ergoemacs-menus is loaded for any easymenu changes, Matthew Fidler, 2014/07/25
- [elpa] 114/117: Remap save-buffer to commit in log-edit-mode, Matthew Fidler, 2014/07/25
- [elpa] 116/117: Fix some undo bindings., Matthew Fidler, 2014/07/25
- [elpa] 115/117: Deferred keys now work for maps that are not modified, Matthew Fidler, 2014/07/25
- [elpa] 117/117: v5.14.7.3 - Fixed some undo key bindings to work better with undo-tree - Now deferred key bindings work: When a function is undefined, it isn't added to the keymap until it becomes defined - Settings called within an ergoemacs-mode theme component block now will use customize-set-variable when they are a customizable variable. - Added some more globally defined keys to better characterize what is globally changed. - When saving settings, only save to the customize file once. - Turn off ergoemacs-mode and turn on ergoemacs-ini-mode before saving the settings. This allows ergoemacs-mode to be called when the initialization file calls it, hopefully taking care of some issues with keys changing if ergoemacs-mode is loaded before it resets the globally bound keymaps. - Added visual-line-mode support to the smart functions - Ergoemacs-mode no longer uses composed keymaps as final keymaps, so it is possible to extend to emacs 23 (will require interim composed maps so this function will need to be back-ported). - Allow ergoemacs-mode line to be turned off - Most of ergoemacs-mode has been changed to lexical scoping - Added partial support of guide-key-mode - Ergoemacs keyboard quit now looks up functions based on major mode, nd if "Q" and "C-g" are bound to something interesting, Matthew Fidler, 2014/07/25
- [elpa] 113/117: Only check for globally defined keys when setting up ergoemacs-mode keymaps,
Matthew Fidler <=
- Prev by Date:
[elpa] 117/117: v5.14.7.3 - Fixed some undo key bindings to work better with undo-tree - Now deferred key bindings work: When a function is undefined, it isn't added to the keymap until it becomes defined - Settings called within an ergoemacs-mode theme component block now will use customize-set-variable when they are a customizable variable. - Added some more globally defined keys to better characterize what is globally changed. - When saving settings, only save to the customize file once. - Turn off ergoemacs-mode and turn on ergoemacs-ini-mode before saving the settings. This allows ergoemacs-mode to be called when the initialization file calls it, hopefully taking care of some issues with keys changing if ergoemacs-mode is loaded before it resets the globally bound keymaps. - Added visual-line-mode support to the smart functions - Ergoemacs-mode no longer uses composed keymaps as final keymaps, so it is possible to extend to emacs 23 (will require interim composed maps so this function will need to be back-ported). - Allow ergoemacs-mode line to be turned off - Most of ergoemacs-mode has been changed to lexical scoping - Added partial support of guide-key-mode - Ergoemacs keyboard quit now looks up functions based on major mode, nd if "Q" and "C-g" are bound to something interesting
- Next by Date:
[elpa] branch master updated (68ccff3 -> ca001a5)
- Previous by thread:
[elpa] 117/117: v5.14.7.3 - Fixed some undo key bindings to work better with undo-tree - Now deferred key bindings work: When a function is undefined, it isn't added to the keymap until it becomes defined - Settings called within an ergoemacs-mode theme component block now will use customize-set-variable when they are a customizable variable. - Added some more globally defined keys to better characterize what is globally changed. - When saving settings, only save to the customize file once. - Turn off ergoemacs-mode and turn on ergoemacs-ini-mode before saving the settings. This allows ergoemacs-mode to be called when the initialization file calls it, hopefully taking care of some issues with keys changing if ergoemacs-mode is loaded before it resets the globally bound keymaps. - Added visual-line-mode support to the smart functions - Ergoemacs-mode no longer uses composed keymaps as final keymaps, so it is possible to extend to emacs 23 (will require interim composed maps so this function will need to be back-ported). - Allow ergoemacs-mode line to be turned off - Most of ergoemacs-mode has been changed to lexical scoping - Added partial support of guide-key-mode - Ergoemacs keyboard quit now looks up functions based on major mode, nd if "Q" and "C-g" are bound to something interesting
- Next by thread:
[elpa] branch master updated (68ccff3 -> ca001a5)
- Index(es):