From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#11520: 24.1.50; delete-selection-mode conflicts with electric-pair-mode Date: Wed, 18 Jul 2012 08:13:51 -0400 Message-ID: References: <87ipdqx6e4.fsf@gnu.org> <87a9z19jgj.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1342613714 25245 80.91.229.3 (18 Jul 2012 12:15:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 18 Jul 2012 12:15:14 +0000 (UTC) Cc: Chong Yidong , 11520@debbugs.gnu.org To: Simon Law Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 18 14:15:14 2012 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 1SrT9r-00079n-Js for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Jul 2012 14:15:11 +0200 Original-Received: from localhost ([::1]:38695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrT9q-0001ly-S5 for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Jul 2012 08:15:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrT9f-0001eA-3F for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2012 08:15:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrT9d-0000M8-JL for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2012 08:14:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrT9d-0000M4-G0 for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2012 08:14:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SrTFW-00086x-F5 for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2012 08:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Jul 2012 12:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11520 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11520-submit@debbugs.gnu.org id=B11520.134261400431113 (code B ref 11520); Wed, 18 Jul 2012 12:21:02 +0000 Original-Received: (at 11520) by debbugs.gnu.org; 18 Jul 2012 12:20:04 +0000 Original-Received: from localhost ([127.0.0.1]:47681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrTEZ-00085m-JO for submit@debbugs.gnu.org; Wed, 18 Jul 2012 08:20:04 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:60773) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrTEX-00085J-AI for 11520@debbugs.gnu.org; Wed, 18 Jul 2012 08:20:02 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q6ICDrW5032029; Wed, 18 Jul 2012 08:13:54 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 4DEC8AECAF; Wed, 18 Jul 2012 08:13:51 -0400 (EDT) In-Reply-To: (Simon Law's message of "Sun, 15 Jul 2012 12:33:37 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4282=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4282> : streams <786675> : uri <1168436> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:62093 Archived-At: > That way, electric-pair-mode can override the (put > 'self-insert-command 'delete-selection ...) with its own function that > understands the triggering condition. The triggering condition would > be extracted from electric-pair-post-self-insert-function so it could > be used in two places. That sounds like a reasonable plan, yes. An alternative is to change self-insert-command so that it pays attention to delete-selection-mode (and provides some hook for electric-pair-mode to indicate when it would use the region). > P.S. I don't have an bzr checkout of Emacs right now. Would this be > something useful to target against Emacs 24 as a bugfix? Yes. Stefan PS: I don't much like delete-selection-mode because of its implementation strategy (using a pre-command-hook along with symbol properties, as opposed to modifying the commands themselves). I can fully understand why it was done this way, but I'd be happy to see it changed, along the same lines as what we did for the shift-select-mode. AFAICT, of the various `delete-selection' properties, `kill' is only used for `open-line' (for no good reason) and could be eliminated. `supersede' is only used by command which should obey `delete-active-region' or close enough, `yank' is only used for commands which end up calling `yank' (so adding code to the `yank' command would cover them), and t is used for commands which end up calling `self-insert-command' (with a few minor exceptions like open-line).