From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SK9eO8evk2JMLQAAbAwnHQ (envelope-from ) for ; Sun, 29 May 2022 19:39:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id YAY7O8evk2LJ7QAAauVa8A (envelope-from ) for ; Sun, 29 May 2022 19:39:19 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7EC81382A7 for ; Sun, 29 May 2022 19:39:19 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 6EE945F525; Sun, 29 May 2022 17:39:16 +0000 (UTC) X-Greylist: delayed 302 seconds by postgrey-1.36 at yantan; Sun, 29 May 2022 15:15:58 UTC Received: from mail-108-mta14.mxroute.com (mail-108-mta14.mxroute.com [136.175.108.14]) by mail.notmuchmail.org (Postfix) with ESMTPS id 80E575E020 for ; Sun, 29 May 2022 15:15:58 +0000 (UTC) Received: from filter006.mxroute.com ([140.82.40.27] 140.82.40.27.vultrusercontent.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta14.mxroute.com (ZoneMTA) with ESMTPSA id 181105ec2f2000c327.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Sun, 29 May 2022 15:10:54 +0000 X-Zone-Loop: 80a89f156678c47ef50fffd309495cfc0a8795d5d8d3 X-Originating-IP: [140.82.40.27] From: joshua@joshuao.com To: notmuch@notmuchmail.org Subject: [PATCH] emacs: add paramter to not quote original message in replies Date: Sun, 29 May 2022 16:10:40 +0100 Message-Id: <20220529151040.616780-1-joshua@joshuao.com> MIME-Version: 1.0 X-AuthUser: joshua@joshuao.com X-MailFrom: joshua@joshuao.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 Message-ID-Hash: F45SVDCVVUPFAOHRE6K5ZI5IM6JFIDGM X-Message-ID-Hash: F45SVDCVVUPFAOHRE6K5ZI5IM6JFIDGM X-Mailman-Approved-At: Sun, 29 May 2022 17:39:14 +0000 CC: Joshua O'Connor X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653845959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=zlnQ6f3EeGqQ6DkvVUBF1Nms+8wu7zRvwLw/1hEg3jw=; b=Z77zHjN9DFkJc8f+eKRgCVR/vRtbRmxdpUGzDg/tMjKadT/y4ZmfXN9/LD50vOLiVmlbfk NGj0KIoFc+BfV96qsCgMdPwQBLNT8/TE/iOYOU4DB52WLZlDRbLJQbJWzvWixK3NSZEBy8 4dd3m6WZgaqxfrAjnwJTFkA5TMrwT5w4vaF5QibjCA1LH4oNQT9BIaKF9684SYPSzBcvbS 6blIl9zh+F4p6WZN2sV2VYipjFTpRPd7c57w4LHIXnZzTz1hQsgofGepbP6ioLv6c7BQ4W //82v57BTiOdjmiT7UjWR4isFEfcgpF6YmnpsiP7XhTxafTx/a/fLCfg6U73qA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653845959; a=rsa-sha256; cv=none; b=VoCyY6HbNJ/b5z/Hzi7Zz56qftqGXY+6Rn0CMOcbWr3J6ctdW1vJ7sr5iZsfMHCvkTWr2F e5mlz3JVQe81tIV+YM2K6L8PhYQdgYiEFMDZtGV4ulMDIts6P10yMXIqu5uZseFMkcoIuq jeaTRLjlrbXDq8pfa98YllHFydVHPT+0SWSJx/IAFOAsbIgLWUHfoXEkBph9vdpAUrN8EE /zPYVUW9fMJbx9XGarPubSUjBew3vq36hyNkNFUmJB5CsGxOym1IMg3yB0HUa6wuuPkdsr I4m+L2xm8VOPtUK/L+RfZX+cPUIE/1nxnAf3FOZSMvhv2et6MeatEyryjHrDHQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.04 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 7EC81382A7 X-Spam-Score: -1.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: Z0HZsetjEbHw From: Joshua O'Connor While the default reply function does nicely set the region to the quoted text to allow for easy an easy kill-region, at least one package, org-msg, interprets the incoming citation (or not) and operates on it. Adding this parameter makes it feasible for users of that library to write their own notmuch-show-reply-sender-esque function for this purpose. --- emacs/notmuch-mua.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 60801f4b..b37bab0d 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -234,7 +234,7 @@ Typically this is added to `notmuch-mua-send-hook'." ;;; Mua reply -(defun notmuch-mua-reply (query-string &optional sender reply-all) +(defun notmuch-mua-reply (query-string &optional sender reply-all omit-original) (let ((args '("reply" "--format=sexp" "--format-version=5")) (process-crypto notmuch-show-process-crypto) reply @@ -280,6 +280,7 @@ Typically this is added to `notmuch-mua-send-hook'." (when notmuch-message-replied-tags (setq notmuch-message-queued-tag-changes (list (cons query-string notmuch-message-replied-tags)))) + (unless omit-original ;; Insert the message body - but put it in front of the signature ;; if one is present, and after any other content ;; message*setup-hooks may have added to the message body already. @@ -327,7 +328,7 @@ Typically this is added to `notmuch-mua-send-hook'." (set-mark (point)) (goto-char start) ;; Quote the original message according to the user's configured style. - (funcall notmuch-mua-cite-function))) + (funcall notmuch-mua-cite-function)))) ;; Crypto processing based crypto content of the original message (when process-crypto (notmuch-mua-reply-crypto (plist-get original :body)))) @@ -512,12 +513,13 @@ the From: address." (message-hide-headers) (set-buffer-modified-p nil)))) -(defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all) +(defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all omit-original) "Compose a reply to the message identified by QUERY-STRING. If PROMPT-FOR-SENDER is non-nil, the user will be prompted for the From: address first. If REPLY-ALL is non-nil, the message -will be addressed to all recipients of the source message." +will be addressed to all recipients of the source message. If +OMIT-ORIGINAL is non-nil, the orignial message will not be quoted." ;; `select-active-regions' is t by default. The reply insertion code ;; sets the region to the quoted message to make it easy to delete ;; (kill-region or C-w). These two things combine to put the quoted @@ -532,7 +534,7 @@ will be addressed to all recipients of the source message." (let ((sender (and prompt-for-sender (notmuch-mua-prompt-for-sender))) (select-active-regions nil)) - (notmuch-mua-reply query-string sender reply-all) + (notmuch-mua-reply query-string sender reply-all omit-original) (deactivate-mark))) ;;; Checks -- 2.36.1