From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#13312: 24.3.50; delete selection mode not killing on overwrite Date: Sat, 19 Oct 2013 10:42:44 -0700 (PDT) Message-ID: References: <87wql9i8l5.fsf@mail.jurta.org> <761f4d61-cd53-4371-9744-70f08619c75b@default> <87vc0tfcn6.fsf@mail.jurta.org> 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 1382204600 17013 80.91.229.3 (19 Oct 2013 17:43:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Oct 2013 17:43:20 +0000 (UTC) Cc: 13312@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 19 19:43:23 2013 Return-path: Envelope-to: geb-bug-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 1VXaYc-00023J-MH for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Oct 2013 19:43:22 +0200 Original-Received: from localhost ([::1]:33989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXaYc-0001QQ-7q for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Oct 2013 13:43:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXaYR-0001PP-AX for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2013 13:43:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXaYJ-0000Pn-5K for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2013 13:43:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXaYJ-0000Pj-1b for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2013 13:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VXaYI-0001aF-HB for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2013 13:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Oct 2013 17:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13312 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 13312-submit@debbugs.gnu.org id=B13312.13822045776074 (code B ref 13312); Sat, 19 Oct 2013 17:43:02 +0000 Original-Received: (at 13312) by debbugs.gnu.org; 19 Oct 2013 17:42:57 +0000 Original-Received: from localhost ([127.0.0.1]:58146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXaYC-0001Zt-13 for submit@debbugs.gnu.org; Sat, 19 Oct 2013 13:42:56 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:47627) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXaY9-0001Zf-Em for 13312@debbugs.gnu.org; Sat, 19 Oct 2013 13:42:54 -0400 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r9JHgkI7031114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 19 Oct 2013 17:42:47 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9JHgjkj009585 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Oct 2013 17:42:46 GMT Original-Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9JHgjbK008276; Sat, 19 Oct 2013 17:42:45 GMT In-Reply-To: <87vc0tfcn6.fsf@mail.jurta.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79394 Archived-At: > Ah, I thought this is a new bug report from you. ;-) > But I still can't find a link to the associate StackOverflow question. http://stackoverflow.com/questions/14076480/how-to-kill-text-when-overwriti= ng-in-delete-selection-mode > What I wanted to suggest is to add more self-inserting commands > to delsel like `insert-char' and `quoted-insert'. I guess > they don't need the same `self-insert-uses-region-functions' > like the currently existing `self-insert-iso' doesn't use that. Sounds like a more general discussion. Please consider moving that and the rest of the discussion to a separate bug report or emacs-devel. It doesn't seem like it is limited to this bug. My request was to move this bug back to Normal from Wish List. If someone would also look into fixing it, that would be great. > But when you want put `kill' as the `delete-selection' property > then it's better to use this code: > (put 'self-insert-command 'delete-selection > (lambda () > (and (not (run-hook-with-args-until-success > =09=09 'self-insert-uses-region-functions)) > =09 'kill))) Maybe so, but that is not at all what the `delete-selection-mode' doc & comments tell users. If this is a new requirement/guideline, then it needs to be documented. But I wonder why this must now be so. In the past, a user could just put `kill' as the property. The code does not seem so clean now. One of the benefits of the `delsel.el' design (and yes, along with those benefits come also some disadvantages) is its simplicity for users. This seems to go against that. Is it really necessary? Isn't there another way to accomplish the same thing (whatever that is), so we can keep the simple and clean design for users? What was the reason for introducing `self-insert-uses-region-functions'? It seems it was only for `electric-pair-mode'. IIRC, I wasn't too happy with that hack when it was done. Now it seems to be dirtying (complicating) `delsel.el'. Isn't there a better way? But again, we should probably be discussing this elsewhere, since it does not seem to be only about this bug. > It currently doesn't work properly because `kill-region' overwrites > the value of `this-command'. This is a bug that can be fixed > by this patch that also fixes overwrite-mode for `kill' and > puts `delete-selection' on more commands: Sorry, I cannot judge now whether this DTRT. But again, this seems to reach beyond this bug. (Let me know if I'm missing something and this is really specific to this bug.) I would like to see, if possible, a simpler `delsel.el', rather than a more complicated one - from the user's perspective, at least, if not necessarily the implementation. Users should be able to `put' a single, understandable symbol as the `delete-selection' property value. They should not need to fiddle with obscure lambda forms (or symbols whose names are not simple to understand). Symbol `kill' is simple - it says that you want the region to be killed. This simplicity was the case before (`delsel.el' is old and simple). Someone introduced `electric-pair-mode', and then someone else complained about its interaction with `delete-selection-mode'. The fix for that should not have involved screwing `delete-selection-mode', as seems to be the case so far.