unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: logically group def{custom,face}s
@ 2011-07-05 18:33 Pieter Praet
  2011-10-10 13:49 ` Daniel Schoepe
  0 siblings, 1 reply; 26+ messages in thread
From: Pieter Praet @ 2011-07-05 18:33 UTC (permalink / raw)
  To: notmuch

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@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

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] emacs: logically group def{custom,face}s
  2011-07-05 18:33 [PATCH] emacs: logically group def{custom,face}s Pieter Praet
@ 2011-10-10 13:49 ` Daniel Schoepe
  2011-10-18 15:18   ` Jameson Graef Rollins
  0 siblings, 1 reply; 26+ messages in thread
From: Daniel Schoepe @ 2011-10-10 13:49 UTC (permalink / raw)
  To: Pieter Praet, notmuch

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

On Tue,  5 Jul 2011 20:33:00 +0200, Pieter Praet <pieter@praet.org> wrote:
> To allow for expansion whilst keeping everything tidy and organized,
> move all defcustom/defface variables to the following subgroups,
> defined in notmuch-lib.el:

Since the customize page for notmuch is getting pretty crowded, I think
this patch is a good idea and should be applied.

Cheers,
Daniel

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] emacs: logically group def{custom,face}s
  2011-10-10 13:49 ` Daniel Schoepe
@ 2011-10-18 15:18   ` Jameson Graef Rollins
  2011-11-01 20:00     ` Pieter Praet
  0 siblings, 1 reply; 26+ messages in thread
From: Jameson Graef Rollins @ 2011-10-18 15:18 UTC (permalink / raw)
  To: Daniel Schoepe, Pieter Praet, notmuch

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

On Mon, 10 Oct 2011 15:49:03 +0200, Daniel Schoepe <daniel@schoepe.org> wrote:
> On Tue,  5 Jul 2011 20:33:00 +0200, Pieter Praet <pieter@praet.org> wrote:
> > To allow for expansion whilst keeping everything tidy and organized,
> > move all defcustom/defface variables to the following subgroups,
> > defined in notmuch-lib.el:
> 
> Since the customize page for notmuch is getting pretty crowded, I think
> this patch is a good idea and should be applied.

Agreed.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] emacs: logically group def{custom,face}s
  2011-10-18 15:18   ` Jameson Graef Rollins
@ 2011-11-01 20:00     ` Pieter Praet
  2011-11-21  2:51       ` David Bremner
  0 siblings, 1 reply; 26+ messages in thread
From: Pieter Praet @ 2011-11-01 20:00 UTC (permalink / raw)
  To: Jameson Graef Rollins, Daniel Schoepe, notmuch

On Tue, 18 Oct 2011 08:18:18 -0700, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> On Mon, 10 Oct 2011 15:49:03 +0200, Daniel Schoepe <daniel@schoepe.org> wrote:
> > On Tue,  5 Jul 2011 20:33:00 +0200, Pieter Praet <pieter@praet.org> wrote:
> > > To allow for expansion whilst keeping everything tidy and organized,
> > > move all defcustom/defface variables to the following subgroups,
> > > defined in notmuch-lib.el:
> > 
> > Since the customize page for notmuch is getting pretty crowded, I think
> > this patch is a good idea and should be applied.
> 
> Agreed.
> 
> jamie.

Thanks for testing, Daniel and Jameson!

It still applies cleanly, so if there's anything preventing it from
being merged in, I'd like to hear about it.


Peace

-- 
Pieter

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] emacs: logically group def{custom,face}s
  2011-11-01 20:00     ` Pieter Praet
@ 2011-11-21  2:51       ` David Bremner
  2012-01-12 17:12         ` [PATCH v2] " Pieter Praet
  0 siblings, 1 reply; 26+ messages in thread
From: David Bremner @ 2011-11-21  2:51 UTC (permalink / raw)
  To: Pieter Praet, Jameson Graef Rollins, Daniel Schoepe, notmuch

On Tue, 01 Nov 2011 21:00:28 +0100, Pieter Praet <pieter@praet.org> wrote:
> 
> Thanks for testing, Daniel and Jameson!
> 
> It still applies cleanly, so if there's anything preventing it from
> being merged in, I'd like to hear about it.
> 

Oops. Some time in the last few weeks, it stopped applying cleanly.

d

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v2] emacs: logically group def{custom,face}s
  2011-11-21  2:51       ` David Bremner
@ 2012-01-12 17:12         ` Pieter Praet
  2012-01-13  3:31           ` David Bremner
  2012-01-13 20:56           ` [PATCH v2] " Jameson Graef Rollins
  0 siblings, 2 replies; 26+ messages in thread
From: Pieter Praet @ 2012-01-12 17:12 UTC (permalink / raw)
  To: David Bremner, Jameson Graef Rollins, Daniel Schoepe; +Cc: Notmuch Mail

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

As an added benefit, defcustom keyword args are now consistently
in order of appearance @ defcustom's docstring (OCD much?).
---
 emacs/notmuch-address.el     |    3 +-
 emacs/notmuch-crypto.el      |   22 +++++++++++++-------
 emacs/notmuch-hello.el       |   34 ++++++++++++++++++--------------
 emacs/notmuch-lib.el         |   44 ++++++++++++++++++++++++++++++++++++++++-
 emacs/notmuch-maildir-fcc.el |    6 ++--
 emacs/notmuch-message.el     |    2 +-
 emacs/notmuch-mua.el         |   21 ++++++++++---------
 emacs/notmuch-show.el        |   33 ++++++++++++++++---------------
 emacs/notmuch.el             |   35 +++++++++++++++++++++------------
 9 files changed, 131 insertions(+), 69 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 8eba7a0..2e8b840 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 ac30098..232c1a0 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -34,38 +34,44 @@ The effect of setting this variable can be seen temporarily by
 providing a prefix when viewing a signed or encrypted message, or
 by providing a prefix when reloading the message in notmuch-show
 mode."
