branch: externals/ergoemacs-mode commit 4b6d159fe69e17686403d13979125d7875495d25 Author: Walter Landry <wlan...@caltech.edu> Commit: Walter Landry <wlan...@caltech.edu>
Remove command-loop and translate stuff --- ergoemacs-command-loop.el | 29 ------------------------- ergoemacs-theme-engine.el | 4 +--- ergoemacs-themes.el | 2 -- ergoemacs-translate.el | 54 ----------------------------------------------- 4 files changed, 1 insertion(+), 88 deletions(-) diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el index 131bd39..fb007a4 100644 --- a/ergoemacs-command-loop.el +++ b/ergoemacs-command-loop.el @@ -102,9 +102,6 @@ "Determines if mark was active before ergoemacs command loop.") -(defvar ergoemacs-command-loop--universal-functions '(universal-argument ergoemacs-universal-argument ergoemacs-command-loop--universal-argument) - "List of `ergoemacs-mode' recognized functions.") - (defvar ergoemacs-command-loop--next-key-hash (let ((hash (make-hash-table))) (puthash 'event-apply-shift-modifier (list '(shift) :force) hash) @@ -207,32 +204,6 @@ with this function." (add-hook 'ergoemacs-mode-startup-hook #'ergoemacs-command-loop--setup-quit-key) (add-hook 'ergoemacs-mode-shutdown-hook #'ergoemacs-command-loop--redefine-quit-key) -(defun ergoemacs-command-loop--universal-argument (&rest _ignore) - "`ergoemacs-mode' universal argument. -This is called through `ergoemacs-command-loop'" - (interactive) - (cond - ((not (ergoemacs-command-loop-p)) - ;; Command loop hasn't started. - (setq current-prefix-arg '(4)) - (ergoemacs-command-loop nil nil nil t)) - ((not current-prefix-arg) - (setq current-prefix-arg '(4) - ergoemacs-command-loop--universal t - ergoemacs-command-loop--exit :ignore-post-command-hook)) - ((listp current-prefix-arg) - ;; Change current prefix argument - (setq current-prefix-arg (list (* (nth 0 current-prefix-arg) 4)) - ergoemacs-command-loop--universal t - ergoemacs-command-loop--exit :ignore-post-command-hook)) - (t - (setq ergoemacs-command-loop--universal t - ergoemacs-command-loop--exit :ignore-post-command-hook)))) - -(defalias 'ergoemacs-read-key--universal-argument 'ergoemacs-command-loop--universal-argument) - -(defalias 'ergoemacs-universal-argument 'ergoemacs-command-loop--universal-argument) - (dolist (arg '((next-key-is-alt (meta)) (next-key-is-meta (meta)) (next-key-is-ctl (control)) diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el index 14eebdf..0303168 100644 --- a/ergoemacs-theme-engine.el +++ b/ergoemacs-theme-engine.el @@ -629,7 +629,7 @@ See also `find-function-recenter-line' and `find-function-after-hook'." (ergoemacs-beginning-or-end-of-buffer "↑ Top*") (ergoemacs-call-keyword-completion "↯ compl") (ergoemacs-close-current-buffer "x Close Buffer") - (ergoemacs-command-loop--universal-argument "Argument") + (universal-argument "Argument") (ergoemacs-compact-uncompact-block "fill/unfill ¶") (ergoemacs-copy-all "copy all") (ergoemacs-copy-line-or-region "copy") @@ -651,7 +651,6 @@ See also `find-function-recenter-line' and `find-function-after-hook'." (ergoemacs-paste "paste") (ergoemacs-paste-cycle "paste ↑") (pr-interface "Print") - (ergoemacs-read-key--universal-argument "Argument") (ergoemacs-select-current-block "Sel. Block") (ergoemacs-select-current-line "Sel. Line") (ergoemacs-select-text-in-quote "←quote→") @@ -661,7 +660,6 @@ See also `find-function-recenter-line' and `find-function-after-hook'." (ergoemacs-text-scale-normal-size "Reset Zoom") (ergoemacs-toggle-camel-case "tog. camel") (ergoemacs-toggle-letter-case "tog. case") - (ergoemacs-universal-argument "Argument") (execute-extended-command "M-x") (find-file "Open") (flyspell-auto-correct-word "flyspell") diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el index dcce886..81fb59d 100644 --- a/ergoemacs-themes.el +++ b/ergoemacs-themes.el @@ -597,8 +597,6 @@ calling any other ergoemacs-set-* function" (global-set-key [remap eshell] 'ergoemacs-eshell-here) (global-set-key [remap powershell] 'ergoemacs-powershell-here) (global-set-key [remap shell] 'ergoemacs-shell-here) - (global-set-key [remap universal-argument] - 'ergoemacs-command-loop--universal-argument) (global-set-key [remap describe-mode] 'ergoemacs-describe-major-mode) ) diff --git a/ergoemacs-translate.el b/ergoemacs-translate.el index 71b682d..c40ff1d 100644 --- a/ergoemacs-translate.el +++ b/ergoemacs-translate.el @@ -672,60 +672,6 @@ For keys, the list consists of: (key nil) (unchorded nil)) -(defvar ergoemacs-translate--setup-command-loop-regexp - "^\\(?:ergoemacs\\(?:-translate-\\)?\\)-\\(.*?\\)-\\(universal-argument\\|negative-argument\\|digit-argument\\|modal\\)$" - "Command loop command match/setup regular expression.") - -(defun ergoemacs-translate--setup-command-loop () - "Setup command loop. -To do anything, `this-command' must match -`ergoemacs-translate--setup-command-loop-regexp'. The first -match is the NAME of the translation, the second match is the -TYPE of command. This command will then -call (ergoemacs-command-loop-TYPE :NAME)." - (interactive) - (let ((command-str (symbol-name this-command)) - name type) - (save-match-data - (when (string-match ergoemacs-translate--setup-command-loop-regexp command-str) - (setq name (match-string 1 command-str) - type (match-string 2 command-str)) - (funcall (intern (concat "ergoemacs-command-loop--" type)) (intern (concat ":" name))))))) - -(defun ergoemacs-translate--setup-translation (&optional name) - "Setup translation functions and keymaps. -If NAME is nil, setup all translations. -When NAME is a symbol, setup the translation function for the symbol." - (if (not name) - (maphash - (lambda(name _item) - (ergoemacs-translate--setup-translation name)) - ergoemacs-translation-hash) - (let ((name-str (and (symbolp name) (substring (symbol-name name) 1)))) - (eval - (macroexpand - `(progn - (defvar ,(intern (concat "ergoemacs-translate--" name-str "-map")) (make-sparse-keymap) - ,(concat "Ergoemacs local map for translation :" - name-str - " while completing a key sequence.")) - (define-obsolete-variable-alias ',(intern (concat "ergoemacs-" name-str "-translation-local-map")) - ',(intern (concat "ergoemacs-translate--" name-str "-map")))))) - (ergoemacs-map-properties--label-map (intern (concat "ergoemacs-translate--" name-str "-map")) t) - (ergoemacs (symbol-value (intern (concat "ergoemacs-translate--" name-str "-map"))) :only-local-modifications-p t) - ;; - (dolist (type '("-universal-argument" "-negative-argument" - "-digit-argument" "-modal")) - (fset (intern (concat "ergoemacs-translate--" name-str type)) - 'ergoemacs-translate--setup-command-loop) - (fset (intern (concat "ergoemacs-" name-str type)) - 'ergoemacs-translate--setup-command-loop) - (when (string= type "-universal-argument") - (cl-pushnew (intern (concat "ergoemacs-" name-str type)) ergoemacs-command-loop--universal-functions) - (cl-pushnew (intern (concat "ergoemacs-translate--" name-str type)) ergoemacs-command-loop--universal-functions)))))) - -(add-hook 'ergoemacs-mode-intialize-hook #'ergoemacs-translate--setup-translation) - (defun ergoemacs-translate--create (&rest plist) "Create a translation from PLIST and return translation object." (let ((plist plist)