aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorChong Yidong2009-07-18 17:39:35 +0000
committerChong Yidong2009-07-18 17:39:35 +0000
commit16f2e9fca0eb8d7127b243d66acc36235432cd21 (patch)
tree0d31b3bb409092c9b680cafc3948b19969cf439a /lisp
parenta6c2c80cdd8abfb59abcb6c08b42115c50a4aa0b (diff)
downloademacs-16f2e9fca0eb8d7127b243d66acc36235432cd21.tar.gz
emacs-16f2e9fca0eb8d7127b243d66acc36235432cd21.zip
* simple.el (region-active-p, use-region-p): Doc fix (Bug#3873).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/simple.el22
2 files changed, 16 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 00e8e0bf598..390475000a1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12009-07-18 Chong Yidong <cyd@stupidchicken.com>
2
3 * simple.el (region-active-p, use-region-p): Doc fix (Bug#3873).
4
12009-07-18 Eli Zaretskii <eliz@gnu.org> 52009-07-18 Eli Zaretskii <eliz@gnu.org>
2 6
3 * desktop.el (desktop-buffers-not-to-save): Default value is nil. 7 * desktop.el (desktop-buffers-not-to-save): Default value is nil.
diff --git a/lisp/simple.el b/lisp/simple.el
index 50e4ac5b4a8..6ea572b68e5 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3559,23 +3559,25 @@ point otherwise."
3559(defun use-region-p () 3559(defun use-region-p ()
3560 "Return t if the region is active and it is appropriate to act on it. 3560 "Return t if the region is active and it is appropriate to act on it.
3561This is used by commands that act specially on the region under 3561This is used by commands that act specially on the region under
3562Transient Mark mode. It returns t if and only if Transient Mark 3562Transient Mark mode.
3563mode is enabled, the mark is active, and the region is non-empty.
3564If `use-empty-active-region' is non-nil, it returns t even if the
3565region is empty.
3566 3563
3567For some commands, it may be appropriate to disregard the value 3564The return value is t provided Transient Mark mode is enabled and
3568of `use-empty-active-region'; in that case, use `region-active-p'." 3565the mark is active; and, when `use-empty-active-region' is
3566non-nil, provided the region is empty. Otherwise, the return
3567value is nil.
3568
3569For some commands, it may be appropriate to ignore the value of
3570`use-empty-active-region'; in that case, use `region-active-p'."
3569 (and (region-active-p) 3571 (and (region-active-p)
3570 (or use-empty-active-region (> (region-end) (region-beginning))))) 3572 (or use-empty-active-region (> (region-end) (region-beginning)))))
3571 3573
3572(defun region-active-p () 3574(defun region-active-p ()
3573 "Return t if Transient Mark mode is enabled and the mark is active. 3575 "Return t if Transient Mark mode is enabled and the mark is active.
3574 3576
3575Most commands that act on the region if it is active and 3577Some commands act specially on the region when Transient Mark
3576Transient Mark mode is enabled, and on the text near point 3578mode is enabled. Usually, such commands should use
3577otherwise, should use `use-region-p' instead. That function 3579`use-region-p' instead of this function, because `use-region-p'
3578checks the value of `use-empty-active-region' as well." 3580also checks the value of `use-empty-active-region'."
3579 (and transient-mark-mode mark-active)) 3581 (and transient-mark-mode mark-active))
3580 3582
3581(defvar mark-ring nil 3583(defvar mark-ring nil