From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: hw Newsgroups: gmane.emacs.devel Subject: Re: visual-region-mode? Date: Thu, 13 Sep 2018 22:08:07 +0200 Organization: my virtual residence Message-ID: <877ejpkvo8.fsf@toy.adminart.net> References: <874lf0oul4.fsf@toy.adminart.net> <877ejuabdt.fsf_-_@toy.adminart.net> <878t473dhg.fsf@toy.adminart.net> <87pnxii2b7.fsf@toy.adminart.net> <20180913172210.GA4019@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536870813 17564 195.159.176.226 (13 Sep 2018 20:33:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 13 Sep 2018 20:33:33 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: "Charles A. Roelli" , cpitclaudel@gmail.com, lokedhs@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 13 22:33:28 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0YIn-0004Mz-Vt for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2018 22:33:26 +0200 Original-Received: from localhost ([::1]:44207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0YKu-0000nu-Ak for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2018 16:35:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0YJn-0000nm-QX for emacs-devel@gnu.org; Thu, 13 Sep 2018 16:34:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g0YJj-0003jt-Sq for emacs-devel@gnu.org; Thu, 13 Sep 2018 16:34:25 -0400 Original-Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::4]:33404) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g0YJf-0003UL-DR; Thu, 13 Sep 2018 16:34:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1536870846; s=strato-dkim-0002; d=adminart.net; h=References:Message-ID:Date:In-Reply-To:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=YtRQsBY7LYdEzHVKYosqpRVNQ1UBhSxsNVV0kDJ+yHQ=; b=kYWlmMP8Mcu70n3p5agKty47+sFOfwuF/huQnBTMDrneTl0KgtOqZ8R+jb0Eo3TK1f hYP8t5xcvcQHhV5u2YPY3OJKZl4bbvnFV6ofPu1i9Lni2+fNZp+pTcgBrVpEFF8bejY5 srPoA7hefUnrsDUGqXkWnqjyNTw3PXGupiNmUjw8mCb3Kek9KL7lmsIRNMJ9gnPXryQz Vpx6HHSTISRxg77jv7O8nxgvfA70jKUmCAjXe1g5TyVBMypmkEvcWXAvXlRJh4WiOMY4 A3BDMo0RAA9jJB3b2iyS6C0avKGfI9Aq2KFA0d5I3noKxZ5u1J4HemcPRsXj+UQyOmn9 zD1g== X-RZG-AUTH: ":O2kGeEG7b/pS1FS4THaxjVF9w0vVgfQ9xGcjwO5WMRo5c+h5ceMqQWZ3yrBp+AVdIIwXjneEe9k=" X-RZG-CLASS-ID: mo00 Original-Received: from himinbjorg.adminart.net by smtp.strato.de (RZmta 44.1 DYNA|AUTH) with ESMTPSA id 20bdb7u8DKXm1U9 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Thu, 13 Sep 2018 22:33:48 +0200 (CEST) Original-Received: from toy.adminart.net ([192.168.3.55]) by himinbjorg.adminart.net with esmtp (Exim 4.90_1) (envelope-from ) id 1g0YJ9-00025Z-G5; Thu, 13 Sep 2018 22:33:47 +0200 In-Reply-To: <20180913172210.GA4019@ACM> (Alan Mackenzie's message of "Thu, 13 Sep 2018 17:22:10 +0000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:229759 Archived-At: Alan Mackenzie writes: > Hello, hw. > > On Thu, Sep 13, 2018 at 06:00:32 +0200, hw wrote: >> charles@aurox.ch (Charles A. Roelli) writes: > >> >> From: hw >> >> Date: Tue, 11 Sep 2018 23:56:11 +0200 > >> >> [...] > >> > This is where Emacs differs from other programs, I suppose. It's >> > optimized for efficient use, even when the result can be a surprise to >> > the user. Otherwise, in this case, C-w and M-w would do nothing with >> > no "active region". > >> What is efficient about hidden regions the way they are? > > They don't get in your way. Of course they do. They're lurking hidden in the background, waiting for me to make a mistake, and are making me feel uneasy all the time. > A lot of the time, you won't be conceptualising the buffer portion > between mark and point as "the region" - it's just point, and there's > mark hanging around somewhere, possibly at somewhere significant. I always know it's lurking. > [...] >> If killing or copying a region didn't happen to be bound to keys that >> are rather unlikely to get pressed by mistake, the design flaw of being >> able to do something with a non-highlighted region while >> transient-mark-mode is enabled might be more obvious. > > What seems like a design flaw to you is a feature to somebody else. No, software has a design flaw when it doesn't protect the user from making mistakes and makes mistakes even worse. For that, it doesn't matter how easy it is to make the mistake. This doesn't have anything to do with features. > That's why Emacs is so customisable. As Juri has already pointed out, > there's an option you can set so that this "design flaw" won't affect > you. I suggest you spending a couple of hours reading through the > chapter "The Mark and the Region" (also known simply as "Mark") in the > Emacs manual to see if there're any other options which would be useful > to you at a non-default setting. I already looked in the manual and was surprised about the lack of options. Maybe I'll find some when I read more. >> Disabling transient-mark-mode removes the possibility of highlighting >> regions. What is the purpose of that? > > For users who find this highlighting unhelpful. That simply doesn't make any sense. > [...] > >> >> > C-SPC (without a prefix argument) always pushes a mark, so it always >> >> > alters the region (unless point is already at the mark). C-u C-SPC >> >> > sets point where the mark is, and pops the mark ring, effectively >> >> > restoring the previous region. We should keep this behavior. > >> >> How am I supposed to know where a mark was? Why would I try to confuse >> >> myself with C-u C-spc? In which way is the position of the mark >> >> adjusted so that it sticks with the same contents of the buffer, which >> >> it would need to do to be of any use? > > Mark does get adjusted so that it stays at the "same" position in the > buffer, even if you insert or delete text before it. Try it! And how do I know where it is? And why text before it and not after it? When you set a mark in the middle of the buffer and delete something at the end, the mark moves towards the end of the buffer. And what happens when you delete a place that contains a mark? >> > Various commands set the mark, as documented in the manual. When you >> > use them, normally a message appears in the echo area saying "Mark >> > set". > >> Yes, and they never told me anything because I don't use the mark for >> navigation. > > An interesting question: why not? The mark is one of the concepts which > distinguish Emacs from lesser editors, and with it you can do things > like: > (i) You search for something, and find it. You want to go back to your > starting point. No problem in Emacs! C-u C-. > (ii) You're editing something, and you want to read the massive comment > that often appears near the beginning of source files. You do M-<, read > that comment, then C-u C- to get back to where you were editing. > > Personally, I use the mark all the time for navigation, and would not > want to go back to an editor without one. The mark is not for navigation, it's for making selections. When I want to select something, I go there and select it. So why would these messages tell me anything and why would I care? I don't even need a mark, I only need to select things. >> When I want a region, i. e. a selection, I go where I want it and >> select what I want. The mark is irrelevant with this kind of usage, >> and so are these messages. > > You can ignore both of them, surely, for this kind of usage. No, the problem is that there is always something lurking hidden in the background --- you call it a region. If I was ignoring that, I might make a mistake and do something with it I don't want to. > [ .... ] > >> And there is no way to show the mark? > > Not really, no. Highlighting the region when transient-mark-mode is > enabled is sort of a way, but that's not really what you meant. > > When I use the mark, my subconsciousness retains a map of where the mark > is for an appreciable time. I don't need the mark to be visible. I > don't think most users do, either. > > If you want the mark to be visible, implement it. Others might find it > useful, too. I don't know how to. I might find it useful to use a mark for navigation, but only when has nothing to do with making selections. >> >> >> What would the advantage of hidden regions be? When something is within >> >> >> a region, it should be highlighted, and when it is no longer >> >> >> highlighted, it should no longer be within a region. > >> >> > Again, in Emacs, as long there is a mark in the current buffer, there >> >> > is always a "region". > >> >> How would that make sense? I expect the mark to be gone once I used the >> >> region. > >> > That's what transient-mark-mode tries to implement, I think. > >> It doesn't remove the mark after a highlighted region has been used. >> The idea was apparently to limit functions to a selection by >> highlighting a region and then calling it particularly "active". > >> Highlighting and calling a region "active" would not be necessary if >> functions could otherwise be limited to the region. Combining these >> three things and not allowing another way to limit functions to the >> region make a mess. > > There is another way: narrow to the region (e.g. with C-x n n). Standard > editing function are then restricted to this portion of the buffer. That is triple work because first I'd have to make a selection, second I'd have to narrow the buffer and third I'd have to widen it again. > Useful here is, for example, C-x n d, which narrows to the current > source-code function. Cases in which operations that need to be limited to a selection are as wide as a whole function almost don't exist. > [ .... ] > >> Emacs would have to have all key bindings re-defined to work well with >> keyboards for different languages, leading to a definition for each >> language. > > That's a bit of an exaggeration. Why? Move one key binding, and there will already be another key binding in the way, so you first have to move that one, etc., and you end up shuffling them all around a great deal until you might find something that reasonably works --- or not. > [ .... ] > >> The only purpose of the mark is to make a selection. > > No. That's how _your_ use of it is currently restricted. I earnestly > recommend you to spend time learning other uses of the mark. It will > ease your editing. I don't have any other uses for it --- actually, I don't have any. Making selections doesn't have anything to do with navigation, and overloading the navigational aid that is called a mark by involving it into making selections is a very bad idea. A constantly changing, hidden selection which is being brought up by that is also a very bad idea. >> After the selection has been used, editing moves on, and the location >> has become irrelevant. Places of interest are those where navigational >> aids are being placed, like bookmarks and registers. > >> If it was possible to make a selection without using the mark, I might >> never use the mark. However, I might get used to using the mark for >> navigation if it was like a default register that can be easily set and >> moved back to. The way it currently is is merely dangerous because it >> may influence hidden and highlighted regions without that being my >> intention. > > Repeat: in an Emacs buffer there is exactly one region at any time. I > can't suppress the feeling that sometime soon, something in your brain is > going to click, you're going to shout "Eureka!", and suddenly the Emacs > mark will be obvious and natural to you (as it is to so many users). I might use it for navigation if it didn't do anything else. Since there is currently no other way to make a selection, I have to use it for making selections. There's nothing obvious about it other than that it is a bad idea. > [ .... ] > >> A feature request for the possibility of having multiple regions that >> can be highlighted, first decoupling making selections from navigation, >> might be an option. I'm not sure if further discussion before making >> such a request is better because there might be pretty strong resistance >> against this from everyone used to and using things the way they have >> been for a long time --- and maybe we're missing something. > > There would indeed be resistance. Somehow, you've got to set up a > multiple region. That will need key sequences (of which there are very > few spare). Then you've got to modify lots of commands to work on a > multiple region. Indeed you've got to decide what they will do. This is > not a task for the faint-hearted. Apparently there are some modes that allow to use multiple selections :) > > [ .... ] > >> Why not let the mark be mark and find a way of making selections >> independently from it? > > Because that would lead to a general loss of convenience in the use of > the mark. It could be used for navigation, how would that make anything less convenient? > Still, if you have a solid idea of how this could work (and it > would have to be optional), implement it and ask for it to be > incorporated into Emacs. I don't know how to implement it. > [ .... ] > >> That would overload the mark even more than it already is. > > I don't agree the mark is overloaded. Using it's several features > together is one of the delights of Emacs. It's no delight at all, it's a bad idea.