diff options
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/simple.el | 22 |
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 @@ | |||
| 1 | 2009-07-18 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * simple.el (region-active-p, use-region-p): Doc fix (Bug#3873). | ||
| 4 | |||
| 1 | 2009-07-18 Eli Zaretskii <eliz@gnu.org> | 5 | 2009-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. |
| 3561 | This is used by commands that act specially on the region under | 3561 | This is used by commands that act specially on the region under |
| 3562 | Transient Mark mode. It returns t if and only if Transient Mark | 3562 | Transient Mark mode. |
| 3563 | mode is enabled, the mark is active, and the region is non-empty. | ||
| 3564 | If `use-empty-active-region' is non-nil, it returns t even if the | ||
| 3565 | region is empty. | ||
| 3566 | 3563 | ||
| 3567 | For some commands, it may be appropriate to disregard the value | 3564 | The return value is t provided Transient Mark mode is enabled and |
| 3568 | of `use-empty-active-region'; in that case, use `region-active-p'." | 3565 | the mark is active; and, when `use-empty-active-region' is |
| 3566 | non-nil, provided the region is empty. Otherwise, the return | ||
| 3567 | value is nil. | ||
| 3568 | |||
| 3569 | For 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 | ||
| 3575 | Most commands that act on the region if it is active and | 3577 | Some commands act specially on the region when Transient Mark |
| 3576 | Transient Mark mode is enabled, and on the text near point | 3578 | mode is enabled. Usually, such commands should use |
| 3577 | otherwise, should use `use-region-p' instead. That function | 3579 | `use-region-p' instead of this function, because `use-region-p' |
| 3578 | checks the value of `use-empty-active-region' as well." | 3580 | also 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 |