emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 03/287: Fix some of Stephan's patches.


From: Matthew Fidler
Subject: [elpa] 03/287: Fix some of Stephan's patches.
Date: Wed, 02 Jul 2014 14:44:06 +0000

mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.

commit 6e317147303388c2d49c46c37ff58f3958b88b90
Author: Matthew L. Fidler <address@hidden>
Date:   Fri May 23 17:25:56 2014 +0800

    Fix some of Stephan's patches.
---
 ergoemacs-advices.el      |   15 +++++++++------
 ergoemacs-mode.el         |    7 +++++--
 ergoemacs-theme-engine.el |   14 +++++++-------
 ergoemacs-unbind.el       |    2 +-
 4 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/ergoemacs-advices.el b/ergoemacs-advices.el
index 3b5501d..df0cf30 100644
--- a/ergoemacs-advices.el
+++ b/ergoemacs-advices.el
@@ -51,7 +51,8 @@
   "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
-   ((and ergoemacs-mode (eq hook 'pre-command-hook)
+   ((and (boundp 'ergoemacs-mode)
+         ergoemacs-mode (eq hook 'pre-command-hook)
          (boundp 'ergoemacs-hook-functions)
          (memq hook ergoemacs-hook-functions))
     (add-hook 'ergoemacs-pre-command-hook function append local))
@@ -62,7 +63,8 @@ If `pre-command-hook' is used and `ergoemacs-mode' is enabled 
add to `ergoemacs-
   "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
-   ((and ergoemacs-mode (eq hook 'pre-command-hook)
+   ((and (boundp 'ergoemacs-mode)
+         ergoemacs-mode (eq hook 'pre-command-hook)
          (boundp 'ergoemacs-hook-functions)
          (memq hook ergoemacs-hook-functions))
     (remove-hook 'ergoemacs-pre-command-hook function local))
@@ -105,7 +107,7 @@ Also adds keymap-flag for user-defined keys run with 
`run-mode-hooks'."
         (when ergoemacs-global-not-changed-cache
           (delete (key-description key) ergoemacs-global-not-changed-cache))
         (add-to-list 'ergoemacs-global-override-rm-keys key)
-        (when ergoemacs-mode
+        (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))
@@ -163,17 +165,17 @@ Also adds keymap-flag for user-defined keys run with 
`run-mode-hooks'."
 
 (defadvice cua-mode (around ergoemacs-activate-only-selection-mode (arg))
   "When `ergoemacs-mode' is enabled, enable `cua-selection-mode' instead of 
plain `cua-mode'."
-  (when ergoemacs-mode
+  (when (and (boundp 'ergoemacs-mode) ergoemacs-mode)
     (setq-default cua-enable-cua-keys nil))
   ad-do-it
-  (when ergoemacs-mode
+  (when (and (boundp 'ergoemacs-mode) ergoemacs-mode)
     (customize-mark-as-set 'cua-enable-cua-keys)))
 
 (ad-activate 'cua-mode)
 
 (defadvice icicle-mode (around ergoemacs-icicle-play (arg))
   "Allow `ergoemacs-mode' to play nicely with `icicle-mode'."
-  (let ((oee ergoemacs-mode))
+  (let ((oee (and (boundp 'ergoemacs-mode) ergoemacs-mode)))
     (when oee ;; Remove key bindings
       (ergoemacs-mode -1))
     ad-do-it
@@ -200,6 +202,7 @@ This require `ergoemacs-mode' to be enabled as well as
 "
       (cond
        ((and ergoemacs-helm-expand-user-dirs
+             (boundp 'ergoemacs-mode)
              ergoemacs-mode
              (helm-file-completion-source-p)
              (string-match "/\\(~[^/]*/\\)$" helm-pattern)
diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index 662dbd9..e6ea3dd 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -60,12 +60,15 @@
 
 ;;; Code:
 
-;; (eval-when-compile (require 'cl))
+(setq debug-on-error t)
+
+(eval-when-compile (require 'cl))
 ;; FIXME: Use cl-lib when available.
-(require 'cl)
+;;(require 'cl)
 (require 'easymenu)
 (require 'cua-base)
 (require 'cua-rect)
+(defvar ergoemacs-mode)
 
 (defvar ergoemacs-debug ""
   "Debugging for `ergoemacs-mode'.")
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index 1e4823e..e5cb1d6 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -1372,13 +1372,13 @@ added to the appropriate startup hooks.
       (mapc
        (lambda(hook)
          (when (string-match "hook\\'" (symbol-name hook))
-           (let ((fsym (intern (concat "ergoemacs-for-" (symbol-name hook)))))
-             (fset fsym
-                  `(lambda ()
-                     ,(format "Run `ergoemacs-theme-hook' for `%s'"
-                              (symbol-name hook))
-                     (ergoemacs-theme-hook ',hook))))
-           (funcall (if remove-p #'remove-hook #'add-hook) hook fsym)))
+           (fset (intern (concat "ergoemacs-for-" (symbol-name hook)))
+                 `(lambda ()
+                    ,(format "Run `ergoemacs-theme-hook' for `%s'"
+                             (symbol-name hook))
+                    (ergoemacs-theme-hook ',hook)))
+           (funcall (if remove-p #'remove-hook #'add-hook) hook
+                    (intern (concat "ergoemacs-for-" (symbol-name hook))))))
        (gethash (concat true-component ":minor-list")
                 ergoemacs-theme-component-hash)))))
 
diff --git a/ergoemacs-unbind.el b/ergoemacs-unbind.el
index bc946fc..0eb5181 100644
--- a/ergoemacs-unbind.el
+++ b/ergoemacs-unbind.el
@@ -754,7 +754,7 @@
                  elt
               ;; FIXME: Use `push' or `cl-pushnew' instead of
                ;; `add-to-list'.
-               (pushnew 'last fn)
+               (pushnew 'last fn :test #'equal)
                `(,first ,last))))
          ergoemacs-emacs-default-bindings))
   (ergoemacs-reset-global-where-is))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]