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 CF8A66DE012F for ; Mon, 28 Aug 2017 00:32:35 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.08 X-Spam-Level: X-Spam-Status: No, score=0.08 tagged_above=-999 required=5 tests=[AWL=-0.050, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-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 2xfcy9aLA0kg for ; Mon, 28 Aug 2017 00:32:35 -0700 (PDT) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by arlo.cworth.org (Postfix) with ESMTPS id 9A66E6DE0A6C for ; Mon, 28 Aug 2017 00:32:33 -0700 (PDT) Received: by mail-wm0-f66.google.com with SMTP id i76so6103722wme.1 for ; Mon, 28 Aug 2017 00:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QOgubM22hPPpD/cOIOUW4mNT5Sx1o+H82VhnykfuLRc=; b=IiExYIfjB4JcByMA9JZ9PaTw3aK1YKaUpf3oT0KkJVrnZKTyf/rQUHDHsr3fYih/s/ fFS5+t3mXq/UXZoyInz29RC7S5LDSgjnt1B0V4y/JGlENuZO0XnCRS5WNbc2t4mJ62z/ VGEHCMnewoBVaAgDHSBJ/DPB1PlIKio6ad/6fLyRgS1yHtQMwry4+0oz5fniLeTMiFk/ AcJCpNvB3jTY1h+v44EqKBl0EOkX9nVwljtu5IUxmJDM5XIxKak99lLIDaIeADldKjK0 7RKg7zJoQFMW8ath7Z2DzacJIwsUNx1Hz0lsnY+i/21QNAi2MSCj8ncCJ+KFsQHT9Uo7 B0lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QOgubM22hPPpD/cOIOUW4mNT5Sx1o+H82VhnykfuLRc=; b=Rqkbw3N2SC/MLWcs7Cwa09Pb9+p8ixkQGs9+Q1ZhvE2fECSAs8+rVGrrnD6367bnHV WvvysozFyvJCHnEL6cwfj38zkyW80R5Ss5eoeOgOBSFzz88E313v9at5j3eptfYyS4X2 2bFhFv414fSV5kYQPVuVGyYeYZnJWcvjTl7FhZzh3wHlvQIcZVC3Ux1ulu3SiYquKdQ3 2fv4BH/LuU19K25Tt2l5KpZ3x+9HdoIUIraYlqb5vzdGUkf8r/29YMyptIItJd2wwDy/ T2j/qh1jvhT4E63o4dsJP2pYATtfk+SF1wzIej36ZQbdjVpxkkTGZTqFANi9m2CAv6Gf Z4Cw== X-Gm-Message-State: AHYfb5iyssCsg1ud/7wAJDH1rnVsTNdsmNfhbtOeHx9kyZhsGZO4WvSv KZ6zhbhPFa//EVLr X-Received: by 10.28.144.210 with SMTP id s201mr2842367wmd.195.1503905550930; Mon, 28 Aug 2017 00:32:30 -0700 (PDT) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id w14sm9269179wra.19.2017.08.28.00.32.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Aug 2017 00:32:30 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH 1/2] emacs: maildir fcc make insert more flexible Date: Mon, 28 Aug 2017 08:32:21 +0100 Message-Id: <1503905542-19961-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1503905542-19961-1-git-send-email-markwalters1009@gmail.com> References: <1503905542-19961-1-git-send-email-markwalters1009@gmail.com> 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 07:32:36 -0000 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 inserted message." (apply 'notmuch-call-notmuch-process :stdin-string (buffer-string) "insert" args))) -(defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header &optional create) +(defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header &optional create header-name) "Store message with notmuch insert. The fcc-header should be of the form \"folder +tag1 -tag2\" where @@ -239,7 +239,8 @@ quoting each space with an immediately preceding backslash or surrounding the entire folder name in double quotes. 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 necessary." ;; 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 header? " + (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 header-name)) + (?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't header-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)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -- 2.1.4