discussion and development of piem
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: piem@inbox.kyleam.com
Subject: Re: [PATCH 4/4] gnus, notmuch: Consider text/plain patch attachments
Date: Sun, 22 Nov 2020 16:10:49 -0500
Message-ID: <87k0udumg6.fsf@kyleam.com> (raw)
In-Reply-To: <20201122204609.12604-5-kyle@kyleam.com>

Kyle Meyer writes:

> -(defun piem-am-patch-attachment-p (type)
> +(defun piem-am-patch-attachment-p (type filename)
>    "Return non-nil if an attachment should be treated as a patch.
> -TYPE is a media type such as \"text/x-patch\"."
> -  (member type '("text/x-diff" "text/x-patch")))
> +TYPE is a media type such as \"text/x-patch\".  FILENAME is the
> +attachment file name, if any."
> +   (or (member type '("text/x-diff" "text/x-patch"))
> +      (and filename
> +           (equal type "text/plain")
> +           (string-match-p "\\.patch\\'" filename))))

Oops, the indentation is off here.  Will squash this in.

diff --git a/piem.el b/piem.el
index bee17c0..cf43503 100644
--- a/piem.el
+++ b/piem.el
@@ -565,7 +565,7 @@ (defun piem-am-patch-attachment-p (type filename)
   "Return non-nil if an attachment should be treated as a patch.
 TYPE is a media type such as \"text/x-patch\".  FILENAME is the
 attachment file name, if any."
-   (or (member type '("text/x-diff" "text/x-patch"))
+  (or (member type '("text/x-diff" "text/x-patch"))
       (and filename
            (equal type "text/plain")
            (string-match-p "\\.patch\\'" filename))))

      reply	other threads:[~2020-11-22 21:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-22 20:46 [PATCH 0/4] Support " Kyle Meyer
2020-11-22 20:46 ` [PATCH 1/4] gnus: Prefer mm-handle-media-type over direct access Kyle Meyer
2020-11-22 20:46 ` [PATCH 2/4] gnus, notmuch: Share "attachment is patch?" logic Kyle Meyer
2020-11-22 20:46 ` [PATCH 3/4] Use when-let in a few more spots Kyle Meyer
2020-11-22 20:46 ` [PATCH 4/4] gnus, notmuch: Consider text/plain patch attachments Kyle Meyer
2020-11-22 21:10   ` Kyle Meyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://git.kyleam.com/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0udumg6.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=piem@inbox.kyleam.com \
    --subject='Re: [PATCH 4/4] gnus, notmuch: Consider text/plain patch attachments' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

discussion and development of piem

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.kyleam.com/piem/0 piem/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 piem piem/ https://inbox.kyleam.com/piem \
		piem@inbox.kyleam.com
	public-inbox-index piem

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.piem


code repositories for project(s) associated with this inbox:

	https://git.kyleam.com/piem/

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git