From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Documentation of transient-mark-mode is sloppy, wrong, and confused. Date: Fri, 29 May 2009 11:01:29 +0000 Message-ID: <20090529110129.GD2793@muc.de> References: <20090528122927.GA2175@muc.de> <87fxepf9s8.fsf@cyd.mit.edu> <20090528201529.GA4605@muc.de> <87bppdx8c0.fsf@cyd.mit.edu> <20090528230359.GA1474@muc.de> <44395.130.55.118.19.1243554794.squirrel@webmail.lanl.gov> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1243595083 29121 80.91.229.12 (29 May 2009 11:04:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 May 2009 11:04:43 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Davis Herring Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 29 13:04:39 2009 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 1M9zt8-0003ku-AR for ged-emacs-devel@m.gmane.org; Fri, 29 May 2009 13:04:38 +0200 Original-Received: from localhost ([127.0.0.1]:46351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9zt7-0008Mg-26 for ged-emacs-devel@m.gmane.org; Fri, 29 May 2009 07:04:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M9zpK-0006VD-Qs for emacs-devel@gnu.org; Fri, 29 May 2009 07:00:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M9zpF-0006R9-N4 for emacs-devel@gnu.org; Fri, 29 May 2009 07:00:42 -0400 Original-Received: from [199.232.76.173] (port=60340 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9zpF-0006Qx-H7 for emacs-devel@gnu.org; Fri, 29 May 2009 07:00:37 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:3291 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M9zpE-0002ba-Ro for emacs-devel@gnu.org; Fri, 29 May 2009 07:00:37 -0400 Original-Received: (qmail 63269 invoked by uid 3782); 29 May 2009 11:00:34 -0000 Original-Received: from acm.muc.de (pD9E514E9.dip.t-dialin.net [217.229.20.233]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Fri, 29 May 2009 13:00:32 +0200 Original-Received: (qmail 5181 invoked by uid 1000); 29 May 2009 11:01:29 -0000 Content-Disposition: inline In-Reply-To: <44395.130.55.118.19.1243554794.squirrel@webmail.lanl.gov> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:111195 Archived-At: Hi, Davis! On Thu, May 28, 2009 at 04:53:14PM -0700, Davis Herring wrote: > >> Some commands, which ordinarily operate on the region when the > >> mark is active, instead act on the entire buffer. > > That is a definition of "active", surely, as I suggested above. > > Surely, it is better to regard the mark and region as being inactive > > when t-m-m is disabled? > It seems to me that there are two kinds of activeness of the mark (and > the region; they have between them only one state). The first kind > (call it active1) is associated with commands like `kill-region', which > refuse to do anything unless the region is active1. Outside of > transient mark mode, the mark is always active1 if it exists at all; > with tmm, the mark is frequently activated1 and deactivated1. > The other kind (active2) is associated with commands like `undo', > `insert-parentheses', and `how-many', which restrict, extend, or change > (respectively) their area of effect to be the region iff it is active2. > Outside of transient mark mode, the mark is never active2 at all; with > tmm, the mark is active2 iff it is active1. Bingo! That's the answer! Thanks! So an honest @dfn{active} would be along the lines: Historically, @dfn{active region} has had two distinct, sometimes contradictory meanings: @itemize @bullet @item Certain commands which use the region, such as @key{C-w} (@code{kill-region}) are disabled when the region isn't @dfn{active}. As from Emacs 23, the region is now always ``active'' in this sense, unless you set the user option @code{mark-even-when-inactive} (@pxref{...}). @item Certain commands work in an enhanced manner when the region is @dfn{active}: for example, `fill-paragraph' (@pxref{..}) fills the region when it is active, rather than just the current paragraph. When the region is ``active'' in this sense, it is highlit. @end @itemize Most uses of ``active'' in this manual have the second meaning. > So we see that while there are two predicates, they can be resolved as (or > (not transient-mark-mode) (mark-active)) and (and transient-mark-mode > (mark-active)). I think these can be more simply expressed as (i) mark-active and (ii) (use-region-p). > Since my imaginary function `mark-active' is only ever called when tmm > is on, we may take it to return nil otherwise and replace active2 with > just (mark-active). There is then only one variable "active", but tmm > has different effects on different interpretations of its value. > Sidebar: I like the 22 feature of turning tmm on temporarily; I don't like > it in general (partly because I like the mark being active1), but > otherwise I cannot have an active2 mark at all. Doesn't (setq mark-even-if-inactive t) do what you want? > Davis -- Alan Mackenzie (Nuremberg, Germany).