From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Replacing huge hidden selection when pasting text Date: Sat, 2 Jan 2016 19:10:36 -0800 (PST) Message-ID: <4657a06c-58f8-44d7-89fe-34d5ff4e9d49@default> References: <5da6a556-646f-42ba-9bae-f5bf4387f09e@googlegroups.com> <84da4496-944e-4192-ac09-b5bfc0992f3f@googlegroups.com> <70837df3-23f5-416b-8e0a-b9f105f7a40c@googlegroups.com> <871t9zwgan.fsf@web.de> 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 1451790676 27075 80.91.229.3 (3 Jan 2016 03:11:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jan 2016 03:11:16 +0000 (UTC) To: Michael Heerdegen , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 03 04:11:02 2016 Return-path: Envelope-to: geh-help-gnu-emacs@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 1aFZ4P-000806-5Q for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Jan 2016 04:11:01 +0100 Original-Received: from localhost ([::1]:40349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFZ4K-0002ny-S1 for geh-help-gnu-emacs@m.gmane.org; Sat, 02 Jan 2016 22:10:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFZ48-0002mw-GU for help-gnu-emacs@gnu.org; Sat, 02 Jan 2016 22:10:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFZ45-0002M8-Ad for help-gnu-emacs@gnu.org; Sat, 02 Jan 2016 22:10:44 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:39479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFZ45-0002M4-47 for help-gnu-emacs@gnu.org; Sat, 02 Jan 2016 22:10:41 -0500 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u033Ads4028908 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 3 Jan 2016 03:10:40 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u033AbsV003535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 3 Jan 2016 03:10:39 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u033AbH3016193; Sun, 3 Jan 2016 03:10:37 GMT In-Reply-To: <871t9zwgan.fsf@web.de> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] 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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108591 Archived-At: > > > Apologies for not following this thread. But offhand I'd say that > > > there's your problem right there: you enable `delete-selection-mode' > > > but you disable `transient-mark-mode'. That should be a no-no. > > > > Oh my dear, I managed to hit a no-no! But if it's a no-no why is it > > possible in the first place? Why ain't there a single warning? Where > > are emacs's no-nos listed? Where is the checkbox and message saying "I > > agree not to do any emacs no-no, even if I don't know what they are"? > > Are you serious? >=20 > I think there was much confusion in the thread, no doubt did the > nihilistic tone of Alexandre inhibit a fruitful discussion. >=20 > Drew only wanted to help. But I think he was wrong with what he said. > I think it's ok to use the two modes at the same time. In the sentence > Drew cited: >=20 > When Delete Selection mode is enabled, Transient Mark mode is also > ^^ > enabled, typed text replaces the selection if the selection is active, > and DEL deletes the selection. >=20 > I think there is an "and" missing, and the sentence means something > different from what we thought. In fact, until Emacs 24.4, `delete-selection-mode' explicitly turned on `transient-mark-mode', and the doc string was as I quoted it (and it was correct). No "and" was missing; t-m-mode was really enabled by d-s-mode. Emacs 24.3: (if (not delete-selection-mode) (remove-hook 'pre-command-hook 'delete-selection-pre-hook) (add-hook 'pre-command-hook 'delete-selection-pre-hook) (transient-mark-mode t)) ; <=3D=3D=3D=3D=3D=3D=3D=3D=3D Starting with Emacs 24.4, d-s-mode no longer turns on t-m-mode. > The current docstring (in my Emacs 25) says: > When Delete Selection mode is enabled, typed text replaces the > selection if the selection is active. Otherwise, typed text is just > inserted at point regardless of any selection. >=20 > With `transient-mark-mode' off, you can mark a region (i.e., turn on > transient mark mode temporarily) by hitting C-SPC twice. Only then does > delete-selection-mode replace the region. In any other case (when the > region is not visible, i.e. not active) transient-mark-mode is just off, > and delete-selection-mode should not delete the region, never. I think you are right. This is not the original design of d-s-mode, but was done when "temporary t-m-mode" was added (presumably precisely to avoid the kind of gotcha that bit Alexandre). > So I think the behavior he sometimes gets could indeed be a bug. Would > be good to have a bug report, and it would be good if Alexandre would > try to find a recipe so that we can find out what's going on (this could > also be caused by some add on package) and fix the issue when necessary. Agreed. (And maybe the doc string of `transient-mark-mode' should, like the Emacs manual (node `Disabled Transient Mark'), mention temporary activation of t-m-mode (via C-SPC C-SPC or C-u C-x C-x).