Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 6BC67431FAF for ; Thu, 6 Sep 2012 07:12:22 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8QSKd15xun-4 for ; Thu, 6 Sep 2012 07:12:21 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 5A17F431FAE for ; Thu, 6 Sep 2012 07:12:21 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id F0CBF19F30DD; Thu, 6 Sep 2012 16:12:16 +0200 (CEST) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id 3JucGTLQ4i9b; Thu, 6 Sep 2012 16:12:07 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 77EA219F32DD; Thu, 6 Sep 2012 16:12:07 +0200 (CEST) Received: from steelpick.2x.cz (note-sojka.felk.cvut.cz [147.32.86.30]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 746EE660904; Thu, 6 Sep 2012 16:12:07 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.80) (envelope-from ) id 1T9coR-0002Nc-Ac; Thu, 06 Sep 2012 16:12:07 +0200 From: Michal Sojka To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH v2] emacs: Add customization group for replying In-Reply-To: References: <1346919815-20397-1-git-send-email-sojkam1@fel.cvut.cz> <87y5kntjf1.fsf@steelpick.2x.cz> User-Agent: Notmuch/0.14+23~g9d68aca (http://notmuchmail.org) Emacs/24.1.1 (x86_64-pc-linux-gnu) Date: Thu, 06 Sep 2012 16:12:07 +0200 Message-ID: <87k3w7jl54.fsf@steelpick.2x.cz> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 14:12:22 -0000 On Thu, Sep 06 2012, Tomi Ollila wrote: > On Thu, Sep 06 2012, Michal Sojka wrote: > >>> So far good, but... >>> >>> You forgot to handle the current group setting for >>> notmuch-message-replied-tags -- currently notmuch-message.el has this: >>> >>> (defcustom notmuch-message-replied-tags '("replied") >>> "Tags to be automatically added to or removed from a message when it is >>> replied to. >>> Any tag in the list will be added to a replied message or, >>> if it is prefaced with a \"-\", removed. >>> >>> 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-send) >>> >>> If the above was changed to 'normuch-send, (require 'notmuch-lib) >>> was added to the beginning of notmuch-message.el and the defgroup >>> below was written as >>> >>> (defgroup notmuch-reply >>> '((message-insertion custom-group))) >>> "Replying to messages. >>> ... >>> >>> would that work as expected ? >> >> Hi Tomi, >> >> I don't really get what are you trying to say. Do you mean that >> notmuch-message-replied-tags is referenced from notmuch-lib.el without >> (require 'notmuch-message)? I'm not sure whether it is required, but it >> works here without problems. > > Ok, some sillines in my part and something I did not check well > enough before replying... > > First, notmuch-lib.el defines notmuch-send group, yet > (defcustom notmuch-message-replied-tags ...) is defined > in notmuch-message.el which is not requiring notmuch-lib... > and all of this works now... > > Actually, notmuch-lib.el defines all defgroups (except coolj). > > Then, I found the following: notmuch-mua-send-hook is defined > both in notmuch-hooks and notmuch-send groups (having a precedent > helps a bit there when choosing alternatives below) > > > All the defgroups are defined using pattern: > > (defgroup notmuch- nil ...) > > We should follow this pattern unless there is good reason not to > do so here: notmuch-send is written as: > > (defgroup notmuch-send nil > "Sending messages from Notmuch." > :group 'notmuch) > > (custom-add-to-group 'notmuch-send 'message 'custom-group) > > But, as the documentation in this notmuch-reply definition references > 'Message insertion' group, doing > > (defgroup notmuch-reply > '((message-insertion custom-group))' > "Replying to messages. > > Most of the reply customization settings can be found in `Message > insertion' group. Notmuch specific settings are included directly > here." > :group 'notmuch) > > could be good thing to do here; definition matches doc from the beginning > (just not adding any of the custom variables, yet). > > > Now, currently notmuch-message.el defines notmuch-message-replied-tags > and puts that to :group 'notmuch-send > > There are 2 alternatives: > > 1) change that to :group 'notmuch-reply Now I understand. I think that 1) would be a good solution. I'll wait a bit for other comments and than I'll send a new patch. -Michal > > 2) add (custom-add-to-group 'notmuch-reply 'notmuch-message-replied-tags 'custom-variable) > to notmuch-message.el (or notmuch-lib.el) > > 2b) change :group 'notmuch-send -> :group 'notmuch-reply and > add (custom-add-to-group 'notmuch-send 'notmuch-message-replied-tags 'custom-variable) > to notmuch-message.el (or notmuch-lib.el) > > > I personally would slightly lean to option 1 but if 2 gets more > supporters then 2b (so that the spesific group is in the group definition). > > On other words; 1 or 2b gets LGTM from me :)