Changes committed gnus/lisp (ChangeLog mml.el)
"Katsumi Yamaoka" <[email protected]> Mon, 31 Aug 2009 02:10:24 +0200
| Newsgroups | gmane.emacs.gnus.commits |
|---|---|
| Message-ID | <[email protected]> |
Modified: ChangeLog mml.el (mml-attach-file, mml-attach-buffer, mml-attach-external): Don't move point if the command is invoked inside the message header. Index: ChangeLog diff -u gnus/lisp/ChangeLog:7.2007 gnus/lisp/ChangeLog:7.2008 --- ChangeLog:7.2007 Fri Aug 28 12:57:24 2009 +++ ChangeLog Mon Aug 31 02:10:23 2009 @@ -1,3 +1,8 @@ +2009-08-31 Katsumi Yamaoka <[email protected]> + + * mml.el (mml-attach-file, mml-attach-buffer, mml-attach-external): + Don't move point if the command is invoked inside the message header. + 2009-08-28 Katsumi Yamaoka <[email protected]> * mml.el (mml-attach-file, mml-attach-buffer, mml-attach-external): Index: mml.el diff -u gnus/lisp/mml.el:7.76 gnus/lisp/mml.el:7.77 --- mml.el:7.76 Fri Aug 28 12:57:24 2009 +++ mml.el Mon Aug 31 02:10:23 2009 @@ -1292,14 +1292,24 @@ (description (mml-minibuffer-read-description)) (disposition (mml-minibuffer-read-disposition type nil file))) (list file type description disposition))) - (unless (message-in-body-p) (goto-char (point-max))) - (mml-insert-empty-tag 'part - 'type type - ;; icicles redefines read-file-name and returns a - ;; string w/ text properties :-/ - 'filename (mm-substring-no-properties file) - 'disposition (or disposition "attachment") - 'description description)) + ;; Don't move point if this command is invoked inside the message header. + (let ((head (unless (message-in-body-p) + (prog1 + (point) + (goto-char (point-max)))))) + (mml-insert-empty-tag 'part + 'type type + ;; icicles redefines read-file-name and returns a + ;; string w/ text properties :-/ + 'filename (mm-substring-no-properties file) + 'disposition (or disposition "attachment") + 'description description) + (when head + (unless (prog1 + (pos-visible-in-window-p) + (goto-char head)) + (message "The file \"%s\" has been attached at the end of the message" + (file-name-nondirectory file)))))) (defun mml-dnd-attach-file (uri action) "Attach a drag and drop file. @@ -1335,10 +1345,21 @@ (description (mml-minibuffer-read-description)) (disposition (mml-minibuffer-read-disposition type nil))) (list buffer type description disposition))) - (unless (message-in-body-p) (goto-char (point-max))) - (mml-insert-empty-tag 'part 'type type 'buffer buffer - 'disposition disposition - 'description description)) + ;; Don't move point if this command is invoked inside the message header. + (let ((head (unless (message-in-body-p) + (prog1 + (point) + (goto-char (point-max)))))) + (mml-insert-empty-tag 'part 'type type 'buffer buffer + 'disposition disposition + 'description description) + (when head + (unless (prog1 + (pos-visible-in-window-p) + (goto-char head)) + (message + "The buffer \"%s\" has been attached at the end of the message" + buffer))))) (defun mml-attach-external (file &optional type description) "Attach an external file into the buffer. @@ -1349,9 +1370,19 @@ (type (mml-minibuffer-read-type file)) (description (mml-minibuffer-read-description))) (list file type description))) - (unless (message-in-body-p) (goto-char (point-max))) - (mml-insert-empty-tag 'external 'type type 'name file - 'disposition "attachment" 'description description)) + ;; Don't move point if this command is invoked inside the message header. + (let ((head (unless (message-in-body-p) + (prog1 + (point) + (goto-char (point-max)))))) + (mml-insert-empty-tag 'external 'type type 'name file + 'disposition "attachment" 'description description) + (when head + (unless (prog1 + (pos-visible-in-window-p) + (goto-char head)) + (message "The file \"%s\" has been attached at the end of the message" + (file-name-nondirectory file)))))) (defun mml-insert-multipart (&optional type) (interactive (list (completing-read "Multipart type (default mixed): "