This project defines a GNU Emacs
package, ipe ("i"nsert-"p"air-"e"dit). This package supplies
commands that are a more feature rich alternative to the standard M-(
Emacs keybinding, (insert-parentheses).
The ipe package supplies commands to insert (and also, update,
edit and delete) "PAIRs" within an Emacs buffer. These
PAIRs consist of OPEN and CLOSE strings that delimit text in
some fashion. (This could be a simple open and close parentheses, (
and ), or, it could be a more complex pair of strings that are used
within a programming language.)
The main entry point to the ipe package is the Emacs interactive
command ipe-insert-pair-edit. When executed, this command will
prompt the user to enter a MNEMONIC identifying a (customizable)
PAIR via the Emacs minibuffer.
Selection of a MNEMONIC will cause two overlays to be inserted into the buffer. These overlays represent the OPEN and CLOSE strings of the PAIR to be inserted.
These overlays can then be either: immediately inserted into the buffer, or, more importantly, moved about the buffer to correctly surround the text to be enclosed by the PAIR.
After adding the OPEN and CLOSE overlays into the buffer, the
ipe-insert-pair-edit command starts the Insert Pair Edit
minor mode (ipe-edit-mode)
The Insert Pair Edit (ipe) minor mode supplies commands to
move these OPEN and CLOSE overlays about the buffer. When
positioned correctly, these OPEN and CLOSE overlays can then
either be inserted <RET> (ipe-edit--insert-pair), or discarded
<C-g> (ipe-edit--abort).
The Insert Pair Edit (ipe) minor mode also supplies additional commands to:
-
Operate on the CONTENTS of the PAIR (i.e. the text between the OPEN and CLOSE overlays.) Text can be copied, deleted, replaced and case converted.

Customizations for the mode can be found under the ipe group.
The set of PAIRs available for editing are defined per-major-mode.
Example PAIR Definitions are supplied for:
- Markdown
- TexInfo
- HTML
Most of the functionality of the ipe package can also be accessed
via the Emacs menubar. If running Emacs in an environment
which supports menus, the ipe package can add an extra Pairs
sub-menu to the standard Emacs Edit menu item.
If the Pairs menu is enabled, the set of PAIRs listed under the
Pairs -> Insert PAIR / Update PAIR / Delete PAIR sub-menus
will change dynamically based upon the current buffer's major-mode.
Selecting a menu item under Insert PAIR will insert the selected
PAIR into the current buffer around POINT, and enter
ipe-edit-mode.
Selecting a menu item under Update PAIR will update the nearest
PAIR (of the given type) and enter ipe-edit-mode.
Selecting a menu item under Delete PAIR will delete the nearest
PAIR (of the given type) and remain in the current Emacs mode.
1a. Download the ipe package from MELPA:
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(package-initialize)
(package-install 'ipe)Or:
1b. Download the insert-pair-edit.el project source:
git clone https://github.com/BriansEmacs/insert-pair-edit.el <path-to-download-dir>/ipe
And add the following to your .emacs file:
(add-to-list 'load-path "<path-to-download-dir>/ipe")
(add-to-list 'load-path "<path-to-download-dir>/ipe/modes")- Add the following to your
.emacsfile:
(require 'ipe)
(global-set-key (kbd "M-(") 'ipe-insert-pair-edit)- You may also want to enable the
ipe"Pairs" menu:
(customize-save-variable 'ipe-menu-support-p t)- You may also want to bind the other
ipecommands:
(global-set-key (kbd "A-(") 'ipe-insert-pair-edit-update)
(global-set-key (kbd "H-(") 'ipe-insert-pair-edit-delete)- You may also want to load the "example" modal PAIR mappings:
(require 'ipe-markdown-mode)
(require 'ipe-texinfo-mode)
(require 'ipe-html-mode)After installation:
From the keyboard:
M-x ipe-help
M-x ipe-help-info
M-x ipe-options(If you have enabled ipe-menu-support-p) From the Emacs Edit menu:
Edit >
Pairs >
Options
Info
Help











