From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joaotavora@gmail.com (=?iso-8859-1?Q?Jo=E3o_T=E1vora?=) Newsgroups: gmane.emacs.devel Subject: Re: electric-pair-mode as a minor mode? Date: Mon, 30 Mar 2015 16:43:43 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1427730259 3958 80.91.229.3 (30 Mar 2015 15:44:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Mar 2015 15:44:19 +0000 (UTC) Cc: Yuri D'Elia , Lars Magne Ingebrigtsen , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 30 17:44:17 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 1YcbrH-0004RD-DP for ged-emacs-devel@m.gmane.org; Mon, 30 Mar 2015 17:44:11 +0200 Original-Received: from localhost ([::1]:34677 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcbrG-0004Q5-U4 for ged-emacs-devel@m.gmane.org; Mon, 30 Mar 2015 11:44:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycbqx-0004Po-W9 for emacs-devel@gnu.org; Mon, 30 Mar 2015 11:43:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ycbqt-0007MD-Uk for emacs-devel@gnu.org; Mon, 30 Mar 2015 11:43:51 -0400 Original-Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:35634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycbqt-0007M3-O4 for emacs-devel@gnu.org; Mon, 30 Mar 2015 11:43:47 -0400 Original-Received: by wicne17 with SMTP id ne17so36586633wic.0 for ; Mon, 30 Mar 2015 08:43:46 -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=btMuEMVhxDUF2jAJle4nK8GpBNpKgci1NemroDMIneY=; b=R7lmfNq5OZ973EbIFVCubbdavM8h+LAQkx0JutS8Y80w7hBzPDWmEsLZjYBkc/Gijg XJf08boyOk6L+BwOn+TXcMwrJtRdjzsh+rBG6fAVUHJRhDG00GUcj079kyWWvcOsBfj3 lsiWQCZ20ZqsrcAigLHPT+Wt4cM608GhAuwWsfQ0EvEtfgm+a2GNn/PeCF4Geph5XECm pCg/4oIEIqFGs5YIHxUvKu4UNrcEzVrCb8PQO74zNbd4q9RDKZLqFXB0z3oNdHwhjS2g YokBGHMhpA1WZcIMoJjdSa5d5CldU+G7a37bCDaY+OGtxi1BMWNPcYWYdBE38QbRs1nU aW6A== X-Received: by 10.194.170.193 with SMTP id ao1mr65415854wjc.52.1427730226882; Mon, 30 Mar 2015 08:43:46 -0700 (PDT) Original-Received: from GONDOMAR.yourcompany.com (mail3.siscog.pt. [195.23.29.18]) by mx.google.com with ESMTPSA id j7sm16247963wix.4.2015.03.30.08.43.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Mar 2015 08:43:46 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Mon, 30 Mar 2015 09:53:15 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::229 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:184552 Archived-At: Stefan Monnier writes: > 14 is definitely not right. A "comment fence" means "this char starts > or ends a comment, depending on whether we're inside a comment". oh, silly. > That's because you mis-used the comment markers. They should only be > put at the beginning and at the end of the comment. Makes sense. Look better? (defvar message--comment-regexps ;; TODO: make this user-visible/customizable??? (list ;; smiley regexp (TODO find a better one) ;; ":-?[()]" ;; citations ;; (concat "^" message-cite-prefix-regexp ".*$") ; citations ;; TODO: probably should be one here for citation header lines ;; TODO: also, let user add some of his own here? ) "List of regexps counting as comments in message-mode buffers.") (defun message--syntax-propertize (beg end) "Syntax-propertize certain message parts as comments." (mapc (lambda (regexp) (goto-char beg) (while (search-forward-regexp regexp end 'noerror) (let ((start (match-beginning 0)) (end (match-end 0))) (add-text-properties start (1+ start) '(syntax-table (11 . nil))) (add-text-properties (1- end) end '(syntax-table (12 . nil)))))) message--comment-regexps)) > >> * I'm using `message-cite-prefix-regexp' to detect citations. It's what >> font-lock in lisp/gnus/message.el uses so it seems ideal. But there >> are also a lot of vars like `message-yank-prefix', whose docstring >> contains the following line which baffles me: >>> Fix `message-cite-prefix-regexp' if it is set to an abnormal value. > Hopefully Lars can say something useful about that. I'll follow up with a proper patch then. Jo=E3o