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: Wed, 19 Sep 2018 03:45:23 +0200 Organization: my virtual residence Message-ID: <878t3yv0p0.fsf@toy.adminart.net> References: <83k1nxvm5j.fsf@gnu.org> <877ejxsm18.fsf@toy.adminart.net> <874lf0oul4.fsf@toy.adminart.net> <877ejuabdt.fsf_-_@toy.adminart.net> <878t473dhg.fsf@toy.adminart.net> <87pnxii2b7.fsf@toy.adminart.net> <87k1nm7eit.fsf@toy.adminart.net> <878t403dn5.fsf@toy.adminart.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1537323985 6889 195.159.176.226 (19 Sep 2018 02:26:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 19 Sep 2018 02:26:25 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: cpitclaudel@gmail.com, lokedhs@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: charles@aurox.ch (Charles A. Roelli) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 19 04:26:20 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 1g2SC1-0001el-FT for ged-emacs-devel@m.gmane.org; Wed, 19 Sep 2018 04:26:17 +0200 Original-Received: from localhost ([::1]:43332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2SE8-0006aX-34 for ged-emacs-devel@m.gmane.org; Tue, 18 Sep 2018 22:28:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2SD6-0006Pf-DD for emacs-devel@gnu.org; Tue, 18 Sep 2018 22:27:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2SD5-0003RO-IF for emacs-devel@gnu.org; Tue, 18 Sep 2018 22:27:24 -0400 Original-Received: from mo6-p01-ob.smtp.rzone.de ([2a01:238:20a:202:5301::2]:26563) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g2SD5-0003Pl-9P; Tue, 18 Sep 2018 22:27:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1537324042; 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=iwlN1h5xp+j4DsAk1fPnqyXQJifjGn4Ao8zNwA51qR8=; b=n6v1Hp45Cb658oZqDIEF9eWNb5+CnX0I+Eb1zByYG0UHryaDhX5NJzCyRdL8PmNWm2 zCxJLyCysjGrNsTEuW5elGgIGLpZcLqR1uJI/B97ir7YvlMmVLWHrotoRC0dnu5kW7Pj 2ZUTbNEZRvpk2tWtOZ5J///z4Ieuljn0NWdhWC05SN3tyPPM4Sg+BVPGXvqRsZrsGaWx JDgo7r1GswsmJcO+e8DsOvFhy+XcUvb7nOTHPcyl6QAYphfnI+32EaZhPlhHvw64Tqgo DMxcF3DlDxcOwgPp4xul/Y4cjyDU5MU0grO/2iu5MmjtzTlsZ8j3FiN9siQDYnjeHuiW vvdw== 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 20bdb7u8J2REG6X (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); Wed, 19 Sep 2018 04:27:14 +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 1g2SCv-0001dq-Pb; Wed, 19 Sep 2018 04:27:13 +0200 In-Reply-To: (Charles A. Roelli's message of "Tue, 18 Sep 2018 21:22:29 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5301::2 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:229958 Archived-At: charles@aurox.ch (Charles A. Roelli) writes: >> From: hw >> Date: Mon, 17 Sep 2018 22:36:30 +0200 >> >> Having clarified which operations can be used with a region doesn't mean >> that working with a region can be efficiently done. > > It does for me. For example, see the output of M-x -region TAB. By > just knowing a smidgeon of these commands, you can work very > efficiently with a region, with all the documentation and help Emacs > provides. That's like saying it doesn't matter how inefficient a procedure is if you only have some instructions to perform it. > If we somehow "disarm" the region by default (as you have > suggested), the use of all these commands would be less efficient. That was Elis idea, and it doesn't refer to commands implying "region" but, IIUC, to how to deal with that users might sometimes want to delete a region by inserting characters and sometimes not. >> > The "hidden regions" can only be a source of error if you type, say, >> > C-w or M-w at random during editing. >> >> What about upcase-region, downcase-region and others that don't come to >> mind atm? They already clash with transient-mark-mode and are as unsafe >> as C-w and M-w. Changing mark-even-if-inactive to nil is required to >> prevent that --- why isn't that the default? > > These commands are already disabled by default. Right, I didn't notice. Emacs says they are disabled because they can be confusing. Confusing usually doesn't exactly mean efficient. >> The hidden regions mean that I always have to consider that they are >> always there so that I do not make a mistake in the first place. That >> makes me feel uneasy. > > What's the worst that could happen? We have so many ways to recover > from these sorts of errors: autosaves, backups, VC, > diff-buffer-with-file, ... An accidental downcase-region of a couple lines in a program usually isn't very noticeable unless you look very closely at it, so chances aren't too bad that the problems they may cause only come up when it means that the worst thing does happen. > In addition, for buffers that you think should have additional > protection against accidental edits, there's "view-mode". Well, I have delete-active-region and mark-even-if-inactive set to nil and am testing this: (defun my-exchange-point-and-mark (&optional arg) "Put the mark where point is now, and point where the mark is now. With a prefix argument, toggle the activeness of the region. This function itself is ignorant of `transient-mark-mode'." (interactive "P") (let ((omark (marker-position (mark-marker)))) (if (null omark) (user-error "No mark set in this buffer")) (set-marker (mark-marker) (point)) (goto-char omark)) (if arg (if mark-active (deactivate-mark) (activate-mark t)))) Now I have the region fortified and am able to use the mark for navigation without making (or unmaking) a selection from the region unless I actually want to. I just wish the mark was visible and point was indicating the direction of it. View-mode is cool for things not being edited.