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: Mon, 22 Oct 2007 02:18:49 +0900 Message-ID: <87k5pgl72e.fsf@uwakimon.sk.tsukuba.ac.jp> References: <200710191149.59775.andreas.roehler@online.de> <87bqau3iq5.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1192993385 4022 80.91.229.12 (21 Oct 2007 19:03:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Oct 2007 19:03:05 +0000 (UTC) Cc: Juri Linkov , andreas.roehler@online.de, rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 21 21:03:04 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 1Ijg4k-0005HP-RZ for ged-emacs-devel@m.gmane.org; Sun, 21 Oct 2007 21:03:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ijg4a-0000YF-Q7 for ged-emacs-devel@m.gmane.org; Sun, 21 Oct 2007 15:02:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ijg4W-0000XI-OB for emacs-devel@gnu.org; Sun, 21 Oct 2007 15:02:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ijg4P-0000Uk-Gj for emacs-devel@gnu.org; Sun, 21 Oct 2007 15:02:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ijg4P-0000Uh-Aw for emacs-devel@gnu.org; Sun, 21 Oct 2007 15:02:41 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ijf1x-0007rp-RJ; Sun, 21 Oct 2007 13:56:06 -0400 Original-Received: from mtps01.sk.tsukuba.ac.jp ([130.158.97.223]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IjeRj-00023t-4F; Sun, 21 Oct 2007 13:18:39 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (unknown [130.158.99.156]) by mtps01.sk.tsukuba.ac.jp (Postfix) with ESMTP id EF9EB1535A8; Mon, 22 Oct 2007 02:18:04 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id EBC6B1A2E12; Mon, 22 Oct 2007 02:18:50 +0900 (JST) In-Reply-To: X-Mailer: VM 7.17 under 21.5 (beta28) "fuki" (+CVS-20070621) XEmacs Lucid X-detected-kernel: by mx20.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:81391 Archived-At: Stefan Monnier writes: > >> What about to introduce `region-active-p' and/or > >> `region-exists-p' for > > >> (and mark-active transient-mark-mode) > > > I think this is a good idea. Instead of putting everywhere > > a complex condition: > > > 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. All the commands I can think of that use > this kind of feature make the command work on the selected region instead of > just "at point". So an empty region isn't very meaningful for them. 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.