From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) Newsgroups: gmane.emacs.devel Subject: Re: electric-pair-mode as a minor mode? Date: Sat, 28 Mar 2015 21:47:20 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1427579273 27720 80.91.229.3 (28 Mar 2015 21:47:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Mar 2015 21:47:53 +0000 (UTC) Cc: Yuri D'Elia , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 28 22:47:48 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 1Ybya1-0006Q3-C2 for ged-emacs-devel@m.gmane.org; Sat, 28 Mar 2015 22:47:45 +0100 Original-Received: from localhost ([::1]:55348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ybya0-0004Ng-F4 for ged-emacs-devel@m.gmane.org; Sat, 28 Mar 2015 17:47:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbyZl-0004Hw-7S for emacs-devel@gnu.org; Sat, 28 Mar 2015 17:47:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbyZh-0003Hw-69 for emacs-devel@gnu.org; Sat, 28 Mar 2015 17:47:29 -0400 Original-Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:38872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbyZg-0003Hs-Vl for emacs-devel@gnu.org; Sat, 28 Mar 2015 17:47:25 -0400 Original-Received: by wibgn9 with SMTP id gn9so75645473wib.1 for ; Sat, 28 Mar 2015 14:47:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=ivjhhcvwq9O1c80/1+QzQbLV5fitxCmhy9zyCoiSdx4=; b=I0TtfBFg3Y1XnP4FJv9+dHY9iXLi91W7S+510QFcfVhSvqZ8+igKwzsGK1KcqhmlFH ueLjGrhSDjBjlcFsrmhrqNFACRcwDwoa751r2uXS8k7XsRJOpZ5EY/gixfcudhWJXX4B b/PwHVE26dtT940DvHDxaGSRCXVIrx5hO+KktvaG5gzhKTCOCSn/rJDo2x9oxYHEBXPM JnoRyTWw8wCReV2i3ORfLVPqBJKx6vIX62HznniSPrvnggafAtqqh6ruYQqFuTHW4iWX d38wAbxyusYMaMQyDMGaJplHPmv2c3SziPXUy/0r0NoG9trVxGjqh4rOsgIjl/XQg3Zo pBqg== X-Received: by 10.180.206.244 with SMTP id lr20mr9042151wic.24.1427579244320; Sat, 28 Mar 2015 14:47:24 -0700 (PDT) Original-Received: from king.yourcompany.com (31.57.37.188.rev.vodafone.pt. [188.37.57.31]) by mx.google.com with ESMTPSA id u10sm9342517wib.1.2015.03.28.14.47.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Mar 2015 14:47:23 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sat, 28 Mar 2015 16:36:59 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22b 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:184486 Archived-At: Stefan Monnier writes: >> I like my syntax-table to understand to know as much as possible, so >> that other commands can dwim. Perhaps I'll try a message-mode hack to >> make blockquotes and smileys comment syntax. That should bring the 90% >> to 99%... > Those `)' thingies shouldn't be counted. There can be many other > reasons. Here's another: in message-mode you might have a buffer that > > > foo far bla (blibli > Here's my answer to that. But this is precisely the use case for the "message mode hack" earlier: If the following line (I called it a "blockquote" but perhaps it has another name) > foo bar bla (blibli is seen, in message-mode, has having comment syntax, then you shouldn't have that problem. If, additionally, smileys and other sporadic artifacts can also be identified as comments or strings, the situations you mention should be further reduced. I haven't tested, because I don't have time to learn about implementing comment syntaxes right now (I also probably won't if you tell me it's futile or problematic for some other reason). But anyway in my naive assessment it should work as well as it already does for programming modes, where `(' and `)' thingies can exist unpaired in comments and string literals. > Again, the parens are not balanced (in this case because the matching > paren was simply in a part of the message which was omitted). > >> Anyway `electric-pair-local-mode' is now available so people can choose. > > I actually don't want to disable electric-pair-mode in text-modes. > But I do find it occasionally too optimistic in its assessment of what > it knows. Yes, I understand, but what do you suggest? I just hope it's not changing the default value of `electric-pair-preserve-balance', which I personally like very much... Why don't you (add-hook 'text-mode-hook (lambda () (setq-local electric-pair-preserve-balance nil))) in your configuration? Jo=C3=A3o