[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 09/287: Took out unknown signatory advice :(. Cleaned up advices.
From: |
Matthew Fidler |
Subject: |
[elpa] 09/287: Took out unknown signatory advice :(. Cleaned up advices. |
Date: |
Wed, 02 Jul 2014 14:44:09 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit ed131be2e1c63a083d8c2576bfc35007908e517d
Author: Matthew L. Fidler <address@hidden>
Date: Fri May 23 18:19:04 2014 +0800
Took out unknown signatory advice :(. Cleaned up advices.
---
ergoemacs-advices.el | 62 +++++--------------------------------------------
1 files changed, 7 insertions(+), 55 deletions(-)
diff --git a/ergoemacs-advices.el b/ergoemacs-advices.el
index e5a186c..5b2c57c 100644
--- a/ergoemacs-advices.el
+++ b/ergoemacs-advices.el
@@ -38,13 +38,14 @@
"Ergoemacs directory.")
(add-to-list 'load-path ergoemacs-dir)
(require 'ergoemacs-shortcuts)
+(require 'ergoemacs-unbind)
(defmacro ergoemacs-define-overrides (&rest body)
"Force the define-keys to work"
`(let ((ergoemacs-run-mode-hooks t))
,@body))
-(defadvice add-hook (around ergoemacs-add-hook-advice (hook function &optional
append local))
+(defadvice add-hook (around ergoemacs-add-hook-advice (hook function &optional
append local) activate)
"Advice to allow `this-command' to be set correctly before running
`pre-command-hook'
If `pre-command-hook' is used and `ergoemacs-mode' is enabled add to
`ergoemacs-pre-command-hook' instead."
(cond
@@ -55,9 +56,8 @@ If `pre-command-hook' is used and `ergoemacs-mode' is enabled
add to `ergoemacs-
(add-hook 'ergoemacs-pre-command-hook function append local))
(t
ad-do-it)))
-(ad-activate 'add-hook)
-(defadvice remove-hook (around ergoemacs-remove-hook-advice (hook function
&optional local))
+(defadvice remove-hook (around ergoemacs-remove-hook-advice (hook function
&optional local) activate)
"Advice to allow `this-command' to be set correctly before running
`pre-command-hook'.
If `pre-command-hook' is used and `ergoemacs-mode' is remove from
`ergoemacs-pre-command-hook' instead."
(cond
@@ -68,9 +68,8 @@ If `pre-command-hook' is used and `ergoemacs-mode' is remove
from `ergoemacs-pre
(remove-hook 'ergoemacs-pre-command-hook function local))
(t
ad-do-it)))
-(ad-activate 'remove-hook)
-(defadvice define-key (around ergoemacs-define-key-advice (keymap key def))
+(defadvice define-key (around ergoemacs-define-key-advice (keymap key def)
activate)
"This does the right thing when modifying `ergoemacs-keymap'.
Also adds keymap-flag for user-defined keys run with `run-mode-hooks'."
(let ((is-global-p (equal keymap (current-global-map))))
@@ -90,7 +89,6 @@ Also adds keymap-flag for user-defined keys run with
`run-mode-hooks'."
(unless (vectorp vk) ;; Do vector def too.
(setq vk (read-kbd-macro (key-description key) t))
(ergoemacs-global-set-key-after vk def))))))
-(ad-activate 'define-key)
(defvar ergoemacs-global-override-rm-keys '())
;;; Advices enabled or disabled with ergoemacs-mode
@@ -108,12 +106,11 @@ Also adds keymap-flag for user-defined keys run with
`run-mode-hooks'."
(when (and (boundp 'ergoemacs-mode) ergoemacs-mode)
(ergoemacs-theme-remove-key-list (list key) t))))))
-(defadvice local-set-key (around ergoemacs-local-set-key-advice (key command))
+(defadvice local-set-key (around ergoemacs-local-set-key-advice (key command)
activate)
"This let you use `local-set-key' as usual when `ergoemacs-mode' is enabled."
(if (and (fboundp 'ergoemacs-mode) ergoemacs-mode)
(ergoemacs-local-set-key key command)
ad-do-it))
-
(add-to-list 'ergoemacs-advices 'ergoemacs-local-set-key-advice)
(defadvice local-unset-key (around ergoemacs-local-unset-key-advice (key))
@@ -220,63 +217,18 @@ This require `ergoemacs-mode' to be enabled as well as
(ad-activate 'helm-ff-auto-expand-to-home-or-root)))
-(defadvice run-mode-hooks (around ergoemacs-run-hooks)
+(defadvice run-mode-hooks (around ergoemacs-run-hooks activate)
"`ergoemacs-mode' run-hooks advice helps user define keys properly.
This assumes any key defined while running a hook is a user-defined hook."
(let ((ergoemacs-run-mode-hooks t))
ad-do-it))
-(ad-activate 'run-mode-hooks)
-(defadvice turn-on-undo-tree-mode (around ergoemacs-undo-tree-mode)
+(defadvice turn-on-undo-tree-mode (around ergoemacs-undo-tree-mode activate)
"Make `ergoemacs-mode' and undo-tree compatible."
(ergoemacs-with-global
ad-do-it))
-(ad-activate 'turn-on-undo-tree-mode)
-
-(defcustom ergoemacs-check-new-buffer-auto-mode 't
- "Check `auto-mode-alist' for major mode for just created new buffer.
-If nil - use value of `major-mode'."
- :group 'ergoemacs-mode
- :type 'boolean)
-(defadvice set-buffer-major-mode (after ergoemacs-new-buffer-auto-mode
activate compile)
- "Select major mode for newly created buffer.
-Compare the `buffer-name' the entries in `auto-mode-alist'."
- (when ergoemacs-check-new-buffer-auto-mode
- (with-current-buffer (ad-get-arg 0)
- (if (and (buffer-name) (not buffer-file-name))
- (let ((name (buffer-name)) mode)
- ;; Remove backup-suffixes from file name.
- (setq name (file-name-sans-versions name))
- ;; Do not handle service buffers
- (while (and name (not (string-match "^\\*.+\\*$" name)))
- ;; Find first matching alist entry.
- (setq mode
- (if (memq system-type '(windows-nt cygwin))
- ;; System is case-insensitive.
- (let ((case-fold-search t))
- (assoc-default name auto-mode-alist
- 'string-match))
- ;; System is case-sensitive.
- (or
- ;; First match case-sensitively.
- (let ((case-fold-search nil))
- (assoc-default name auto-mode-alist
- 'string-match))
- ;; Fallback to case-insensitive match.
- (and auto-mode-case-fold
- (let ((case-fold-search t))
- (assoc-default name auto-mode-alist
- 'string-match))))))
- (if (and mode
- (consp mode)
- (cadr mode))
- (setq mode (car mode)
- name (substring name 0 (match-beginning 0)))
- (setq name nil))
- (when mode
- (set-auto-mode-0 mode t))))))))
(provide 'ergoemacs-advices)
- [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 <=
- [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, 2014/07/02
- [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