From: David Edmondson Date: Thu, 30 Oct 2014 08:23:15 +0000 (+0000) Subject: Re: [PATCH] emacs: add stash support for git send-email command line X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3af84558e2d8d1731f8197732bc8bb94ed52850b;p=notmuch-archives.git Re: [PATCH] emacs: add stash support for git send-email command line --- diff --git a/58/89ac2841b5b0242b3a71b1f7347bd7a9f862db b/58/89ac2841b5b0242b3a71b1f7347bd7a9f862db new file mode 100644 index 000000000..7a0e5e620 --- /dev/null +++ b/58/89ac2841b5b0242b3a71b1f7347bd7a9f862db @@ -0,0 +1,115 @@ +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 E97FB431FC7 + for ; Thu, 30 Oct 2014 01:23:22 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.699 +X-Spam-Level: +X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7, UNPARSEABLE_RELAY=0.001] + 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 ADLRXvldc3b3 for ; + Thu, 30 Oct 2014 01:23:18 -0700 (PDT) +Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com + [209.85.212.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 07BF4431FB6 + for ; Thu, 30 Oct 2014 01:23:17 -0700 (PDT) +Received: by mail-wi0-f173.google.com with SMTP id n3so3761429wiv.12 + for ; Thu, 30 Oct 2014 01:23:16 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:to:subject:in-reply-to:references:user-agent + :from:date:message-id:mime-version:content-type; + bh=iNmDl6cLX9FIfv1SFN7rx5HNlv3kNiS+Ssyy1kJz6GI=; + b=kG5aPWy2RmfZhWRnoXN9LUKbSuDzuMHAtTpi8BAfNx7w5+RcumoHVeVdvfedXQyC7U + WSsMLk2g02bptqKPbghsK9cegN0XMFMHCaIWMEGvcaKWG9a9lRPJwOPvjD7DHiY51I3b + iQLXYYhmr5UNjYMuKjWfR8VtY8FwmicqYS1FuUKrdmiM+l4RsGBP6FbJ/nOZFFDpmrTV + FTjjLc4v1iVPxkB0m6MR/QE7DsqIBIibO0wQvotu5UyTQEf4rFiHTywsfMBBdysyns8x + XIjktulab4tfUsoiKrpFDGqczMVcPYeyxpMop5og3iZJxN4tcC+4c2Np1Dmi367aZEU+ + 5q4Q== +X-Gm-Message-State: + ALoCoQk5uEUd+FGA4VcXU169OOM/QPdBktoprIRLrBNWAl8YWt1gDhPGb+sFHhYhG0RRO50R8GSR +X-Received: by 10.180.83.37 with SMTP id n5mr41945260wiy.7.1414657396648; + Thu, 30 Oct 2014 01:23:16 -0700 (PDT) +Received: from disaster-area.hh.sledj.net + ([2a01:348:1a2:1:ea39:35ff:fe2c:a227]) + by mx.google.com with ESMTPSA id pc8sm7818513wjb.36.2014.10.30.01.23.15 + for + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Thu, 30 Oct 2014 01:23:15 -0700 (PDT) +Received: from localhost (30000@localhost [local]); + by localhost (OpenSMTPD) with ESMTPA id f494b3f8; + Thu, 30 Oct 2014 08:23:14 +0000 (UTC) +To: Jani Nikula , notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: add stash support for git send-email command line +In-Reply-To: <87y4ryzju6.fsf@nikula.org> +References: <1414525138-838-1-git-send-email-jani@nikula.org> + <87y4ryzju6.fsf@nikula.org> +User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-apple-darwin14.0.0) +From: David Edmondson +Date: Thu, 30 Oct 2014 08:23:15 +0000 +Message-ID: +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, 30 Oct 2014 08:23:23 -0000 + +On Wed, Oct 29 2014, Jani Nikula wrote: +>>> +(defun notmuch-show-stash-git-send-email () +>>> + "Copy From/To/Cc/Message-Id of current message to kill-ring in a form suitable for pasting to git send-email command line." +>>> + (interactive) +>>> + (notmuch-common-do-stash +>>> + (concat +>>> + (notmuch-show-stash-git-helper (message-tokenize-header (notmuch-show-get-from)) "--to=") +>>> + (notmuch-show-stash-git-helper (message-tokenize-header (notmuch-show-get-to)) "--to=") +>>> + (notmuch-show-stash-git-helper (message-tokenize-header (notmuch-show-get-cc)) "--cc=") +>>> + (concat "--in-reply-to=\"" (notmuch-show-get-message-id t) "\"")))) +>> +>> ...this would have to use something like: +>> +>> (mapconcat 'identity (list +>> (notmuch-show-stash-git-helper (message-tokenize-header (notmuch-show-get-from)) "--to=") +>> (notmuch-show-stash-git-helper (message-tokenize-header (notmuch-show-get-to)) "--to=") +>> (notmuch-show-stash-git-helper (message-tokenize-header (notmuch-show-get-cc)) "--cc=") +>> (concat "--in-reply-to=\"" (notmuch-show-get-message-id t) "\"")) +>> "") +>> +>> to separate the chunks (untested). +> +> The last "" has to be " " to separate the elements, + +Of course. + +> but this brings another small wrinkle: if one of the headers is +> missing, typically Cc:, it will be nil in the list, and mapconcat adds +> spaces both sides of that, i.e. double space. Any ideas how to fix +> that? + +I suppose a collecting loop would do it. + +>> Do the leading and trailing spaces really matter? +> +> Does aesthetically displeasing count? Because message-tokenize-header +> splits using "," but headers typically have ", " between addresses, the +> end result will practically always have --to=" user@example.com" without +> the trimming. + +The trimming is fine, really.