Commit ad29e145 authored by Juri Linkov's avatar Juri Linkov
Browse files

* lisp/simple.el (region-bounds): New function.

(region-noncontiguous-p): Use it.
http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00044.html
parent 07d15164
......@@ -787,6 +787,11 @@ of an arbitrary function. This generalizes 'subr-arity' for functions
that are not built-in primitives. We recommend using this new
function instead of 'subr-arity'.
** New function 'region-bounds' can be used in the interactive spec
to provide region boundaries (for rectangular regions more than one)
to an interactively callable function as a single argument instead of
two separate arguments region-beginning and region-end.
+++
** 'parse-partial-sexp' state has a new element. Element 10 is
non-nil when the last character scanned might be the first character
......
......@@ -5410,11 +5410,15 @@ also checks the value of `use-empty-active-region'."
;; region is active when there's no mark.
(progn (cl-assert (mark)) t)))
(defun region-bounds ()
"Return the boundaries of the region as a list of (START . END) positions."
(funcall region-extract-function 'bounds))
(defun region-noncontiguous-p ()
"Return non-nil if the region contains several pieces.
An example is a rectangular region handled as a list of
separate contiguous regions for each line."
(> (length (funcall region-extract-function 'bounds)) 1))
(> (length (region-bounds)) 1))
(defvar redisplay-unhighlight-region-function
(lambda (rol) (when (overlayp rol) (delete-overlay rol))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment