From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 3377F6DE00C4 for ; Mon, 28 Aug 2017 03:23:53 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.451 X-Spam-Level: X-Spam-Status: No, score=0.451 tagged_above=-999 required=5 tests=[AWL=-0.182, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4N24zW_whPwd for ; Mon, 28 Aug 2017 03:23:49 -0700 (PDT) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by arlo.cworth.org (Postfix) with ESMTPS id 52DAD6DE009B for ; Mon, 28 Aug 2017 03:23:49 -0700 (PDT) Received: by mail-wm0-f47.google.com with SMTP id u26so779147wma.0 for ; Mon, 28 Aug 2017 03:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dme-org.20150623.gappssmtp.com; s=20150623; h=to:subject:in-reply-to:references:from:date:message-id:mime-version :content-transfer-encoding; bh=WSjb33C+Ao2mlXLQL/r7UEo3KoXijiNa3LnfD1On2KQ=; b=u7vibfwJ6aLDMuMw/tfNCDZCEJ3m6F0RncfW9v9xZ7W1F2ZSaxM30hGXVTYNM9YmC4 kAHHh6sy8ktabmUGPcT+MyD63CQzD7ynnxOGjqwG+05epv6piCfITF4zuLzvmPgJ2Oj4 r3zYSE53toX2Qy+jgwPbSAvRx9mL3Q6xAPukBkVReoEJyZhyKfZ8j03YI97iTOJM4SpQ YHUUHsg9j/9G3Y9P3nyLKYZ5tXLHDPYIoKgRArXA6Zbh7NKRRBfbAEVNXRWnna2o71nu tp3phmR0xsNgRriVDXoYYtXog1CGk1FTIfGTx9rhVwlF2lIK0/RMvVyzPAXJ3cJP55Ie l0pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:in-reply-to:references:from:date :message-id:mime-version:content-transfer-encoding; bh=WSjb33C+Ao2mlXLQL/r7UEo3KoXijiNa3LnfD1On2KQ=; b=VZ1tveiQecsMhhph6OCiIms41vBzAs4s1iYIXsvpNxejPbdf4TGEBDx7jFwZd889YN wazpWo+32HXjSL+SSYRpjXXcZ6/oasbN9e9oq/ZefTha/4n0FJU4+MKgYenc4OWTGRdG NS7d3ffIYGKuAZIiLvO96WZZmFtePV7AsQ1KTu2de+fcZA5B4kVQCnqo5TFYcM5Hhe1q IslXtV0KraPepodkFvrsjS+LswBviehqeUUJ1FlTW49yN+pFnSzT5nnjotz9rVtPqOdd w2hWTlWokvdV6d/7IkUwzBwB6s8nlLGFJqmFNnHGp0pLmuEb7xVN95kwUJKRpztCpO1M 72zw== X-Gm-Message-State: AHYfb5hEiO14k2p4qlROlBJhzYjo1OldaQ2cKRyHls9DK1YlQJG1nDcV /qlnfTioV9o6L3cX0SQ0WA== X-Received: by 10.80.182.249 with SMTP id f54mr83108ede.268.1503915827147; Mon, 28 Aug 2017 03:23:47 -0700 (PDT) Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net. [81.149.164.25]) by smtp.gmail.com with ESMTPSA id q21sm25276edd.41.2017.08.28.03.23.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Aug 2017 03:23:46 -0700 (PDT) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id ff9b4c00; Mon, 28 Aug 2017 10:23:45 +0000 (UTC) To: Mark Walters , notmuch@notmuchmail.org Subject: Re: [PATCH 1/2] emacs: maildir fcc make insert more flexible In-Reply-To: <1503905542-19961-2-git-send-email-markwalters1009@gmail.com> References: <1503905542-19961-1-git-send-email-markwalters1009@gmail.com> <1503905542-19961-2-git-send-email-markwalters1009@gmail.com> X-HGTTG: agrajag From: David Edmondson Date: Mon, 28 Aug 2017 11:23:45 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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: Mon, 28 Aug 2017 10:23:53 -0000 On Monday, 2017-08-28 at 08:32:21 +0100, Mark Walters wrote: > This changeset makes the function > notmuch-maildir-fcc-with-notmuch-insert slightly more flexible by > allowing some of the prompts to be controlled by the caller. > --- > emacs/notmuch-maildir-fcc.el | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el > index 1551e8b..acff24d 100644 > --- a/emacs/notmuch-maildir-fcc.el > +++ b/emacs/notmuch-maildir-fcc.el > @@ -227,7 +227,7 @@ should be a list of tag changes to apply to the inser= ted message." > (apply 'notmuch-call-notmuch-process > :stdin-string (buffer-string) "insert" args))) >=20=20 > -(defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header &optional cre= ate) > +(defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header &optional cre= ate header-name) Given that this is not FCC specific, perhaps rename it? > "Store message with notmuch insert. >=20=20 > The fcc-header should be of the form \"folder +tag1 -tag2\" where I realise that this patch set didn't add this string, but it is mildly ridiculous. There's no reason that we couldn't use a list, where a leading =E2=80=9C+=E2=80=9D or =E2=80=9C-=E2=80=9D indicates a tag and anyt= hing else is a folder. Even two variables (one for folder and another for tags) would be an improvement > @@ -239,7 +239,8 @@ quoting each space with an immediately preceding back= slash > or surrounding the entire folder name in double quotes. >=20=20 > If CREATE is non-nil then create the folder if necessary." > - (let* ((args (split-string-and-unquote fcc-header)) > + (let* ((header-name (or header-name "Fcc header")) > + (args (split-string-and-unquote fcc-header)) > (folder (car args)) > (tags (cdr args))) > (condition-case nil > @@ -250,14 +251,17 @@ If CREATE is non-nil then create the folder if nece= ssary." > ;; how to deal with it. > (error > (let ((response (notmuch-read-char-choice > - "Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the hea= der? " > + (concat > + "Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the " > + header-name "? ") > '(?r ?c ?i ?e)))) > (case response > - (?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header)) > - (?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't)) > + (?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header nil head= er-name)) > + (?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't heade= r-name)) > (?i 't) > (?e (notmuch-maildir-fcc-with-notmuch-insert > - (read-from-minibuffer "Fcc header: " fcc-header))))))))) > + (read-from-minibuffer (concat header-name ": ") fcc-header) > + nil header-name)))))))) >=20=20 >=20=20 > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > --=20 > 2.1.4 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch dme. --=20 Walk without rhythm and it won't attract the worm.