From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas =?iso-8859-1?q?R=F6hler?= Newsgroups: gmane.emacs.devel Subject: Re: region-active-p Date: Sun, 21 Oct 2007 21:22:56 +0200 Message-ID: <200710212122.57935.andreas.roehler@online.de> References: <200710191149.59775.andreas.roehler@online.de> <87lk9wseuf.fsf@catnip.gol.com> 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 1192994268 6687 80.91.229.12 (21 Oct 2007 19:17:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Oct 2007 19:17:48 +0000 (UTC) Cc: Juri Linkov , emacs-devel@gnu.org, Richard Stallman , Stefan Monnier To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 21 21:17:48 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 1IjgJ1-0000jB-Lv for ged-emacs-devel@m.gmane.org; Sun, 21 Oct 2007 21:17:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IjgIt-000781-R8 for ged-emacs-devel@m.gmane.org; Sun, 21 Oct 2007 15:17:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IjgIp-00073j-9r for emacs-devel@gnu.org; Sun, 21 Oct 2007 15:17:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IjgIn-000700-Hl for emacs-devel@gnu.org; Sun, 21 Oct 2007 15:17:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IjgIn-0006zj-CD for emacs-devel@gnu.org; Sun, 21 Oct 2007 15:17:33 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.188]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IjgIb-0005Qx-Sq; Sun, 21 Oct 2007 15:17:22 -0400 Original-Received: from noname (p54BE9FF2.dip0.t-ipconnect.de [84.190.159.242]) by mrelayeu.kundenserver.de (node=mrelayeu2) with ESMTP (Nemesis) id 0MKwtQ-1IjgIY0llW-00038p; Sun, 21 Oct 2007 21:17:19 +0200 User-Agent: KMail/1.9.5 In-Reply-To: <87lk9wseuf.fsf@catnip.gol.com> Content-Disposition: inline X-Provags-ID: V01U2FsdGVkX18xZssa3lTApXJGTgTenRjJaQk7D7IKLox0hmF igbFjfV8EzmaHwQd3I+i4bKq+mRewjIQe3Z4pPyU8d4Iyj7tNT XCxWj1AIbyJPwfEJRjqjg== X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) 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:81392 Archived-At: Am Sonntag, 21. Oktober 2007 16:48 schrieb Miles Bader: > Stefan Monnier writes: > >> The name `region-active-p' > >> implies that it doesn't matter whether the region is empty. > > > > Not necessarily. I don't consider an empty region as being really > > "active". > > And in many cases an empty-but-"active" region can be pretty confusing > if you don't realize what's going on... (e.g., undo with an > empty-but-"active" region used to be _extremely_ confusing, though that > seems to have been fixed). > > -Miles Introducing something like=20 (not (eq (region-beginning) (region-end))) would mean a new feature for both Emacsen AFAIS XEmacs simple.el knows two funktions region-active-p and region-exists-p=20 where (defsubst region-exists-p () "..." (not (null (mark)))) relates to the state of `mark-active' in GNU, whereas `region-active-p' delivers something near `transient-mark-mode' (defun region-active-p () "..." (and zmacs-regions zmacs-region-extent (eq (current-buffer) (zmacs-region-buffer)))) `region-exists-p' returns t if called at a buffer with length 1 where the mark is set. Checked with: (defun report-region-exists-p (&optional ispec)=20 (interactive "p") (if ispec (message "%s" (not (null (mark))))=20 (not (null (mark))))) So far=20 (defsubst region-exists-p () "..." (not (null (mark)))) could be taken as is, beneath=20 (defun region-active-p () "..." (and mark-active transient-mark-mode)) Andreas R=F6hler=09