From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Lillibridge Newsgroups: gmane.emacs.devel Subject: Re: Change in rmail-insert-mime-forwarded-message Date: Fri, 11 Jan 2013 08:48:07 -0800 Message-ID: <87d2xb64zc.fsf@foil.strangled.net> References: <837gnkgmxm.fsf@gnu.org> Reply-To: mdl@alum.mit.edu NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1357922926 21417 80.91.229.3 (11 Jan 2013 16:48:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Jan 2013 16:48:46 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 11 17:49:02 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tthmv-00007z-64 for ged-emacs-devel@m.gmane.org; Fri, 11 Jan 2013 17:49:01 +0100 Original-Received: from localhost ([::1]:58200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tthmf-0000h9-An for ged-emacs-devel@m.gmane.org; Fri, 11 Jan 2013 11:48:45 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TthmV-0000gm-J8 for emacs-devel@gnu.org; Fri, 11 Jan 2013 11:48:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TthmH-0004dT-QE for emacs-devel@gnu.org; Fri, 11 Jan 2013 11:48:35 -0500 Original-Received: from alum-mailsec-scanner-7.mit.edu ([18.7.68.19]:53195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tthm1-0004aV-Et; Fri, 11 Jan 2013 11:48:05 -0500 X-AuditID: 12074413-b7f786d0000008bb-7b-50f0424492d7 Original-Received: from outgoing-alum.mit.edu (OUTGOING-ALUM.MIT.EDU [18.7.68.33]) by alum-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 05.BD.02235.44240F05; Fri, 11 Jan 2013 11:48:04 -0500 (EST) Original-Received: from foil.strangled.net (c-67-188-235-212.hsd1.ca.comcast.net [67.188.235.212]) (authenticated bits=0) (User authenticated as mdl@ALUM.MIT.EDU) by outgoing-alum.mit.edu (8.13.8/8.12.4) with ESMTP id r0BGm2MI014592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 11 Jan 2013 11:48:03 -0500 In-Reply-To: <837gnkgmxm.fsf@gnu.org> (message from Eli Zaretskii on Fri, 11 Jan 2013 10:10:13 +0200) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFIsWRmVeSWpSXmKPExsUixO6iqOvi9CHAYPlxE4uXV44yWzxe8ITV YurHM2wWU5ZsZXdg8fj7/gOTR9s0swCmKG6bpMSSsuDM9Dx9uwTujA9dWxgLJqpVNJw6zdLA OFu2i5GTQ0LAROLV8UssELaYxIV769m6GLk4hAQuM0rsXHKCCcK5yiSx/eIOsCo2AU2J6c++ s4PYIgIKEndf3mYEsZkFVCRe7jjJBGILC1hJ7HzZARbnFEiV6Np5FcwWEpCSWLroBFgvi4Cq RPusecwgNq+AvsTUe8tYIWxBiZMzn7BAzJSQOPjiBfMERr5ZSFKzkKQWMDKtYpRLzCnN1c1N zMwpTk3WLU5OzMtLLdI118vNLNFLTSndxAgJO+EdjLtOyh1iFOBgVOLhrdJ8HyDEmlhWXJl7 iFGSg0lJlDfB5kOAEF9SfkplRmJxRnxRaU5q8SFGCQ5mJRHe99ZAOd6UxMqq1KJ8mJQ0B4uS OK/aEnU/IYH0xJLU7NTUgtQimKwMB4eSBK+CI1CjYFFqempFWmZOCUKaiYMTZDiXlEhxal5K alFiaUlGPCjG4ouBUQaS4gHae9cBZG9xQWIuUBSi9RSjLsev5R3PGYVY8vLzUqXEeWVAdgiA FGWU5sGtgCWZV4ziQB8L8xqCVPEAExTcpFdAS5iAlpy98B5kSUkiQkqqgZEjodQ7/ktd9SwF r8ev3pjGNy93219uNsEvbINgSOuGT2rLdsmKqJVeTVjW9tyYIYLPqUwvhWch897iKSvvMx2W fzPZufw1g2mUjuu3mTMjEs7u/lUY/rEqkDVt08JLwnYX9R7+LhfeaFn04/AO76i5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 18.7.68.19 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:156232 Archived-At: Eli Zaretskii writes: > > Date: Thu, 10 Jan 2013 23:43:33 -0500 > > From: Richard Stallman > > Cc: emacs-devel@gnu.org > > > > Hmmm. Richard, does the behavior of "f" when > > rmail-enable-mime-composing is set to nil do what you want? > > > > I just tried it, and it seems ok. > > > > If so, we > > just need to figure out a good way to make that behavior and my patch > > behavior for "f" available at the same time. > > > > That's ok with me. Any suggestions? > > Test rmail-enable-mime-composing's value and do one or the other > depending on that value? The obvious first step would seem to be to modify rmail-forward (below) to have an optional argument that overrides the setting of rmail-enable-mime-composing. The question is how best to select this argument interactively? Unfortunately, the prefix argument is already being used to toggle between regular forward and resend message. We could make C-u f resend and C-u C-u f forward the non-default way, but that feels kludgy to me. Accordingly, I'm thinking adding a new command key would be better. We could add F for the alternative forward method or move resend to its own key, R, and make C-u f the alternative forward (not muscle memory backwards compatible). If you don't like shifting (I don't think Rmail currently uses any shifted letters), y and z look available but are not very memorable. Either way, this probably means adding a short helper function that calls rmail-forward with the appropriate arguments. An advantage of "F" is that it would allow using C-u F in the future for alternative methods of forwarding like (3). Note that there are a few other ways to forward messages (menubar, from summary buffer) that would also need to be changed similarly to whatever we do with the main one. We should probably rename (with obsolete alias) rmail-enable-mime-composing to something like rmail-default-forwarding-method if we do this. I don't have a strong argument offhand for which way the default should be set, but if it's (2), it might be useful to have a mini-buffer message if the message has attachments suggesting that the user might want to use (1) instead. - Mark (defun rmail-forward (resend) "Forward the current message to another user. With prefix argument, \"resend\" the message instead of forwarding it; see the documentation of `rmail-resend'." (interactive "P") (if (zerop rmail-current-message) (error "No message to forward")) (if resend (call-interactively 'rmail-resend) (let ((forward-buffer rmail-buffer) (msgnum rmail-current-message) (subject (concat "[" (let ((from (or (mail-fetch-field "From") (mail-fetch-field ">From")))) (if from (concat (mail-strip-quoted-names from) ": ") "")) (or (mail-fetch-field "Subject") "") "]"))) (if (rmail-start-mail nil nil subject nil nil rmail-buffer (list (list 'rmail-mark-message forward-buffer (with-current-buffer rmail-buffer (aref rmail-msgref-vector msgnum)) rmail-forwarded-attr-index)) ;; If only one window, use it for the mail buffer. ;; Otherwise, use another window for the mail buffer ;; so that the Rmail buffer remains visible ;; and sending the mail will get back to it. (and (not rmail-mail-new-frame) (one-window-p t))) ;; The mail buffer is now current. (save-excursion ;; Insert after header separator--before signature if any. (rfc822-goto-eoh) (forward-line 1) (if (and rmail-enable-mime rmail-enable-mime-composing rmail-insert-mime-forwarded-message-function) (prog1 (funcall rmail-insert-mime-forwarded-message-function forward-buffer) ;; rmail-insert-mime-forwarded-message-function ;; works by inserting MML tags into forward-buffer. ;; The MUA will need to convert it to MIME before ;; sending. mail-encode-mml tells them to do that. ;; message.el does that automagically. (or (eq mail-user-agent 'message-user-agent) (setq mail-encode-mml t))) (insert "------- Start of forwarded message -------\n") ;; Quote lines with `- ' if they start with `-'. (let ((beg (point)) end) (setq end (point-marker)) (set-marker-insertion-type end t) (insert-buffer-substring forward-buffer) (goto-char beg) (while (re-search-forward "^-" end t) (beginning-of-line) (insert "- ") (forward-line 1)) (goto-char end) (skip-chars-backward "\n") (if (< (point) end) (forward-char 1)) (delete-region (point) end) (set-marker end nil)) (insert "------- End of forwarded message -------\n")) (push-mark))))))