branch: externals/ergoemacs-mode commit d9b09beb8eeb3593045b98677a186a03aaad17a5 Author: Matthew Fidler <514778+mattfid...@users.noreply.github.com> Commit: Matthew Fidler <514778+mattfid...@users.noreply.github.com>
Make command loop play with unicode only --- ergoemacs-advice.el | 6 ++++++ ergoemacs-command-loop.el | 24 ++++++++++++------------ ergoemacs-themes.el | 6 +++++- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/ergoemacs-advice.el b/ergoemacs-advice.el index 7af3d24..7e37bef 100644 --- a/ergoemacs-advice.el +++ b/ergoemacs-advice.el @@ -170,6 +170,12 @@ TYPE is the type of translation installed." (when (eq 'ergoemacs-command-loop--shift-translate (key-binding (this-single-command-keys))) (setq this-command-keys-shift-translated t))) +(ergoemacs-advice read-key (&optional prompt) + "Drop single command keys for read-key." ; For compataiblity with emacs 25.5 + :type :before + (setq ergoemacs-command-loop--single-command-keys nil)) + + (provide 'ergoemacs-advice) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ergoemacs-advice.el ends here diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el index af73e3e..ab81351 100644 --- a/ergoemacs-command-loop.el +++ b/ergoemacs-command-loop.el @@ -201,7 +201,7 @@ ignore the post-command hooks.") (sexp :tag "Translated Type"))) :group 'ergoemacs-command-loop) -(defcustom ergoemacs-command-loop-blink-character (ergoemacs :unicode-or-alt "•" "·" "-") +(defcustom ergoemacs-command-loop-blink-character "•" "Blink character." :type '(choice (string :tag "Cursor") @@ -555,12 +555,12 @@ UNIVERSAL" (and (not universal) "") (or (and (string= ergoemacs-command-loop--read-key-prompt "") "") " ") (and ergoemacs-command-loop-blink-character - (or (and blink-on (ergoemacs :unicode-or-alt ergoemacs-command-loop-blink-character "-")) + (or (and blink-on ergoemacs-command-loop-blink-character) " ")) " ") (or (and (not universal) "") - (ergoemacs :unicode-or-alt "▸" ">")))) + "▸"))) (format "%s%s%s %s " (cond @@ -569,13 +569,13 @@ UNIVERSAL" (t current-prefix-arg)) (or (and (not universal) "") (and ergoemacs-command-loop-blink-character - (or (and blink-on (ergoemacs :unicode-or-alt ergoemacs-command-loop-blink-character "-")) + (or (and blink-on ergoemacs-command-loop-blink-character) " ")) " ") (or (and (listp current-prefix-arg) (format "%s" current-prefix-arg)) "") - (ergoemacs :unicode-or-alt "▸" ">")))) + "▸"))) (defun ergoemacs-command-loop--ensure-sane-variables () "Make sure that certain variables won't lock up Emacs. @@ -655,7 +655,7 @@ This is not done when the event is [ergoemacs-ignore]" ((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 "-") " *"))) + (string-match-p prompt (concat " *" ergoemacs-command-loop-blink-character " *"))) nil) (ergoemacs-command-loop--universal prompt) (ergoemacs-command-loop--echo-keystrokes-complete prompt) @@ -848,7 +848,7 @@ KEYS is the keys information" (or (and (string= ergoemacs-command-loop--read-key-prompt "") "") " ") (or (and universal "") (and ergoemacs-command-loop-blink-character - (or (and blink-on (ergoemacs :unicode-or-alt ergoemacs-command-loop-blink-character "-")) + (or (and blink-on ergoemacs-command-loop-blink-character) " ")) " ") trans @@ -993,7 +993,7 @@ read." ;; (string-match-p "\\<mouse\\>" tmp)) (format "%s%s%s" (ergoemacs :modifier-desc (nth 0 elt)) - (ergoemacs :unicode-or-alt "↔" "<->") + "↔" (ergoemacs :modifier-desc (nth 1 elt)))) double ", ")) "") @@ -1002,7 +1002,7 @@ read." (lambda(elt) (format "%s%s%s" (ergoemacs :modifier-desc (nth 0 elt)) - (ergoemacs :unicode-or-alt "→" "->") + "→" (ergoemacs :modifier-desc (nth 1 elt)))) trans ", "))) "")) (maphash @@ -1013,8 +1013,8 @@ read." (setq tmp (format "%s%s%s" (ergoemacs-key-description local-key) (if (eq (nth 1 item) :force) - (ergoemacs :unicode-or-alt "⇒" "=>") - (ergoemacs :unicode-or-alt "→" "->")) + "⇒" + "→") (ergoemacs :modifier-desc (nth 0 item)))) (push (elt local-key 0) mod-keys) (setq keys (or (and (not keys) tmp) @@ -2139,7 +2139,7 @@ TRANSLATED-KEY is what the assumed key is actually bound." (eq ergoemacs-echo-function :multi-key))) (ergoemacs-command-loop--temp-message "%s%s%s%s" (ergoemacs-key-description key) - (ergoemacs :unicode-or-alt "→" "->") + "→" lookup (or (and translated-key (format " (from %s)" (ergoemacs-key-description translated-key))) diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el index 1431ad3..3ee0f02 100644 --- a/ergoemacs-themes.el +++ b/ergoemacs-themes.el @@ -1329,6 +1329,10 @@ keys (e.g. M-O A == <up>) or regular M-O keybinding." (ergoemacs-define-key ergoemacs-override-keymap (kbd "<menu> n t") 'org-capture) (ergoemacs-define-key ergoemacs-override-keymap (kbd "<menu> n C-t") 'org-agenda) (ergoemacs-define-key ergoemacs-override-keymap (kbd "<menu> n T") 'org-agenda) + ;(define-key ergoemacs-translate--parent-map [f2] 'ergoemacs-command-loop--force-universal-argument) + ;(define-key ergoemacs-translate--parent-map (kbd "DEL") 'ergoemacs-command-loop--force-undo-last)) + ;(define-key ergoemacs-translate--parent-map (if (eq system-type 'windows-nt) [apps] [menu]) + ; 'ergoemacs-command-loop--swap-translation) ) (defun ergoemacs-install-standard-theme () @@ -1423,7 +1427,7 @@ keys (e.g. M-O A == <up>) or regular M-O keybinding." (ergoemacs-translation ctl-to-alt () "Ctl <-> Alt translation" - :text (lambda() (format "<Ctl%sAlt> " (ergoemacs :unicode-or-alt "↔" " to "))) + :text "<Ctl↔Alt> " :meta '(control) :control '(meta)