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 5BCD26DE1040 for ; Tue, 19 Mar 2019 07:03:40 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.549 X-Spam-Level: X-Spam-Status: No, score=-0.549 tagged_above=-999 required=5 tests=[AWL=0.151, RCVD_IN_DNSWL_LOW=-0.7] 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 Fbw53DVbeaMo for ; Tue, 19 Mar 2019 07:03:36 -0700 (PDT) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by arlo.cworth.org (Postfix) with ESMTPS id 9F1CA6DE11E0 for ; Tue, 19 Mar 2019 07:03:25 -0700 (PDT) X-Originating-IP: 90.92.41.33 Received: from bababa (lfbn-1-12225-33.w90-92.abo.wanadoo.fr [90.92.41.33]) (Authenticated sender: pierre@atlas.engineer) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 5913CFF811 for ; Tue, 19 Mar 2019 14:03:22 +0000 (UTC) From: Pierre Neidhardt To: notmuch@notmuchmail.org Subject: Re: Reply inline in notmuch-show buffer, "mu4e-conversation style" In-Reply-To: <877ecvb0q7.fsf@bababa.i-did-not-set--mail-host-address--so-tickle-me> References: <877ecvb0q7.fsf@bababa.i-did-not-set--mail-host-address--so-tickle-me> Date: Tue, 19 Mar 2019 15:03:21 +0100 Message-ID: <877ecvm05y.fsf@bababa.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Tue, 19 Mar 2019 14:03:40 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable What I did in mu4e-conversation was actually rather simple, albeit a bit hackish: =2D Copy the test from the composition buffer =2D Save the window excursion =2D Fire up a new message buffer as notmuch-show-reply would produce. =2D Cleanup the citation. =2D Insert the copied text from the composition buffer. =2D Send. Sadly, mu4e wraps too much around message-mode and this forced me to use some ugly hacks. I haven't looked at notmuch's code yet, but it seems that it does not wrap quite as much, so it might be cleaner and as simple as a writing a 10-line-longish function. The "hardest" part is to add a composition area. Here is the code excerpt from mu4e-conversation: =2D-8<---------------cut here---------------start------------->8--- (defun mu4e-conversation-send (&optional msg) "Send message at the end of the view buffer. If MSG is specified, then send this message instead. Most `mu4e-compose-=E2=80=A6' variables are lexically bound during the call of this function." (interactive) (unless (mu4e-conversation--buffer-p) (mu4e-warn "(send) Not a conversation buffer")) (let (draft-buf (buf (current-buffer)) (mu4e-compose-signature mu4e-compose-signature) ;; [More local variables...] (mu4e-compose-crypto-reply-encrypted-policy mu4e-compose-crypto-rep= ly-encrypted-policy)) (run-hooks 'mu4e-conversation-before-send-hook) (save-window-excursion (mu4e-conversation--open-draft msg) (condition-case nil ;; Force-kill DRAFT-BUF on succcess since it's an implementation ;; detail in mu4e-conversation and the composition area is in BUF. (let ((message-kill-buffer-on-exit t)) (message-send-and-exit)) ;; Stay in draft buffer and widen in case we failed during header c= heck. (error (setq draft-buf (current-buffer)) (widen)))) (cond (draft-buf (switch-to-buffer draft-buf)) (mu4e-conversation-kill-buffer-on-exit (switch-to-buffer buf) (mu4e-conversation-quit 'no-confirm)) (t ;; Delete message that was just sent. (goto-char (point-max)) (mu4e-conversation-previous-message) (forward-line) (delete-region (line-beginning-position 1) (point-max)) ;; Ensure it's writable. (insert (propertize "\n" 'face 'mu4e-conversation-header 'rear-nonsticky t)) (set-buffer-modified-p nil) ;; -after-send-hook can be used to update the conversation buffer so = that ;; it includes the message that was just sent. (run-hooks 'mu4e-conversation-after-send-hook))))) =2D-8<---------------cut here---------------end--------------->8--- The hackish part is in mu4e-conversation--open-draft, which I'm not including here because it's long and boring. Hopefully notmuch.el won't require us to do this. =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlyQ9qkACgkQm9z0l6S7 zH/vMQf/QW6ZM9OHySM+Tc6rqICS+FJJVTBrUjb9W10iOu+B/N5MPeJ7veCJx+mC 5uxauPb6B/We8akRy/EyrysAPOZI5PZVVNLGlUEonER1a/X+GF6Lf/mr9nJYNL9q VsOyg2kRJ8MwuN4lfoDOXvQPP+oAlctl5ZOfqQs29twFU28QAKW8UdgKWAuemTJU 6dwClkhfJM3s3CcqwcwUjUZJ8SCHoy24XFfv4FK28oGICFuXwIkFc7NgKXeFr+Mb 90yb6pkz+vwII0KbBBvwu+rzRYoCAqPj54Z7aRdMQscb7ZEFpG0WseThV73WLKQ7 ChyCaloaLP5mTlSLv1mXLBGECMMueg== =PbKC -----END PGP SIGNATURE----- --=-=-=--