emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ergoemacs-mode 59235bb 12/87: Allow ergoemacs-mode to h


From: Stefan Monnier
Subject: [elpa] externals/ergoemacs-mode 59235bb 12/87: Allow ergoemacs-mode to handle ending <apps> keys
Date: Wed, 14 Apr 2021 18:46:58 -0400 (EDT)

branch: externals/ergoemacs-mode
commit 59235bbe24a98d8b674776b3ba4f617d2c70313f
Author: Fidler <matthew.fidler@gmail.com>
Commit: Fidler <matthew.fidler@gmail.com>

    Allow ergoemacs-mode to handle ending <apps> keys
---
 ergoemacs-advice.el | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/ergoemacs-advice.el b/ergoemacs-advice.el
index 798aecb..de3453c 100644
--- a/ergoemacs-advice.el
+++ b/ergoemacs-advice.el
@@ -320,6 +320,25 @@ command selected, instead of rerunning `smex' and
   :type :before
   (setq ergoemacs-command-loop--single-command-keys nil))
 
+(ergoemacs-advice undefined ()
+  "Allow `ergoemacs-mode' to display keys, and intercept ending <apps> keys."
+  :type :around
+  (if (not ergoemacs-mode)
+      ad-do-it
+    (let ((keys (this-single-command-keys)))
+      (if (member (substring keys -1) '([apps] [menu]))
+         (ergoemacs-command-loop keys)
+       (ding)
+        (ergoemacs-command-loop--temp-message "%s is undefined!"
+                                              (ergoemacs-key-description 
(this-single-command-keys)))
+        (setq defining-kbd-macro nil)
+        (force-mode-line-update)
+        ;; If this is a down-mouse event, don't reset prefix-arg;
+        ;; pass it to the command run by the up event.
+       (setq prefix-arg
+              (when (memq 'down (event-modifiers last-command-event))
+                current-prefix-arg))))))
+
 (provide 'ergoemacs-advice)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; ergoemacs-advice.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]