-  :group 'notmuch
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-crypto)
 
 (defface notmuch-crypto-part-header
   '((t (:foreground "blue")))
   "Face used for crypto parts headers."
-  :group 'notmuch)
+  :group 'notmuch-crypto
+  :group 'notmuch-appearance)
 
 (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 333d4c1..fad9027 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)
 
 (defun notmuch-sort-saved-searches (alist)
   "Generate an alphabetically sorted saved searches alist."
@@ -60,7 +60,7 @@ alist to be used."
 		 (const :tag "Sort alphabetically" notmuch-sort-saved-searches)
 		 (function :tag "Custom sort function"
 			   :value notmuch-sort-saved-searches))
-  :group 'notmuch)
+  :group 'notmuch-hello)
 
 (defvar notmuch-hello-indent 4
   "How much to indent non-headers.")
@@ -68,12 +68,13 @@ alist to be used."
 (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.
@@ -89,12 +90,12 @@ should return a filter for that tag, or nil to hide the tag."
 		 (string :tag "Custom filter"
 			 :value "tag:unread")
 		 (function :tag "Custom filter 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)
@@ -104,7 +105,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.
@@ -126,11 +128,11 @@ So:
   30.
 - if you don't want to worry about all of this nonsense, leave
   this set to `t'."
-  :group 'notmuch
   :type '(choice
 	  (const :tag "Automatically calculated" t)
 	  (integer :tag "Number of characters")
-	  (float :tag "Fraction of window")))
+	  (float :tag "Fraction of window"))
+  :group 'notmuch-hello)
 
 (defcustom notmuch-hello-thousands-separator " "
   "The string used as a thousands separator.
@@ -138,18 +140,20 @@ So:
 Typically \",\" in the US and UK and \".\" or \" \" in Europe.
 The latter is recommended in the SI/ISO 31-0 standard and by the
 International Bureau of Weights and Measures."
-  :group 'notmuch
-  :type 'string)
+  :type 'string
+  :group 'notmuch-hello)
 
 (defcustom notmuch-hello-mode-hook nil
   "Functions called after entering `notmuch-hello-mode'."
-  :group 'notmuch
-  :type 'hook)
+  :type 'hook
+  :group 'notmuch-hello
+  :group 'notmuch-hooks)
 
 (defcustom notmuch-hello-refresh-hook nil
   "Functions called after updating a `notmuch-hello' buffer."
   :type 'hook
-  :group 'notmuch)
+  :group 'notmuch-hello
+  :group 'notmuch-hooks)
 
 (defvar notmuch-hello-url "http://notmuchmail.org"
   "The `notmuch' web site.")
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 0f856bf..b089dfc 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 6fbf82d..dcfbc4b 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -51,13 +51,13 @@ the database.path option in the notmuch configuration file).
 You will be prompted to create the directory if it does not exist
 yet when sending a mail."
 
- :require 'notmuch-fcc-initialization
- :group 'notmuch
  :type '(choice
 	 (const :tag "No FCC header" nil)
 	 (string :tag "A single folder")
 	 (repeat :tag "A folder based on the From header"
-		 (cons regexp (string :tag "Folder")))))
+		 (cons regexp (string :tag "Folder"))))
+ :require 'notmuch-fcc-initialization
+ :group 'notmuch-send)
 
 (defun notmuch-fcc-initialization ()
   "If notmuch-fcc-directories is set,
diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el
index 08e5b17..264a5b9 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 32e2e30..e256302 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -28,25 +28,26 @@
 
 (defcustom notmuch-mua-send-hook '(notmuch-mua-message-send-hook)
   "Hook run before sending messages."
-  :group 'notmuch
-  :type 'hook)
+  :type 'hook
+  :group 'notmuch-send
+  :group 'notmuch-hooks)
 
 (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
   :type '(choice (const :tag "No user agent string" nil)
 		 (const :tag "Full" notmuch-mua-user-agent-full)
 		 (const :tag "Notmuch" notmuch-mua-user-agent-notmuch)
 		 (const :tag "Emacs" notmuch-mua-user-agent-emacs)
 		 (function :tag "Custom user agent function"
-			   :value notmuch-mua-user-agent-full)))
+			   :value notmuch-mua-user-agent-full))
+  :group 'notmuch-send)
 
 (defcustom notmuch-mua-hidden-headers '("^User-Agent:")
   "Headers that are added to the `message-mode' hidden headers
 list."
-  :group 'notmuch
-  :type '(repeat string))
+  :type '(repeat string)
+  :group 'notmuch-send)
 
 ;;
 
@@ -154,16 +155,16 @@ OTHER-ARGS are passed through to `message-mail'."
 
 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
-  :type '(repeat string))
+  :type '(repeat string)
+  :group 'notmuch-send)
 
 (defcustom notmuch-always-prompt-for-sender nil
   "Always prompt for the From: address when composing or forwarding a message.
 
 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
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-send)
 
 (defvar notmuch-mua-sender-history nil)
 
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 5502efd..d576e81 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -47,8 +47,8 @@ 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
-  :type '(repeat string))
+  :type '(repeat string)
+  :group 'notmuch-show)
 
 (defcustom notmuch-message-headers-visible t
   "Should the headers be visible by default?
@@ -58,13 +58,13 @@ 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
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-show)
 
 (defcustom notmuch-show-relative-dates t
   "Display relative dates in the message summary line."
-  :group 'notmuch
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-show)
 
 (defvar notmuch-show-markup-headers-hook '(notmuch-show-colour-headers)
   "A list of functions called to decorate the headers listed in
@@ -72,27 +72,27 @@ any given message."
 
 (defcustom notmuch-show-hook nil
   "Functions called after populating a `notmuch-show' buffer."
-  :group 'notmuch
-  :type 'hook)
+  :type 'hook
+  :group 'notmuch-show)
 
 (defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-wrap-long-lines
 						 notmuch-wash-tidy-citations
 						 notmuch-wash-elide-blank-lines
 						 notmuch-wash-excerpt-citations)
   "Functions used to improve the display of text/plain parts."
-  :group 'notmuch
   :type 'hook
   :options '(notmuch-wash-convert-inline-patch-to-part
 	     notmuch-wash-wrap-long-lines
 	     notmuch-wash-tidy-citations
 	     notmuch-wash-elide-blank-lines
-	     notmuch-wash-excerpt-citations))
+	     notmuch-wash-excerpt-citations)
+  :group 'notmuch-show)
 
 ;; Mostly useful for debugging.
 (defcustom notmuch-show-all-multipart/alternative-parts t
   "Should all parts of multipart/alternative parts be shown?"
-  :group 'notmuch
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-show)
 
 (defcustom notmuch-indent-messages-width 1
   "Width of message indentation in threads.
@@ -101,14 +101,15 @@ Messages are shown indented according to their depth in a thread.
 This variable determines the width of this indentation measured
 in number of blanks.  Defaults to `1', choose `0' to disable
 indentation."
-  :group 'notmuch
-  :type 'integer)
+  :type 'integer
+  :group 'notmuch-show
+  :group 'notmuch-appearance)
 
 (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
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-show)
 
 (defmacro with-current-notmuch-show-message (&rest body)
   "Evaluate body with current buffer set to the text of current message"
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 1e61775..dca38af 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)
 
 (defvar notmuch-query-history nil
   "Variable to store minibuffer history for notmuch queries")
@@ -199,7 +199,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)))
@@ -306,27 +307,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)
@@ -338,7 +344,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)
@@ -350,7 +357,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.
@@ -495,7 +503,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.
@@ -506,7 +514,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
@@ -662,7 +670,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."
@@ -997,7 +1006,7 @@ Note that the recommended way of achieving the same is using
   :type '(choice (const :tag "notmuch new" nil)
 		 (const :tag "Disabled" "")
 		 (string :tag "Custom script"))
-  :group 'notmuch)
+  :group 'notmuch-external)
 
 (defun notmuch-poll ()
   "Run \"notmuch new\" or an external script to import mail.
-- 
1.7.8.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v2] emacs: logically group def{custom,face}s
  2012-01-12 17:12         ` [PATCH v2] " Pieter Praet
@ 2012-01-13  3:31           ` David Bremner
  2012-01-13 16:15             ` David Edmondson
  2012-01-14  9:02             ` Pieter Praet
  2012-01-13 20:56           ` [PATCH v2] " Jameson Graef Rollins
  1 sibling, 2 replies; 26+ messages in thread
From: David Bremner @ 2012-01-13  3:31 UTC (permalink / raw)
  To: Pieter Praet; +Cc: Notmuch Mail

On Thu, 12 Jan 2012 18:12:16 +0100, Pieter Praet <pieter@praet.org> wrote:
> 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

I didn't investigate too closely, but I noticed when I customize-group
emacs, each subgroup has some explanatory text beside it. Did you omit
that on purpose?

d

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2] emacs: logically group def{custom,face}s
  2012-01-13  3:31           ` David Bremner
@ 2012-01-13 16:15             ` David Edmondson
  2012-01-14  9:05               ` Pieter Praet
  2012-01-14  9:02             ` Pieter Praet
  1 sibling, 1 reply; 26+ messages in thread
From: David Edmondson @ 2012-01-13 16:15 UTC (permalink / raw)
  To: David Bremner, Pieter Praet; +Cc: Notmuch Mail

[-- Attachment #1: Type: text/plain, Size: 673 bytes --]

On Thu, 12 Jan 2012 23:31:34 -0400, David Bremner <david@tethera.net> wrote:
> On Thu, 12 Jan 2012 18:12:16 +0100, Pieter Praet <pieter@praet.org> wrote:
> > 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
> 
> I didn't investigate too closely, but I noticed when I customize-group
> emacs, each subgroup has some explanatory text beside it. Did you omit
> that on purpose?

That should be a requirement, I think.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2] emacs: logically group def{custom,face}s
  2012-01-12 17:12         ` [PATCH v2] " Pieter Praet
  2012-01-13  3:31           ` David Bremner
@ 2012-01-13 20:56           ` Jameson Graef Rollins
  1 sibling, 0 replies; 26+ messages in thread
From: Jameson Graef Rollins @ 2012-01-13 20:56 UTC (permalink / raw)
  To: Pieter Praet, David Bremner, Daniel Schoepe; +Cc: Notmuch Mail

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

On Thu, 12 Jan 2012 18:12:16 +0100, Pieter Praet <pieter@praet.org> wrote:
> To allow for expansion whilst keeping everything tidy and organized,
> move all defcustom/defface variables to the following subgroups,
> defined in notmuch-lib.el:

Baring the issue that the Davids brought up about the sub group
descriptions, I think this would be a nice cleanup.  +1.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2] emacs: logically group def{custom,face}s
  2012-01-13  3:31           ` David Bremner
  2012-01-13 16:15             ` David Edmondson
@ 2012-01-14  9:02             ` Pieter Praet
  2012-01-14  9:04               ` [PATCH] " Pieter Praet
  1 sibling, 1 reply; 26+ messages in thread
From: Pieter Praet @ 2012-01-14  9:02 UTC (permalink / raw)
  To: David Bremner; +Cc: Notmuch Mail

