From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode Date: Thu, 4 Jul 2019 19:01:00 +0000 Message-ID: <20190704190100.GG5564@ACM> References: <20190702131632.GA30597@ACM> <20190702160410.GB30597@ACM> <20190702182811.GC30597@ACM> <20190703105804.GA11238@ACM> <20190704165846.GF5564@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="178485"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel To: =?iso-8859-1?Q?Jo=E3o_T=E1vora?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 04 21:01:16 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hj6yq-000kHO-DO for ged-emacs-devel@m.gmane.org; Thu, 04 Jul 2019 21:01:16 +0200 Original-Received: from localhost ([::1]:48262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hj6yk-0003Sv-Rp for ged-emacs-devel@m.gmane.org; Thu, 04 Jul 2019 15:01:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35502) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hj6yf-0003Sb-VH for emacs-devel@gnu.org; Thu, 04 Jul 2019 15:01:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hj6yf-0004h0-1J for emacs-devel@gnu.org; Thu, 04 Jul 2019 15:01:05 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:27285 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hj6ye-0004fV-RC for emacs-devel@gnu.org; Thu, 04 Jul 2019 15:01:04 -0400 Original-Received: (qmail 64365 invoked by uid 3782); 4 Jul 2019 19:01:00 -0000 Original-Received: from acm.muc.de (p4FE15EDB.dip0.t-ipconnect.de [79.225.94.219]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 04 Jul 2019 21:01:00 +0200 Original-Received: (qmail 14094 invoked by uid 1000); 4 Jul 2019 19:01:00 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.org gmane.emacs.devel:238359 Archived-At: Hello, Joćo. On Thu, Jul 04, 2019 at 19:45:26 +0100, Joćo Tįvora wrote: > On Wed, Jul 03, 2019 at 14:31:58 +0100, Joćo Tįvora wrote: > > [ .... ] > > > If [you] don't agree, find a small enough solution that fixes e-p-m, > > > propose it here, then find a consensus that overrides my opinion, it > > > happens all the time, won't hold it against you or anyone else, good > > > luck. > > Here is the entire part of the fix needed for bug #36474, that should go > > into elec-pair-mode.el: > I'll have a look, but please show the whole change, not just > the new function. A new function by itself has no effect in e-p-m or > any other part of emacs. You should show where you intend to use it > (it should, in principle, be in one of e-p-m's external-facing variables). At the top of c-basic-common-init: diff -r eb4ee9bb0682 cc-mode.el --- a/cc-mode.el Thu Jul 04 13:01:08 2019 +0000 +++ b/cc-mode.el Thu Jul 04 18:56:49 2019 +0000 @@ -521,6 +521,14 @@ (setq c-buffer-is-cc-mode mode) + ;; Prepare for the use of `electric-pair-mode': + (eval-after-load "elec-pair" + '(when (and (boundp 'electric-pair-inhibit-predicate) + (fboundp 'electric-pair-cc-inhibit-predicate)) + (make-local-variable 'electric-pair-inhibit-predicate) + (setq electric-pair-inhibit-predicate + #'electric-pair-cc-inhibit-predicate))) + ;; these variables should always be buffer local; they do not affect ;; indentation style. (make-local-variable 'parse-sexp-ignore-comments) > Thanks, > Joćo -- Alan Mackenzie (Nuremberg, Germany).