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

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

[elpa] externals/objed 7ad08e2 052/216: Set C-h to work as usual


From: Stefan Monnier
Subject: [elpa] externals/objed 7ad08e2 052/216: Set C-h to work as usual
Date: Tue, 8 Jan 2019 12:29:10 -0500 (EST)

branch: externals/objed
commit 7ad08e2b0586826a5960c765c30d0e975a9f888a
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>

    Set C-h to work as usual
---
 objed.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/objed.el b/objed.el
index 547087c..99ca427 100644
--- a/objed.el
+++ b/objed.el
@@ -645,6 +645,7 @@ object as an argument."
     (define-key map (kbd "C-g") 'objed-quit)
     (define-key map "g" 'objed-quit)
     (define-key map (kbd "?") 'objed-show-top-level)
+    (define-key map (kbd "C-h") 'objed-which-key-C-h-dispatch)
     ;; TODO: support repeated invokation
     (define-key map (kbd "C-u") 'universal-argument)
     (define-key map (kbd "C-SPC") 'set-mark-command)
@@ -1190,6 +1191,19 @@ non-nil which is the case when called interactively."
     (when interactive
       (objed--describe-bindings objed-map))))
 
+(defun objed-which-key-C-h-dispatch ()
+  "If which-key popup is howing act as paging prefix.
+
+Otherwise act as ususal help prefix."
+  (interactive)
+  (if (which-key--popup-showing-p)
+      (which-key-C-h-dispatch)
+    (objed--exit-objed)
+    (setq unread-command-events
+          (append unread-command-events
+                  (listify-key-sequence (kbd "C-h"))))))
+
+
 (defun objed-describe-dispatch-bindings ()
   "Describe `objed-dispatch-map' bindings."
   (interactive)



reply via email to

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