On Thu, 12 Jan 2012 23:31:34 -0400, David Bremner <david@tethera.net> wrote:
> On Thu, 12 Jan 2012 18:12:16 +0100, Pieter Praet <pieter@praet.org> wrote:
> > 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
> 
> I didn't investigate too closely, but I noticed when I customize-group
> emacs, each subgroup has some explanatory text beside it. Did you omit
> that on purpose?
> 

That is correct.  Coming up with decent docstrings is hard :)

Also, the group names are fairly descriptive in and of themselves IMO.

Anyways, I've given it a shot, but (I hope!) people will come up with
much better descriptions, so this probably isn't the end of it...

Patch follows.

> d


Peace

-- 
Pieter

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH] emacs: logically group def{custom,face}s
  2012-01-14  9:02             ` Pieter Praet
@ 2012-01-14  9:04               ` Pieter Praet
  2012-01-14 18:08                 ` Austin Clements
  0 siblings, 1 reply; 26+ messages in thread
From: Pieter Praet @ 2012-01-14  9:04 UTC (permalink / raw)
  To: David Bremner; +Cc: Notmuch Mail

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
- External Commands
- Appearance

As an added benefit, defcustom keyword args are now consistently
in order of appearance @ defcustom's docstring (OCD much?).

---
 emacs/notmuch-address.el     |    3 +-
 emacs/notmuch-crypto.el      |   22 +++++++++++++-------
 emacs/notmuch-hello.el       |   34 +++++++++++++++++--------------
 emacs/notmuch-lib.el         |   45 ++++++++++++++++++++++++++++++++++++++++-
 emacs/notmuch-maildir-fcc.el |    6 ++--
 emacs/notmuch-message.el     |    2 +-
 emacs/notmuch-mua.el         |   21 ++++++++++---------
 emacs/notmuch-show.el        |   33 +++++++++++++++--------------
 emacs/notmuch.el             |   35 ++++++++++++++++++++------------
 9 files changed, 132 insertions(+), 69 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 8eba7a0..2e8b840 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 ac30098..232c1a0 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -34,38 +34,44 @@ The effect of setting this variable can be seen temporarily by
 providing a prefix when viewing a signed or encrypted message, or
 by providing a prefix when reloading the message in notmuch-show
 mode."
-  :group 'notmuch
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-crypto)
 
 (defface notmuch-crypto-part-header
   '((t (:foreground "blue")))
   "Face used for crypto parts headers."
-  :group 'notmuch)
+  :group 'notmuch-crypto
+  :group 'notmuch-appearance)
 
 (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 02017ce..2493a26 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)
 
 (defun notmuch-sort-saved-searches (alist)
   "Generate an alphabetically sorted saved searches alist."
@@ -60,7 +60,7 @@ alist to be used."
 		 (const :tag "Sort alphabetically" notmuch-sort-saved-searches)
 		 (function :tag "Custom sort function"
 			   :value notmuch-sort-saved-searches))
-  :group 'notmuch)
+  :group 'notmuch-hello)
 
 (defvar notmuch-hello-indent 4
   "How much to indent non-headers.")
@@ -68,12 +68,13 @@ alist to be used."
 (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.
@@ -89,12 +90,12 @@ should return a filter for that tag, or nil to hide the tag."
 		 (string :tag "Custom filter"
 			 :value "tag:unread")
 		 (function :tag "Custom filter 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)
@@ -104,7 +105,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.
@@ -126,11 +128,11 @@ So:
   30.
 - if you don't want to worry about all of this nonsense, leave
   this set to `t'."
-  :group 'notmuch
   :type '(choice
 	  (const :tag "Automatically calculated" t)
 	  (integer :tag "Number of characters")
-	  (float :tag "Fraction of window")))
+	  (float :tag "Fraction of window"))
+  :group 'notmuch-hello)
 
 (defcustom notmuch-hello-thousands-separator " "
   "The string used as a thousands separator.
@@ -138,18 +140,20 @@ So:
 Typically \",\" in the US and UK and \".\" or \" \" in Europe.
 The latter is recommended in the SI/ISO 31-0 standard and by the
 International Bureau of Weights and Measures."
-  :group 'notmuch
-  :type 'string)
+  :type 'string
+  :group 'notmuch-hello)
 
 (defcustom notmuch-hello-mode-hook nil
   "Functions called after entering `notmuch-hello-mode'."
-  :group 'notmuch
-  :type 'hook)
+  :type 'hook
+  :group 'notmuch-hello
+  :group 'notmuch-hooks)
 
 (defcustom notmuch-hello-refresh-hook nil
   "Functions called after updating a `notmuch-hello' buffer."
   :type 'hook
-  :group 'notmuch)
+  :group 'notmuch-hello
+  :group 'notmuch-hooks)
 
 (defvar notmuch-hello-url "http://notmuchmail.org"
   "The `notmuch' web site.")
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 0f856bf..f6f48e9 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -28,17 +28,58 @@
   "Notmuch mail reader for Emacs."
   :group 'mail)
 
+(defgroup notmuch-hello nil
+  "Options concerning `notmuch-hello-mode'."
+  :tag "Notmuch Hello"
+  :group 'notmuch)
+
+(defgroup notmuch-search nil
+  "Options concerning `notmuch-search-mode'."
+  :tag "Notmuch Search"
+  :group 'notmuch)
+
+(defgroup notmuch-show nil
+  "Options concerning `notmuch-show-mode'."
+  :tag "Notmuch Show"
+  :group 'notmuch)
+
+(defgroup notmuch-send nil
+  "Options concerning the sending of messages."
+  :tag "Notmuch Send"
+  :group 'notmuch)
+
+(defgroup notmuch-crypto nil
+  "Options concerning the processing and fontification of
+cryptographic MIME parts in `notmuch-show-mode'."
+  :tag "Notmuch Crypto"
+  :group 'notmuch)
+
+(defgroup notmuch-hooks nil
+  "Run custom code on well-defined occasions."
+  :tag "Notmuch Hooks"
+  :group 'notmuch)
+
+(defgroup notmuch-external nil
+  "Run more custom code on different well-defined occasions."
+  :tag "Notmuch External Commands"
+  :group 'notmuch)
+
+(defgroup notmuch-appearance nil
+  "Options concerning how Notmuch looks."
+  :tag "Notmuch Appearance"
+  :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 6fbf82d..dcfbc4b 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -51,13 +51,13 @@ the database.path option in the notmuch configuration file).
 You will be prompted to create the directory if it does not exist
 yet when sending a mail."
 
- :require 'notmuch-fcc-initialization
- :group 'notmuch
  :type '(choice
 	 (const :tag "No FCC header" nil)
 	 (string :tag "A single folder")
 	 (repeat :tag "A folder based on the From header"
-		 (cons regexp (string :tag "Folder")))))
+		 (cons regexp (string :tag "Folder"))))
+ :require 'notmuch-fcc-initialization
+ :group 'notmuch-send)
 
 (defun notmuch-fcc-initialization ()
   "If notmuch-fcc-directories is set,
diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el
index 08e5b17..264a5b9 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 32e2e30..e256302 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -28,25 +28,26 @@
 
 (defcustom notmuch-mua-send-hook '(notmuch-mua-message-send-hook)
   "Hook run before sending messages."
-  :group 'notmuch
-  :type 'hook)
+  :type 'hook
+  :group 'notmuch-send
+  :group 'notmuch-hooks)
 
 (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
   :type '(choice (const :tag "No user agent string" nil)
 		 (const :tag "Full" notmuch-mua-user-agent-full)
 		 (const :tag "Notmuch" notmuch-mua-user-agent-notmuch)
 		 (const :tag "Emacs" notmuch-mua-user-agent-emacs)
 		 (function :tag "Custom user agent function"
-			   :value notmuch-mua-user-agent-full)))
+			   :value notmuch-mua-user-agent-full))
+  :group 'notmuch-send)
 
 (defcustom notmuch-mua-hidden-headers '("^User-Agent:")
   "Headers that are added to the `message-mode' hidden headers
 list."
-  :group 'notmuch
-  :type '(repeat string))
+  :type '(repeat string)
+  :group 'notmuch-send)
 
 ;;
 
@@ -154,16 +155,16 @@ OTHER-ARGS are passed through to `message-mail'."
 
 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
-  :type '(repeat string))
+  :type '(repeat string)
+  :group 'notmuch-send)
 
 (defcustom notmuch-always-prompt-for-sender nil
   "Always prompt for the From: address when composing or forwarding a message.
 
 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
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-send)
 
 (defvar notmuch-mua-sender-history nil)
 
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 034db87..bff48f6 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -47,8 +47,8 @@ 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
-  :type '(repeat string))
+  :type '(repeat string)
+  :group 'notmuch-show)
 
 (defcustom notmuch-message-headers-visible t
   "Should the headers be visible by default?
@@ -58,13 +58,13 @@ 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
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-show)
 
 (defcustom notmuch-show-relative-dates t
   "Display relative dates in the message summary line."
-  :group 'notmuch
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-show)
 
 (defvar notmuch-show-markup-headers-hook '(notmuch-show-colour-headers)
   "A list of functions called to decorate the headers listed in
@@ -72,27 +72,27 @@ any given message."
 
 (defcustom notmuch-show-hook nil
   "Functions called after populating a `notmuch-show' buffer."
-  :group 'notmuch
-  :type 'hook)
+  :type 'hook
+  :group 'notmuch-show)
 
 (defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-wrap-long-lines
 						 notmuch-wash-tidy-citations
 						 notmuch-wash-elide-blank-lines
 						 notmuch-wash-excerpt-citations)
   "Functions used to improve the display of text/plain parts."
-  :group 'notmuch
   :type 'hook
   :options '(notmuch-wash-convert-inline-patch-to-part
 	     notmuch-wash-wrap-long-lines
 	     notmuch-wash-tidy-citations
 	     notmuch-wash-elide-blank-lines
-	     notmuch-wash-excerpt-citations))
+	     notmuch-wash-excerpt-citations)
+  :group 'notmuch-show)
 
 ;; Mostly useful for debugging.
 (defcustom notmuch-show-all-multipart/alternative-parts t
   "Should all parts of multipart/alternative parts be shown?"
-  :group 'notmuch
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-show)
 
 (defcustom notmuch-show-indent-messages-width 1
   "Width of message indentation in threads.
@@ -101,14 +101,15 @@ Messages are shown indented according to their depth in a thread.
 This variable determines the width of this indentation measured
 in number of blanks.  Defaults to `1', choose `0' to disable
 indentation."
-  :group 'notmuch
-  :type 'integer)
+  :type 'integer
+  :group 'notmuch-show
+  :group 'notmuch-appearance)
 
 (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
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-show)
 
 (defmacro with-current-notmuch-show-message (&rest body)
   "Evaluate body with current buffer set to the text of current message"
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 1e61775..dca38af 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)
 
 (defvar notmuch-query-history nil
   "Variable to store minibuffer history for notmuch queries")
@@ -199,7 +199,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)))
@@ -306,27 +307,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)
@@ -338,7 +344,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)
@@ -350,7 +357,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.
@@ -495,7 +503,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.
@@ -506,7 +514,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
@@ -662,7 +670,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."
@@ -997,7 +1006,7 @@ Note that the recommended way of achieving the same is using
   :type '(choice (const :tag "notmuch new" nil)
 		 (const :tag "Disabled" "")
 		 (string :tag "Custom script"))
