[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 14/287: Fix `ergoemacs-populate-pre-command-hook'
From: |
Matthew Fidler |
Subject: |
[elpa] 14/287: Fix `ergoemacs-populate-pre-command-hook' |
Date: |
Wed, 02 Jul 2014 14:44:12 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit e9717d9ee189cf8ff3bc19ad4c1ecd62d43a64f5
Author: Matthew L. Fidler <address@hidden>
Date: Fri May 23 22:12:13 2014 +0800
Fix `ergoemacs-populate-pre-command-hook'
---
ergoemacs-mode.el | 54 +++++++++++++++++++++++++++-------------------------
1 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index bb2735c..fbd2bea 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -771,32 +771,34 @@ These hooks are deferred to make sure `this-command' is
set appropriately.")
(defun ergoemacs-populate-pre-command-hook (&optional depopulate)
"Populate `ergoemacs-pre-command-hook' with `pre-command-hook' values."
- (let (do-append ergoemacs-mode)
- (mapc
- (lambda(item)
- (if (eq item t)
- (setq do-append t)
- (unless (or depopulate (not (memq item ergoemacs-hook-functions)))
- (add-hook 'ergoemacs-pre-command-hook item do-append nil)
- (remove-hook 'pre-command-hook item nil))
- (when depopulate
- (add-hook 'pre-command-hook item do-append nil)
- (remove-hook 'ergoemacs-pre-command-hook item do-append))))
- (default-value (if depopulate 'ergoemacs-pre-command-hook
'pre-command-hook)))
- (unless (equal (default-value (if depopulate 'ergoemacs-pre-command-hook
'pre-command-hook))
- (symbol-value (if depopulate 'ergoemacs-pre-command-hook
'pre-command-hook)))
- (setq do-append nil)
- (mapc
- (lambda(item)
- (if (eq item t)
- (setq do-append t)
- (unless (or depopulate (not (memq item ergoemacs-hook-functions)))
- (add-hook 'ergoemacs-pre-command-hook item do-append t)
- (remove-hook 'pre-command-hook item t))
- (when depopulate
- (add-hook 'pre-command-hook item do-append t)
- (remove-hook 'ergoemacs-pre-command-hook item t))))
- (symbol-value (if depopulate 'ergoemacs-pre-command-hook
'pre-command-hook))))))
+ (let ((from-hook (or (and depopulate 'ergoemacs-pre-command-hook)
+ 'pre-command-hook))
+ do-append ergoemacs-mode)
+ (dolist (item (default-value from-hook))
+ (if (eq item t)
+ (setq do-append t)
+ (unless (or depopulate (not (memq item ergoemacs-hook-functions)))
+ (add-hook 'ergoemacs-pre-command-hook item do-append nil)
+ (remove-hook 'pre-command-hook item nil))
+ (when depopulate
+ (add-hook 'pre-command-hook item do-append nil)
+ (remove-hook 'ergoemacs-pre-command-hook item do-append))))
+ (save-excursion
+ (dolist (buf (buffer-list))
+ (with-current-buffer buf
+ (unless (equal (default-value from-hook)
+ (symbol-value from-hook))
+ (setq do-append nil)
+ (dolist (item (symbol-value from-hook))
+ (if (eq item t)
+ (setq do-append t)
+ (unless (or depopulate (not (memq item
ergoemacs-hook-functions)))
+ (add-hook 'ergoemacs-pre-command-hook item do-append t)
+ (remove-hook 'pre-command-hook item t))
+ (when depopulate
+ (add-hook 'pre-command-hook item do-append t)
+ (remove-hook 'ergoemacs-pre-command-hook item t))))))))))
+
(defvar ergoemacs-smart-functions
'(ergoemacs-shortcut
ergoemacs-shortcut-movement-no-shift-select ergoemacs-shortcut-movement
ergoemacs-read-key
- [elpa] branch externals/ergoemacs-mode updated (a36c916 -> 88c1d95), Matthew Fidler, 2014/07/02
- [elpa] 02/287: Merge branch 'externals/ergoemacs-mode' of git://git.sv.gnu.org/emacs/elpa, Matthew Fidler, 2014/07/02
- [elpa] 05/287: Fix diffs of patch., Matthew Fidler, 2014/07/02
- [elpa] 03/287: Fix some of Stephan's patches., Matthew Fidler, 2014/07/02
- [elpa] 07/287: Gitignore change., Matthew Fidler, 2014/07/02
- [elpa] 08/287: Move ergoemacs-advices, Matthew Fidler, 2014/07/02
- [elpa] 11/287: No longer wrap in unwind-protect, Matthew Fidler, 2014/07/02
- [elpa] 09/287: Took out unknown signatory advice :(. Cleaned up advices., Matthew Fidler, 2014/07/02
- [elpa] 10/287: Took out usless argument to ergoemacs-global-set-key-after, Matthew Fidler, 2014/07/02
- [elpa] 13/287: Activate advices in definitions., Matthew Fidler, 2014/07/02
- [elpa] 14/287: Fix `ergoemacs-populate-pre-command-hook',
Matthew Fidler <=
- [elpa] 12/287: no-ergoemacs-advice -> ergoemacs-ignore-advice, Matthew Fidler, 2014/07/02
- [elpa] 15/287: Use strinp consp and vectorp, Matthew Fidler, 2014/07/02
- [elpa] 18/287: Load ergoemacs-test for clean ergoemacs-mode load., Matthew Fidler, 2014/07/02
- [elpa] 06/287: Don't use symbol-value, Matthew Fidler, 2014/07/02
- [elpa] 16/287: ergoemacs--key-message, Matthew Fidler, 2014/07/02
- [elpa] 17/287: fix some let bindings., Matthew Fidler, 2014/07/02
- [elpa] 20/287: Add requires for byte-compile, Matthew Fidler, 2014/07/02
- [elpa] 21/287: Remove unused ergoemacs-define-key, Matthew Fidler, 2014/07/02
- [elpa] 22/287: Some cleanups for ergoemacs-setup-translation, Matthew Fidler, 2014/07/02
- [elpa] 19/287: Added `ergoemacs-read-key--echo-command`, Matthew Fidler, 2014/07/02