branch: externals/ergoemacs-mode commit b20b8ae3b8ae441636fb8c11fbf9902fc530a15d Author: Walter Landry <wlan...@caltech.edu> Commit: Walter Landry <wlan...@caltech.edu>
Remove :mode and unused macro properties --- ergoemacs-component.el | 35 +---------------------------------- ergoemacs-macros.el | 29 +---------------------------- ergoemacs-map-properties.el | 15 --------------- ergoemacs-map.el | 1 - 4 files changed, 2 insertions(+), 78 deletions(-) diff --git a/ergoemacs-component.el b/ergoemacs-component.el index dfe3160..db328d5 100644 --- a/ergoemacs-component.el +++ b/ergoemacs-component.el @@ -147,7 +147,7 @@ (defvar ergoemacs-component-struct--define-key-current nil) (defun ergoemacs-component-struct--parse-list (list function &rest args) - "Handle :bind and :mode LIST and call FUNCTION. + "Handle :bind LIST and call FUNCTION. The FUNCTION calls the with the first argument as the string piece and the second argument the symbol piece of the definition. @@ -191,32 +191,6 @@ binding assumes KEYMAP is `global-map'." (ergoemacs-component-struct--parse-list bind #'ergoemacs-component-struct--handle-bind-1 keymap))) -(defun ergoemacs-component-struct--handle-mode-1 (regexpr mode) - "Add (cons REGEXPR MODE) to `auto-mode-alist'. -Also autoload MODE. - -Requires `ergoemacs-component-struct--define-key-current' to be -an `ergoemacs-component-struct' object." - ;; (message "Handle Mode #2: %s %s" regexpr mode) - (when (ergoemacs-component-struct-p ergoemacs-component-struct--define-key-current) - (let* ((c (cons regexpr mode)) - (obj ergoemacs-component-struct--define-key-current) - (package-name (ergoemacs-component-struct-package-name obj))) - (ergoemacs-component-struct--deferred - `(unless (member ',c auto-mode-alist) - (push ',c auto-mode-alist))) - (when (and package-name mode (not (fboundp mode))) - ;; Create autoload. - (autoload mode (format "%s, a major mode defined in %s" mode package-name) nil t) - (setq c (cons mode package-name)) - (unless (member c (ergoemacs-component-struct-autoloads obj)) - (push (cons mode package-name) (ergoemacs-component-struct-autoloads obj))))))) - -(defun ergoemacs-component-struct--handle-mode (mode) - "Handle MODE list from :mode keyword." - (when mode - (ergoemacs-component-struct--parse-list mode #'ergoemacs-component-struct--handle-mode-1))) - (defun ergoemacs-component-struct--create-component (plist body file) "Create ergoemacs component. @@ -271,13 +245,6 @@ FILE is the file name where the component was created." (setf (ergoemacs-component-struct-defer ergoemacs-component-struct--define-key-current) t)) (ergoemacs-component-struct--handle-bind tmp 'ergoemacs-override-keymap) - ;; Handle :mode - (setq tmp (plist-get plist :mode)) - (when (and tmp (not defer-present-p) (not defer)) - (setq defer-present-p t defer t) - (setf (ergoemacs-component-struct-defer ergoemacs-component-struct--define-key-current) t)) - (ergoemacs-component-struct--handle-mode tmp) - ;; Handle :commands (setq tmp (plist-get plist :commands)) (when (and tmp (not defer-present-p) (not defer)) diff --git a/ergoemacs-macros.el b/ergoemacs-macros.el index 1f37478..66193e3 100644 --- a/ergoemacs-macros.el +++ b/ergoemacs-macros.el @@ -252,7 +252,6 @@ macro." :bind* :bind-keymap* :commands - :mode :interpreter :defer :demand @@ -333,7 +332,7 @@ This accepts the following keywords: :defer -- Should this package's loading be deferred? When using :commands :bind :bind* :bind-keymap :bind-keymap* - :mode or :interperter, defer is implied. When :package-name + or :interperter, defer is implied. When :package-name is nil, this dosen't do anything. :demand -- Prevent deferred loading in all cases @@ -349,19 +348,6 @@ This accepts the following keywords: By default this is nil. -:mode -- Modes to be added to `auto-mode-alist'. This can be a string such as: - - :mode \"\\\\.rb\\\\'\" - -or a list - - :mode (\"\\\\.rb\\\\'\" . ruby-mode) - -or a list of modes: - - :mode ((\"\\\\.R\\\\'\" . R.mode) - (\"\\\\.[Ss][Aa][Ss]\\\\'\" . SAS-mode)) - Borrowed from `use-package'. :package-name -- Name of package to load. When non-nil any key @@ -704,16 +690,6 @@ When arg1 can be a property. The following properties are supported: (if (>= 25 emacs-major-version) `(gui-set-selection ,@(cdr args)) `(x-set-selection ,@(cdr args)))) - ((and arg1 (symbolp arg1) (eq arg1 :width)) - `(ergoemacs-mode--eval-width ,arg2)) - ((and arg1 (symbolp arg1) (eq arg1 :mode-if) arg2) - `(ergoemacs-mode-line--if ,arg2 ,arg3 ,arg4)) - ((and arg1 (symbolp arg1) (memq arg1 '(:sep :separator))) - `(ergoemacs-mode-line--sep ,@(cdr args))) - ((and arg1 (symbolp arg1) (memq arg1 '(:sep-right :separator-right))) - `(ergoemacs-mode-line--sep 'right ,@(cdr args))) - ((and arg1 (symbolp arg1) (memq arg1 '(:sep-left :separator-left))) - `(ergoemacs-mode-line--sep 'left ,@(cdr args))) ((and arg1 (symbolp arg1) (eq arg1 :custom-p) (symbolp arg2)) (if (fboundp 'custom-variable-p) `(custom-variable-p ,arg2) @@ -749,9 +725,6 @@ When arg1 can be a property. The following properties are supported: (memq arg1 ergoemacs--map-properties-list)) `(,(intern (format "ergoemacs-map-properties--%s" (substring (symbol-name arg1) 1))) ,@(cdr args))) - ((and arg1 arg2 (eq arg2 :new-command) arg3) - ;; (ergoemacs arg1 :new-command 'next-line) - `(ergoemacs-map-properties--new-command ,arg1 ,arg3)) ((and arg1 (symbolp arg1) (eq arg1 :global-map)) `(ergoemacs-map-properties--original (or ergoemacs-saved-global-map global-map))) diff --git a/ergoemacs-map-properties.el b/ergoemacs-map-properties.el index eada251..a272116 100644 --- a/ergoemacs-map-properties.el +++ b/ergoemacs-map-properties.el @@ -1109,21 +1109,6 @@ KEYMAP can be an `ergoemacs-map-properties--key-struct' of the keymap as well." (setq ret (ergoemacs keymap :extract-lookup))) ret)) -(defun ergoemacs-map-properties--new-command (keymap command &optional relative-map) - "In KEYMAP, get the COMMAND equivalent binding relative to the RELATIVE-MAP." - (and command keymap - (let* (ret - (hash-table (ergoemacs (or relative-map ergoemacs-saved-global-map global-map) :where-is)) - (cmd-list (ergoemacs-gethash command hash-table))) - (if (not cmd-list) nil - (catch 'found-new - (dolist (key cmd-list) - (when (and (setq ret (lookup-key keymap key t)) - (or (and (commandp ret t) (not (memq ret ergoemacs-remap-ignore))) - (and (integerp ret) (setq ret nil)))) - (throw 'found-new t)) - (setq ret nil)) t) ret)))) - (defun ergoemacs-map-properties--revert-original (keymap &rest type) "Revert KEYMAP. diff --git a/ergoemacs-map.el b/ergoemacs-map.el index 8702952..241488b 100644 --- a/ergoemacs-map.el +++ b/ergoemacs-map.el @@ -102,7 +102,6 @@ (declare-function ergoemacs-map-properties--lookup "ergoemacs-map-properties") (declare-function ergoemacs-map-properties--map-fixed-plist "ergoemacs-map-properties") (declare-function ergoemacs-map-properties--map-list "ergoemacs-map-properties") -(declare-function ergoemacs-map-properties--new-command "ergoemacs-map-properties") (declare-function ergoemacs-map-properties--original "ergoemacs-map-properties") (declare-function ergoemacs-map-properties--original-user "ergoemacs-map-properties") (declare-function ergoemacs-map-properties--override-maps "ergoemacs-map-properties")