-  :group 'notmuch)
+  :group 'notmuch-external)
 
 (defun notmuch-poll ()
   "Run \"notmuch new\" or an external script to import mail.
-- 
1.7.8.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v2] emacs: logically group def{custom,face}s
  2012-01-13 16:15             ` David Edmondson
@ 2012-01-14  9:05               ` Pieter Praet
  0 siblings, 0 replies; 26+ messages in thread
From: Pieter Praet @ 2012-01-14  9:05 UTC (permalink / raw)
  To: David Edmondson, David Bremner; +Cc: Notmuch Mail

On Fri, 13 Jan 2012 16:15:59 +0000, David Edmondson <dme@dme.org> wrote:
> On Thu, 12 Jan 2012 23:31:34 -0400, David Bremner <david@tethera.net> wrote:
> > On Thu, 12 Jan 2012 18:12:16 +0100, Pieter Praet <pieter@praet.org> wrote:
> > > 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
> > 
> > I didn't investigate too closely, but I noticed when I customize-group
> > emacs, each subgroup has some explanatory text beside it. Did you omit
> > that on purpose?
> 
> That should be a requirement, I think.

I agree;  But for ~every rule, there are exceptions  :)


Peace

-- 
Pieter

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] emacs: logically group def{custom,face}s
  2012-01-14  9:04               ` [PATCH] " Pieter Praet
@ 2012-01-14 18:08                 ` Austin Clements
  2012-01-14 20:12                   ` Jameson Graef Rollins
  2012-01-16 10:34                   ` Pieter Praet
  0 siblings, 2 replies; 26+ messages in thread
From: Austin Clements @ 2012-01-14 18:08 UTC (permalink / raw)
  To: Pieter Praet; +Cc: Notmuch Mail

Quoth Pieter Praet on Jan 14 at 10:04 am:
> 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
> - External Commands
> - Appearance
> 
> As an added benefit, defcustom keyword args are now consistently
> in order of appearance @ defcustom's docstring (OCD much?).

Thanks for doing this.  I recently went into customize-group notmuch
and was overwhelmed by the pile of options presented.

> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
> index 0f856bf..f6f48e9 100644
> --- a/emacs/notmuch-lib.el
> +++ b/emacs/notmuch-lib.el
> @@ -28,17 +28,58 @@
>    "Notmuch mail reader for Emacs."
>    :group 'mail)
>  

Group docstrings aren't generally of the form "Options concerning
..."; they just jump into what they concern.  E.g.,

Convenience : Convenience features for faster editing.

Calendar Hooks : Calendar hooks.

Also, all but one of the tags you give the groups would be
automatically derived by Emacs, so you can remove those.

