All Projects → mrkkrp → ace-popup-menu

mrkkrp / ace-popup-menu

Licence: other
Replace GUI popup menu in Emacs with something more efficient

Programming Languages

emacs lisp
2029 projects
Nix
1067 projects

Projects that are alternatives of or similar to ace-popup-menu

avy-migemo
avy with migemo
Stars: ✭ 16 (-79.49%)
Mutual labels:  avy
SHPopup
A lightweight library for popup view
Stars: ✭ 36 (-53.85%)
Mutual labels:  popup-menu
Xpopup
🔥XPopup2.0版本重磅来袭,2倍以上性能提升,带来可观的动画性能优化和交互细节的提升!!!功能强大,交互优雅,动画丝滑的通用弹窗!可以替代Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner等组件,自带十几种效果良好的动画, 支持完全的UI和动画自定义!(Powerful and Beautiful Popup for Android,can absolutely replace Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner. With built-in animators , very easy to custom popup v…
Stars: ✭ 6,106 (+7728.21%)
Mutual labels:  popup-menu
Basepopup
Android下打造通用便捷的PopupWindow弹窗库
Stars: ✭ 4,603 (+5801.28%)
Mutual labels:  popup-menu
UIPopupMenu
一个自定义popupMenu效果,基于PopupWindow+LinearLayout实现,默认为QQ效果,支持icon、文字、文字颜色、文字单位、是否可点击等属性设置,并支持自定义背景
Stars: ✭ 23 (-70.51%)
Mutual labels:  popup-menu
avy-menu
An Avy-powered popup menu
Stars: ✭ 16 (-79.49%)
Mutual labels:  avy

Ace Popup Menu

License GPL 3 MELPA CI

Ace Popup Menu

This package allows its users to replace the GUI popup menu (created by x-popup-menu by default) with a little textual window. In this window, menu items are displayed and labeled with one or two letters.

Installation

The package is available via MELPA, so you can just type M-x package-install RET ace-popup-menu RET.

If you would like to install the package manually, download or clone it and put on Emacs' load-path. Then you can require it in your init file like this:

(require 'ace-popup-menu)

Usage

In order to replace the standard behavior of x-popup-menu, activate ace-popup-menu-mode in your configuration file, like this:

(ace-popup-menu-mode 1)

You can toggle/activate it either interactively or programmaticaly. The mode follows all usual Emacs Lisp conventions for minor modes, except it's always global. See the documentation for ace-popup-menu-mode for more information.

You can use the enhanced menu directly via ace-popup-menu, too. To use it you don't need to enable the minor mode. See documentation of the function for detailed information.

With Flyspell

A popular use case for this package is in conjunction with Flyspell. I personally use the following function for quick correction of misspellings:

(defun mk-flyspell-correct-previous (&optional words)
  "Correct word before point, reach distant words.

WORDS words at maximum are traversed backward until a misspelled
word is found.  If the argument WORDS is not specified, traverse
12 words by default.

Return T if a misspelled word is found and NIL otherwise.  Never
move the point."
  (interactive "P")
  (let* ((delta (- (point-max) (point)))
         (counter (string-to-number (or words "12")))
         (result
          (catch 'result
            (while (>= counter 0)
              (when (cl-some #'flyspell-overlay-p
                             (overlays-at (point)))
                (flyspell-correct-word-before-point)
                (throw 'result t))
              (backward-word 1)
              (setq counter (1- counter))
              nil))))
    (goto-char (- (point-max) delta))
    result))

It works nicely with ace-popup-menu-mode enabled.

Customization

You can ask Ace Popup Menu to show headers of individual panes (they are not shown in the original GUI popup menu):

(setq ace-popup-menu-show-pane-header t)

This variable can be changed via the customization interface as well.

This package is built on top of avy-menu, see its customization settings if you wish to change appearance of the menu itself.

Limitations

Here is something you may want to know:

  • The original x-popup-menu can take menu argument in the form of a keymap or a list of keymaps. This is currently not supported. If you run into a situation when this breaks something, please open an issue. Describe how to reproduce your problem and I'll try to fix it.

  • Some packages, such as flyspell, may test if they work under X-window system and refuse to call x-popup-menu if they think it's unavailable. There is nothing I can do about it, so it may be hard to use Ace Popup Menu in terminal, even though it's perfectly capable of functioning there.

  • Currently only horizontal format of menu items is available. This is because it's much easier to implement. This should not be a problem, though.

License

Copyright © 2015–present Mark Karpov

Distributed under GNU GPL, version 3.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].