emacs-devel
[Top][All Lists]
Advanced

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

Re: region-active-p


From: Richard Stallman
Subject: Re: region-active-p
Date: Fri, 26 Oct 2007 22:28:49 -0400

     > If there is no extension, just the mark set,
     > `zmacs-region-extent' is nil and `region-active-p'
     > returns nil therefor.

    Right.  However, if zmacs-region-extent is non-nil, it is possible
    that (region-beginning) equals (region-end), in which case there is
    (usually) no point in operating on the region.  It is that check that
    Richard is asking about AFAICS.

That really puzzles me.  It seems to say that in the following XEmacs code

    (defun fill-paragraph-or-region (arg)
      "Fill the current region, if it's active; otherwise, fill the paragraph.
    See `fill-paragraph' and `fill-region' for more information."
      (interactive "*P")
      (if (region-active-p)
          (call-interactively 'fill-region)
        (call-interactively 'fill-paragraph)))

with an active but empty region, region-active-p sometimes returns t
and sometimes returns nil.  (This is because zmacs-region-extent might
be nil, or might be t and empty.)

Do I understand correctly?





reply via email to

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