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: Tue, 23 Oct 2007 10:53:26 +0200
User-agent: KMail/1.9.5

Am Dienstag, 23. Oktober 2007 09:12 schrieb Richard Stallman:
>     (defun region-active-p ()
>       "..."
>       (and zmacs-regions zmacs-region-extent
>          (eq (current-buffer) (zmacs-region-buffer))))
>
> When commands in XEmacs call this, do they also test
> for a nonempty region?  Or do they operate on the region
> when it is empty?

No. AFAIU `zmacs-region-extent' checks for a physical extend, it may be nil or 
have a value, for example I got

,----
| `zmacs-region-extent' is a variable declared in Lisp.
|   -- loaded from "/home/speck/progarbeit/xemacs/veraendert/simple.el"
| 
| Value: #<extent [147998, 148021] 0x8e8aa24 in buffer simple.el>
| 
| Documentation:
| The extent of the zmacs region; don't use this. 
`----


`zmacs-regions' seems equivalent to
`transient-mark-mode':

,----
| `zmacs-regions' is a built-in boolean variable.
|   -- loaded 
from "/usr/src/packages/BUILD/xemacs-21.5.27.20060705/src/editfns.c"
| 
| Value: t
| 
| Documentation:
| *Whether LISPM-style active regions should be used.
| This means that commands which operate on the region (the area between the
| point and the mark) will only work while the region is in the ``active''
| state, which is indicated by highlighting.
`----

>
> I don't see any need for region-exists-p
> unless we want it specifically to run code in Emacs
> which was written for XEmacs.

AFAIS `region-exists-p' in XEmacs delivers precisely
the value `mark-active' in GNU has.

To provide respective symbols in both Emacsen would
save time for programmers.

Maybe it could be written in GNU somehow as

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

and in XEmacs

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


Andreas Röhler




reply via email to

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