;;; emh-comp.el --- emh functions for composing messages
-;; Copyright (C) 1993,1994,1995,1996,1997,1998 Free Software Foundation, Inc.
+;; Copyright (C) 1993,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
-;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
;; Created: 1996/2/29 (separated from tm-mh-e.el)
;; Renamed: 1997/2/21 from tmh-comp.el
(defun emh-insert-message (&optional message)
;; always ignores message
- (let ((article-buffer
- (if (not (and (stringp mh-sent-from-folder)
- (numberp mh-sent-from-msg)
- ))
- (cond ((and (boundp 'gnus-original-article-buffer)
- (bufferp mh-sent-from-folder)
- (get-buffer gnus-original-article-buffer)
- )
- gnus-original-article-buffer)
- ((and (boundp 'gnus-article-buffer)
- (get-buffer gnus-article-buffer)
- (bufferp mh-sent-from-folder)
- )
- (save-excursion
- (set-buffer gnus-article-buffer)
- (if (eq major-mode 'mime-view-mode)
- mime-raw-buffer
- (current-buffer)
- )))
- ))))
- (if (null article-buffer)
- (emh-insert-mail
- (emh::make-message mh-sent-from-folder mh-sent-from-msg)
- )
- (insert-buffer article-buffer)
- (mime-edit-inserted-message-filter)
- )
+ ;; (let ((article-buffer
+ ;; (if (not (and (stringp mh-sent-from-folder)
+ ;; (numberp mh-sent-from-msg)
+ ;; ))
+ ;; (cond ((and (boundp 'gnus-original-article-buffer)
+ ;; (bufferp mh-sent-from-folder)
+ ;; (get-buffer gnus-original-article-buffer)
+ ;; )
+ ;; gnus-original-article-buffer)
+ ;; ((and (boundp 'gnus-article-buffer)
+ ;; (get-buffer gnus-article-buffer)
+ ;; (bufferp mh-sent-from-folder)
+ ;; )
+ ;; (save-excursion
+ ;; (set-buffer gnus-article-buffer)
+ ;; (if (eq major-mode 'mime-view-mode)
+ ;; mime-raw-buffer
+ ;; (current-buffer)
+ ;; )))
+ ;; ))))
+ (if (null article-buffer)
+ (emh-insert-mail
+ (emh::make-message mh-sent-from-folder mh-sent-from-msg))
+ ;; (insert-buffer article-buffer)
+ ;; (mime-edit-inserted-message-filter)
+ ;; )
))
(defun emh-insert-mail (&optional message)
(number (emh-prompt-for-message "Message number: " folder)))
(emh::insert-letter folder number verbatim)))
-(defun emh-yank-cur-msg-with-no-filter ()
- "Insert the current message into the draft buffer.
-This function makes new show-buffer from article-buffer to disable
-variable `mime-preview-text/plain-hook'. If you don't want to use text
-filters for replying message, please set it to
-`emh-message-yank-function'.
-Prefix each non-blank line in the message with the string in
-`mh-ins-buf-prefix'. The entire message will be inserted if
-`mh-yank-from-start-of-msg' is non-nil. If this variable is nil, the
-portion of the message following the point will be yanked. If
-`mh-delete-yanked-msg-window' is non-nil, any window displaying the
-yanked message will be deleted."
- (interactive)
- (if (and mh-sent-from-folder mh-sent-from-msg)
- (let ((to-point (point))
- (to-buffer (current-buffer)))
- (set-buffer mh-sent-from-folder)
- (if mh-delete-yanked-msg-window
- (delete-windows-on mh-show-buffer))
- (set-buffer mh-show-buffer) ; Find displayed message
- (let ((mh-ins-str
- (if mime-raw-buffer
- (let (mime-display-text/plain-hook buf)
- (prog1
- (save-window-excursion
- (set-buffer mime-raw-buffer)
- (setq buf (mime-view-mode))
- (buffer-string)
- )
- (kill-buffer buf)
- ))
- (buffer-string)
- )))
- (set-buffer to-buffer)
- (save-restriction
- (narrow-to-region to-point to-point)
- (push-mark)
- (insert mh-ins-str)
- (mh-insert-prefix-string mh-ins-buf-prefix)
- (insert "\n"))))
- (error "There is no current message")))
+;; (defun emh-yank-cur-msg-with-no-filter ()
+;; "Insert the current message into the draft buffer.
+;; This function makes new show-buffer from article-buffer to disable
+;; variable `mime-preview-text/plain-hook'. If you don't want to use text
+;; filters for replying message, please set it to
+;; `emh-message-yank-function'.
+;; Prefix each non-blank line in the message with the string in
+;; `mh-ins-buf-prefix'. The entire message will be inserted if
+;; `mh-yank-from-start-of-msg' is non-nil. If this variable is nil, the
+;; portion of the message following the point will be yanked. If
+;; `mh-delete-yanked-msg-window' is non-nil, any window displaying the
+;; yanked message will be deleted."
+;; (interactive)
+;; (if (and mh-sent-from-folder mh-sent-from-msg)
+;; (let ((to-point (point))
+;; (to-buffer (current-buffer)))
+;; (set-buffer mh-sent-from-folder)
+;; (if mh-delete-yanked-msg-window
+;; (delete-windows-on mh-show-buffer))
+;; (set-buffer mh-show-buffer) ; Find displayed message
+;; (let ((mh-ins-str
+;; (if mime-raw-buffer
+;; (let (mime-display-text/plain-hook buf)
+;; (prog1
+;; (save-window-excursion
+;; (set-buffer mime-raw-buffer)
+;; (setq buf (mime-view-mode))
+;; (buffer-string)
+;; )
+;; (kill-buffer buf)
+;; ))
+;; (buffer-string)
+;; )))
+;; (set-buffer to-buffer)
+;; (save-restriction
+;; (narrow-to-region to-point to-point)
+;; (push-mark)
+;; (insert mh-ins-str)
+;; (mh-insert-prefix-string mh-ins-buf-prefix)
+;; (insert "\n"))))
+;; (error "There is no current message")))
;; (defun emh-yank-current-message ()
;; "Insert the current message into the draft buffer.
;;; emh.el --- MIME extender for mh-e
-;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997,1998,2000 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
;;; @ version
;;;
-(defconst emh-version "1.10.0")
+(defconst emh-version "1.13.0")
;;; @ variable
;;; @ functions
;;;
+(defsubst emh-raw-buffer (folder-buffer)
+ (concat "article-" (if (bufferp folder-buffer)
+ (buffer-name folder-buffer)
+ folder-buffer)))
+
(defun mh-display-msg (msg-num folder &optional show-buffer mode)
"Display message number MSG-NUM of FOLDER.
This function uses `mime-view-mode' if MODE is not nil. If MODE is
(setq buffer-read-only nil)
(erase-buffer)
(if mode
- (let* ((aname (concat "article-" folder))
+ (let* ((aname (emh-raw-buffer folder))
(abuf (get-buffer aname)))
(if abuf
(progn
(if (null arg)
(not emh-automatic-mime-preview)
arg))
- (save-excursion
- (set-buffer mh-show-buffer)
- (if (null emh-automatic-mime-preview)
- (if (and mime-raw-buffer
- (get-buffer mime-raw-buffer))
- (kill-buffer mime-raw-buffer)
- )))
+ (let ((raw-buffer (emh-raw-buffer (current-buffer))))
+ (if (get-buffer raw-buffer)
+ (kill-buffer raw-buffer)
+ ))
(mh-invalidate-show-buffer)
(mh-show (mh-get-msg-num t))
)