From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: electric-pair-mode as a minor mode? Date: Fri, 27 Mar 2015 14:20:39 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1427480731 24849 80.91.229.3 (27 Mar 2015 18:25:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Mar 2015 18:25:31 +0000 (UTC) Cc: Yuri D'Elia , emacs-devel@gnu.org To: joaotavora@gmail.com (=?windows-1252?B?Sm/jbyBU4XZvcmE=?=) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 27 19:25: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 1YbYwW-000793-Dh for ged-emacs-devel@m.gmane.org; Fri, 27 Mar 2015 19:25:16 +0100 Original-Received: from localhost ([::1]:51290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbYwV-0007yg-Lo for ged-emacs-devel@m.gmane.org; Fri, 27 Mar 2015 14:25:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbYwR-0007yG-0a for emacs-devel@gnu.org; Fri, 27 Mar 2015 14:25:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbYwJ-0001Bz-Ka for emacs-devel@gnu.org; Fri, 27 Mar 2015 14:25:10 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:48320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbYs4-0005BV-Kj for emacs-devel@gnu.org; Fri, 27 Mar 2015 14:20:40 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUFAGvvdVRBbthL/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCws0EhQYDYg3ohGMDR06CQMDgz4Dg3AEqDs X-IPAS-Result: AgUFAGvvdVRBbthL/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCws0EhQYDYg3ohGMDR06CQMDgz4Dg3AEqDs X-IronPort-AV: E=Sophos;i="5.01,1,1400040000"; d="scan'208";a="114764475" Original-Received: from 65-110-216-75.cpe.pppoe.ca (HELO pastel.home) ([65.110.216.75]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Mar 2015 14:20:40 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id E4454D65; Fri, 27 Mar 2015 14:20:39 -0400 (EDT) In-Reply-To: (=?windows-1252?Q?=22Jo=E3o_T=E1v?= =?windows-1252?Q?ora=22's?= message of "Fri, 27 Mar 2015 14:09:28 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:184412 Archived-At: > Seriously, while I won't stand in the way of having some > `electric-pair-mode'-related default hookage in text-mode-hook, why > isn't this fixed in text-mode's syntax-table? Aren't those wrong > assumptions the real culprit? I don't think so: it's very useful for text-mode to match parentheses (even if it only works 90% of the time), so I definitely don't want to change that (that would prevent using C-M-f and friends). But code shouldn't assume that syntax-ppss gives any kind of useful info in such modes because in practice it's much too frequent for parentheses not to be properly paired. > But you obviously know this, so what do you have in mind? The behavior of the old electric-pair-mode did not use syntax-ppss and its `)' simply always skipped (if there was a `)' to skip, obviously). The assumption was basically that it's easier for the user to hit ')' one more time than to delete an extraneous ')'. Stefan