From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Proposal to change cursor appearance to indicate region activation Date: Sat, 23 Nov 2013 12:25:08 -0800 (PST) Message-ID: <78667428-5c03-402b-8d42-5342079d9bfd@default> References: <1366426478.1624.YahooMailClassic@web141106.mail.bf1.yahoo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1385238332 2139 80.91.229.3 (23 Nov 2013 20:25:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Nov 2013 20:25:32 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier , Kelly Dean Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 23 21:25:37 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VkJlo-0002dd-Fb for ged-emacs-devel@m.gmane.org; Sat, 23 Nov 2013 21:25:36 +0100 Original-Received: from localhost ([::1]:44968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkJln-0003J0-Tj for ged-emacs-devel@m.gmane.org; Sat, 23 Nov 2013 15:25:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkJlc-0003Ht-Fa for emacs-devel@gnu.org; Sat, 23 Nov 2013 15:25:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VkJlU-0007ER-Sf for emacs-devel@gnu.org; Sat, 23 Nov 2013 15:25:24 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:42305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkJlU-0007EM-M3 for emacs-devel@gnu.org; Sat, 23 Nov 2013 15:25:16 -0500 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rANKPFgL016609 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 23 Nov 2013 20:25:16 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rANKPD5D005938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 23 Nov 2013 20:25:14 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rANKPDZ2025952; Sat, 23 Nov 2013 20:25:13 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:165633 Archived-At: > > (add-hook 'deactivate-mark-hook (lambda () (setq cursor-type t))) > > (add-hook 'activate-mark-hook (lambda () (setq cursor-type 'bar))) >=20 > I like the idea, but this collides with other uses of cursor-type. > Could someone cook up a patch which only does the above if cursor- > type has not been modified (and which lets users opt-out if they > prefer). Also, the patch should directly modify deactivate-mark > and activate-mark rather than using the hooks. If you do anything like this, please put it in a minor mode or make it otherwise customizable (e.g. trivial to turn off). I would even argue against it being on by default (but not strongly) - I prefer that the default behavior not be changed. It is simple for a user or library to change the `cursor-type' on demand or based on some dynamic condition. Why put this on mark (de)activation hooks unconditionally, or "directly modify deactivate-mark and activate-mark"? That sounds like a mistake. For instance, I have the cursor type change to `box' for overwrite mode and read-only buffers, and use type `bar' as the default. And the type changes to `box' when Emacs is idle. But these things are user choices. They happen only if a user chooses them, and the particular types used for each state are also customizable. Emacs should do likewise: make such behavior optional. You speak of letting users opt out, but only if the `cursor-type' has been modified, whatever that might mean (does it matter how it was modified or how long ago?). The problems this proposal purports to solve are exaggerated, IMO: 1. The 1st reason given for the proposal is to let users tell when the active region is empty: "when the region is active but empty, there's no visual indication of this status." A better way to do that is to include the code from library `modeline-posn.el' for this: show the region size, highlighted with face `region', in the mode line in place of the buffer size whenever the region is active. 2. The 2nd reason given for the proposal: "Neither is there indication of the active region if point is one less than mark and blink-cursor-mode is off." I don't see that. For me, the active region is highlighted in that case. Am I missing something? And again, the `modeline-posn.el' region-size indication shows clearly when the region size is 1, regardless of the where point is relative to mark. 3. The 3rd reason given for the proposal: "Also, if point is greater than mark, the active region is highlighted, but the block cursor does an inverse-video highlight of the character following the region." So? The cursor, block or otherwise, indicates point: where text will insert. A block cursor is on top of the character after point, but that does not mean or suggest that that character is selected, i.e., is in the region. The proposal says that this "(speaking from experience) an Emacs newbie finds distracting, since it seems to indicate that that character is also part of the region, even though it actually isn't." In what way does it "seem to indicate" that the character under the cursor is part of the region? It never indicated that to me, and I don't see how it would for others. And even if some newbie did mistakenly get that impression, how long does it take to realize that that impression is incorrect? Emacs provides plenty of visual feedback about what is the correct impression. It doesn't take any thought to find out what is in the region and what is not. It just takes one or two selections - an experimentation of maybe 20 seconds or so. Seriously, how long did it take you to figure out the truth here? 4. The 4th and final reason given for this proposal: "Adding to the confusion, the inverse-video highlighted character actually is part of the region in the case that point is less than mark." So? The position of the cursor does not tell you anything about whether the character after it (for `bar') or under it (for `box') is part of the region. For `bar', you can see the character after the cursor, so you can tell. OK. For `box', you can see the character also, and you can see the `region' face applied to it as foreground. I.e., you see the character highlighted as part of the region, but you see it in inverse video. Admittedly, the `region' face as background instead of foreground is more obvious. I'll grant you that. But that alone does not justify this feature being hardcoded into Emacs, IMO. If this feature is added, please make it optional, easy to change (turn off), and preferably not on by default. And you are welcome to consider incorporating the behavior of `modeline-posn.el'. http://www.emacswiki.org/emacs-en/download/modeline-posn.el