From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id q3LNJQgoi2LiXAAAbAwnHQ (envelope-from ) for ; Mon, 23 May 2022 08:22:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gLufJAgoi2LbHgAAauVa8A (envelope-from ) for ; Mon, 23 May 2022 08:22:00 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (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 03A14F0ED for ; Mon, 23 May 2022 08:22:00 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 096BE5F6BC; Mon, 23 May 2022 06:21:57 +0000 (UTC) X-Greylist: delayed 83594 seconds by postgrey-1.36 at yantan; Mon, 23 May 2022 06:21:54 UTC Received: from mail.choca.pics (mail.choca.pics [IPv6:2001:910:1410:500::1]) by mail.notmuchmail.org (Postfix) with ESMTPS id 6C4CA5F5E3 for ; Mon, 23 May 2022 06:21:54 +0000 (UTC) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 2FFE71819D8A9 for ; Mon, 23 May 2022 08:21:53 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id Z2-FOwalTAPX for ; Mon, 23 May 2022 08:21:52 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 812F01819D8A8 for ; Mon, 23 May 2022 08:21:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at choca.pics Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id RxIfsvi6u9ff for ; Mon, 23 May 2022 08:21:52 +0200 (CEST) Received: from localhost (153.226.95.79.rev.sfr.net [79.95.226.153]) by mail.choca.pics (Postfix) with ESMTPSA id 299AD1800EE15 for ; Mon, 23 May 2022 08:21:52 +0200 (CEST) From: Damien Cassou To: notmuch@notmuchmail.org Subject: Re: [PATCH] Fix notmuch-mua.el notmuch-mua-mail In-Reply-To: <87fsl22geh.fsf@cassou.me> References: <87fsl22geh.fsf@cassou.me> Date: Mon, 23 May 2022 08:21:51 +0200 Message-ID: <87zgj8zs3k.fsf@cassou.me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Message-ID-Hash: JET74ZA2TRMCAU7CYON3CZ4KBR2YGUWM X-Message-ID-Hash: JET74ZA2TRMCAU7CYON3CZ4KBR2YGUWM X-MailFrom: damien@cassou.me 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 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: 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=1653286920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=vwMJuPUu69C0eWYEM+pDyhkl+Vkm8u2mJ0BertGfnT0=; b=uEJYNWTPOxdJDJh7ZF6XEUEVJDOFf/lHGNeUaPM9T3VW7TM0gxNedjHDYCuae+o3nW9apG pyijCJtjpJV4VNMApw9+21akLGqEZ5kdvQKeOf47URdAvgmwxsVnCjmCjvHF9/EwktiNy9 BE9YagglzBK1jqiJ6Hok4mprCzlkVMa83m27pGt9CQUCxdc8wX1uKicmdQiUvI+6LqrdQd +QBS6LFLVwMutPiXC8HHhMsnYp49qCk/s+gu5uNf0YkKcEhlptaa5TxueiniTGgHEvjPsE O4pt9izXTA0+EjpLqn12ZFzRlR/9E1WCsmQuncID/XUQfmEDMUisz89zil06Lg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653286920; a=rsa-sha256; cv=none; b=R+MNJcbswgJBP1V4X3DGfR1df8zK9iUD4GN96m02eoh6rnCSa7rFcJR0COowUM417gsHv8 /PatnMw8+A+ixq4bgmrJQb0dTUdcK+r6/9WpZxwB3RL5nepKKnK3B1oZnJkVhfF9Qe10H4 mMNjpnuf3ilnAWDs9QNBYiJYeyumej43ddDsSXuzq2evV4bAXNwMH7Sgzprs+oCtOnvZKz nj7t/yKLnALxyOAOkcoOreIzozMyvucELgoUsK+k1wHP9ReuR/iDgDJA7Pxkymv69svmZL zeY/VfrSmDwr5Aeu8TLvl+lUaZlBEdHmCsnL1TSRK7qIo44d+i0vprOkGjLxjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.97 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 03A14F0ED X-Spam-Score: -1.97 X-Migadu-Scanner: scn1.migadu.com X-TUID: L5gaXiAtpulE --=-=-= Content-Type: text/plain Here is a new version of the patch that takes into account the fact that notmuch-mua-mail can also be called interactively by notmuch and not only through the mail-user-agent variable. -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Change-where-to-move-point-at-the-end-of-notmuch-mua.patch >From 6106765b56464edc649d73916f97208b67ef5eb4 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Mon, 23 May 2022 08:17:27 +0200 Subject: [PATCH] Change where to move point at the end of `notmuch-mua-mail` * emacs/notmuch-mua.el (notmuch-mua-mail): Move point to the position that makes the most sense instead of always moving point to the TO. This is useful when TO/SUBJECT are passed as argument. --- emacs/notmuch-mua.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 60801f4b..4ee252f2 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -420,7 +420,10 @@ (defun notmuch-mua-mail (&optional to subject other-headers _continue (message-hide-headers) (set-buffer-modified-p nil) (notmuch-mua-maybe-set-window-dedicated) - (message-goto-to)) + (cond + ((and to subject) (message-goto-body)) + (to (message-goto-subject)) + (t (message-goto-to)))) (defvar notmuch-mua-sender-history nil) -- 2.36.0 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --=-=-=--