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

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

[elpa] externals/frog-menu 06d5f17 03/12: Add mode menu entry command fo


From: Clemens Radermacher
Subject: [elpa] externals/frog-menu 06d5f17 03/12: Add mode menu entry command for example
Date: Thu, 21 May 2020 11:15:12 -0400 (EDT)

branch: externals/frog-menu
commit 06d5f175d4dc82c182cd4215985872a37a697677
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Add mode menu entry command for example
---
 README.org | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/README.org b/README.org
index dc31a0d..42befb4 100644
--- a/README.org
+++ b/README.org
@@ -87,21 +87,13 @@ And here is yet another example I use to navigate the 
menubar:
          (lambda (item)
            (eq (cddr item) 'ignore)) tmm-km-list)))
 
-(defun frog-tmm ()
-  "Adapted from `counsel-tmm'."
-  (interactive)
-  (run-hooks 'menu-bar-update-hook)
-  (setq tmm-table-undef nil)
-  (frog-tmm-prompt (tmm-get-keybind [menu-bar])))
-
-
-(defun frog-tmm-prompt (menu)
+(defun frog-tmm-prompt (menu &optional item)
   "Adapted from `counsel-tmm-prompt'."
   (let (out
         choice
         chosen-string)
     (setq tmm-km-list (tmm-init-km-list+ menu))
-    (setq out (frog-menu-read "Menu: " (mapcar #'car tmm-km-list)))
+    (setq out (or item (frog-menu-read "Menu: " (mapcar #'car tmm-km-list))))
     (setq choice (cdr (assoc out tmm-km-list)))
     (setq chosen-string (car choice))
     (setq choice (cdr choice))
@@ -110,4 +102,18 @@ And here is yet another example I use to navigate the 
menubar:
           ((and choice chosen-string)
            (setq last-command-event chosen-string)
            (call-interactively choice)))))
+
+(defun frog-tmm ()
+  "Adapted from `counsel-tmm'."
+  (interactive)
+  (run-hooks 'menu-bar-update-hook)
+  (setq tmm-table-undef nil)
+  (frog-tmm-prompt (tmm-get-keybind [menu-bar])))
+
+(defun frog-tmm-mode (&optional mode)
+  "Adapted from `counsel-tmm'."
+  (interactive)
+  (run-hooks 'menu-bar-update-hook)
+  (setq tmm-table-undef nil)
+  (frog-tmm-prompt (tmm-get-keybind [menu-bar]) mode-name))
 #+end_src



reply via email to

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