All Projects → mickeynp → Discover.el

mickeynp / Discover.el

Licence: gpl-3.0
Discover more of emacs with context menus!

Labels

Projects that are alternatives of or similar to Discover.el

Hledger Mode
An Emacs major mode for Hledger
Stars: ✭ 142 (-7.19%)
Mutual labels:  emacs
Spiral
Emacs Clojure IDE based on UNREPL
Stars: ✭ 146 (-4.58%)
Mutual labels:  emacs
Mastodon.el
Emacs client for Mastodon
Stars: ✭ 150 (-1.96%)
Mutual labels:  emacs
Monky
Magit for Hg
Stars: ✭ 142 (-7.19%)
Mutual labels:  emacs
Borg
Assimilate Emacs packages as Git submodules
Stars: ✭ 145 (-5.23%)
Mutual labels:  emacs
Emacs Bootstrap
Your on-the-fly Emacs development environment.
Stars: ✭ 147 (-3.92%)
Mutual labels:  emacs
Prism.el
Disperse Lisp forms (and other languages) into a spectrum of colors by depth
Stars: ✭ 141 (-7.84%)
Mutual labels:  emacs
Lunarymacs
Moon-based Emacs configuration.
Stars: ✭ 151 (-1.31%)
Mutual labels:  emacs
Docker Emacs
Run Emacs in docker containers!
Stars: ✭ 145 (-5.23%)
Mutual labels:  emacs
Writingwithemacs
Tips, Examples, and Resources for Writing with Emacs
Stars: ✭ 150 (-1.96%)
Mutual labels:  emacs
Mu4e Alert
Desktop notifications and modeline display for mu4e
Stars: ✭ 143 (-6.54%)
Mutual labels:  emacs
Webmacs
webmacs - keyboard driven (emacs key bindings) browser, https://webmacs.readthedocs.io/en/latest/
Stars: ✭ 145 (-5.23%)
Mutual labels:  emacs
Org Fragtog
Automatically toggle Org mode LaTeX fragment previews as the cursor enters and exits them
Stars: ✭ 149 (-2.61%)
Mutual labels:  emacs
Org Mode Workshop
Workshop for Org-mode with focus on todo-, project- and workflow-management
Stars: ✭ 141 (-7.84%)
Mutual labels:  emacs
Doom Snippets
The Doom Emacs snippets library
Stars: ✭ 150 (-1.96%)
Mutual labels:  emacs
Pipenv.el
A Pipenv porcelain inside Emacs.
Stars: ✭ 141 (-7.84%)
Mutual labels:  emacs
Monroe
Clojure nREPL client for Emacs
Stars: ✭ 146 (-4.58%)
Mutual labels:  emacs
Linum Relative
display relative line number in the left margin in emacs
Stars: ✭ 152 (-0.65%)
Mutual labels:  emacs
Emacs4cl
A 40 line ~/.emacs to quickly set up vanilla Emacs for Common Lisp programming
Stars: ✭ 151 (-1.31%)
Mutual labels:  emacs
Swiper
Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
Stars: ✭ 1,948 (+1173.2%)
Mutual labels:  emacs

discover.el

Discover more of emacs using context menus.

For in-depth information, including screenshots, please read my article on "discover.el: discover more of Emacs using context menus" here:

http://www.masteringemacs.org/articles/2013/12/21/discoverel-discover-emacs-context-menus/

Installation

Install it from MELPA. It's called discover.

Third-party module support

If you want to support discover.el you must use the function discover-add-context-menu, like so::

(discover-add-context-menu :context-menu '(isearch (description "Isearch, occur and highlighting") (lisp-switches ("-cf" "Case should fold search" case-fold-search t nil)) (lisp-arguments ("=l" "context lines to show (occur)" "list-matching-lines-default-context-lines" (lambda (dummy) (interactive) (read-number "Number of context lines to show: ")))) (actions ("Isearch" ("_" "isearch forward symbol" isearch-forward-symbol) ("w" "isearch forward word" isearch-forward-word)) ("Occur" ("o" "occur" occur)) ("More" ("h" "highlighters ..." makey-key-mode-popup-isearch-highlight)))) :bind "M-s")

This will create a keybinding M-s against discover-mode, making it generally available.

Under the hood a command is dynamically created to set the key when discover-mode-hook is called.

To create a context menu that is only available to a specific mode is very easy, and is essentially an extension of the example above. This time I will use dired to demonstrate this::

(discover-add-context-menu :context-menu '(dired ...) :bind "?" :mode 'dired-mode :mode-hook 'dired-mode-hook )

As you can see, there is not much else to it. This will bind another dynamic command, but this time it will be against the hook specified in the property :mode-hook. You must ensure you pick the correct mode hook; usually it is named after the major mode.

The string you give in :bind will be passed directly to kbd -- so no need to escape anything!

You may want to check if discover is present before you call discover-add-context-menu. The easiest way is to check for its presence, like so::

(when (featurep 'discover) (discover-add-context-menu ... ))

Useful Helper Commands

You can get the name of the command that reveals a given context menu by calling ``discover-get-context-menu-command-name``. If you just want to funcall the returned symbol, the function ``discover-show-context-menu`` will do this for you.


Long-term Goals
===============

#. Replace makey.el with the rewritten version proposed by the Magit team.
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].