From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: region-active-p Date: Sat, 27 Oct 2007 06:53:19 +0900 Message-ID: <874pgd5yr4.fsf@uwakimon.sk.tsukuba.ac.jp> References: <200710191149.59775.andreas.roehler@online.de> <200710261017.33513.andreas.roehler@online.de> <877ilai63w.fsf@uwakimon.sk.tsukuba.ac.jp> <200710261303.13426.andreas.roehler@online.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1193435565 20773 80.91.229.12 (26 Oct 2007 21:52:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2007 21:52:45 +0000 (UTC) Cc: Richard Stallman , Reiner Steib , emacs-devel@gnu.org, Juri Linkov , Stefan Monnier , Miles Bader To: Andreas =?iso-8859-1?Q?R=F6hler?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 26 23:52:46 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IlX6j-0005L4-Gf for ged-emacs-devel@m.gmane.org; Fri, 26 Oct 2007 23:52:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IlX6a-00028a-RO for ged-emacs-devel@m.gmane.org; Fri, 26 Oct 2007 17:52:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IlX6X-00028A-LN for emacs-devel@gnu.org; Fri, 26 Oct 2007 17:52:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IlX6V-00027o-7O for emacs-devel@gnu.org; Fri, 26 Oct 2007 17:52:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IlX6U-00027h-Vv for emacs-devel@gnu.org; Fri, 26 Oct 2007 17:52:31 -0400 Original-Received: from mtps01.sk.tsukuba.ac.jp ([130.158.97.223]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IlX6K-00079R-EZ; Fri, 26 Oct 2007 17:52:20 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (unknown [130.158.99.156]) by mtps01.sk.tsukuba.ac.jp (Postfix) with ESMTP id 949F31535B3; Sat, 27 Oct 2007 06:52:18 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id C8EE91A2E12; Sat, 27 Oct 2007 06:53:19 +0900 (JST) In-Reply-To: <200710261303.13426.andreas.roehler@online.de> X-Mailer: VM 7.17 under 21.5 (beta28) "fuki" (+CVS-20070621) XEmacs Lucid X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:81803 Archived-At: Andreas R=F6hler writes: > > Right. However, if zmacs-region-extent is non-nil, it is possible > > that (region-beginning) equals (region-end),=20 >=20 > If this is possible--my little check rather > contradicts Try "C-SPC C-x C-x M-: (list (region-beginning) (region-end) zemacs-region-extent) RET" and you will see it is quite possible. > --than I consider it as not congruent with its name "extent" or a > bug. Please read the documentation on extents. Extents are *objects* with properties. For example, zero-length extents are the usual way to insert images in a window that are not attached to any particular buffer text. I see no particular reason why an extent of zero length should be impossible; it's the obviously limiting case. > At stake are AFAIU tree different and hierarchical conditions: >=20 > 1 region exists but has no extent > 2 region has extent but is not visible > 3 region is visible You're using "extent" as a property of the region. However, in XEmacs extents are Lisp_Objects, and the test for zmacs-region-extent is a test for whether such an object is attached to the region. In XEmacs 2 and 3 are almost the same, because the highlighting is carried by the extent. The region is visible if and only if the extent exists, with the sole exception of zero-length regions. (It would be possible to make them visible by adding an image to them.) > For appropriate names I held something like >=20 > 1 region-exist-p > 2 region-extent-p This is not compatible with XEmacs usage of the word "extent". You can use it as you like, of course, but if you choose to use it in this way you will find it very difficult to communicate with XEmacs developers. > 3 region-visible-p >=20 > In GNU Emacs these conditions are expressed by >=20 > 1 mark-active > 2 (and mark-active (not (eq (region-beginning) (region-end)))) > 3 (and transient-mark-mode mark-active > (not (eq (region-beginning) (region-end)))) >=20 > XEmacs has AFAIS >=20 > 1 region-exist-p >=20 > 3 region-active-p No. 1 and XEmacs's `region-exists-p' may be equivalent (but maybe not: if zmacs-regions is non-nil, then region exists if and only if it is active), but `region-active-p' is surely not equivalent to 3, because an active region can have zero length in the buffer. I'm not sure whether this is more useful than the definition you suggest, but that is the way XEmacs works. Also, for a region to be active, the buffer containing it must be current. I'm not sure why this test is necessary in XEmacs, or whether it would be useful in Emacs.