[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ergoemacs-mode 91b273c 236/325: Remove ergoemacs-compon
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ergoemacs-mode 91b273c 236/325: Remove ergoemacs-component-struct--define-key |
Date: |
Sat, 23 Oct 2021 18:49:01 -0400 (EDT) |
branch: externals/ergoemacs-mode
commit 91b273cd9b1757e74db526e94ec425ff792d393f
Author: Walter Landry <wlandry@caltech.edu>
Commit: Walter Landry <wlandry@caltech.edu>
Remove ergoemacs-component-struct--define-key
---
ergoemacs-component.el | 110 -------------------------------------------------
1 file changed, 110 deletions(-)
diff --git a/ergoemacs-component.el b/ergoemacs-component.el
index bda4235..02aeb5c 100644
--- a/ergoemacs-component.el
+++ b/ergoemacs-component.el
@@ -259,116 +259,6 @@ with the label, and then return."
(setf (ergoemacs-component-struct-map obj) map)
map)))
-(defun ergoemacs-component-struct--define-key (keymap key def &optional object)
- "In KEYMAP, define KEY to be DEF for OBJECT.
-If not specified, OBJECT is `ergoemacs-component-struct--define-key-current'."
- (cond
- ((and (not ergoemacs-component-struct--define-key-current) (not object)) ;;
Old
- (error "`ergoemacs-component-struct--define-key' is confused"))
- (t
- (let ((obj (or object ergoemacs-component-struct--define-key-current))
- (key (or (and (consp key) (memq (car key) '(kbd read-kbd-macro))
- (stringp (nth 1 key)) (read-kbd-macro (nth 1 key)))
- key))
- (def (ergoemacs-component-struct--define-key-get-def def)))
- (if (not (ergoemacs-component-struct-p obj))
- (error "OBJECT not a ergoemacs-component-structure")
- (setq key (vconcat key))
- (let* ((global-map-p (or (eq keymap 'global-map) (eq keymap
'ergoemacs-mode-map)
- (eq keymap 'ergoemacs-keymap)))
- (when-condition (ergoemacs-component-struct-when-condition obj))
- (hook (ergoemacs-component-struct-hook obj))
- (cur-map (or (and global-map-p (not when-condition)
- (ergoemacs-component-struct--ini-map obj))
- (and (not when-condition) (ergoemacs-gethash
keymap (ergoemacs-component-struct-maps obj)))
- (and global-map-p when-condition
(ergoemacs-gethash when-condition (ergoemacs-component-struct-cond-maps obj)))
- (and when-condition hook (ignore-errors
(ergoemacs-gethash keymap (ergoemacs-gethash hook
(ergoemacs-component-struct-hook-maps obj)))))))
- (package-name (ergoemacs-component-struct-package-name obj))
- fn-lst
- (key (or (and (vectorp key) key)
- (and (stringp key) (vconcat key))))
- tmp)
- (cond
- ((and (not cur-map) (not when-condition))
- (cl-pushnew keymap ergoemacs-map-properties--known-maps)
- (cl-pushnew keymap ergoemacs-map-properties--label-atoms-maps)
- (setq cur-map (make-sparse-keymap))
- (puthash keymap cur-map (ergoemacs-component-struct-maps obj)))
- ((and (not cur-map) when-condition global-map-p)
- (setq cur-map (make-sparse-keymap))
- (puthash when-condition cur-map
(ergoemacs-component-struct-cond-maps obj)))
- ((and (not cur-map) when-condition hook)
- (unless (ergoemacs-gethash hook
(ergoemacs-component-struct-hook-maps obj))
- (puthash hook (make-hash-table)
(ergoemacs-component-struct-hook-maps obj)))
- (cl-pushnew keymap ergoemacs-map-properties--known-maps)
- (cl-pushnew keymap ergoemacs-map-properties--label-atoms-maps)
- (setq cur-map (make-sparse-keymap))
- (puthash keymap cur-map (ergoemacs-gethash hook
(ergoemacs-component-struct-hook-maps obj)))))
- (cond
- ((and global-map-p (not when-condition) (not def) (setq tmp
(lookup-key (ergoemacs-component-struct-map obj) key))
- (not (integerp tmp)))
- ;; Remove the key from the keymap, do not set it to
- ;; nil; Its as if it was never defined
- (setq ergoemacs-component-struct--define-key-temp-map
(make-sparse-keymap))
- (ergoemacs-timing remove-global-map-map-keymap
- (ergoemacs-map-keymap
- (lambda (cur-key item)
- (if (consp cur-key)
- (ergoemacs-warn "Keymap range currently not supported %s
%s" cur-key item)
- (unless (eq item 'ergoemacs-prefix)
- (unless (equal key cur-key)
- (ergoemacs :define-key
ergoemacs-component-struct--define-key-temp-map cur-key item)))))
- cur-map))
- (setf (ergoemacs-component-struct-map obj)
- (copy-keymap
ergoemacs-component-struct--define-key-temp-map))
- (setq ergoemacs-component-struct--define-key-temp-map nil))
- ((and global-map-p (not (eq keymap 'global-map)) (not
when-condition) (not def));; Add to unbind keys
- (unless (member key (ergoemacs-component-struct-unbind obj))
- (push key (ergoemacs-component-struct-unbind obj))))
- ((and global-map-p (not when-condition) (not def)) ;; Add to
undefined keys
- (unless (member key (ergoemacs-component-struct-undefined obj))
- (push key (ergoemacs-component-struct-undefined obj))))
- ((and (not when-condition) (lookup-key cur-map key) (not def))
- ;; Remove the key from the keymap. Do not set it to nil.
- ;; Its as if it was never defined.
- (setq ergoemacs-component-struct--define-key-temp-map
(make-sparse-keymap))
- (ergoemacs-timing remove-local-keymap-map-keymap
- (ergoemacs-map-keymap
- (lambda (cur-key item)
- (if (consp cur-key)
- (message "Key range not supported %s, %s" cur-key item)
- (unless (eq item 'ergoemacs-prefix)
- (unless (equal key cur-key)
- (ergoemacs :define-key
ergoemacs-component-struct--define-key-temp-map cur-key item)))))
- cur-map))
- (puthash keymap (copy-keymap
ergoemacs-component-struct--define-key-temp-map)
(ergoemacs-component-struct-maps obj))
- (setq ergoemacs-component-struct--define-key-temp-map nil))
- ((and (consp def) (stringp (nth 0 def)) (symbolp (nth 1 def)) (eq
(nth 1 def) 'keymap))
- (ergoemacs :define-key cur-map key def))
- ((and (consp def) (symbolp (nth 1 def))) ;; (fn1 fn2 fn3 fn4)
- (unless (catch 'found-fn
- (dolist (cur-def def)
- (if (not (commandp cur-def t))
- (push cur-def fn-lst)
- (if (ergoemacs-keymapp cur-def)
- (ergoemacs :define-key cur-map key (copy-keymap
cur-def))
- (ergoemacs :define-key cur-map key cur-def))
- (throw 'found-fn t)))
- nil)
- ;; Not found
- (ergoemacs :define-key cur-map key `(lambda() (interactive)
(error ,(format "This key is undefined without one of the following functions:
%s" fn-lst)))))
- (when fn-lst ;; Test for later
- (push (list keymap key fn-lst)
- (ergoemacs-component-struct-dynamic-keys obj))))
- (t
- (if (ergoemacs-keymapp def)
- (ergoemacs :define-key cur-map key (copy-keymap def))
- (ergoemacs :define-key cur-map key def))
- (when (and package-name def (not (fboundp def)))
- ;; Create autoload.
- (autoload def (format "%s" package-name) nil t)
- (push (cons def package-name)
(ergoemacs-component-struct-autoloads obj)))))))))))
-
(defun ergoemacs-component-struct--clear-cache (struct-map)
"Clears STRUCT-MAP's cache of keymaps.
- [elpa] externals/ergoemacs-mode b6ad133 178/325: Remove M-O-fight test. It fails, but the keys work with manual tests, (continued)
- [elpa] externals/ergoemacs-mode b6ad133 178/325: Remove M-O-fight test. It fails, but the keys work with manual tests, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 6c909f3 185/325: Remove the shutdown hook, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 615ec31 186/325: Really remove the startup and shutdown hooks, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode d475686 187/325: Remove require stuff, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 209e00f 189/325: Fix a test, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode c484389 201/325: Lots of tweaks to the help svg, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 7553908 215/325: Remove set-layout, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 3433126 208/325: Move key binding help up and rename it, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 5c39790 227/325: Remove ergoemacs-theme, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode ec39c50 234/325: Remove more ergoemacs-theme-component--parse, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 91b273c 236/325: Remove ergoemacs-component-struct--define-key,
Stefan Monnier <=
- [elpa] externals/ergoemacs-mode b40fd9e 237/325: Remove ergoemacs-map--, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode c4b5f13 170/325: Fix dired problem, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 8856942 169/325: Cleanup, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 84a66e1 188/325: Remove the need for a theme, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode dde1804 200/325: Remove apps/menu from svg, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode a9f7caf 217/325: Remove major mode stuff, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 7ffdf3b 218/325: Cleanup, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 0a189f3 232/325: Minor cleanup, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode bc28407 019/325: Remove icicles tests, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 706e35e 024/325: Remove dead code, Stefan Monnier, 2021/10/23