aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman2007-12-23 21:46:25 +0000
committerRichard M. Stallman2007-12-23 21:46:25 +0000
commitd03b9b3108cc27e5c8058788ffcb32068ec0d953 (patch)
tree5d3f1150f6263fe455a2fc0af82332536ad01d0b /lisp
parent55d77548e7e8cb10ca1690259f82ba541f7d9bd3 (diff)
downloademacs-d03b9b3108cc27e5c8058788ffcb32068ec0d953.tar.gz
emacs-d03b9b3108cc27e5c8058788ffcb32068ec0d953.zip
(region-active-p): New function.
(use-empty-active-region): New variable.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/simple.el22
2 files changed, 25 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9fb73a60a1c..76dfeb27f05 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12007-12-23 Richard Stallman <rms@gnu.org> 12007-12-23 Richard Stallman <rms@gnu.org>
2 2
3 * simple.el (region-active-p): New function.
4 (use-empty-active-region): New variable.
5
3 * dired-aux.el (dired): Load dired.el at run time too. 6 * dired-aux.el (dired): Load dired.el at run time too.
4 7
52007-12-23 Juri Linkov <juri@jurta.org> 82007-12-23 Juri Linkov <juri@jurta.org>
diff --git a/lisp/simple.el b/lisp/simple.el
index 22f29ab0464..2750fc85777 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3329,6 +3329,28 @@ store it in a Lisp variable. Example:
3329 (run-hooks 'deactivate-mark-hook) 3329 (run-hooks 'deactivate-mark-hook)
3330 (set-marker (mark-marker) nil))) 3330 (set-marker (mark-marker) nil)))
3331 3331
3332(defcustom use-empty-active-region nil
3333 "If non-nil, an active region takes control even if empty.
3334This applies to certain commands which, in Transient Mark mode,
3335apply to the active region if there is one. If the setting is t,
3336these commands apply to an empty active region if there is one.
3337If the setting is nil, these commands treat an empty active
3338region as if it were not active."
3339 :type 'boolean
3340 :version "23.1"
3341 :group 'editing-basics)
3342
3343(defun region-active-p ()
3344 "Return t if certain commands should apply to the region.
3345Certain commands normally apply to text near point,
3346but in Transient Mark mode when the mark is active they apply
3347to the region instead. Such commands should use this subroutine to
3348test whether to do that.
3349
3350This function also obeys `use-empty-active-region'."
3351 (and transient-mark-mode mark-active
3352 (or use-empty-active-region (> (region-end) (region-beginning)))))
3353
3332(defvar mark-ring nil 3354(defvar mark-ring nil
3333 "The list of former marks of the current buffer, most recent first.") 3355 "The list of former marks of the current buffer, most recent first.")
3334(make-variable-buffer-local 'mark-ring) 3356(make-variable-buffer-local 'mark-ring)