emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105699: Add to sendmail.el a new com


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105699: Add to sendmail.el a new command mail-add-attachment.
Date: Sat, 10 Sep 2011 11:26:12 +0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105699 [merge]
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2011-09-10 11:26:12 +0300
message:
  Add to sendmail.el a new command mail-add-attachment.
  
   etc/NEWS: Document the new command and the alias for mail-insert-file.
   lisp/mail/sendmail.el (mml-to-mime, mml-attach-file)
   (mm-default-file-encoding): Remove autoload forms, they are
   replaced with autoload cookies in mml.el and mm-encode.el.
   (mail-add-attachment): New command.
   (mail-mode-map): Add a menu-bar item for mail-add-attachment.
   (mail-mode): Mention mail-insert-file and mail-add-attachment in
   the doc string.
   (mml-to-mime, mml-attach-file, mm-default-file-encoding): Declare.
   lisp/gnus/mm-encode.el (mm-default-file-encoding): Add autoload cookie.
   lisp/gnus/mml.el (mml-to-mime, mml-attach-file): Add autoload cookies.
   doc/emacs/sending.texi (Mail Misc): Document mail-add-attachment.
modified:
  doc/emacs/ChangeLog
  doc/emacs/sending.texi
  etc/NEWS
  lisp/ChangeLog
  lisp/gnus/ChangeLog
  lisp/gnus/mm-encode.el
  lisp/gnus/mml.el
  lisp/mail/sendmail.el
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog       2011-09-04 16:53:44 +0000
+++ b/doc/emacs/ChangeLog       2011-09-10 08:26:12 +0000
@@ -1,3 +1,7 @@
+2011-09-10  Eli Zaretskii  <address@hidden>
+
+       * sending.texi (Mail Misc): Document mail-add-attachment.
+
 2011-09-04  Eli Zaretskii  <address@hidden>
 
        * basic.texi (Inserting Text): Add index entries.  (Bug#9433)

=== modified file 'doc/emacs/sending.texi'
--- a/doc/emacs/sending.texi    2011-08-25 16:30:46 +0000
+++ b/doc/emacs/sending.texi    2011-09-10 08:26:12 +0000
@@ -556,8 +556,8 @@
 @cindex Multipurpose Internet Mail Extensions
   You can @dfn{attach} a file to an outgoing message by typing
 @kbd{C-c C-a} (@code{mml-attach-file}) in the mail buffer.  Attaching
-is done using the MIME (Multipurpose Internet Mail Extensions)
-standard.
+is done using the Multipurpose Internet Mail Extensions
+(@acronym{MIME}) standard.
 
   The @code{mml-attach-file} command prompts for the name of the file,
 and for the attachment's @dfn{content type}, @dfn{description}, and
@@ -570,6 +570,13 @@
 or @samp{attachment}, which means the link will be separate from the
 body.
 
address@hidden mail-add-attachment
+  The @code{mml-attach-file} command is specific to Message mode; in
+Mail mode use @kbd{mail-add-attachment} instead.  It will prompt only
+for the name of the file, and will determine the content type and the
+disposition automatically.  If you want to include some description of
+the attached file, type that in the message body.
+
   The actual contents of the attached file are not inserted into the
 mail buffer.  Instead, some placeholder text is inserted into the mail
 buffer, like this:

=== modified file 'etc/NEWS'
--- a/etc/NEWS  2011-08-30 15:24:07 +0000
+++ b/etc/NEWS  2011-09-10 08:26:12 +0000
@@ -156,6 +156,15 @@
 
 in your ~/.authinfo file instead.
 
+*** sendmail changes
++++
+You can now add MIME attachments to outgoing messages with the new
+command `mail-add-attachment'.
+
+---
+The command `mail-attach-file' was renamed to `mail-insert-file'; the
+old name is now an obsolete alias to the new name.
+
 ** Emacs server and client changes
 +++
 *** New option `server-port' specifies the port on which the Emacs

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-09-10 03:02:06 +0000
+++ b/lisp/ChangeLog    2011-09-10 08:26:12 +0000
@@ -1,3 +1,14 @@
+2011-09-10  Eli Zaretskii  <address@hidden>
+
+       * mail/sendmail.el (mml-to-mime, mml-attach-file)
+       (mm-default-file-encoding): Remove autoload forms, they are
+       replaced with autoload cookies in mml.el and mm-encode.el.
+       (mail-add-attachment): New command.
+       (mail-mode-map): Add a menu-bar item for mail-add-attachment.
+       (mail-mode): Mention mail-insert-file and mail-add-attachment in
+       the doc string.
+       (mml-to-mime, mml-attach-file, mm-default-file-encoding): Declare.
+
 2011-09-10  Reuben Thomas  <address@hidden>
 
        * simple.el (count-words-region): Use buffer if there's no region.

=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-09-09 10:18:45 +0000
+++ b/lisp/gnus/ChangeLog       2011-09-10 08:26:12 +0000
@@ -1,3 +1,10 @@
+2011-09-10  Eli Zaretskii  <address@hidden>
+
+       Add autoload cookies for functions used by sendmail.el.
+       * mm-encode.el (mm-default-file-encoding): Add autoload cookie.
+
+       * mml.el (mml-to-mime, mml-attach-file): Add autoload cookies.
+
 2011-09-09  Katsumi Yamaoka  <address@hidden>
 
        * gnus-art.el (article-date-ut): Work properly even when there are

=== modified file 'lisp/gnus/mm-encode.el'
--- a/lisp/gnus/mm-encode.el    2011-01-25 04:08:28 +0000
+++ b/lisp/gnus/mm-encode.el    2011-09-10 08:26:12 +0000
@@ -97,6 +97,7 @@
     (insert "Content-Type: multipart/mixed; boundary=\"" boundary "\"\n")
     boundary))
 
+;;;###autoload
 (defun mm-default-file-encoding (file)
   "Return a default encoding for FILE."
   (if (not (string-match "\\.[^.]+$" file))

=== modified file 'lisp/gnus/mml.el'
--- a/lisp/gnus/mml.el  2011-01-25 04:08:28 +0000
+++ b/lisp/gnus/mml.el  2011-09-10 08:26:12 +0000
@@ -897,6 +897,7 @@
 (autoload 'message-encode-message-body "message")
 (declare-function message-narrow-to-headers-or-head "message" ())
 
+;;;###autoload
 (defun mml-to-mime ()
   "Translate the current buffer from MML to MIME."
   ;; `message-encode-message-body' will insert an encoded Content-Description
@@ -1294,6 +1295,7 @@
   :version "22.1" ;; Gnus 5.10.9
   :group 'message)
 
+;;;###autoload
 (defun mml-attach-file (file &optional type description disposition)
   "Attach a file to the outgoing MIME message.
 The file is not inserted or encoded until you send the message with

=== modified file 'lisp/mail/sendmail.el'
--- a/lisp/mail/sendmail.el     2011-09-09 08:59:51 +0000
+++ b/lisp/mail/sendmail.el     2011-09-10 08:26:12 +0000
@@ -31,9 +31,6 @@
 
 (require 'rfc2047)
 
-(autoload 'mml-to-mime "mml"
-  "Translate the current buffer from MML to MIME.")
-
 (defgroup sendmail nil
   "Mail sending commands for Emacs."
   :prefix "mail-"
@@ -310,6 +307,9 @@
     (define-key map [menu-bar mail]
       (cons "Mail" (make-sparse-keymap "Mail")))
 
+    (define-key map [menu-bar mail attachment]
+      '("Attach File" . mail-add-attachment))
+
     (define-key map [menu-bar mail fill]
       '("Fill Citation" . mail-fill-yanked-message))
 
@@ -700,6 +700,8 @@
 \\[mail-signature]  mail-signature (insert `mail-signature-file' file).
 \\[mail-yank-original]  mail-yank-original (insert current message, in Rmail).
 \\[mail-fill-yanked-message]  mail-fill-yanked-message (fill what was yanked).
+\\[mail-insert-file] insert a text file into the message.
+\\[mail-add-attachment] attach to the message a file as binary attachment.
 Turning on Mail mode runs the normal hooks `text-mode-hook' and
 `mail-mode-hook' (in that order)."
   (make-local-variable 'mail-reply-action)
@@ -868,6 +870,7 @@
   :type '(repeat string)
   :group 'sendmail)
 
+(declare-function mml-to-mime "mml" ())
 
 (defun mail-send ()
   "Send the message in the current buffer.
@@ -1697,7 +1700,7 @@
   (split-line mail-yank-prefix))
 
 
-(defun mail-attach-file (&optional file)
+(defun mail-insert-file (&optional file)
   "Insert a file at the end of the buffer, with separator lines around it."
   (interactive "fAttach file: ")
   (save-excursion
@@ -1716,6 +1719,21 @@
       (insert-file-contents file)
       (or (bolp) (newline))
       (goto-char start))))
+
+(define-obsolete-function-alias 'mail-attach-file 'mail-insert-file "24.1")
+
+(declare-function mml-attach-file "mml"
+                 (file &optional type description disposition))
+(declare-function mm-default-file-encoding "mm-encode" (file))
+
+(defun mail-add-attachment (file)
+  "Add FILE as a MIME attachment to the end of the mail message being 
composed."
+  (interactive "fAttach file: ")
+  (mml-attach-file file
+                  (or (mm-default-file-encoding file)
+                      "application/octet-stream") nil)
+  (setq mail-encode-mml t))
+
 
 ;; Put these commands last, to reduce chance of lossage from quitting
 ;; in middle of loading the file.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]