jeremy-compostella / org-msg

OrgMsg is a GNU/Emacs global minor mode mixing up Org mode and Message mode to compose and reply to emails in a Outlook HTML friendly style.
GNU General Public License v3.0
276 stars 57 forks source link

Consider allowing replies with no citation and/or no signature #104

Open guibor opened 3 years ago

guibor commented 3 years ago

This would involve setting reply-to to nil in org-msg-post-setup if the the no citation option is on (and even if org-msg-posting-style is 'top-posting).

Very specific use-case - when replying to Google Docs comments or other online threads that are also sent by email and can be replied to, it is often necessary to respond in plain text (covered in #90) and not include the citation.

A similar option for inserting the signature in these (or other cases) would be helpful as well.

jeremy-compostella commented 3 years ago

There is fine line I am very careful not crossing between what a mail user agent should provide and OrgMsg goals. In my opinion, the no citation feature falls under the mail user agent duty. When I reply to email with gnus I can either call gnus-summary-followup or gnus-summary-followup-with-original only the later will include the citation (I am sure there is an equivalent in mu4e). Note that I always use the later and I realized that the former makes OrgMsg crash. I fixed it in the experimental branch.

Your second request clearly fall under OrgMsg scope and I have implemented something in the experimental branch which I believe should allow you to implement this behavior.

guibor commented 3 years ago

Hi Jeremy,

I tried it out:

(defun mdfz/org-msg-remove-signature (composition-parameters)
  (if (mdfz/org-msg-should-force-plaintext)
      (add-to-list 'composition-parameters '(signature . nil))
    composition-parameters))

(advice-add 'org-msg-composition-parameters :filter-return #'mdfz/org-msg-remove-signature)

and it works great.

guibor commented 3 years ago

As a side note - it's not trivial to customize citation behavior through message-mode or mu4e-compose. But you are probably right.

Thanks for the feature!

jeremy-compostella commented 3 years ago

Indeed, I looked at the mu4e souce code and I could not find any way to do this through available configuration. I see that you have opened a ticket with mu and I subscribed to it. If they can't provide a solution, it is really easy to implement one in OrgMsg in just a few lines of code. However I believe that this feature should be implemented in the user mail agent as it would benefit more people than if implemented in OrgMsg.

theophilusx commented 3 years ago

In case it helps, here is what I did for mu4e.

(defun tx-delete-citation ()
  (delete-region (point) (point-max)))

(defun tx-mu4e-reply (prefix)
  (interactive "P")
  (setq mu4e-compose-cite-function (if prefix
                                       #'tx-delete-citation
                                     #'message-cite-original-without-signature))
  (mu4e-compose-reply))

(define-key mu4e-view-mode-map "R" #'tx-mu4e-reply)
(define-key mu4e-headers-mode-map "R" #'tx-mu4e-reply)

This is using mu4e dev version (head of mu4e repository). Basically, if I use the universal argument when replying e.g. C-u R, cited message text is removed. If I just do R to reply, the full message, without signature, is cited.

danielfleischer commented 2 years ago

I think it's not enough. When you do org-msg-preview you do see the original message being replied.

You actually need to remove the :reply-to: property from the message.

danielfleischer commented 2 years ago

A simple solution

(defun df/org-msg-edit-advice (&rest args)
  (if current-prefix-arg (org-msg-set-prop "reply-to" nil)))
(advice-add 'org-msg-edit-mode :after #'df/org-msg-edit-advice)

Need to remember this discussion is only relevant for HTML emails and the citation text you see in the draft buffer is only an indication; this is only a hack to prevent adding the original message, in HTML format to the new email.