From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Willemse Newsgroups: gmane.emacs.devel Subject: Re: electric-pair-mode as a minor mode? Date: Fri, 27 Mar 2015 13:52:53 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1427460806 20192 80.91.229.3 (27 Mar 2015 12:53:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Mar 2015 12:53:26 +0000 (UTC) Cc: Yuri D'Elia , =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 27 13:53:18 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YbTlE-0002fG-T7 for ged-emacs-devel@m.gmane.org; Fri, 27 Mar 2015 13:53:17 +0100 Original-Received: from localhost ([::1]:50075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbTlD-0002IX-Si for ged-emacs-devel@m.gmane.org; Fri, 27 Mar 2015 08:53:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbTl8-0002IS-36 for emacs-devel@gnu.org; Fri, 27 Mar 2015 08:53:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbTl3-0002ah-Ty for emacs-devel@gnu.org; Fri, 27 Mar 2015 08:53:10 -0400 Original-Received: from r0.smtpout1.alwaysdata.com ([176.31.58.0]:37861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbTl3-0002aV-Jr for emacs-devel@gnu.org; Fri, 27 Mar 2015 08:53:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alwaysdata.net; s=ryuslash; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=LSAZLiw+3PvxtLnbkZCtjXvZn+Z4UEJ7goUVKcxdhT0=; b=HLTlKgD/x5279C+aC3jaz3BX9MXxKJHQR3WHZDxRv2rxDJZ9ym6zEvSBHcg87A9Ddalm2iJBL0DeyVDpqSYHZp68oWyPJX1Y1DDBkPSsJhBqfKAhIK4qooQEgt2dW8YBg09ufafBJ+diBCgksYMlxVG75380+q98NeHsi4vYbYU=; Original-Received: from [2a02:1812:2518:ce00:f24d:a2ff:fede:451c] (helo=localhost) by smtpout1.alwaysdata.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.77) (envelope-from ) id 1YbTks-0001lf-9I; Fri, 27 Mar 2015 13:52:54 +0100 In-Reply-To: (Stefan Monnier's message of "Thu, 26 Mar 2015 22:18:33 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-alwaysdata-ID: 59606506 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 176.31.58.0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:184376 Archived-At: Stefan Monnier writes: >> I'd like to disable electric-pair-mode in certain buffers. >> Probably the most important example is the minibuffer. > >> Incremental searching with eletric-pairing is frustrating as opposed to >> being helpful as the search is "temporarily broken" as soon as the pair >> is inserted. > > [ I'm curious to know more about those isearch and minibuffer cases > because I haven't bumped into them. Not that it makes any difference > to the following. ] > >> I made eletric-pair-mode nil/buffer-local in the hooks that I need, >> but somehow I feel electric-pair-mode should be a regular minor mode. > > Hmm, electric-pair-mode *is* a regular minor mode. Maybe you mean > that it should be buffer-local because you'd only want to enable it in > a few specific major modes? > > We could very well define an electric-pair-local-mode, like we did with > electric-indent-local-mode. In the mean time, you should be able to > hack it with something like: Not to be a nuisance, but I wrote a patch for that some time ago and I'm still waiting on a response: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19528 I've been using it since long before I sent it in and it's basically just a copy of the `electric-indent-local-mode' code (comments and all). Regards, Tom