Emacs Right Click Context menu
Emacs Lisp
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Cask
README.org
demo-region-convert.gif
demo.gif
region-convert.el
right-click-context.el

README.org

Emacs Right Click Context menu

This package is in development.

A customizable context menu, call it from right-click of mouse. You can also use the context menu from keyboard.

Demo

demo.gif

Install

Cask

(depends-on "right-click-context" :git "git@github.com:zonuexe/right-click-context.git")

Setup

Easy way (use minor-mode)

(right-click-context-mode 1)

;; If want to use context menu by keyboard
;(define-key right-click-context-mode-map (kbd "C-c :") 'right-click-context-menu)

Use keymap

If you do not need the minor-mode, you can add a command to global keymap.

(global-set-key (kbd "<mouse-3>") 'right-click-context-menu)

(bind-key "C-c <mouse-3>" 'right-click-context-menu)
(bind-key "C-c :" 'right-click-context-menu)

Hide lighter

You will feel mode line is that it is complicated.

;; Use emoji
(setq right-click-context-mode-lighter "🐭")

;; hidden
(setq right-click-context-mode-lighter "")

Customize Menu

DSL

(require 'datetime-format nil t)
(let ((right-click-context-local-menu-tree
       (append right-click-context-global-menu-tree
               '(("Insert"
                  ("FooBar" :call (insert "FooBar"))
                  ("Current Time" :call (insert (datetime-format 'atom)) :if (fboundp 'datetime-format)))))))
  (right-click-context-menu))

Region Convert (region-convert.el)

demo-region-convert.gif

Interactive

  1. Select text region (mark region)
  2. M-x region-convert (or press binding key)
  3. Input function name (completing read)

Key binding

(global-set-key (kbd "C-c r") 'region-convert)

Use from Lisp

(region-convert 5 22 'upcase)