Reply inline in notmuch-show buffer, "mu4e-conversation style"

2019-03-19 Thread Pierre Neidhardt
Hi,

mu4e-conversation (https://gitlab.com/ambrevar/mu4e-conversation) has a
very nice feature in my opinion: it allows you to compose a reply at the
end of the buffer, in a dedicated "composition area".

- Pressing C-c C-c sends the message (it won't if the message is empty
  or white space).

- Pressing "RET" appends the region to the composition area.  This
  makes it very convenient to *quote/cite from different messages*.
  With a prefix argument, it prepends a citation line (e.g. "John doe 
wrote...").
  This is similar to how messengers like Whatsapp work.
  This is the real killer-feature of mu4e-conversation in my opinion.

What to you people think of adding such a feature to notmuch-show?

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Reply inline in notmuch-show buffer, "mu4e-conversation style"

2019-03-19 Thread Pierre Neidhardt
What I did in mu4e-conversation was actually rather simple, albeit a bit
hackish:

- Copy the test from the composition buffer
- Save the window excursion
- Fire up a new message buffer as notmuch-show-reply would produce.
- Cleanup the citation.
- Insert the copied text from the composition buffer.
- 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:

--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-…' 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-reply-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 check.
(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)
--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.

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Reply inline in notmuch-show buffer, "mu4e-conversation style"

2019-04-03 Thread David Edmondson
On Wednesday, 2019-04-03 at 11:12:27 +02, Pierre Neidhardt wrote:

> Anyone interested?  Should I send a patch?

I couldn't figure out when I'd want to use this, as yanking text from
the existing notmuch-show buffer seems straightforward.

Maybe something akin to gnus-dired-mode would be interesting - it would
be used in notmuch-show mode and yank selected text into the current
message-mode buffer (including quoting).

dme.
-- 
I got a girlfriend that's better than that.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Reply inline in notmuch-show buffer, "mu4e-conversation style"

2019-04-10 Thread David Edmondson
On Wednesday, 2019-04-10 at 15:27:14 +02, Pierre Neidhardt wrote:

> David Edmondson  writes:
>
>> Yes. My argument was not that we shouldn't have this, just that I wonder
>> if it results in a good workflow for people who are not using
>> notmuch/mu4e/gmail (or any other client that shares the same kind of
>> thread view).
>
> With about 1 year of experience using mu4e-conversation, I found that it
> works really well, actually better in most cases since it does not
> "pollute" emails with forgotten citations.

Encouraging people to trim their replies is an ongoing burden, I agree.

> Most people use Gmail or clients that support threading, in which case
> this is really a good fit.

90% of my email is via my employer. There is no Gmail there, and most
people are not using a threaded mailer. In general they are used to
inter-mingling their comments in replies rather than top-posting or not
quoting (but this is definitely changing over time, with top-posting
becoming more common).

> But really if we think about the workflow of "most people", then most of
> the time citations are ignored (e.g. top-posting) and just pollute the
> rest of the emails.  In those cases (the majority?) a non-threaded
> workflow does not really work I think.

I've no problem with their being more options.

dme.
-- 
Stranded starfish have no place to hide.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch