From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michal Nazarewicz Newsgroups: gmane.emacs.bugs Subject: bug#17699: [PATCH 3/7] tildify.el: Improve defcustom's types Date: Thu, 5 Jun 2014 13:27:32 +0200 Message-ID: <1401967656-16171-3-git-send-email-mina86@mina86.com> References: <1401967656-16171-1-git-send-email-mina86@mina86.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1401968513 12087 80.91.229.3 (5 Jun 2014 11:41:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Jun 2014 11:41:53 +0000 (UTC) To: 17699@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 05 13:41:47 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1WsW3F-0005ev-Bw for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Jun 2014 13:41:45 +0200 Original-Received: from localhost ([::1]:40051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsW3E-0002cA-VY for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Jun 2014 07:41:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsW2k-0001rd-Tn for bug-gnu-emacs@gnu.org; Thu, 05 Jun 2014 07:41:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsW2Z-0005NQ-RQ for bug-gnu-emacs@gnu.org; Thu, 05 Jun 2014 07:41:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsW2Z-0005Mr-OJ for bug-gnu-emacs@gnu.org; Thu, 05 Jun 2014 07:41:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WsVq1-0007n0-Ij for bug-gnu-emacs@gnu.org; Thu, 05 Jun 2014 07:28:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michal Nazarewicz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jun 2014 11:28:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17699 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17699-submit@debbugs.gnu.org id=B17699.140196768229906 (code B ref 17699); Thu, 05 Jun 2014 11:28:05 +0000 Original-Received: (at 17699) by debbugs.gnu.org; 5 Jun 2014 11:28:02 +0000 Original-Received: from localhost ([127.0.0.1]:44814 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVpx-0007lq-2Q for submit@debbugs.gnu.org; Thu, 05 Jun 2014 07:28:02 -0400 Original-Received: from mail-we0-f201.google.com ([74.125.82.201]:53078) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVpt-0007kS-8t for 17699@debbugs.gnu.org; Thu, 05 Jun 2014 07:27:57 -0400 Original-Received: by mail-we0-f201.google.com with SMTP id w62so85720wes.4 for <17699@debbugs.gnu.org>; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=a3vfvz2Nz+LWJNiAF7nnpGYTq+6GWVWoCoTdW3HnjME=; b=iLRkQFyI1KdzoEydTTsbtC1J16geGLmdpe3MtnL140R1/x7rBB376geE7tlERL5Xtc wfag2SS3HNLtyxBW7Jy51t2LbN2N8+k22QYTvHPr5JRizNrlgRU9EBkvwDzymPeL5DjJ kniOZ21/sD7etFUyExj03fNeS9jaA+LObSSf2m/wLFA5Z6wSyX0FVPa51O3Fcs0EBoeW xWgiTpAw+pNJGfvg1mn0HJTVQB4rPsyKmpn2U402gdtdBKtcsHAG7rrNnzGLhZ1t2kIq b1c4k6So99gNJHqmdbPRasR46FZUrel/SnF33WBIxVke/9rzTui3lfo2Pi1bVDIRT+Jp +NIA== X-Gm-Message-State: ALoCoQn3ngOFPSGq6Le2GKKWnAuw0xECr3b7YKjyJvI7WISjF6L2j5k+7hc2DBf3ws6zFOv4CrmgwlCJkELEZGQCuBXzQJ1s4pBZ++UGFLM6YZsSlvWlGc1M4voRv/7J7Qfdu5CcY7bK X-Received: by 10.181.13.196 with SMTP id fa4mr2221607wid.6.1401967666353; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Original-Received: from corp2gmr1-2.eem.corp.google.com (corp2gmr1-2.eem.corp.google.com [172.25.138.117]) by gmr-mx.google.com with ESMTPS id eh2si903080wib.2.2014.06.05.04.27.46 for <17699@debbugs.gnu.org> (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Original-Received: from hpgntag-ubiq62.eem.corp.google.com (hpgntag-ubiq62.eem.corp.google.com [172.25.135.103]) by corp2gmr1-2.eem.corp.google.com (Postfix) with ESMTP id 339D31E4316 for <17699@debbugs.gnu.org>; Thu, 5 Jun 2014 04:27:46 -0700 (PDT) Original-Received: by hpgntag-ubiq62.eem.corp.google.com (Postfix, from userid 126942) id E891310B6FA; Thu, 5 Jun 2014 13:27:45 +0200 (CEST) X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1401967656-16171-1-git-send-email-mina86@mina86.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:90042 Archived-At: * lisp/textmodes/tildify.el (tildify-pattern-alist) (tildify-string-alist, tildify-ignored-environments-alist): Add more tags explaining what each value means and replace “sexp” used in `tildify-ignored-environments-alist' with a full type declaration. --- lisp/ChangeLog | 6 ++++++ lisp/textmodes/tildify.el | 32 +++++++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 523b2a9..487e21c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2014-06-05 Michal Nazarewicz + * textmodes/tildify.el (tildify-pattern-alist) + (tildify-string-alist, tildify-ignored-environments-alist): + Improve defcustom's types by adding more tags explaining what each + value means and replace “sexp” used in + `tildify-ignored-environments-alist' with a full type declaration. + * textmodes/tildify.el (tildify-find-env): Fix matched group indexes in end-regex building diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el index 7aa338e..d61998a 100644 --- a/lisp/textmodes/tildify.el +++ b/lisp/textmodes/tildify.el @@ -77,7 +77,13 @@ by the hard space character. The form (MAJOR-MODE . SYMBOL) defines alias item for MAJOR-MODE. For this mode, the item for the mode SYMBOL is looked up in the alist instead." :group 'tildify - :type '(repeat (choice (list symbol regexp integer) (cons symbol symbol)))) + :type '(repeat (cons :tag "Entry for major mode" + (choice (const :tag "Default" t) + (symbol :tag "Major mode")) + (choice (list :tag "Regexp" + regexp + (integer :tag "Group ")) + (symbol :tag "Like other"))))) (defcustom tildify-string-alist '((latex-mode . "~") @@ -104,7 +110,12 @@ for SGML. The form (MAJOR-MODE . SYMBOL) defines alias item for MAJOR-MODE. For this mode, the item for the mode SYMBOL is looked up in the alist instead." :group 'tildify - :type '(repeat (cons symbol (choice string symbol)))) + :type '(repeat (cons :tag "Entry for major mode" + (choice (const :tag "Default" t) + (symbol :tag "Major mode")) + (choice (const :tag "No-break space (U+00A0)" "\u00A0") + (string :tag "String ") + (symbol :tag "Like other"))))) (defcustom tildify-ignored-environments-alist '((latex-mode @@ -160,7 +171,22 @@ END-REGEX defines end of the corresponding text part and can be either: subexpressions of BEG-REGEX (this is used to solve cases like \\\\verb in TeX)." :group 'tildify - :type '(repeat (cons symbol (choice symbol (repeat sexp))))) + :type '(repeat + (cons :tag "Entry for major mode" + (choice (const :tag "Default" t) + (symbol :tag "Major mode")) + (choice + (const :tag "None") + (repeat + :tag "Environments" + (cons :tag "Regexp pair" + (regexp :tag "Open ") + (choice :tag "Close" + (regexp :tag "Regexp") + (list :tag "Regexp and groups (concatenated)" + (choice (regexp :tag "Regexp") + (integer :tag "Group ")))))) + (symbol :tag "Like other"))))) ;;; *** Internal variables *** -- 2.0.0.526.g5318336