Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
16f2e9fc
Commit
16f2e9fc
authored
Jul 18, 2009
by
Chong Yidong
Browse files
* simple.el (region-active-p, use-region-p): Doc fix (Bug#3873).
parent
a6c2c80c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
lisp/ChangeLog
lisp/ChangeLog
+4
-0
lisp/simple.el
lisp/simple.el
+12
-10
No files found.
lisp/ChangeLog
View file @
16f2e9fc
2009-07-18 Chong Yidong <cyd@stupidchicken.com>
* simple.el (region-active-p, use-region-p): Doc fix (Bug#3873).
2009-07-18 Eli Zaretskii <eliz@gnu.org>
* desktop.el (desktop-buffers-not-to-save): Default value is nil.
...
...
lisp/simple.el
View file @
16f2e9fc
...
...
@@ -3559,23 +3559,25 @@ point otherwise."
(defun use-region-p ()
"Return t if the region is active and it is appropriate to act on it.
This is used by commands that act specially on the region under
Transient Mark mode. It returns t if and only if Transient Mark
mode is enabled, the mark is active, and the region is non-empty.
If `use-empty-active-region' is non-nil, it returns t even if the
region is empty.
Transient Mark mode.
For some commands, it may be appropriate to disregard the value
of `use-empty-active-region'; in that case, use `region-active-p'."
The return value is t provided Transient Mark mode is enabled and
the mark is active; and, when `use-empty-active-region' is
non-nil, provided the region is empty. Otherwise, the return
value is nil.
For some commands, it may be appropriate to ignore the value of
`use-empty-active-region'; in that case, use `region-active-p'."
(and (region-active-p)
(or use-empty-active-region (> (region-end) (region-beginning)))))
(defun region-active-p ()
"Return t if Transient Mark mode is enabled and the mark is active.
Most
commands
that act
on the region
if it is active and
Transient Mark mode is enabled, and on the text near point
otherwise, should use
`use-region-p' instead
. That
function
checks the value of `use-empty-active-region'
as well
."
Some
commands
act specially
on the region
when Transient Mark
mode is enabled. Usually, such commands should use
`use-region-p' instead
of this
function
, because `use-region-p'
also
checks the value of `use-empty-active-region'."
(and transient-mark-mode mark-active))
(defvar mark-ring nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment