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: Transient Region Highlighting - an improvement over Transient Mark Mode. Date: Tue, 1 Apr 2008 15:19:31 +0000 Message-ID: <20080401151931.GA6533@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1207062392 7847 80.91.229.12 (1 Apr 2008 15:06:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Apr 2008 15:06:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 01 17:07:03 2008 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 1Jgi2n-0000wL-WA for ged-emacs-devel@m.gmane.org; Tue, 01 Apr 2008 17:05:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jgi2B-0002Vr-Ry for ged-emacs-devel@m.gmane.org; Tue, 01 Apr 2008 11:04:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jgi1h-0001pA-OX for emacs-devel@gnu.org; Tue, 01 Apr 2008 11:03:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jgi1f-0001l3-3r for emacs-devel@gnu.org; Tue, 01 Apr 2008 11:03:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jgi1e-0001kw-Vs for emacs-devel@gnu.org; Tue, 01 Apr 2008 11:03:51 -0400 Original-Received: from colin.muc.de ([193.149.48.1] 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 1Jgi1e-0003Sv-7y for emacs-devel@gnu.org; Tue, 01 Apr 2008 11:03:50 -0400 Original-Received: (qmail 32789 invoked by uid 3782); 1 Apr 2008 15:03:47 -0000 Original-Received: from acm.muc.de (p57AF60DD.dip.t-dialin.net [87.175.96.221]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 01 Apr 2008 17:03:45 +0200 Original-Received: (qmail 6613 invoked by uid 1000); 1 Apr 2008 15:19:31 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: 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:94119 Archived-At: Hi, Emacs! I've criticised Transient Mark Mode somewhat in the last few days. I therefore feel obliged to make a constructive suggestion as how to make it better. Here is that suggestion: Analysing T-M-M, it seems to consist of 3 vaguely related features: (i) Disabling functions which operate on the region; (ii) Highlighting the region; (iii) Restricting the operation of some commands (e.g. M-x occur) to the region when highlit, a sort of narrowing. Just as an aside, I think that terms like "active mark" and "activating the region" are unhelpful, and have caused confused thinking over the years. Neither the mark nor the region is an agent - they don't DO anything, anymore than a milepost on a country road between two villages, or the road itself, do. So I suggest we purge these terms from the code and manual. Feature (i) above, the one for which "Transient Mark Mode" is named, doesn't seem to be useful, so let's just remove it - the mark, once set, remains set, ditto for the region. The variable mark-even-if-inactive is redundant, and can vanish (or be marked obsolete). Feature (ii) seems to be what people really want. So let's rename the entire feature "Region Highlighting Mode". The variable `region-highlighting-mode' should take the values nil, t, and possibly 'always, should there be anybody who wants the region always to be highlit. Region highlighting is switched on when the user types C-, (?C-u) C-x C-x or M-@ or the like, or the "certain mouse commands". There should be a command to switch it off (Keybinding C-u C-g, perhaps?). I don't think a simple C-g should switch it off. Highlighting should also be removed (via a before-change-function, possibly) when the buffer is changed. I don't think it should be switched off on executing a random command. For example, if you do M-: region-highlit, and see "t", the t should remain meaningful. "Momentary Transient Mark Mode" (there's tautology there ;-) should stay, but be renamed to "Explicit Region Highlighting", to indicated that the region gets highlit only when the user explicitly requests it via C- C- or C-u C-x C-x. Feature (iii) should be construed as "Wide area commands are restricted to the region when it is highlit", and should be an option independent of Region Highlighting Mode. How about calling it `area-commands-on-highlit-region-flag'? To use this feature when Region Highlighting is switched off, a user needs to set explicit region highlighting first. I think something like this design would be logically coherent, simple to document, implement and use, would have the features that people want, and be a vast improvement over the current Transient Mark Mode. What do others think? -- Alan Mackenzie (Nuremberg, Germany).