branch: externals/ergoemacs-mode commit c9d4c1bb8958a8684554775ccb9d220ffc8fee60 Author: Walter Landry <wlan...@caltech.edu> Commit: Walter Landry <wlan...@caltech.edu>
Remove ergoemacs-package --- ergoemacs-macros.el | 43 +------------------------------------------ ergoemacs-test.el | 53 +++++++++-------------------------------------------- 2 files changed, 10 insertions(+), 86 deletions(-) diff --git a/ergoemacs-macros.el b/ergoemacs-macros.el index b9b2a81..2c13591 100644 --- a/ergoemacs-macros.el +++ b/ergoemacs-macros.el @@ -439,45 +439,6 @@ on the definition: ,(when (plist-get (nth 0 kb) :ergoemacs-require) `(ergoemacs-require ',(intern (plist-get (nth 0 kb) :name))))))) -(defmacro ergoemacs-package (name &rest keys-and-body) - "Defines a required package named NAME. - -KEYS-AND-BODY will be processed by -`ergoemacs-theme-component--parse-keys-and-body'. - -The documentation of the supported keys are in -`ergoemacs-theme-component'. - -The NAME will be assumed to be the :package-name keyword. - -By default, this package also set the :ergoemacs-require to t, -requiring the ergoemacs theme component immediately. To turn off -this feature, you can specify :ergoemacs-require nil in the body -of the `ergoemacs-package' macro. Another option is to use -`ergoemacs-autoload', which is the same as `ergoemacs-package' -with :ergoemacs-require set to nil." - (declare (indent 2)) - (let ((kb (make-symbol "body-and-plist")) - (plist (make-symbol "plist")) - (body (make-symbol "body")) - (doc (make-symbol "doc"))) - (setq kb (ergoemacs-theme-component--parse-keys-and-body keys-and-body nil t) - plist (nth 0 kb) - body (nth 1 kb)) - (when (equal (car body) '()) - (setq body (cdr body))) - (setq doc (if (stringp (car body)) (pop body) (symbol-name name))) - (unless (memq :ergoemacs-require plist) ;; Its a required theme component. - (setq plist (plist-put plist :ergoemacs-require name))) - (unless (plist-get plist :package-name) - (setq plist (plist-put plist :package-name name))) - (macroexpand-all - `(ergoemacs-theme-component ,name () - ,doc - ,@plist - ;; (require ',name) - ,@body)))) - (defmacro ergoemacs-autoload (name &rest keys-and-body) "Defines a required package named NAME. @@ -494,9 +455,7 @@ deferring the ergoemacs theme component until it is required by the user by either `ergoemacs-require' or turning it on/off in an ergoemacs-mode theme. To turn off this feature, you can specify :ergoemacs-require t in the body of the -`ergoemacs-autoload' macro. Another option is to use -`ergoemacs-package', which is the same as `ergoemacs-autoload' -with :ergoemacs-require set to t." +`ergoemacs-autoload' macro." (declare (indent 2)) (let ((kb (make-symbol "body-and-plist")) (plist (make-symbol "plist")) diff --git a/ergoemacs-test.el b/ergoemacs-test.el index 0163aaf..6cfe081 100644 --- a/ergoemacs-test.el +++ b/ergoemacs-test.el @@ -1417,47 +1417,15 @@ Should test issue #142" (when (file-exists-p w-file) (delete-file w-file)))) -(ert-deftest ergoemacs-test-issue-437 () - "Test windmove bindings should be set everywhere." - :tags '(:slow) - (let* ((emacs-exe (ergoemacs-emacs-exe)) - (w-file (expand-file-name "global-test" ergoemacs-dir)) - (temp-file (make-temp-file "ergoemacs-test" nil ".el"))) - (with-temp-file temp-file - (insert "(eval-when-compile (require 'ergoemacs-macros) (require 'cl-lib))" - (or (and (boundp 'wait-for-me) - "(setq debug-on-error t debug-on-quit t)") "") - "(ergoemacs-package foo \n" - ":bind* ((\"<M-left>\" . windmove-left)" - "(\"<M-right>\" . windmove-right)" - "(\"<M-up>\" . windmove-up)" - "(\"<M-down>\" . windmove-down)))" - "(setq ergoemacs-mode--start-p t)" - "(ergoemacs-mode 1)\n" - "(when (and (eq (key-binding (kbd \"<M-left>\")) 'windmove-left)\n" - " (eq (key-binding (kbd \"<M-right>\")) 'windmove-right)\n" - " (eq (key-binding (kbd \"<M-up>\")) 'windmove-up)\n" - " (eq (key-binding (kbd \"<M-down>\")) 'windmove-down))\n" - "(with-temp-file \"" w-file "\")\n" - " (message \"Passed\")" - " (insert \"Found\"))\n" - (or (and (boundp 'wait-for-me) "") - "(kill-emacs)"))) - (byte-compile-file temp-file) - (message "%s" - (shell-command-to-string - (format "%s %s -Q -L %s -l %s -l %s" - emacs-exe (if (boundp 'wait-for-me) "-debug-init" "--batch") - (expand-file-name (file-name-directory (locate-library "ergoemacs-mode"))) - (expand-file-name (file-name-sans-extension (locate-library "ergoemacs-mode"))) - temp-file))) - (should (file-exists-p w-file)) - (when (file-exists-p temp-file) - (delete-file temp-file)) - (when (file-exists-p (concat temp-file "c")) - (delete-file (concat temp-file "c"))) - (when (file-exists-p w-file) - (delete-file w-file)))) +;; Issue 437 +;; +;; Can override an ergoemacs binding when loading the new mode. For +;; example, this code changes M-left to M-right. +;; +;; (add-hook 'org-mode-hook +;; (lambda () +;; (define-key org-mode-map (kbd "<M-left>") 'org-metaright) +;; )) ;;; Not sure why this doesn't actually use `ergoemacs-test-major-mode-map'. (define-derived-mode ergoemacs-test-major-mode fundamental-mode "ET" @@ -1837,9 +1805,6 @@ hash appropriaetly." "(global-set-key (kbd \"C-f .\") 'isearch-forward-symbol-at-point))" "(ergoemacs-require 'reclaim-C-f)" "(setq icicle-search-key-prefix (kbd \"C-f\"))" - "(ergoemacs-package smart-mode-line :ensure t (sml/setup))" - "(ergoemacs-package srefactor :ensure t)" - "(ergoemacs-package virtualenvwrapper :ensure t)" "(defun test-freeze ()\n" "(interactive)\n" "(yes-or-no-p \"Are you sure you want to remove this file? \"))"