Function: rectangle-mark-mode

rectangle-mark-mode is an autoloaded, interactive and byte-compiled function defined in rect.el.gz.

Signature

(rectangle-mark-mode &optional ARG)

Documentation

Toggle the region as rectangular.

Activates the region if it's inactive and Transient Mark mode is on. Only lasts until the region is next deactivated.

This is a minor mode. If called interactively, toggle the Rectangle-Mark mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate the variable rectangle-mark-mode(var)/rectangle-mark-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

View in manual

Probably introduced at or before Emacs version 24.4.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/rect.el.gz
;;;###autoload
(define-minor-mode rectangle-mark-mode
  "Toggle the region as rectangular.

Activates the region if it's inactive and Transient Mark mode is
on.  Only lasts until the region is next deactivated."
  :lighter nil
  (rectangle--reset-crutches)
  (when rectangle-mark-mode
    (advice-add 'region-beginning :around #'rectangle--region-beginning)
    (advice-add 'region-end :around #'rectangle--region-end)
    (add-hook 'deactivate-mark-hook
              (lambda () (rectangle-mark-mode -1)))
    (unless (region-active-p)
      (push-mark (point) t t)
      (message "Mark set (rectangle mode)"))))