From 72fa857e5a538b6f941848f8a9d902ae91e76b58 Mon Sep 17 00:00:00 2001 From: David Edmondson Date: Fri, 31 Oct 2014 08:05:21 +0000 Subject: [PATCH] [PATCH v1 2/2] emacs: Washing should use more `defcustom'. --- 1c/feee4fb2be0b3d6d73175dd4f6561ac84d562d | 188 ++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 1c/feee4fb2be0b3d6d73175dd4f6561ac84d562d diff --git a/1c/feee4fb2be0b3d6d73175dd4f6561ac84d562d b/1c/feee4fb2be0b3d6d73175dd4f6561ac84d562d new file mode 100644 index 000000000..810dab1a2 --- /dev/null +++ b/1c/feee4fb2be0b3d6d73175dd4f6561ac84d562d @@ -0,0 +1,188 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 0DF30431E62 + for ; Fri, 31 Oct 2014 01:05:49 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.379 +X-Spam-Level: +X-Spam-Status: No, score=0.379 tagged_above=-999 required=5 + tests=[NO_DNS_FOR_FROM=0.379] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id lxDYI1E6tLWe for ; + Fri, 31 Oct 2014 01:05:44 -0700 (PDT) +Received: from heart-of-gold.hh.sledj.net (disaster-area.hh.sledj.net + [81.149.164.25]) + by olra.theworths.org (Postfix) with ESMTP id CFBEA431FD4 + for ; Fri, 31 Oct 2014 01:05:37 -0700 (PDT) +Received: by heart-of-gold.hh.sledj.net (Postfix, from userid 501) + id 505661670FA5; Fri, 31 Oct 2014 08:05:21 +0000 (GMT) +From: David Edmondson +To: notmuch@notmuchmail.org +Subject: [PATCH v1 2/2] emacs: Washing should use more `defcustom'. +Date: Fri, 31 Oct 2014 08:05:21 +0000 +Message-Id: <1414742721-22561-3-git-send-email-dme@dme.org> +X-Mailer: git-send-email 1.9.3 (Apple Git-50) +In-Reply-To: <1414742721-22561-1-git-send-email-dme@dme.org> +References: <1414742721-22561-1-git-send-email-dme@dme.org> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 31 Oct 2014 08:05:49 -0000 + +More of the washing variables should be available through the standard +customisation interface. +--- + emacs/notmuch-wash.el | 88 +++++++++++++++++++++++++++++++++------------------ + 1 file changed, 57 insertions(+), 31 deletions(-) + +diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el +index 1844400..a76b4f5 100644 +--- a/emacs/notmuch-wash.el ++++ b/emacs/notmuch-wash.el +@@ -31,73 +31,99 @@ + "Cleaning up messages for display." + :group 'notmuch) + +-(defvar notmuch-wash-signature-regexp +- "^\\(-- ?\\|_+\\)$" +- "Pattern to match a line that separates content from signature.") +- +-(defvar notmuch-wash-citation-regexp +- "\\(^[[:space:]]*>.*\n\\)+" +- "Pattern to match citation lines.") +- +-(defvar notmuch-wash-original-regexp "^\\(--+\s?[oO]riginal [mM]essage\s?--+\\)$" +- "Pattern to match a line that separates original message from reply in top-posted message.") +- +-(defvar notmuch-wash-button-signature-hidden-format ++(defcustom notmuch-wash-signature-regexp "^\\(-- ?\\|_+\\)$" ++ "Pattern to match a line that separates content from signature." ++ :type 'regexp ++ :group 'notmuch-wash) ++ ++(defcustom notmuch-wash-citation-regexp "\\(^[[:space:]]*>.*\n\\)+" ++ "Pattern to match citation lines." ++ :type 'regexp ++ :group 'notmuch-wash) ++ ++(defcustom notmuch-wash-original-regexp "^\\(--+\s?[oO]riginal [mM]essage\s?--+\\)$" ++ "Pattern to match a line that separates original message from ++reply in top-posted message." ++ :type 'regexp ++ :group 'notmuch-wash) ++ ++(defcustom notmuch-wash-button-signature-hidden-format + "[ %d-line signature. Click/Enter to show. ]" + "String used to construct button text for hidden signatures. +-Can use up to one integer format parameter, i.e. %d") ++Can use up to one integer format parameter, i.e. %d." ++ :type 'string ++ :group 'notmuch-wash) + +-(defvar notmuch-wash-button-signature-visible-format ++(defcustom notmuch-wash-button-signature-visible-format + "[ %d-line signature. Click/Enter to hide. ]" + "String used to construct button text for visible signatures. +-Can use up to one integer format parameter, i.e. %d") ++Can use up to one integer format parameter, i.e. %d." ++ :type 'string ++ :group 'notmuch-wash) + +-(defvar notmuch-wash-button-citation-hidden-format ++(defcustom notmuch-wash-button-citation-hidden-format + "[ %d more citation lines. Click/Enter to show. ]" + "String used to construct button text for hidden citations. +-Can use up to one integer format parameter, i.e. %d") ++Can use up to one integer format parameter, i.e. %d." ++ :type 'string ++ :group 'notmuch-wash) + +-(defvar notmuch-wash-button-citation-visible-format ++(defcustom notmuch-wash-button-citation-visible-format + "[ %d more citation lines. Click/Enter to hide. ]" + "String used to construct button text for visible citations. +-Can use up to one integer format parameter, i.e. %d") ++Can use up to one integer format parameter, i.e. %d." ++ :type 'string ++ :group 'notmuch-wash) + +-(defvar notmuch-wash-button-original-hidden-format ++(defcustom notmuch-wash-button-original-hidden-format + "[ %d-line hidden original message. Click/Enter to show. ]" + "String used to construct button text for hidden citations. +-Can use up to one integer format parameter, i.e. %d") ++Can use up to one integer format parameter, i.e. %d." ++ :type 'string ++ :group 'notmuch-wash) + +-(defvar notmuch-wash-button-original-visible-format ++(defcustom notmuch-wash-button-original-visible-format + "[ %d-line original message. Click/Enter to hide. ]" + "String used to construct button text for visible citations. +-Can use up to one integer format parameter, i.e. %d") ++Can use up to one integer format parameter, i.e. %d." ++ :type 'string ++ :group 'notmuch-wash) + +-(defvar notmuch-wash-signature-lines-max 12 +- "Maximum length of signature that will be hidden by default.") ++(defcustom notmuch-wash-signature-lines-max 12 ++ "Maximum length of signature that will be hidden by default." ++ :type 'integer ++ :group 'notmuch-wash) + +-(defvar notmuch-wash-citation-lines-prefix 3 ++(defcustom notmuch-wash-citation-lines-prefix 3 + "Always show at least this many lines from the start of a citation. + + If there is one more line than the sum of + `notmuch-wash-citation-lines-prefix' and + `notmuch-wash-citation-lines-suffix', show that, otherwise +-collapse the remaining lines into a button.") ++collapse the remaining lines into a button." ++ :type 'integer ++ :group 'notmuch-wash) + +-(defvar notmuch-wash-citation-lines-suffix 3 ++(defcustom notmuch-wash-citation-lines-suffix 3 + "Always show at least this many lines from the end of a citation. + + If there is one more line than the sum of + `notmuch-wash-citation-lines-prefix' and + `notmuch-wash-citation-lines-suffix', show that, otherwise +-collapse the remaining lines into a button.") ++collapse the remaining lines into a button." ++ :type 'integer ++ :group 'notmuch-wash) + +-(defvar notmuch-wash-wrap-lines-length nil ++(defcustom notmuch-wash-wrap-lines-length nil + "Wrap line after at most this many characters. + + If this is nil, lines in messages will be wrapped to fit in the + current window. If this is a number, lines will be wrapped after + this many characters or at the window width (whichever one is +-lower).") ++lower)." ++ :type '(choice (const :tag "window width" nil) ++ (integer :tag "number of characters")) ++ :group 'notmuch-wash) + + (defface notmuch-wash-toggle-button + '((t (:inherit font-lock-comment-face))) +-- +1.9.3 (Apple Git-50) + -- 2.26.2