From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri D'Elia Newsgroups: gmane.emacs.devel Subject: Re: electric-pair-mode as a minor mode? Date: Fri, 27 Mar 2015 20:38:04 +0100 Message-ID: <5515B19C.5070303@thregr.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1427485138 2262 80.91.229.3 (27 Mar 2015 19:38:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Mar 2015 19:38:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 27 20:38:57 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 1Yba5n-0007oD-NN for ged-emacs-devel@m.gmane.org; Fri, 27 Mar 2015 20:38:55 +0100 Original-Received: from localhost ([::1]:51608 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yba5n-0006L6-7N for ged-emacs-devel@m.gmane.org; Fri, 27 Mar 2015 15:38:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yba5T-0006Ho-Bg for emacs-devel@gnu.org; Fri, 27 Mar 2015 15:38:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yba5Q-0001gf-GG for emacs-devel@gnu.org; Fri, 27 Mar 2015 15:38:35 -0400 Original-Received: from e.thregr.org ([2001:41c8:1:556b::10]:51969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yba5Q-0001gS-Az for emacs-devel@gnu.org; Fri, 27 Mar 2015 15:38:32 -0400 Original-Received: from [2a02:27e8:20:9049:8edc:d4ff:fed6:9d01] by e.thregr.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1Yba5M-0004RQ-7x; Fri, 27 Mar 2015 20:38:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:41c8:1:556b::10 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:184424 Archived-At: On 03/27/2015 12:18 PM, João Távora wrote: >>> I'd like to disable electric-pair-mode in certain buffers. >>> Probably the most important example is the minibuffer. >> [ 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 also don't see it. I though that, rightfully so, the syntax in > isearch-mode is tweaked so that parens don't match there. I'll have a deeper look why I have this behavior in isearch. > (add-hook 'foo-mode-hook > (lambda () > (setq-local electric-pair-pairs nil) > (setq-local electric-pair-text-pairs nil) > (setq-local electric-pair-inhibit-predicate #'identity))) > > So electric-pair-mode is still active (you still get autoskipping if the > syntax determines it), but autopairing is inhibited. Is this still > annoying? > > But making electric-pair-local-mode also sounds good to me. For text buffers, I would just disable the minor mode locally. The way I edit text is way less structured than code and much more chaotic. Dumb is better for me in this case. electric-pair not pairing in text mode is less expected than just turning it off. With the same logic, if electric-pair is on, I would expect it to pair by default even in text.