From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: electric-pair-mode Date: Fri, 29 Nov 2013 08:01:49 +0100 Message-ID: <87fvqf1yjm.fsf@thinkpad.tsdh.org> References: <877gc1n9vb.fsf@tsdh.uni-koblenz.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1385708522 28146 80.91.229.3 (29 Nov 2013 07:02:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Nov 2013 07:02:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 29 08:02:06 2013 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 1VmI5W-0001uL-33 for ged-emacs-devel@m.gmane.org; Fri, 29 Nov 2013 08:02:06 +0100 Original-Received: from localhost ([::1]:45712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmI5V-0006hO-DZ for ged-emacs-devel@m.gmane.org; Fri, 29 Nov 2013 02:02:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmI5N-0006gY-Fd for emacs-devel@gnu.org; Fri, 29 Nov 2013 02:02:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VmI5I-0007Cf-B4 for emacs-devel@gnu.org; Fri, 29 Nov 2013 02:01:57 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:52840) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmI5I-0007CL-3o for emacs-devel@gnu.org; Fri, 29 Nov 2013 02:01:52 -0500 Original-Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 649B320C5C; Fri, 29 Nov 2013 02:01:51 -0500 (EST) Original-Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 29 Nov 2013 02:01:51 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:cc:subject:references:date :in-reply-to:message-id:mime-version:content-type; s=smtpout; bh=v8PpcFTFwCj8MqwKJTgNsI53Kl0=; b=tpGFFpGXlMb/ehdsBJ81z7HdafDO oed3ruMwRQk60D5zR7F2Tx4FtnQz+eCnhkYFBAmvxZPyixQAd+FShefq0T4TVVDC o4QAvOQ0VMH/LafTKp2pO2JQezbslXjZYrPnFR/kGUlfTHROfZcTaFg0QPGOqgfs HfuaP8Jfouvg/3A= X-Sasl-enc: uUbT+LTrNiaxEqitGg55ywnXntWCw+g9FQGiu5P9aAwW 1385708511 Original-Received: from thinkpad.tsdh.org (unknown [91.67.164.26]) by mail.messagingengine.com (Postfix) with ESMTPA id CC4F26800F0; Fri, 29 Nov 2013 02:01:50 -0500 (EST) Mail-Followup-To: Stefan Monnier , emacs-devel@gnu.org In-Reply-To: (Stefan Monnier's message of "Thu, 21 Nov 2013 20:13:41 -0500") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.111.4.25 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:165852 Archived-At: Stefan Monnier writes: >> For example, in all kinds of lisp modes I'm using paredit which >> provides both features, too, in a slightly different form. So there >> I wouldn't want to activate these modes (although it seems having >> them activated doesn't do any harm). > > Looks like there's no problem, then. Ok, now I've found a mode where it's a problem. AUCTeX has its own TeX-ified brace pairing feature which for example knows that \left( has to be closed by \right(, \{ by \}, etc. With `electric-pair-mode' enabled, when typing a { I get two closing braces. Right now, I have "disabled" `electric-pair-mode' for auctex using: ;; AUCTeX brace pairing feature doesn't play nice with `electric-pair-mode' ;; which is a global minor mode as of emacs 24.4. (when (and (boundp 'electric-pair-mode) (boundp 'electric-pair-inhibit-predicate)) (set (make-local-variable 'electric-pair-inhibit-predicate) (lambda (char) t)))) Is that the way it's supposed to be done? I somehow have the feeling that `electric-pair-mode' should only do its magic if the opening paren/brace/bracket is inserted with `self-insert-command'. For modes that bind ({[ to special commands (like paredit and auctex), chances are high that you get some interference with whatever special logic the mode does. On the other hand, there doesn't seem to be a problem with paredit, so maybe we're just doing something wrong in auctex... Bye, Tassilo