From 8c3fb9d3a66794194f7f6f0063d8198e38baf80a Mon Sep 17 00:00:00 2001 From: yamaoka Date: Sat, 7 Feb 2004 13:22:10 +0000 Subject: [PATCH] Synch to No Gnus 200402070252. --- lisp/ChangeLog | 7 +++++++ lisp/mml.el | 19 +++++++++++++++++-- texi/ChangeLog | 6 ++++++ texi/gnus-news.texi | 2 ++ texi/message-ja.texi | 3 ++- texi/message.texi | 7 ++++--- 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5fb0823..6976d25 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,12 @@ +2004-02-07 Jesper Harder + + * mml.el (mml-compute-boundary-1): Don't uncompress files. + 2004-02-06 Jesper Harder + * mml.el (mml-mode, mml-x-dnd-attach-file): Attach drop and drag + files. + * message.el (message-generate-headers-first): Don't quote nil and t in docstrings. diff --git a/lisp/mml.el b/lisp/mml.el index 40b4a0d..157ea0e 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -37,7 +37,8 @@ (autoload 'gnus-make-local-hook "gnus-util") (autoload 'message-fetch-field "message") (autoload 'fill-flowed-encode "flow-fill") - (autoload 'message-posting-charset "message")) + (autoload 'message-posting-charset "message") + (autoload 'x-dnd-get-local-file-name "x-dnd")) (defcustom mml-content-type-parameters '(name access-type expiration size permission format) @@ -582,7 +583,7 @@ If MML is non-nil, return the buffer up till the correspondent mml tag." (insert-buffer-substring (cdr (assq 'buffer cont)))) ((and (setq filename (cdr (assq 'filename cont))) (not (equal (cdr (assq 'nofile cont)) "yes"))) - (mm-insert-file-contents filename)) + (mm-insert-file-contents filename nil nil nil nil t)) (t (insert (cdr (assq 'contents cont))))) (goto-char (point-min)) @@ -888,6 +889,11 @@ See Info node `(emacs-mime)Composing'. (> (prefix-numeric-value arg) 0))) (add-minor-mode 'mml-mode " MML" mml-mode-map) (easy-menu-add mml-menu mml-mode-map) + (when (boundp 'x-dnd-protocol-alist) + (set (make-local-variable 'x-dnd-protocol-alist) + '(("^file:///" . mml-x-dnd-attach-file) + ("^file://" . x-dnd-open-file) + ("^file:" . mml-x-dnd-attach-file)))) (run-hooks 'mml-mode-hook))) ;;; @@ -1005,6 +1011,15 @@ description of the attachment." 'disposition (or disposition "attachment") 'description description)) +(defun mml-x-dnd-attach-file (uri action) + "Attach a drag and drop file." + (let ((file (x-dnd-get-local-file-name uri t))) + (when (and file (file-regular-p file)) + (let* ((type (mml-minibuffer-read-type file)) + (description (mml-minibuffer-read-description)) + (disposition (mml-minibuffer-read-disposition type))) + (mml-attach-file file type description disposition))))) + (defun mml-attach-buffer (buffer &optional type description) "Attach a buffer to the outgoing MIME message. See `mml-attach-file' for details of operation." diff --git a/texi/ChangeLog b/texi/ChangeLog index 990cc2d..cf09028 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,9 @@ +2004-02-06 Jesper Harder + + * gnus-news.texi: dnd attachments. + + * message.texi (MIME): do. + 2004-02-03 Reiner Steib * gnus.texi (Batching Agents): Fixed typo in example. Reported diff --git a/texi/gnus-news.texi b/texi/gnus-news.texi index b06ab77..800951e 100644 --- a/texi/gnus-news.texi +++ b/texi/gnus-news.texi @@ -18,6 +18,8 @@ this file (see `gnus-news.el'). @itemize @bullet +@item You can now drag and drop attachments to the Message buffer. + @item @kbd{/ r} limits the summary buffer to replied articles. @item @acronym{ANSI} @acronym{SGR} control sequences can be transformed diff --git a/texi/message-ja.texi b/texi/message-ja.texi index 0387d28..0fafafa 100644 --- a/texi/message-ja.texi +++ b/texi/message-ja.texi @@ -845,7 +845,8 @@ automatically add the @code{Content-Type} and The most typical thing users want to use the multipart things in @acronym{MIME} for is to add ``attachments'' to mail they send out. This can be done with the @kbd{C-c C-a} command, which will prompt for a file -name and a @acronym{MIME} type. +name and a @acronym{MIME} type. If your Emacs supports drag +and drop, you can also drop the file in the Message buffer. You can also create arbitrarily complex multiparts using the @acronym{MML} language (@pxref{Composing, , Composing, emacs-mime, The Emacs MIME diff --git a/texi/message.texi b/texi/message.texi index 5cc5e05..3238ca6 100644 --- a/texi/message.texi +++ b/texi/message.texi @@ -828,9 +828,10 @@ automatically add the @code{Content-Type} and @code{Content-Transfer-Encoding} headers. The most typical thing users want to use the multipart things in -@acronym{MIME} for is to add ``attachments'' to mail they send out. This can -be done with the @kbd{C-c C-a} command, which will prompt for a file -name and a @acronym{MIME} type. +@acronym{MIME} for is to add ``attachments'' to mail they send out. +This can be done with the @kbd{C-c C-a} command, which will prompt for +a file name and a @acronym{MIME} type. If your Emacs supports drag +and drop, you can also drop the file in the Message buffer. You can also create arbitrarily complex multiparts using the @acronym{MML} language (@pxref{Composing, , Composing, emacs-mime, The Emacs MIME -- 1.7.10.4