GNU bug report logs - #1185
23.0.60; Doc string of region-active-p considered unhelpful

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Thu, 16 Oct 2008 19:50:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 1185-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 1185-done <at> debbugs.gnu.org
Subject: 23.0.60; Doc string of region-active-p considered unhelpful
Date: Tue, 21 Oct 2008 13:04:40 -0400
> "C-h f region-active-p RET" produces the following documentation:
>
>   Return t if Transient Mark mode is enabled and the mark is active.
>   This is NOT the best function to use to test whether a command should
>   operate on the region instead of the usual behavior -- for that,
>   use `use-region-p'.
>
> This is not really helpful: it does not tell why would a Lisp program
> want to use this function.  Are there any circumstances where this
> function is useful, or do we keep it for compatibility reasons?

The reason to use use-region-p is because that checks whether the region
is empty and compares that with use-empty-active-region.  That's what we
want for most commands that have the behavior "do X on the region if
it's active".  But in some circumstances, we don't care about whether or
not the region is empty; e.g., some commands want to deactivate the mark
if region-active-p is non-nil.

I checked in a doc fix.




This bug report was last modified 16 years and 272 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.