> +(defgroup notmuch-hello nil
> +  "Options concerning `notmuch-hello-mode'."
> +  :tag "Notmuch Hello"
> +  :group 'notmuch)

Perhaps "Overview of saved searches, tags, etc."

> +
> +(defgroup notmuch-search nil
> +  "Options concerning `notmuch-search-mode'."
> +  :tag "Notmuch Search"
> +  :group 'notmuch)

"Searching and sorting mail"?

> +
> +(defgroup notmuch-show nil
> +  "Options concerning `notmuch-show-mode'."
> +  :tag "Notmuch Show"
> +  :group 'notmuch)

"Showing messages and threads"?

> +
> +(defgroup notmuch-send nil
> +  "Options concerning the sending of messages."
> +  :tag "Notmuch Send"
> +  :group 'notmuch)

"Sending messages from Notmuch"?

We should probably link to the 'message group, perhaps by adding
  :link '(custom-group-link message)
here or maybe to the notmuch group itself.  Unfortunately, I don't
think you can actually add a group to another group after it's been
defined (though I could be wrong).

> +
> +(defgroup notmuch-crypto nil
> +  "Options concerning the processing and fontification of
> +cryptographic MIME parts in `notmuch-show-mode'."
> +  :tag "Notmuch Crypto"
> +  :group 'notmuch)

"Processing and display of cryptographic MIME parts"?  (You also don't
want the docstring to be too long, given how it's displayed.)

> +
> +(defgroup notmuch-hooks nil
> +  "Run custom code on well-defined occasions."
> +  :tag "Notmuch Hooks"
> +  :group 'notmuch)
> +
> +(defgroup notmuch-external nil
> +  "Run more custom code on different well-defined occasions."
> +  :tag "Notmuch External Commands"
> +  :group 'notmuch)

Oof!  It's okay to be a little redundant in the docstring.  Core Emacs
options do it.  "External commands"?

> +
> +(defgroup notmuch-appearance nil
> +  "Options concerning how Notmuch looks."
> +  :tag "Notmuch Appearance"
> +  :group 'notmuch)

"How Notmuch looks"?

I worry that notmuch-appearance is a catch-all that most options
arguably fit in to.  In particular, some notmuch-show options are also
in this group and some aren't and it's not clear to me what the rule
is.

Perhaps this should be notmuch-faces and limited to just faces (and
maybe options that aren't technically faces but that affect face
selection)?  Then the grouping rule would be obvious, like it is for
all of the other groups.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] emacs: logically group def{custom,face}s
  2012-01-14 18:08                 ` Austin Clements
@ 2012-01-14 20:12                   ` Jameson Graef Rollins
  2012-01-16 10:34                   ` Pieter Praet
  1 sibling, 0 replies; 26+ messages in thread
From: Jameson Graef Rollins @ 2012-01-14 20:12 UTC (permalink / raw)
  To: Austin Clements, Pieter Praet; +Cc: Notmuch Mail

I like all of Austin's description suggestions.

jamie.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] emacs: logically group def{custom,face}s
  2012-01-14 18:08                 ` Austin Clements
  2012-01-14 20:12                   ` Jameson Graef Rollins
@ 2012-01-16 10:34                   ` Pieter Praet
  2012-01-16 10:38                     ` [PATCH v4] " Pieter Praet
  1 sibling, 1 reply; 26+ messages in thread
From: Pieter Praet @ 2012-01-16 10:34 UTC (permalink / raw)
  To: Austin Clements; +Cc: Notmuch Mail

On Sat, 14 Jan 2012 13:08:28 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
> Quoth Pieter Praet on Jan 14 at 10:04 am:
> > 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
> > - External Commands
> > - Appearance
> > 
> > As an added benefit, defcustom keyword args are now consistently
> > in order of appearance @ defcustom's docstring (OCD much?).
> 
> Thanks for doing this. [...]

You're very welcome!

> [...] I recently went into customize-group notmuch
> and was overwhelmed by the pile of options presented.
> 

Same here :)

> > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
> > index 0f856bf..f6f48e9 100644
> > --- a/emacs/notmuch-lib.el
> > +++ b/emacs/notmuch-lib.el
> > @@ -28,17 +28,58 @@
> >    "Notmuch mail reader for Emacs."
> >    :group 'mail)
> >  
> 
> Group docstrings aren't generally of the form "Options concerning
> ..."; they just jump into what they concern.  E.g.,
> 
> Convenience : Convenience features for faster editing.
> 
> Calendar Hooks : Calendar hooks.
> 

Couldn't agree more!  I must admit, I was rather apathetic at the
time due to a lack of sleep.

> Also, all but one of the tags you give the groups would be
> automatically derived by Emacs, so you can remove those.
> 

How very convenient.  Removed 'em all: the one @ `notmuch-external'
was pretty pointless as well.

> > +(defgroup notmuch-hello nil
> > +  "Options concerning `notmuch-hello-mode'."
> > +  :tag "Notmuch Hello"
> > +  :group 'notmuch)
> 
> Perhaps "Overview of saved searches, tags, etc."
> 
> > +
> > +(defgroup notmuch-search nil
> > +  "Options concerning `notmuch-search-mode'."
> > +  :tag "Notmuch Search"
> > +  :group 'notmuch)
> 
> "Searching and sorting mail"?
> 
> > +
> > +(defgroup notmuch-show nil
> > +  "Options concerning `notmuch-show-mode'."
> > +  :tag "Notmuch Show"
> > +  :group 'notmuch)
> 
> "Showing messages and threads"?
> 
> > +
> > +(defgroup notmuch-send nil
> > +  "Options concerning the sending of messages."
> > +  :tag "Notmuch Send"
> > +  :group 'notmuch)
> 
> "Sending messages from Notmuch"?
> 
> We should probably link to the 'message group, perhaps by adding
>   :link '(custom-group-link message)
> here or maybe to the notmuch group itself.  Unfortunately, I don't
> think you can actually add a group to another group after it's been
> defined (though I could be wrong).
> 

Agreed.  I've added `notmuch-send' to the `message' group.

> > +
> > +(defgroup notmuch-crypto nil
> > +  "Options concerning the processing and fontification of
> > +cryptographic MIME parts in `notmuch-show-mode'."
> > +  :tag "Notmuch Crypto"
> > +  :group 'notmuch)
> 
> "Processing and display of cryptographic MIME parts"?  (You also don't
> want the docstring to be too long, given how it's displayed.)
> 
> > +
> > +(defgroup notmuch-hooks nil
> > +  "Run custom code on well-defined occasions."
> > +  :tag "Notmuch Hooks"
> > +  :group 'notmuch)
> > +
> > +(defgroup notmuch-external nil
> > +  "Run more custom code on different well-defined occasions."
> > +  :tag "Notmuch External Commands"
> > +  :group 'notmuch)
> 
> Oof!  It's okay to be a little redundant in the docstring.  Core Emacs
> options do it.  "External commands"?
> 
> > +
> > +(defgroup notmuch-appearance nil
> > +  "Options concerning how Notmuch looks."
> > +  :tag "Notmuch Appearance"
> > +  :group 'notmuch)
> 
> "How Notmuch looks"?
> 
> I worry that notmuch-appearance is a catch-all that most options
> arguably fit in to.  In particular, some notmuch-show options are also
> in this group and some aren't and it's not clear to me what the rule
> is.
> 
> Perhaps this should be notmuch-faces and limited to just faces (and
> maybe options that aren't technically faces but that affect face
> selection)?  Then the grouping rule would be obvious, like it is for
> all of the other groups.

That was my original intention, but due to `notmuch-hello-logo-background',
I decided to dump `notmuch-show-logo' in there as well, necessitating a
broader designation.  Fixed!

Patch follows.


Peace

-- 
Pieter

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v4] emacs: logically group def{custom,face}s
  2012-01-16 10:34                   ` Pieter Praet
@ 2012-01-16 10:38                     ` Pieter Praet
  2012-01-16 11:02                       ` David Edmondson
                                         ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Pieter Praet @ 2012-01-16 10:38 UTC (permalink / raw)
  To: Austin Clements; +Cc: Notmuch Mail

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
- External Commands
- Appearance

As an added benefit, defcustom keyword args are now consistently
ordered as they appear @ defcustom's docstring (OCD much?).

Proper defgroup docstrings and various other improvements
by courtesy of Austin Clements.

---

ChangeLog:

v2
- `notmuch-crypto-part-header' was added post-v1 (430fb27) : move to
  `notmuch-crypto' and `notmuch-appearance'.
- `notmuch-crypto-process-mime' was erroneously added to `notmuch-hello'
  in v1 : move to `notmuch-crypto'.
- `notmuch-hello-mode-hook' was added post-v1 (db352df) : move to
  `notmuch-hello' and `notmuch-hooks'.
- `notmuch-hello-refresh-hook' was added post-v1 (4e2fe89) : move to
  `notmuch-hello' and `notmuch-hooks'.
- `notmuch-saved-search-sort-function' was added post-v1 (e312705) :
  move to `notmuch-hello'.
- `notmuch-show-indent-messages-width' was added post-v1 (46eb1c1,
  74bced6) : move to `notmuch-show' and `notmuch-appearance'.
- ... and reorder all defcustom keyword args to match their order of
  appearance in `defcustom's docstring.

v3
- Add some really bad docstrings to the subgroup definitions.

v4
- Replace horrible docstrings with Austin's suggestions [1].
- Remove redundant ":tag" attributes from group definitions,
  as per Austin's recommendation [1].
- Add `notmuch-send' to the `message' group, as per Austin's
  recommendation [1].
- `notmuch-show-logo' was added to `notmuch-appearance' in v1, but
  doesn't really belong there : remove from `notmuch-appearance'.
- `notmuch-show-indent-messages-width' was added to `notmuch-appearance'
  in v2, but doesn't really belong there : remove from `notmuch-appearance'.
- `notmuch-appearance' now only contains face definitions, and still
  lacks a proper docstring : rename to `notmuch-faces' and set docstring.
- `notmuch-hooks', `notmuch-external' : set proper docstrings.
- `notmuch-show-hook' was only added to `notmuch-show' in v1 :
  add to `notmuch-hooks' as well.
- `notmuch-show-insert-text/plain-hook' was only added to `notmuch-show'
  in v1 : add to group `notmuch-hooks' as well.

[1] id:"20120114180828.GD1801@mit.edu"


 emacs/notmuch-address.el     |    3 ++-
 emacs/notmuch-crypto.el      |   22 ++++++++++++++--------
 emacs/notmuch-hello.el       |   33 ++++++++++++++++++---------------
 emacs/notmuch-lib.el         |   37 +++++++++++++++++++++++++++++++++++--
 emacs/notmuch-maildir-fcc.el |    6 +++---
 emacs/notmuch-message.el     |    2 +-
 emacs/notmuch-mua.el         |   21 +++++++++++----------
 emacs/notmuch-show.el        |   34 ++++++++++++++++++----------------
 emacs/notmuch.el             |   35 ++++++++++++++++++++++-------------
 9 files changed, 124 insertions(+), 69 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 8eba7a0..2e8b840 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 ac30098..80ac350 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -34,38 +34,44 @@ The effect of setting this variable can be seen temporarily by
 providing a prefix when viewing a signed or encrypted message, or
 by providing a prefix when reloading the message in notmuch-show
 mode."
-  :group 'notmuch
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-crypto)
 
 (defface notmuch-crypto-part-header
   '((t (:foreground "blue")))
   "Face used for crypto parts headers."
-  :group 'notmuch)
+  :group 'notmuch-crypto
+  :group 'notmuch-faces)
 
 (defface notmuch-crypto-signature-good
   '((t (:background "green" :foreground "black")))
   "Face used for good signatures."
-  :group 'notmuch)
+  :group 'notmuch-crypto
+  :group 'notmuch-faces)
 
 (defface notmuch-crypto-signature-good-key
   '((t (:background "orange" :foreground "black")))
   "Face used for good signatures."
-  :group 'notmuch)
+  :group 'notmuch-crypto
+  :group 'notmuch-faces)
 
 (defface notmuch-crypto-signature-bad
   '((t (:background "red" :foreground "black")))
   "Face used for bad signatures."
-  :group 'notmuch)
+  :group 'notmuch-crypto
+  :group 'notmuch-faces)
 
 (defface notmuch-crypto-signature-unknown
   '((t (:background "red" :foreground "black")))
   "Face used for signatures of unknown status."
-  :group 'notmuch)
+  :group 'notmuch-crypto
+  :group 'notmuch-faces)
 
 (defface notmuch-crypto-decryption
   '((t (:background "purple" :foreground "black")))
   "Face used for encryption/decryption status messages."
-  :group 'notmuch)
+  :group 'notmuch-crypto
+  :group 'notmuch-faces)
 
 (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 02017ce..bff95ac 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)
 
 (defun notmuch-sort-saved-searches (alist)
   "Generate an alphabetically sorted saved searches alist."
@@ -60,7 +60,7 @@ alist to be used."
 		 (const :tag "Sort alphabetically" notmuch-sort-saved-searches)
 		 (function :tag "Custom sort function"
 			   :value notmuch-sort-saved-searches))
-  :group 'notmuch)
+  :group 'notmuch-hello)
 
 (defvar notmuch-hello-indent 4
   "How much to indent non-headers.")
@@ -68,12 +68,12 @@ alist to be used."
 (defcustom notmuch-show-logo t
   "Should the notmuch logo be shown?"
   :type 'boolean
-  :group 'notmuch)
+  :group 'notmuch-hello)
 
 (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.
@@ -89,12 +89,12 @@ should return a filter for that tag, or nil to hide the tag."
 		 (string :tag "Custom filter"
 			 :value "tag:unread")
 		 (function :tag "Custom filter 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)
@@ -104,7 +104,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-faces)
 
 (defcustom notmuch-column-control t
   "Controls the number of columns for saved searches/tags in notmuch view.
@@ -126,11 +127,11 @@ So:
   30.
 - if you don't want to worry about all of this nonsense, leave
   this set to `t'."
-  :group 'notmuch
   :type '(choice
 	  (const :tag "Automatically calculated" t)
 	  (integer :tag "Number of characters")
-	  (float :tag "Fraction of window")))
+	  (float :tag "Fraction of window"))
+  :group 'notmuch-hello)
 
 (defcustom notmuch-hello-thousands-separator " "
   "The string used as a thousands separator.
@@ -138,18 +139,20 @@ So:
 Typically \",\" in the US and UK and \".\" or \" \" in Europe.
 The latter is recommended in the SI/ISO 31-0 standard and by the
 International Bureau of Weights and Measures."
-  :group 'notmuch
-  :type 'string)
+  :type 'string
+  :group 'notmuch-hello)
 
 (defcustom notmuch-hello-mode-hook nil
   "Functions called after entering `notmuch-hello-mode'."
-  :group 'notmuch
-  :type 'hook)
+  :type 'hook
+  :group 'notmuch-hello
+  :group 'notmuch-hooks)
 
 (defcustom notmuch-hello-refresh-hook nil
   "Functions called after updating a `notmuch-hello' buffer."
   :type 'hook
-  :group 'notmuch)
+  :group 'notmuch-hello
+  :group 'notmuch-hooks)
 
 (defvar notmuch-hello-url "http://notmuchmail.org"
   "The `notmuch' web site.")
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 0f856bf..9242537 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -28,17 +28,50 @@
   "Notmuch mail reader for Emacs."
   :group 'mail)
 
+(defgroup notmuch-hello nil
+  "Overview of saved searches, tags, etc."
+  :group 'notmuch)
+
+(defgroup notmuch-search nil
+  "Searching and sorting mail."
+  :group 'notmuch)
+
+(defgroup notmuch-show nil
+  "Showing messages and threads."
+  :group 'notmuch)
+
+(defgroup notmuch-send nil
+  "Sending messages from Notmuch."
+  :group 'notmuch
+  :group 'message)
+
+(defgroup notmuch-crypto nil
+  "Processing and display of cryptographic MIME parts."
+  :group 'notmuch)
+
+(defgroup notmuch-hooks nil
+  "Running custom code on well-defined occasions."
+  :group 'notmuch)
+
+(defgroup notmuch-external nil
+  "Running external commands from within Notmuch."
+  :group 'notmuch)
+
+(defgroup notmuch-faces nil
+  "Graphical attributes for displaying text"
+  :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 6fbf82d..dcfbc4b 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -51,13 +51,13 @@ the database.path option in the notmuch configuration file).
 You will be prompted to create the directory if it does not exist
 yet when sending a mail."
 
- :require 'notmuch-fcc-initialization
- :group 'notmuch
  :type '(choice
 	 (const :tag "No FCC header" nil)
 	 (string :tag "A single folder")
 	 (repeat :tag "A folder based on the From header"
-		 (cons regexp (string :tag "Folder")))))
+		 (cons regexp (string :tag "Folder"))))
+ :require 'notmuch-fcc-initialization
+ :group 'notmuch-send)
 
 (defun notmuch-fcc-initialization ()
   "If notmuch-fcc-directories is set,
diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el
index 08e5b17..264a5b9 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 d8ab822..023645e 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -28,25 +28,26 @@
 
 (defcustom notmuch-mua-send-hook '(notmuch-mua-message-send-hook)
   "Hook run before sending messages."
-  :group 'notmuch
-  :type 'hook)
+  :type 'hook
+  :group 'notmuch-send
+  :group 'notmuch-hooks)
 
 (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
   :type '(choice (const :tag "No user agent string" nil)
 		 (const :tag "Full" notmuch-mua-user-agent-full)
 		 (const :tag "Notmuch" notmuch-mua-user-agent-notmuch)
 		 (const :tag "Emacs" notmuch-mua-user-agent-emacs)
 		 (function :tag "Custom user agent function"
-			   :value notmuch-mua-user-agent-full)))
+			   :value notmuch-mua-user-agent-full))
+  :group 'notmuch-send)
 
 (defcustom notmuch-mua-hidden-headers '("^User-Agent:")
   "Headers that are added to the `message-mode' hidden headers
 list."
-  :group 'notmuch
-  :type '(repeat string))
+  :type '(repeat string)
+  :group 'notmuch-send)
 
 ;;
 
@@ -157,16 +158,16 @@ OTHER-ARGS are passed through to `message-mail'."
 
 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
-  :type '(repeat string))
+  :type '(repeat string)
+  :group 'notmuch-send)
 
 (defcustom notmuch-always-prompt-for-sender nil
   "Always prompt for the From: address when composing or forwarding a message.
 
 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
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-send)
 
 (defvar notmuch-mua-sender-history nil)
 
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 1a250a3..57e7136 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -47,8 +47,8 @@ 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
-  :type '(repeat string))
+  :type '(repeat string)
+  :group 'notmuch-show)
 
 (defcustom notmuch-message-headers-visible t
   "Should the headers be visible by default?
@@ -58,13 +58,13 @@ 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
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-show)
 
 (defcustom notmuch-show-relative-dates t
   "Display relative dates in the message summary line."
-  :group 'notmuch
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-show)
 
 (defvar notmuch-show-markup-headers-hook '(notmuch-show-colour-headers)
   "A list of functions called to decorate the headers listed in
@@ -72,27 +72,29 @@ any given message."
 
 (defcustom notmuch-show-hook nil
   "Functions called after populating a `notmuch-show' buffer."
-  :group 'notmuch
-  :type 'hook)
+  :type 'hook
+  :group 'notmuch-show
+  :group 'notmuch-hooks)
 
 (defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-wrap-long-lines
 						 notmuch-wash-tidy-citations
 						 notmuch-wash-elide-blank-lines
 						 notmuch-wash-excerpt-citations)
   "Functions used to improve the display of text/plain parts."
-  :group 'notmuch
   :type 'hook
   :options '(notmuch-wash-convert-inline-patch-to-part
 	     notmuch-wash-wrap-long-lines
 	     notmuch-wash-tidy-citations
 	     notmuch-wash-elide-blank-lines
-	     notmuch-wash-excerpt-citations))
+	     notmuch-wash-excerpt-citations)
+  :group 'notmuch-show
+  :group 'notmuch-hooks)
 
 ;; Mostly useful for debugging.
 (defcustom notmuch-show-all-multipart/alternative-parts t
   "Should all parts of multipart/alternative parts be shown?"
-  :group 'notmuch
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-show)
 
 (defcustom notmuch-show-indent-messages-width 1
   "Width of message indentation in threads.
@@ -101,14 +103,14 @@ Messages are shown indented according to their depth in a thread.
 This variable determines the width of this indentation measured
 in number of blanks.  Defaults to `1', choose `0' to disable
 indentation."
-  :group 'notmuch
-  :type 'integer)
+  :type 'integer
+  :group 'notmuch-show)
 
 (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
-  :type 'boolean)
+  :type 'boolean
+  :group 'notmuch-show)
 
 (defmacro with-current-notmuch-show-message (&rest body)
   "Evaluate body with current buffer set to the text of current message"
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index ef4dcc7..3602361 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)
 
 (defvar notmuch-query-history nil
   "Variable to store minibuffer history for notmuch queries")
@@ -199,7 +199,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)))
@@ -307,27 +308,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-faces)
 
 (defface notmuch-search-date
   '((t :inherit default))
   "Face used in search mode for dates."
-  :group 'notmuch)
+  :group 'notmuch-search
+  :group 'notmuch-faces)
 
 (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-faces)
 
 (defface notmuch-search-subject
   '((t :inherit default))
   "Face used in search mode for subjects."
-  :group 'notmuch)
+  :group 'notmuch-search
+  :group 'notmuch-faces)
 
 (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-faces)
 
 (defface notmuch-search-non-matching-authors
   '((((class color)
@@ -339,7 +345,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-faces)
 
 (defface notmuch-tag-face
   '((((class color)
@@ -351,7 +358,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-faces)
 
 (defun notmuch-search-mode ()
   "Major mode displaying results of a notmuch search.
@@ -502,7 +510,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.
@@ -513,7 +521,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
@@ -669,7 +677,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-faces)
 
 (defun notmuch-search-color-line (start end line-tag-list)
   "Colorize lines in `notmuch-show' based on tags."
@@ -1004,7 +1013,7 @@ Note that the recommended way of achieving the same is using
   :type '(choice (const :tag "notmuch new" nil)
 		 (const :tag "Disabled" "")
 		 (string :tag "Custom script"))
-  :group 'notmuch)
+  :group 'notmuch-external)
 
 (defun notmuch-poll ()
   "Run \"notmuch new\" or an external script to import mail.
-- 
1.7.8.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v4] emacs: logically group def{custom,face}s
  2012-01-16 10:38                     ` [PATCH v4] " Pieter Praet
@ 2012-01-16 11:02                       ` David Edmondson
  2012-01-16 19:16                       ` Austin Clements
  2012-01-19 17:14                       ` [PATCH v4] emacs: logically group def{custom,face}s David Bremner
  2 siblings, 0 replies; 26+ messages in thread
From: David Edmondson @ 2012-01-16 11:02 UTC (permalink / raw)
  To: Pieter Praet, Austin Clements; +Cc: Notmuch Mail

[-- Attachment #1: Type: text/plain, Size: 22 bytes --]

Nice work. +1 for me.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v4] emacs: logically group def{custom,face}s
  2012-01-16 10:38                     ` [PATCH v4] " Pieter Praet
  2012-01-16 11:02                       ` David Edmondson
@ 2012-01-16 19:16                       ` Austin Clements
  2012-01-18 10:00                         ` Pieter Praet
  2012-01-19 17:14                       ` [PATCH v4] emacs: logically group def{custom,face}s David Bremner
  2 siblings, 1 reply; 26+ messages in thread
From: Austin Clements @ 2012-01-16 19:16 UTC (permalink / raw)
  To: Pieter Praet; +Cc: Notmuch Mail

LGTM.

Quoth Pieter Praet on Jan 16 at 11:38 am:
> - Add `notmuch-send' to the `message' group, as per Austin's
>   recommendation [1].

This is actually the reverse of what I was suggesting (though is also
reasonable).  Since notmuch uses message-mode, I was saying that the
notmuch group (or the notmuch-send group) should link to the message
group.  That way, if you customize-group notmuch, you get all of the
options that affect notmuch, even those that aren't strictly notmuch
variables.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v4] emacs: logically group def{custom,face}s
  2012-01-16 19:16                       ` Austin Clements
@ 2012-01-18 10:00                         ` Pieter Praet
  2012-01-18 18:44                           ` Austin Clements
  0 siblings, 1 reply; 26+ messages in thread
From: Pieter Praet @ 2012-01-18 10:00 UTC (permalink / raw)
  To: Austin Clements; +Cc: Notmuch Mail

On Mon, 16 Jan 2012 14:16:22 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
> LGTM.
> 
> Quoth Pieter Praet on Jan 16 at 11:38 am:
> > - Add `notmuch-send' to the `message' group, as per Austin's
> >   recommendation [1].
> 
> This is actually the reverse of what I was suggesting (though is also
> reasonable).  Since notmuch uses message-mode, I was saying that the
> notmuch group (or the notmuch-send group) should link to the message
> group.  That way, if you customize-group notmuch, you get all of the
> options that affect notmuch, even those that aren't strictly notmuch
> variables.

Sorry, failed to mention;  I tried that, but the additional

  :link '(custom-group-link :tag "Message" message)

didn't seem all that useful compared to (or combined with)
adding `message' as parent group to `notmuch-send':

  #+begin_example
    Parent groups: Message Notmuch

    /- Notmuch Send group: Sending messages from Notmuch.--------------------\
          State: something in this group has been changed outside customize.
  #+end_example

vs.

  #+begin_example
    Parent groups: Message Notmuch

    /- Notmuch Send group: Sending messages from Notmuch.--------------------\
          State: something in this group has been changed outside customize.
          See also Message.
  #+end_example

... so I ripped it out again.  Should I add it back?


Peace

-- 
Pieter

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v4] emacs: logically group def{custom,face}s
  2012-01-18 10:00                         ` Pieter Praet
@ 2012-01-18 18:44                           ` Austin Clements
  2012-01-19 19:10                             ` Pieter Praet
  0 siblings, 1 reply; 26+ messages in thread
From: Austin Clements @ 2012-01-18 18:44 UTC (permalink / raw)
  To: Pieter Praet; +Cc: Notmuch Mail

Quoth Pieter Praet on Jan 18 at 11:00 am:
> On Mon, 16 Jan 2012 14:16:22 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
> > LGTM.
> > 
> > Quoth Pieter Praet on Jan 16 at 11:38 am:
> > > - Add `notmuch-send' to the `message' group, as per Austin's
> > >   recommendation [1].
> > 
> > This is actually the reverse of what I was suggesting (though is also
> > reasonable).  Since notmuch uses message-mode, I was saying that the
> > notmuch group (or the notmuch-send group) should link to the message
> > group.  That way, if you customize-group notmuch, you get all of the
> > options that affect notmuch, even those that aren't strictly notmuch
> > variables.
> 
> Sorry, failed to mention;  I tried that, but the additional
> 
>   :link '(custom-group-link :tag "Message" message)
> 
> didn't seem all that useful compared to (or combined with)
> adding `message' as parent group to `notmuch-send':
> 
>   #+begin_example
>     Parent groups: Message Notmuch
> 
>     /- Notmuch Send group: Sending messages from Notmuch.--------------------\
>           State: something in this group has been changed outside customize.
>   #+end_example
> 
> vs.
> 
>   #+begin_example
>     Parent groups: Message Notmuch
> 
>     /- Notmuch Send group: Sending messages from Notmuch.--------------------\
>           State: something in this group has been changed outside customize.
>           See also Message.
>   #+end_example
> 
> ... so I ripped it out again.  Should I add it back?

Hmm.  You're right that the :link doesn't do much.

One other possibility to consider is
  (custom-add-to-group 'notmuch-show 'message 'custom-group)
or even
  (custom-add-to-group 'notmuch 'message 'custom-group)

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v4] emacs: logically group def{custom,face}s
  2012-01-16 10:38                     ` [PATCH v4] " Pieter Praet
  2012-01-16 11:02                       ` David Edmondson
  2012-01-16 19:16                       ` Austin Clements
@ 2012-01-19 17:14                       ` David Bremner
  2012-01-19 19:21                         ` Pieter Praet
  2 siblings, 1 reply; 26+ messages in thread
From: David Bremner @ 2012-01-19 17:14 UTC (permalink / raw)
  To: Pieter Praet; +Cc: Notmuch Mail

On Mon, 16 Jan 2012 11:38:33 +0100, Pieter Praet <pieter@praet.org> wrote:
> To allow for expansion whilst keeping everything tidy and organized,
> move all defcustom/defface variables to the following subgroups,
> defined in notmuch-lib.el:

pushed

d

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v4] emacs: logically group def{custom,face}s
  2012-01-18 18:44                           ` Austin Clements
@ 2012-01-19 19:10                             ` Pieter Praet
  2012-01-19 19:13                               ` [PATCH] emacs: invert relation between 'notmuch-send and 'message customization groups Pieter Praet
  0 siblings, 1 reply; 26+ messages in thread
From: Pieter Praet @ 2012-01-19 19:10 UTC (permalink / raw)
  To: Austin Clements; +Cc: Notmuch Mail

On Wed, 18 Jan 2012 13:44:08 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
> Quoth Pieter Praet on Jan 18 at 11:00 am:
> > On Mon, 16 Jan 2012 14:16:22 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
> > > LGTM.
> > > 
> > > Quoth Pieter Praet on Jan 16 at 11:38 am:
> > > > - Add `notmuch-send' to the `message' group, as per Austin's
> > > >   recommendation [1].
> > > 
> > > This is actually the reverse of what I was suggesting (though is also
> > > reasonable).  Since notmuch uses message-mode, I was saying that the
> > > notmuch group (or the notmuch-send group) should link to the message
> > > group.  That way, if you customize-group notmuch, you get all of the
> > > options that affect notmuch, even those that aren't strictly notmuch
> > > variables.
> > 
> > Sorry, failed to mention;  I tried that, but the additional
> > 
> >   :link '(custom-group-link :tag "Message" message)
> > 
> > didn't seem all that useful compared to (or combined with)
> > adding `message' as parent group to `notmuch-send':
> > 
> >   #+begin_example
> >     Parent groups: Message Notmuch
> > 
> >     /- Notmuch Send group: Sending messages from Notmuch.--------------------\
> >           State: something in this group has been changed outside customize.
> >   #+end_example
> > 
> > vs.
> > 
> >   #+begin_example
> >     Parent groups: Message Notmuch
> > 
> >     /- Notmuch Send group: Sending messages from Notmuch.--------------------\
> >           State: something in this group has been changed outside customize.
> >           See also Message.
> >   #+end_example
> > 
> > ... so I ripped it out again.  Should I add it back?
> 
> Hmm.  You're right that the :link doesn't do much.
> 

Indeed.  I'll leave it out, in favour of:

> One other possibility to consider is
>   (custom-add-to-group 'notmuch-show 'message 'custom-group)

Agreed!  (though you probably meant 'notmuch-send).

> or even
>   (custom-add-to-group 'notmuch 'message 'custom-group)

Hmm, that might be a tad much.  `message-mode' config is only relevant
when *sending* mail, so adding its group to 'notmuch-send should be
sufficient IMO.

Patch follows (new one, no amendment;  David's on a merging-spree :).


Peace

-- 
Pieter

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH] emacs: invert relation between 'notmuch-send and 'message customization groups
  2012-01-19 19:10                             ` Pieter Praet
@ 2012-01-19 19:13                               ` Pieter Praet
  2012-01-19 19:22                                 ` Austin Clements
  2012-01-21 13:13                                 ` David Bremner
  0 siblings, 2 replies; 26+ messages in thread
From: Pieter Praet @ 2012-01-19 19:13 UTC (permalink / raw)
  To: Austin Clements, David Bremner; +Cc: Notmuch Mail

'message contains options relevant to 'notmuch-send, not the other way around.

Thanks to Austin for suggesting `custom-add-to-group'.
  id:"20120118184408.GD16740@mit.edu"

---
 emacs/notmuch-lib.el |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 9242537..e33e69a 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -42,8 +42,9 @@
 
 (defgroup notmuch-send nil
   "Sending messages from Notmuch."
-  :group 'notmuch
-  :group 'message)
+  :group 'notmuch)
+
+(custom-add-to-group 'notmuch-send 'message 'custom-group)
 
 (defgroup notmuch-crypto nil
   "Processing and display of cryptographic MIME parts."
-- 
1.7.8.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v4] emacs: logically group def{custom,face}s
  2012-01-19 17:14                       ` [PATCH v4] emacs: logically group def{custom,face}s David Bremner
@ 2012-01-19 19:21                         ` Pieter Praet
  0 siblings, 0 replies; 26+ messages in thread
From: Pieter Praet @ 2012-01-19 19:21 UTC (permalink / raw)
  To: David Bremner; +Cc: Notmuch Mail

On Thu, 19 Jan 2012 13:14:25 -0400, David Bremner <david@tethera.net> wrote:
> On Mon, 16 Jan 2012 11:38:33 +0100, Pieter Praet <pieter@praet.org> wrote:
> > To allow for expansion whilst keeping everything tidy and organized,
> > move all defcustom/defface variables to the following subgroups,
> > defined in notmuch-lib.el:
> 
> pushed

Thanks!


> 
> d


Peace

-- 
Pieter

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] emacs: invert relation between 'notmuch-send and 'message customization groups
  2012-01-19 19:13                               ` [PATCH] emacs: invert relation between 'notmuch-send and 'message customization groups Pieter Praet
@ 2012-01-19 19:22                                 ` Austin Clements
  2012-01-21 13:13                                 ` David Bremner
  1 sibling, 0 replies; 26+ messages in thread
From: Austin Clements @ 2012-01-19 19:22 UTC (permalink / raw)
  To: Pieter Praet; +Cc: Notmuch Mail

Quoth Pieter Praet on Jan 19 at  8:13 pm:
> 'message contains options relevant to 'notmuch-send, not the other way around.
> 
> Thanks to Austin for suggesting `custom-add-to-group'.
>   id:"20120118184408.GD16740@mit.edu"

LGTM.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] emacs: invert relation between 'notmuch-send and 'message customization groups
  2012-01-19 19:13                               ` [PATCH] emacs: invert relation between 'notmuch-send and 'message customization groups Pieter Praet
  2012-01-19 19:22                                 ` Austin Clements
@ 2012-01-21 13:13                                 ` David Bremner
  1 sibling, 0 replies; 26+ messages in thread
From: David Bremner @ 2012-01-21 13:13 UTC (permalink / raw)
  To: Pieter Praet; +Cc: Notmuch Mail

On Thu, 19 Jan 2012 20:13:05 +0100, Pieter Praet <pieter@praet.org> wrote:
> 'message contains options relevant to 'notmuch-send, not the other way around.
> 
> Thanks to Austin for suggesting `custom-add-to-group'.
>   id:"20120118184408.GD16740@mit.edu"

pushed, 

d

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2012-01-21 13:14 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-05 18:33 [PATCH] emacs: logically group def{custom,face}s Pieter Praet
2011-10-10 13:49 ` Daniel Schoepe
2011-10-18 15:18   ` Jameson Graef Rollins
2011-11-01 20:00     ` Pieter Praet
2011-11-21  2:51       ` David Bremner
2012-01-12 17:12         ` [PATCH v2] " Pieter Praet
2012-01-13  3:31           ` David Bremner
2012-01-13 16:15             ` David Edmondson
2012-01-14  9:05               ` Pieter Praet
2012-01-14  9:02             ` Pieter Praet
2012-01-14  9:04               ` [PATCH] " Pieter Praet
2012-01-14 18:08                 ` Austin Clements
2012-01-14 20:12                   ` Jameson Graef Rollins
2012-01-16 10:34                   ` Pieter Praet
2012-01-16 10:38                     ` [PATCH v4] " Pieter Praet
2012-01-16 11:02                       ` David Edmondson
2012-01-16 19:16                       ` Austin Clements
2012-01-18 10:00                         ` Pieter Praet
2012-01-18 18:44                           ` Austin Clements
2012-01-19 19:10                             ` Pieter Praet
2012-01-19 19:13                               ` [PATCH] emacs: invert relation between 'notmuch-send and 'message customization groups Pieter Praet
2012-01-19 19:22                                 ` Austin Clements
2012-01-21 13:13                                 ` David Bremner
2012-01-19 17:14                       ` [PATCH v4] emacs: logically group def{custom,face}s David Bremner
2012-01-19 19:21                         ` Pieter Praet
2012-01-13 20:56           ` [PATCH v2] " Jameson Graef Rollins

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).