From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michal Nazarewicz Newsgroups: gmane.emacs.devel Subject: [PATCH 1/5] tildify.el: Improve defcustom's types. Date: Sun, 2 Mar 2014 22:55:31 +0100 Message-ID: <1393797335-18125-2-git-send-email-mpn@google.com> References: <1393797335-18125-1-git-send-email-mpn@google.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 1393797390 9252 80.91.229.3 (2 Mar 2014 21:56:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Mar 2014 21:56:30 +0000 (UTC) To: emacs-devel@gnu.org, Stefan Monnier , =?UTF-8?q?Pavel=20Jan=C3=ADk?= , Milan Zamazal Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 02 22:56:37 2014 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 1WKENA-0001a3-Oi for ged-emacs-devel@m.gmane.org; Sun, 02 Mar 2014 22:56:36 +0100 Original-Received: from localhost ([::1]:36730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKENA-0002i8-DU for ged-emacs-devel@m.gmane.org; Sun, 02 Mar 2014 16:56:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKEMU-0001c7-O0 for emacs-devel@gnu.org; Sun, 02 Mar 2014 16:55:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKEMJ-0008Fc-0J for emacs-devel@gnu.org; Sun, 02 Mar 2014 16:55:54 -0500 Original-Received: from mail-ee0-x230.google.com ([2a00:1450:4013:c00::230]:47301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKEMI-0008F2-M4 for emacs-devel@gnu.org; Sun, 02 Mar 2014 16:55:42 -0500 Original-Received: by mail-ee0-f48.google.com with SMTP id e51so2484336eek.35 for ; Sun, 02 Mar 2014 13:55:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=wQbL/DDIJY86mCNAPt+oBHTRv1GBLLoWW29zlXaVtyc=; b=fxIUUPCpmSizlpW/X0lYk4tLZx95p5esa1Iepj95PvRr5vG2Jt1umXd9uqTlriXsZY oHo+Sib+dgcMdflLiwEVJG200edUbiZyfvZVj96Fu2Se9bCV3DiRfenTVgN0tTh4mAbB 11K2Rpc2+EHnim7IkDprpc1SyxTGyTw5cTIdLdxSHjP8hMieWwtUQzOrg3J4seKCyfXr s2b89x8u/dMMkhmSrfSxhQ8JPoGM3TBIhYJAql55NnC27vsI4TplaYF3Gjag6uYqkuVa MmJbtIRJ+Z+nILYpdMt3TJhWHq0Ox6q3YHAb2hkmtOl/MNXDkRXczwMbMGB4vVDV0HhY wC6A== 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=wQbL/DDIJY86mCNAPt+oBHTRv1GBLLoWW29zlXaVtyc=; b=lMJNLxafhN0Jhqc2dwx19GTCQuexgPfqRShrdg7+JvHpMy33NVfUW9lDSg24ntxoST poNnbtovhQHrK45PVhfrOpYOe7To21XAln/e6OsnpEXKR/zJjeUXty5JElGR7agsKdyp ecYa5l98BC93sn3apka+sDBbXB/zD+OwKKQvBKW8zXhHEppPg+/U+nZiUH5SRQ0u8hMe nbDxPyuJ/ZV3wk5IF2BtBC0ImuphXcjHP5dnmdVYaXAcJf/K5wDQ376pLHPRIwMhGTH/ 3kIlbzVrAws7M3QKuR7gdpabkBb6Z2L6CoL6+E7Z3CWkipaU485Y3grMqvo/i1lRCJmF Murg== X-Gm-Message-State: ALoCoQmhVgJVp9AkUjPY59x15fP87y76V2JdyKT9XLAK3u7CV/BFcgdtZ88w2+U4iDAUb+jAjIG7iIIiQsdwvZD5U3Uzg7ZSpZGKyx+sRfbN7BRfwILbdIBDMmmocD8sA8rEmNEF0b52UejVQ6BI+gFJUbwctG+aRWgXMDXyHmL3ktXsRspc0yFkse2E2wMbJqKDVFnKm6Xd1j8rAhgUSwTfoy7rUWxGfw== X-Received: by 10.15.76.135 with SMTP id n7mr34923348eey.36.1393797341600; Sun, 02 Mar 2014 13:55:41 -0800 (PST) Original-Received: from mpn-glaptop.zrh.mina86.com (178-82-34-113.dynamic.hispeed.ch. [178.82.34.113]) by mx.google.com with ESMTPSA id u6sm41551056eep.11.2014.03.02.13.55.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Mar 2014 13:55:40 -0800 (PST) X-Mailer: git-send-email 1.9.0 In-Reply-To: <1393797335-18125-1-git-send-email-mpn@google.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::230 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:170078 Archived-At: From: Michal Nazarewicz Add more tags explaining what each value means and replace “sexp” used in `tildify-ignored-environments-alist' with a full type declaration. --- lisp/textmodes/tildify.el | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el index 9732e7f..f534bdb 100644 --- a/lisp/textmodes/tildify.el +++ b/lisp/textmodes/tildify.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1997-2014 Free Software Foundation, Inc. ;; Author: Milan Zamazal -;; Version: 4.5 +;; Version: 4.5.1 ;; Keywords: text, TeX, SGML, wp ;; This file is part of GNU Emacs. @@ -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 *** -- 1.9.0.279.gdc9e3eb