branch: externals/ergoemacs-mode commit cac7b5628d54fbce1b4e564fdfd36dc6b989c228 Author: Matthew L. Fidler <514778+mattfid...@users.noreply.github.com> Commit: Matthew L. Fidler <514778+mattfid...@users.noreply.github.com>
Fix (string-match-p error) --- ergoemacs-advice.el | 7 ++++--- ergoemacs-command-loop.el | 14 +++++++++----- ergoemacs-component.el | 6 +++--- ergoemacs-map-properties.el | 4 +++- ergoemacs-test.el | 2 +- ergoemacs-themes.el | 4 +--- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ergoemacs-advice.el b/ergoemacs-advice.el index 0ba3770..e2320d3 100644 --- a/ergoemacs-advice.el +++ b/ergoemacs-advice.el @@ -320,6 +320,8 @@ command selected, instead of rerunning `smex' and :type :before (setq ergoemacs-command-loop--single-command-keys nil)) +(defvar ergoemacs-command-loop--history) + (defun ergoemacs-mode--undefined-advice (&optional type) "Advice for undefined. @@ -329,11 +331,10 @@ TYPE is the type of translation installed." (translation (ergoemacs-translate--get type)) (local-keymap (ergoemacs-translate--keymap translation)) (local-key (substring keys -1)) - modal-p - found) + modal-p) (when (setq modal-p (ergoemacs :modal-p)) (setq local-keymap (ergoemacs-translation-struct-keymap-modal modal-p))) - (if (setq found (lookup-key local-keymap local-key)) + (if (lookup-key local-keymap local-key) (let ((i 1)) ;; Setup history (setq ergoemacs-command-loop--history nil) (while (<= i (- (length keys) 1)) diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el index 7cc5197..8628dbb 100644 --- a/ergoemacs-command-loop.el +++ b/ergoemacs-command-loop.el @@ -224,6 +224,7 @@ If so return the translation." (if (not ergoemacs-command-loop--modal-stack) nil (let* ((translation (nth 0 ergoemacs-command-loop--modal-stack)) (always) + tmp ret) (when (ergoemacs-translation-struct-p translation) (setq always (ergoemacs-translation-struct-modal-always translation)) @@ -235,8 +236,8 @@ If so return the translation." ((and (not always) (catch 'match-modal (dolist (reg ergoemacs-modal-ignored-buffers) - (when (string-match reg (buffer-name)) - (throw 'match-modal t))) + ((when (and (setq tmp (buffer-name)) (stringp tmp) (string-match reg tmp)) + (throw 'match-modal t)))) nil))) (t (setq ret translation)))) @@ -581,9 +582,11 @@ This is not done when the event is [ergoemacs-ignore]" (and (setq ergoemacs-command-loop--last-event-time (float-time)) 0))) (prompt (cond ((not prompt) nil) + ((not (stringp prompt))) ((not (string= "" ergoemacs-command-loop--read-key-prompt)) prompt) ((or (string= prompt " ") - (string-match-p prompt (concat " *" (ergoemacs :unicode-or-alt ergoemacs-command-loop-blink-character "-") " *"))) nil) + (string-match-p prompt (concat " *" (ergoemacs :unicode-or-alt ergoemacs-command-loop-blink-character "-") " *"))) + nil) (ergoemacs-command-loop--universal prompt) (ergoemacs-command-loop--echo-keystrokes-complete prompt) ((not (numberp ergoemacs-command-loop-echo-keystrokes)) prompt) @@ -1186,6 +1189,7 @@ appropriate value based on the COMMAND." (defun ergoemacs-command-loop-full-p (&optional type) "Determines if the full command loop should be run. + TYPE is the type of command loop to check for. By default this is the :full command loop." (and @@ -1407,8 +1411,8 @@ FN-ARG-P can be nil, :drop-rest or :rest" (strip-args (ergoemacs-command-loop--mouse-command-drop-first args)) (rest-p (ergoemacs-command-loop--mouse-command-drop-first args :rest)) (drop-rest (ergoemacs-command-loop--mouse-command-drop-first args :drop-rest)) - (select-window-p (and form (string-match-p "^[*^]*[@]" form))) - (event-p (and form (string-match-p "^[*@^]*e" form))) + (select-window-p (and (stringp form) (string-match-p "^[*^]*[@]" form))) + (event-p (and (stringp form) (string-match-p "^[*@^]*e" form))) (new-form (and form (or (and (not event-p) form) (and event-p (replace-regexp-in-string "^\\([*@^]*\\)e\n*\\(.*\\)" "\\1\\2" form)))))) diff --git a/ergoemacs-component.el b/ergoemacs-component.el index ed4a9d4..3740e57 100644 --- a/ergoemacs-component.el +++ b/ergoemacs-component.el @@ -368,8 +368,8 @@ OBJECT is the ergoemacs component object, and defaults to (t (let ((obj (or object ergoemacs-component-struct--define-key-current)) (hook - (or (and (string-match-p "\\(-hook\\|-mode\\|\\`mark-active\\)\\'" (symbol-name when-condition)) when-condition) - (and (string-match-p "mode-.*" (symbol-name when-condition)) + (or (and (symbol-name when-condition) (string-match-p "\\(-hook\\|-mode\\|\\`mark-active\\)\\'" (symbol-name when-condition)) when-condition) + (and (symbol-name when-condition) (string-match-p "mode-.*" (symbol-name when-condition)) (save-match-data (intern-soft (replace-regexp-in-string @@ -734,7 +734,7 @@ closest `ergoemacs-theme-version' calculated from (when (and ret (functionp ret)) (funcall ret) (setq ret (ergoemacs-gethash map ergoemacs-component-hash)))) - (if (string-match-p "::" map) ret + (if (and map (string-match-p "::" map)) ret (ergoemacs-component-struct--lookup-closest ret version)))))) (defvar ergoemacs-component-struct--get-keymap nil) diff --git a/ergoemacs-map-properties.el b/ergoemacs-map-properties.el index b8717e8..f2d7e23 100644 --- a/ergoemacs-map-properties.el +++ b/ergoemacs-map-properties.el @@ -613,7 +613,9 @@ These keymaps are saved in `ergoemacs-map-properties--hook-map-hash'." (if tmp (if (eq tmp :override-p) t nil) (if (not (functionp (nth 2 key))) nil - (if (string-match-p ergoemacs-map-properties--deferred-hooks-directory-regexp (find-lisp-object-file-name (nth 2 key) (symbol-function (nth 2 key)))) + (if (and (setq tmp (find-lisp-object-file-name (nth 2 key) (symbol-function (nth 2 key)))) + (stringp tmp) + (string-match-p ergoemacs-map-properties--deferred-hooks-directory-regexp tmp)) (progn (puthash (nth 2 key) :deferred-p ergoemacs-map-properties--override-map-hash) nil) diff --git a/ergoemacs-test.el b/ergoemacs-test.el index 2682d43..c62330a 100644 --- a/ergoemacs-test.el +++ b/ergoemacs-test.el @@ -1149,7 +1149,7 @@ Should test issue #142" (when (file-exists-p w-file) (delete-file w-file)))) - +(defvar ergoemacs-component-hash) (ergoemacs-package icicles :ensure t) diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el index 1db511d..fdc7a13 100644 --- a/ergoemacs-themes.el +++ b/ergoemacs-themes.el @@ -829,9 +829,7 @@ (define-key isearch-mode-map (kbd "<escape>") 'isearch-abort) (when org-read-date-minibuffer-setup-hook - (define-key minibuffer-local-map (kbd "<escape>") 'minibuffer-keyboard-quit)) - :version 5.3.7 - (global-set-key (kbd "M-n") 'keyboard-quit)) + (define-key minibuffer-local-map (kbd "<escape>") 'minibuffer-keyboard-quit))) (ergoemacs-component apps () "General Apps Key Sequence"