emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: region-active-p


From: Andreas Röhler
Subject: Re: region-active-p
Date: Mon, 29 Oct 2007 09:24:23 +0100
User-agent: KMail/1.9.5

Am Sonntag, 28. Oktober 2007 08:29 schrieb Stephen J. Turnbull:
> Richard Stallman writes:
>  > Thanks.  Now I understand what XEmacs does here.
>  >
>  > I propose to add an optional argument NONEMPTY to region-active-p
>  > which means "return nil if the region is empty".  How about it?
>
> No, thank you.  That makes the name inaccurate in XEmacs usage, is not
> backwardly compatible (unlike GNU, we support older versions of XEmacs
> which will not support that argument), is IMO less readable than using
> an explicit check where the optimization is appropriate and needed,
> and as far as I know is redundant in current XEmacsen because functions
> where the check is appropriate already do it (typically very quickly
> because they do it in C).
>
> A new API defaulting to the semantics of `region-exists-p' would be
> preferable.  (Not `region-active-p', 


For compatibility we should have both. 

(defun region-exists-p ()
  mark-active)

and

 (defun region-active-p (&optional allow-empty)
...

Andreas Röhler

> since the former makes sense to 
> the user regardless of whether zmacs-regions/transient-mark-mode is
> active.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]