emacs-devel
[Top][All Lists]
Advanced

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

Re: region-active-p


From: Reiner Steib
Subject: Re: region-active-p
Date: Sun, 21 Oct 2007 22:54:08 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux)

On Sun, Oct 21 2007, Stephen J. Turnbull wrote:

> Stefan Monnier writes:
>  > > I agree.  But we need to decide whether (not (eq (region-beginning)
>  > > (region-end))) should be part of it.
>  > 
>  > I think it should be part of it.  [...]
>
> Please implement this interpretation.  It is the interpretation used
> by XEmacs since time immemorial (to me, anyway):
>
> ------------------------------------------------------------------------
> `region-active-p' is a compiled Lisp function
>   -- loaded from "/playpen/src/XEmacs/git-staging/lisp/simple.elc"
> (region-active-p)
>
> Documentation:
> Return non-nil if the region is active in the current buffer.
> If `zmacs-regions' is true, this is equivalent to `region-exists-p'.
> Otherwise, this function always returns false.
> ------------------------------------------------------------------------
>
> I believe `zmacs-regions' is the variable that `transient-mark-mode'
> emulates.

FWIW, Gnus has the following compatibility functions (gnus-ems.el):

(defun gnus-region-active-p ()
  "Say whether the region is active."
  (and (boundp 'transient-mark-mode)
       transient-mark-mode
       (boundp 'mark-active)
       mark-active))

(defun gnus-mark-active-p ()
  "Non-nil means the mark and region are currently active in this buffer."
  mark-active) ; aliased to region-exists-p in XEmacs.

When running Gnus in XEmacs, these are aliased:

gnus-xmas.el:433:  (defalias 'gnus-region-active-p 'region-active-p)
gnus-xmas.el:434:  (defalias 'gnus-mark-active-p 'region-exists-p)

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/





reply via email to

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