From 0053ed5bc35f3c5fb8af85be9315275f9b06654e Mon Sep 17 00:00:00 2001 From: ShengHuo ZHU Date: Tue, 24 Jul 2001 17:51:49 +0000 Subject: [PATCH] 2001-07-24 09:00:00 ShengHuo ZHU * message.el (message-bounce): If no Return-Path, the whole content is considered as the original message. * nnml.el (nnml-check-directory-twice): New. (nnml-article-to-file): Use it. (nnml-retrieve-headers): Hack it. 2001-07-24 02:00:00 ShengHuo ZHU * gnus-win.el (gnus-buffer-configuration): New configure. * gnus-art.el (gnus-mm-display-part): Don't select-window if it is not alive. * mm-decode.el (mm-remove-part): Don't murder the current window (nil). (mm-display-external): Use display-term configure. --- lisp/ChangeLog | 19 +++++++++++++++++++ lisp/gnus-art.el | 3 ++- lisp/gnus-win.el | 5 ++++- lisp/message.el | 20 +++++++++++--------- lisp/mm-decode.el | 28 +++++++++++++++++++--------- lisp/nnml.el | 33 +++++++++++++++++++++------------ 6 files changed, 76 insertions(+), 32 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7c6b17b59..e1973729d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,22 @@ +2001-07-24 09:00:00 ShengHuo ZHU + + * message.el (message-bounce): If no Return-Path, the whole + content is considered as the original message. + + * nnml.el (nnml-check-directory-twice): New. + (nnml-article-to-file): Use it. + (nnml-retrieve-headers): Hack it. + +2001-07-24 02:00:00 ShengHuo ZHU + + * gnus-win.el (gnus-buffer-configuration): New configure. + + * gnus-art.el (gnus-mm-display-part): Don't select-window if it is + not alive. + + * mm-decode.el (mm-remove-part): Don't murder the current window (nil). + (mm-display-external): Use display-term configure. + 2001-07-24 Kai Gro,A_(Bjohann * gnus-delay.el (gnus-delay-default-hour): New variable. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 755916363..f28236c0a 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -3676,7 +3676,8 @@ If no internal viewer is available, use an external viewer." nil id (gnus-article-mime-total-parts) (mm-handle-media-type handle))))) - (select-window window)))) + (if (window-live-p window) + (select-window window))))) (goto-char point) (delete-region (gnus-point-at-bol) (progn (forward-line 1) (point))) (gnus-insert-mime-button diff --git a/lisp/gnus-win.el b/lisp/gnus-win.el index dcdd1799e..c8f8efc67 100644 --- a/lisp/gnus-win.el +++ b/lisp/gnus-win.el @@ -165,7 +165,10 @@ (compose-bounce (vertical 1.0 (article 0.5) - (message 1.0 point)))) + (message 1.0 point))) + (display-term + (vertical 1.0 + ("*display*" 1.0)))) "Window configuration for all possible Gnus buffers. See the Gnus manual for an explanation of the syntax used.") diff --git a/lisp/message.el b/lisp/message.el index 5a9cac276..7a11b468f 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -4639,15 +4639,17 @@ you." (undo-boundary) (goto-char (point-min)) (search-forward "\n\n" nil t) - (or (and (re-search-forward message-unsent-separator nil t) - (forward-line 1)) - (re-search-forward "^Return-Path:.*\n" nil t)) - ;; We remove everything before the bounced mail. - (delete-region - (point-min) - (if (re-search-forward "^[^ \n\t]+:" nil t) - (match-beginning 0) - (point)))) + (if (or (and (re-search-forward message-unsent-separator nil t) + (forward-line 1)) + (re-search-forward "^Return-Path:.*\n" nil t)) + ;; We remove everything before the bounced mail. + (delete-region + (point-min) + (if (re-search-forward "^[^ \n\t]+:" nil t) + (match-beginning 0) + (point))) + (when (re-search-backward "^.?From .*\n" nil t) + (delete-region (match-beginning 0) (match-end 0))))) (mm-enable-multibyte) (mime-to-mml) (save-restriction diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 17839affe..246185910 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -627,15 +627,25 @@ external if displayed external." (mm-mailcap-command method file (mm-handle-type handle))) (require 'term) - (switch-to-buffer - (make-term "display" - shell-file-name - nil - shell-command-switch - (mm-mailcap-command - method file (mm-handle-type handle)))) + (require 'gnus-win) + (set-buffer + (setq buffer + (make-term "display" + shell-file-name + nil + shell-command-switch + (mm-mailcap-command + method file + (mm-handle-type handle))))) (term-mode) - (term-char-mode)) + (term-char-mode) + (set-process-sentinel + (get-buffer-process buffer) + `(lambda (process state) + (if (eq 'exit (process-status process)) + (gnus-configure-windows + ',gnus-current-window-configuration)))) + (gnus-configure-windows 'display-term)) (mm-handle-set-external-undisplayer handle (cons file buffer))) (message "Displaying %s..." (format method file)) 'external) @@ -754,7 +764,7 @@ external if displayed external." ((consp object) (ignore-errors (delete-file (car object))) (ignore-errors (delete-directory (file-name-directory (car object)))) - (ignore-errors (kill-buffer (cdr object)))) + (ignore-errors (and (cdr object) (kill-buffer (cdr object))))) ((bufferp object) (when (buffer-live-p object) (kill-buffer object))))) diff --git a/lisp/nnml.el b/lisp/nnml.el index 6f9399972..080dd7650 100644 --- a/lisp/nnml.el +++ b/lisp/nnml.el @@ -86,6 +86,9 @@ all. This may very well take some time.") (defvoo nnml-generate-active-function 'nnml-generate-active-info) (defvar nnml-nov-buffer-file-name nil) +(defvar nnml-check-directory-twice t + "If t, to make sure nothing went wrong when reading over NFS -- +check twice.") (defvoo nnml-file-coding-system nnmail-file-coding-system) @@ -100,11 +103,16 @@ all. This may very well take some time.") (save-excursion (set-buffer nntp-server-buffer) (erase-buffer) - (let ((file nil) - (number (length sequence)) - (count 0) - (file-name-coding-system nnmail-pathname-coding-system) - beg article) + (let* ((file nil) + (number (length sequence)) + (count 0) + (file-name-coding-system nnmail-pathname-coding-system) + beg article + (nnml-check-directory-twice + (and nnml-check-directory-twice + ;; To speed up, disable it in some case. + (or (not (numberp nnmail-large-newsgroup)) + (<= number nnmail-large-newsgroup))))) (if (stringp (car sequence)) 'headers (if (nnml-retrieve-headers-with-nov sequence fetch-old) @@ -490,13 +498,14 @@ all. This may very well take some time.") (let (file) (if (setq file (cdr (assq article nnml-article-file-alist))) (expand-file-name file nnml-current-directory) - ;; Just to make sure nothing went wrong when reading over NFS -- - ;; check once more. - (when (file-exists-p - (setq file (expand-file-name (number-to-string article) - nnml-current-directory))) - (nnml-update-file-alist t) - file)))) + (if nnml-check-directory-twice + ;; Just to make sure nothing went wrong when reading over NFS -- + ;; check once more. + (when (file-exists-p + (setq file (expand-file-name (number-to-string article) + nnml-current-directory))) + (nnml-update-file-alist t) + file))))) (defun nnml-deletable-article-p (group article) "Say whether ARTICLE in GROUP can be deleted." -- 2.25.1