branch: externals/ergoemacs-mode
commit 37fc1c84a066b526b0a76e7d06d9db0548fa9085
Author: Walter Landry <[email protected]>
Commit: Walter Landry <[email protected]>
Remove ergoemacs-theme-component--parse
---
ergoemacs-macros.el | 133 ----------------------------------------------------
ergoemacs-themes.el | 4 +-
2 files changed, 2 insertions(+), 135 deletions(-)
diff --git a/ergoemacs-macros.el b/ergoemacs-macros.el
index c5a1996..79ed47b 100644
--- a/ergoemacs-macros.el
+++ b/ergoemacs-macros.el
@@ -52,17 +52,6 @@ If SYMBOL is void, return nil"
(ignore-errors (symbol-value ,symbol))))
;; This shouldn't be called at run-time; This fixes the byte-compile warning.
-(fset 'ergoemacs-theme-component--parse
- #'(lambda(keys-and-body &optional skip-first)
- "Parse KEYS-AND-BODY, optionally skipping the name and
-documentation with SKIP-FIRST.
-
-Uses `ergoemacs-theme-component--parse-keys-and-body' and
- `ergoemacs-theme-component--parse-remaining'."
- (ergoemacs-theme-component--parse-keys-and-body
- keys-and-body
- 'ergoemacs-theme-component--parse-remaining
- skip-first)))
(fset 'ergoemacs-theme-component--parse-key-str
#'(lambda (str)
@@ -113,128 +102,6 @@ Uses `ergoemacs-theme-component--parse-keys-and-body' and
`(quote ,fun)))
fun))))
-;;;###autoload
-(defun ergoemacs-theme-component--parse-remaining (remaining)
- "Parse the REMAINING list, and convert:
-
-- `define-key' is converted to
- `ergoemacs-component-struct--define-key' and keymaps are quoted.
-
-- `global-set-key' is converted to
- `ergoemacs-component-struct--define-key' with keymap equal to
- `global-map'.
-
-- `bind-key' is converted to
- `ergoemacs-component-struct--define-key'.
-
-- `global-unset-key' is converted to
- `ergoemacs-component-struct--define-key' with keymap equal to
- `global-map' and function definition is nil.
-
-- `global-reset-key' is converted
- `ergoemacs-component-struct--define-key'
-
-- `setq' and `set' is converted to
- `ergoemacs-component-struct--set'
-
-- `add-hook' and `remove-hook' is converted to
- `ergoemacs-component-struct--set'
-
-- Mode initialization like (delete-selection-mode 1)
- or (delete-selection) is converted to
- `ergoemacs-component-struct--set'
-
-- Allows :version statement expansion to
- `ergoemacs-component-struct--new-version'
-
-- Adds with-hook syntax or (when -hook) or (when -mode) using
- `ergoemacs-component-struct--with-hook'
-
-Since `ergoemacs-mode' tries to distinguish return, escape, and
-tab from their ASCII equivalents In the GUI, the following Emacs
-keyboard codes are converted to keys that `ergoemacs-mode' can
-distinguish from the ASCII equivalents:
-
-- C-i (TAB) is changed to <C-i>
-
-- C-m (RET) is changed to <C-m>
-
-- C-[ (ESC) is changed to <C-]>"
- (let* ((last-was-version nil)
- (remaining
- (mapcar
- (lambda(elt)
- (cond
- (last-was-version
- (setq last-was-version nil)
- (if (stringp elt)
- `(ergoemacs-component-struct--new-version ,elt)
- `(ergoemacs-component-struct--new-version ,(symbol-name
elt))))
- ((ignore-errors (eq elt ':version))
- (setq last-was-version t)
- nil)
- ((ignore-errors (eq (nth 0 elt) 'global-reset-key))
- `(ergoemacs-component-struct--define-key 'global-map
,(ergoemacs-theme-component--parse-key (nth 1 elt)) nil))
- ((ignore-errors (eq (nth 0 elt) 'global-unset-key))
- `(ergoemacs-component-struct--define-key 'global-map
,(ergoemacs-theme-component--parse-key (nth 1 elt)) nil))
- ((ignore-errors (eq (nth 0 elt) 'set))
- ;; Currently doesn't support (setq a b c d ), but it should.
- `(ergoemacs-component-struct--set ,(nth 1 elt) '(lambda() ,(nth
2 elt))))
- ((ignore-errors (eq (nth 0 elt) 'add-hook))
- `(ergoemacs-component-struct--set ,(nth 1 elt) ,(nth 2 elt)
- (list t ,(nth 3 elt) ,(nth 4
elt))))
- ((ignore-errors (eq (nth 0 elt) 'remove-hook))
- `(ergoemacs-component-struct--set ,(nth 1 elt) ,(nth 2 elt)
- (list nil nil ,(nth 3 elt))))
- ((ignore-errors (memq (nth 0 elt) '(setq setq-default)))
- ;; in the theme component `setq' is equivalent to
- ;; `seq-default' since the component uses `set' and
`set-default'
- (let ((tmp-elt elt)
- (ret '()))
- (pop tmp-elt)
- (while (and (= 0 (mod (length tmp-elt) 2)) (< 0 (length
tmp-elt)))
- (push `(ergoemacs-component-struct--set (quote ,(pop
tmp-elt)) '(lambda() ,(pop tmp-elt))) ret))
- (push 'progn ret)
- ret))
- ((ignore-errors (string-match "-mode$" (symbol-name (nth 0
elt))))
- `(ergoemacs-component-struct--set (quote ,(nth 0 elt))
'(lambda() ,(nth 1 elt))))
- ((ignore-errors (eq (nth 0 elt) 'global-set-key))
- `(ergoemacs-component-struct--define-key 'global-map
,(ergoemacs-theme-component--parse-key (nth 1 elt))
-
,(ergoemacs-theme-component--parse-fun (nth 2 elt))))
-
- ;; (bind-key "C-c x" 'my-ctrl-c-x-command)
- ((ignore-errors (and (eq (nth 0 elt) 'bind-key)
- (= (length elt) 3)))
- `(ergoemacs-component-struct--define-key 'global-map (kbd
,(ergoemacs-theme-component--parse-key-str (nth 1 elt)))
-
,(ergoemacs-theme-component--parse-fun (nth 2 elt))))
-
- ;; (bind-key "C-c x" 'my-ctrl-c-x-command some-other-map)
- ((ignore-errors (and (eq (nth 0 elt) 'bind-key)
- (= (length elt) 4)))
- `(ergoemacs-component-struct--define-key (quote ,(nth 3 elt))
(kbd ,(ergoemacs-theme-component--parse-key-str (nth 1 elt)))
-
,(ergoemacs-theme-component--parse-fun (nth 2 elt))))
-
- ((ignore-errors (eq (nth 0 elt) 'define-key))
- (if (equal (nth 1 elt) '(current-global-map))
- `(ergoemacs-component-struct--define-key 'global-map
,(ergoemacs-theme-component--parse-key (nth 2 elt))
-
,(ergoemacs-theme-component--parse-fun (nth 3 elt)))
- `(ergoemacs-component-struct--define-key (quote ,(nth 1 elt))
,(ergoemacs-theme-component--parse-key (nth 2 elt))
-
,(ergoemacs-theme-component--parse-fun (nth 3 elt)))))
- ((or (ignore-errors (eq (nth 0 elt) 'with-hook))
- (and (ignore-errors (eq (nth 0 elt) 'when))
- (ignore-errors (string-match
"\\(-hook\\|-mode\\|^mark-active\\)$" (symbol-name (nth 1 elt))))))
- (let ((tmp (ergoemacs-theme-component--parse (cdr (cdr elt))
t)))
- `(ergoemacs-component-struct--with-hook
- ',(nth 1 elt) ',(nth 0 tmp)
- '(lambda () ,@(nth 1 tmp)))))
- ((ignore-errors (memq (nth 0 elt) '(dolist when unless if)))
- `(,(car elt) ,(car (cdr elt)) ,@(macroexpand-all
(ergoemacs-theme-component--parse-remaining (cdr (cdr elt))))))
- ((ignore-errors (memq (nth 0 elt) '(ergoemacs-advice defadvice)))
- (macroexpand-all elt))
- (t `(ergoemacs-component-struct--deferred ',elt))))
- remaining)))
- remaining))
-
(defvar ergoemacs-theme-component-properties
'(:bind
:bind-keymap
diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el
index 7c5e85e..38af446 100644
--- a/ergoemacs-themes.el
+++ b/ergoemacs-themes.el
@@ -424,8 +424,8 @@ calling any other ergoemacs-set-* function"
)
(defun ergoemacs-set-move-buffer (keymap)
- (ergoemacs-define-key keymap (kbd "M-n")
'ergoemacs-beginning-or-end-of-buffer)
- (ergoemacs-define-key keymap (kbd "M-N")
'ergoemacs-end-or-beginning-of-buffer)
+ (ergoemacs-define-key keymap (kbd "M-n") 'beginning-of-buffer)
+ (ergoemacs-define-key keymap (kbd "M-N") 'end-of-buffer)
(ergoemacs-define-key isearch-mode-map (kbd "M-n")
'isearch-beginning-of-buffer)
(ergoemacs-define-key isearch-mode-map (kbd "M-N") 'isearch-end-of-buffer)