[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/frog-menu 1bcc95f 01/12: Add menubar example
From: |
Clemens Radermacher |
Subject: |
[elpa] externals/frog-menu 1bcc95f 01/12: Add menubar example |
Date: |
Thu, 21 May 2020 11:15:11 -0400 (EDT) |
branch: externals/frog-menu
commit 1bcc95fbeb5a7bba498ec3d0689656a1e5483d0b
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>
Add menubar example
---
README.org | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/README.org b/README.org
index e8fc72f..a406b13 100644
--- a/README.org
+++ b/README.org
@@ -74,3 +74,32 @@ of (command . word) to be used by `flyspell-do-correct'."
Afterwards calling =M-x flyspell-correct-wrapper= will prompt you with a
=frog-menu=.
+And here is yet another example I use to navigate the menubar:
+
+#+begin_src elisp
+(defun frog-tmm ()
+ "Adapted from `counsel-tmm'."
+ (interactive)
+ (require 'tmm)
+ (run-hooks 'menu-bar-update-hook)
+ (setq tmm-table-undef nil)
+ (frog-tmm-prompt (tmm-get-keybind [menu-bar])))
+
+(defun frog-tmm-prompt (menu)
+ "Adapted from `counsel-tmm-prompt'."
+ (let (out
+ choice
+ chosen-string)
+ (setq tmm-km-list nil)
+ (map-keymap (lambda (k v) (tmm-get-keymap (cons k v))) menu)
+ (setq tmm-km-list (nreverse tmm-km-list))
+ (setq out (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))
+ (cond ((keymapp choice)
+ (frog-tmm-prompt choice))
+ ((and choice chosen-string)
+ (setq last-command-event chosen-string)
+ (call-interactively choice)))))
+#+end_src
- [elpa] externals/frog-menu updated (927ff01 -> 3d99c10), Clemens Radermacher, 2020/05/21
- [elpa] externals/frog-menu 1bcc95f 01/12: Add menubar example,
Clemens Radermacher <=
- [elpa] externals/frog-menu 06d5f17 03/12: Add mode menu entry command for example, Clemens Radermacher, 2020/05/21
- [elpa] externals/frog-menu ec633cd 02/12: Update example, Clemens Radermacher, 2020/05/21
- [elpa] externals/frog-menu 9b2fd00 06/12: Require tmm for example, Clemens Radermacher, 2020/05/21
- [elpa] externals/frog-menu 4ef6586 09/12: Give frog-menu-posframe-background-face a default background color, Clemens Radermacher, 2020/05/21
- [elpa] externals/frog-menu 3d99c10 12/12: Bump version, Clemens Radermacher, 2020/05/21
- [elpa] externals/frog-menu 6898f09 04/12: Fix example, Clemens Radermacher, 2020/05/21
- [elpa] externals/frog-menu 0430a4f 05/12: Update example, Clemens Radermacher, 2020/05/21
- [elpa] externals/frog-menu ac85040 07/12: Add posframe border option as suggested by #7, Clemens Radermacher, 2020/05/21
- [elpa] externals/frog-menu 94c99cf 08/12: Add support for all collection formats of completing-read, Clemens Radermacher, 2020/05/21
- [elpa] externals/frog-menu 94a24ff 10/12: Fix hash collection types, Clemens Radermacher, 2020/05/21