[PATCH] emacs: logically group def{custom,face}s
Pieter Praet
pieter at praet.org
Tue Jul 5 11:33:00 PDT 2011
To allow for expansion whilst keeping everything tidy and organized,
move all defcustom/defface variables to the following subgroups,
defined in notmuch-lib.el:
- Hello
- Search
- Show
- Send
- Crypto
- Hooks
- Appearance
- External Commands
Signed-off-by: Pieter Praet <pieter at praet.org>
---
emacs/notmuch-address.el | 3 +-
emacs/notmuch-crypto.el | 17 ++++++++++-----
emacs/notmuch-hello.el | 20 ++++++++++--------
emacs/notmuch-lib.el | 44 ++++++++++++++++++++++++++++++++++++++++-
emacs/notmuch-maildir-fcc.el | 2 +-
emacs/notmuch-message.el | 2 +-
emacs/notmuch-mua.el | 11 +++++----
emacs/notmuch-show.el | 14 ++++++------
emacs/notmuch.el | 35 +++++++++++++++++++++------------
9 files changed, 103 insertions(+), 45 deletions(-)
diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 1a7c577..553a04e 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -28,7 +28,8 @@
single argument and output a list of possible matches, one per
line."
:type 'string
- :group 'notmuch)
+ :group 'notmuch-send
+ :group 'notmuch-external)
(defvar notmuch-address-message-alist-member
'("^\\(Resent-\\)?\\(To\\|B?Cc\\|Reply-To\\|From\\|Mail-Followup-To\\|Mail-Copies-To\\):"
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index f03266f..b8132f5 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -33,33 +33,38 @@ validity of user ID of the signer.
The effect of setting this variable can be seen temporarily by
viewing a signed or encrypted message with M-RET in notmuch
search."
- :group 'notmuch
+ :group 'notmuch-crypto
:type 'boolean)
(defface notmuch-crypto-signature-good
'((t (:background "green" :foreground "black")))
"Face used for good signatures."
- :group 'notmuch)
+ :group 'notmuch-crypto
+ :group 'notmuch-appearance)
(defface notmuch-crypto-signature-good-key
'((t (:background "orange" :foreground "black")))
"Face used for good signatures."
- :group 'notmuch)
+ :group 'notmuch-crypto
+ :group 'notmuch-appearance)
(defface notmuch-crypto-signature-bad
'((t (:background "red" :foreground "black")))
"Face used for bad signatures."
- :group 'notmuch)
+ :group 'notmuch-crypto
+ :group 'notmuch-appearance)
(defface notmuch-crypto-signature-unknown
'((t (:background "red" :foreground "black")))
"Face used for signatures of unknown status."
- :group 'notmuch)
+ :group 'notmuch-crypto
+ :group 'notmuch-appearance)
(defface notmuch-crypto-decryption
'((t (:background "purple" :foreground "black")))
"Face used for encryption/decryption status messages."
- :group 'notmuch)
+ :group 'notmuch-crypto
+ :group 'notmuch-appearance)
(define-button-type 'notmuch-crypto-status-button-type
'action '(lambda (button) (message (button-get button 'help-echo)))
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 65fde75..060ffe4 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -35,12 +35,12 @@
(defcustom notmuch-recent-searches-max 10
"The number of recent searches to store and display."
:type 'integer
- :group 'notmuch)
+ :group 'notmuch-hello)
(defcustom notmuch-show-empty-saved-searches nil
"Should saved searches with no messages be listed?"
:type 'boolean
- :group 'notmuch)
+ :group 'notmuch-hello)
(defvar notmuch-hello-indent 4
"How much to indent non-headers.")
@@ -48,12 +48,13 @@
(defcustom notmuch-show-logo t
"Should the notmuch logo be shown?"
:type 'boolean
- :group 'notmuch)
+ :group 'notmuch-hello
+ :group 'notmuch-appearance)
(defcustom notmuch-show-all-tags-list nil
"Should all tags be shown in the notmuch-hello view?"
:type 'boolean
- :group 'notmuch)
+ :group 'notmuch-hello)
(defcustom notmuch-hello-tag-list-make-query nil
"Function or string to generate queries for the all tags list.
@@ -68,12 +69,12 @@ should return a filter for that tag, or nil to hide the tag."
(const :tag "Unread messages" "tag:unread")
(const :tag "Custom filter" string)
(const :tag "Custom filter function" function))
- :group 'notmuch)
+ :group 'notmuch-hello)
(defcustom notmuch-hello-hide-tags nil
"List of tags to be hidden in the \"all tags\"-section."
:type '(repeat string)
- :group 'notmuch)
+ :group 'notmuch-hello)
(defface notmuch-hello-logo-background
'((((class color)
@@ -83,7 +84,8 @@ should return a filter for that tag, or nil to hide the tag."
(background light))
(:background "white")))
"Background colour for the notmuch logo."
- :group 'notmuch)
+ :group 'notmuch-hello
+ :group 'notmuch-appearance)
(defcustom notmuch-column-control t
"Controls the number of columns for saved searches/tags in notmuch view.
@@ -105,7 +107,7 @@ So:
30.
- if you don't want to worry about all of this nonsense, leave
this set to `t'."
- :group 'notmuch
+ :group 'notmuch-hello
:type '(choice
(const :tag "Automatically calculated" t)
(integer :tag "Number of characters")
@@ -115,7 +117,7 @@ So:
"The string used as a decimal separator.
Typically \",\" in the US and UK and \".\" in Europe."
- :group 'notmuch
+ :group 'notmuch-hello
:type 'string)
(defvar notmuch-hello-url "http://notmuchmail.org"
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index f93c957..2fd1764 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -28,17 +28,57 @@
"Notmuch mail reader for Emacs."
:group 'mail)
+(defgroup notmuch-hello nil
+ ""
+ :tag "Notmuch Hello"
+ :group 'notmuch)
+
+(defgroup notmuch-search nil
+ ""
+ :tag "Notmuch Search"
+ :group 'notmuch)
+
+(defgroup notmuch-show nil
+ ""
+ :tag "Notmuch Show"
+ :group 'notmuch)
+
+(defgroup notmuch-send nil
+ ""
+ :tag "Notmuch Send"
+ :group 'notmuch)
+
+(defgroup notmuch-crypto nil
+ ""
+ :tag "Notmuch Crypto"
+ :group 'notmuch)
+
+(defgroup notmuch-hooks nil
+ ""
+ :tag "Notmuch Hooks"
+ :group 'notmuch)
+
+(defgroup notmuch-appearance nil
+ ""
+ :tag "Notmuch Appearance"
+ :group 'notmuch)
+
+(defgroup notmuch-external nil
+ ""
+ :tag "Notmuch External Commands"
+ :group 'notmuch)
+
(defcustom notmuch-search-oldest-first t
"Show the oldest mail first when searching."
:type 'boolean
- :group 'notmuch)
+ :group 'notmuch-search)
;;
(defcustom notmuch-saved-searches nil
"A list of saved searches to display."
:type '(alist :key-type string :value-type string)
- :group 'notmuch)
+ :group 'notmuch-hello)
(defvar notmuch-folders nil
"Deprecated name for what is now known as `notmuch-saved-searches'.")
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index e678868..b211302 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -52,7 +52,7 @@ You will be prompted to create the directory if it does not exist
yet when sending a mail."
:require 'notmuch-fcc-initialization
- :group 'notmuch
+ :group 'notmuch-send
:type '(choice
(const :tag "No FCC header" nil)
(string :tag "A single folder")
diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el
index aefd3fb..84b0e32 100644
--- a/emacs/notmuch-message.el
+++ b/emacs/notmuch-message.el
@@ -31,7 +31,7 @@ For example, if you wanted to add a \"replied\" tag and remove
the \"inbox\" and \"todo\", you would set
(\"replied\" \"-inbox\" \"-todo\"\)"
:type 'list
- :group 'notmuch)
+ :group 'notmuch-send)
(defun notmuch-message-mark-replied ()
;; get the in-reply-to header and parse it for the message id.
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 274c5da..612ce90 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -28,13 +28,14 @@
(defcustom notmuch-mua-send-hook '(notmuch-mua-message-send-hook)
"Hook run before sending messages."
- :group 'notmuch
+ :group 'notmuch-send
+ :group 'notmuch-hooks
:type 'hook)
(defcustom notmuch-mua-user-agent-function 'notmuch-mua-user-agent-full
"Function used to generate a `User-Agent:' string. If this is
`nil' then no `User-Agent:' will be generated."
- :group 'notmuch
+ :group 'notmuch-send
:type 'function
:options '(notmuch-mua-user-agent-full
notmuch-mua-user-agent-notmuch
@@ -43,7 +44,7 @@
(defcustom notmuch-mua-hidden-headers '("^User-Agent:")
"Headers that are added to the `message-mode' hidden headers
list."
- :group 'notmuch
+ :group 'notmuch-send
:type '(repeat string))
;;
@@ -151,7 +152,7 @@ list."
If this variable is left unset, then a list will be constructed from the
name and addresses configured in the notmuch configuration file."
- :group 'notmuch
+ :group 'notmuch-send
:type '(repeat string))
(defcustom notmuch-always-prompt-for-sender nil
@@ -159,7 +160,7 @@ name and addresses configured in the notmuch configuration file."
This is not taken into account when replying to a message, because in that case
the From: header is already filled in by notmuch."
- :group 'notmuch
+ :group 'notmuch-send
:type 'boolean)
(defvar notmuch-mua-sender-history nil)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f96743b..aabe9c5 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -46,7 +46,7 @@ For an open message, all of these headers will be made visible
according to `notmuch-message-headers-visible' or can be toggled
with `notmuch-show-toggle-headers'. For a closed message, only
the first header in the list will be visible."
- :group 'notmuch
+ :group 'notmuch-show
:type '(repeat string))
(defcustom notmuch-message-headers-visible t
@@ -57,12 +57,12 @@ If this value is non-nil, then all of the headers defined in
of each message. Otherwise, these headers will be hidden and
`notmuch-show-toggle-headers' can be used to make the visible for
any given message."
- :group 'notmuch
+ :group 'notmuch-show
:type 'boolean)
(defcustom notmuch-show-relative-dates t
"Display relative dates in the message summary line."
- :group 'notmuch
+ :group 'notmuch-show
:type 'boolean)
(defvar notmuch-show-markup-headers-hook '(notmuch-show-colour-headers)
@@ -71,12 +71,12 @@ any given message."
(defcustom notmuch-show-hook nil
"Functions called after populating a `notmuch-show' buffer."
- :group 'notmuch
+ :group 'notmuch-show
:type 'hook)
(defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-excerpt-citations)
"Functions used to improve the display of text/plain parts."
- :group 'notmuch
+ :group 'notmuch-show
:type 'hook
:options '(notmuch-wash-convert-inline-patch-to-part
notmuch-wash-wrap-long-lines
@@ -87,13 +87,13 @@ any given message."
;; Mostly useful for debugging.
(defcustom notmuch-show-all-multipart/alternative-parts t
"Should all parts of multipart/alternative parts be shown?"
- :group 'notmuch
+ :group 'notmuch-show
:type 'boolean)
(defcustom notmuch-show-indent-multipart nil
"Should the sub-parts of a multipart/* part be indented?"
;; dme: Not sure which is a good default.
- :group 'notmuch
+ :group 'notmuch-show
:type 'boolean)
(defmacro with-current-notmuch-show-message (&rest body)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index f11ec24..db6bce6 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -70,7 +70,7 @@ For example:
(setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\)
\(\"subject\" . \"%s\"\)\)\)"
:type '(alist :key-type (string) :value-type (string))
- :group 'notmuch)
+ :group 'notmuch-search)
(defun notmuch-select-tag-with-completion (prompt &rest search-terms)
(let ((tag-list
@@ -189,7 +189,8 @@ For a mouse binding, return nil."
"List of functions to call when notmuch displays the search results."
:type 'hook
:options '(hl-line-mode)
- :group 'notmuch)
+ :group 'notmuch-search
+ :group 'notmuch-hooks)
(defvar notmuch-search-mode-map
(let ((map (make-sparse-keymap)))
@@ -297,27 +298,32 @@ For a mouse binding, return nil."
'((((class color) (background light)) (:background "#f0f0f0"))
(((class color) (background dark)) (:background "#303030")))
"Face for the single-line message summary in notmuch-show-mode."
- :group 'notmuch)
+ :group 'notmuch-show
+ :group 'notmuch-appearance)
(defface notmuch-search-date
'((t :inherit default))
"Face used in search mode for dates."
- :group 'notmuch)
+ :group 'notmuch-search
+ :group 'notmuch-appearance)
(defface notmuch-search-count
'((t :inherit default))
"Face used in search mode for the count matching the query."
- :group 'notmuch)
+ :group 'notmuch-search
+ :group 'notmuch-appearance)
(defface notmuch-search-subject
'((t :inherit default))
"Face used in search mode for subjects."
- :group 'notmuch)
+ :group 'notmuch-search
+ :group 'notmuch-appearance)
(defface notmuch-search-matching-authors
'((t :inherit default))
"Face used in search mode for authors matching the query."
- :group 'notmuch)
+ :group 'notmuch-search
+ :group 'notmuch-appearance)
(defface notmuch-search-non-matching-authors
'((((class color)
@@ -329,7 +335,8 @@ For a mouse binding, return nil."
(t
(:italic t)))
"Face used in search mode for authors not matching the query."
- :group 'notmuch)
+ :group 'notmuch-search
+ :group 'notmuch-appearance)
(defface notmuch-tag-face
'((((class color)
@@ -341,7 +348,8 @@ For a mouse binding, return nil."
(t
(:bold t)))
"Face used in search mode face for tags."
- :group 'notmuch)
+ :group 'notmuch-search
+ :group 'notmuch-appearance)
(defun notmuch-search-mode ()
"Major mode displaying results of a notmuch search.
@@ -490,7 +498,7 @@ the messages that are about to be tagged"
:type 'hook
:options '(hl-line-mode)
- :group 'notmuch)
+ :group 'notmuch-hooks)
(defcustom notmuch-after-tag-hook nil
"Hooks that are run after tags of a message are modified.
@@ -501,7 +509,7 @@ a list of strings of the form \"+TAG\" or \"-TAG\".
the messages that were tagged"
:type 'hook
:options '(hl-line-mode)
- :group 'notmuch)
+ :group 'notmuch-hooks)
(defun notmuch-search-set-tags (tags)
(save-excursion
@@ -657,7 +665,8 @@ attributes overriding earlier. A message having both \"delete\"
and \"unread\" tags with the above settings would have a green
foreground and blue background."
:type '(alist :key-type (string) :value-type (custom-face-edit))
- :group 'notmuch)
+ :group 'notmuch-search
+ :group 'notmuch-appearance)
(defun notmuch-search-color-line (start end line-tag-list)
"Colorize lines in `notmuch-show' based on tags."
@@ -952,7 +961,7 @@ the user's needs:
2. Invoke \"notmuch new\" to incorporate the new mail
3. Invoke one or more \"notmuch tag\" commands to classify the mail"
:type 'string
- :group 'notmuch)
+ :group 'notmuch-external)
(defun notmuch-poll ()
"Run external script to import mail.
--
1.7.5.4
More information about the notmuch
mailing list