From d397f2c72ba7fa32b2966d74aeff050b798e28ef Mon Sep 17 00:00:00 2001 From: ShengHuo ZHU Date: Thu, 2 Nov 2000 17:52:10 +0000 Subject: [PATCH] 2000-11-02 13:27:56 ShengHuo ZHU * gnus-uu.el (gnus-uu-post-news): Comment out the redundancy. * gnus-art.el (gnus-article-edit-done): * gnus-sum.el (gnus-summary-edit-article-done): Move line counting code here. * gnus-msg.el (gnus-setup-message): Remove a hack. --- lisp/ChangeLog | 8 ++++++++ lisp/gnus-art.el | 21 --------------------- lisp/gnus-msg.el | 9 +++------ lisp/gnus-sum.el | 21 +++++++++++++++++++++ lisp/gnus-uu.el | 2 +- 5 files changed, 33 insertions(+), 28 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 65b5e4ad9..af0fdc626 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2000-11-02 13:27:56 ShengHuo ZHU + + * gnus-uu.el (gnus-uu-post-news): Comment out the redundancy. + * gnus-art.el (gnus-article-edit-done): + * gnus-sum.el (gnus-summary-edit-article-done): Move line + counting code here. + * gnus-msg.el (gnus-setup-message): Remove a hack. + 2000-11-02 09:33:01 ShengHuo ZHU * gnus-sum.el (gnus-newsgroup-variables): New variable. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index ac98d50d9..be1b30e88 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -4116,27 +4116,6 @@ groups." (defun gnus-article-edit-done (&optional arg) "Update the article edits and exit." (interactive "P") - (save-excursion - (save-restriction - (widen) - (when (article-goto-body) - (let ((lines (count-lines (point) (point-max))) - (length (- (point-max) (point))) - (case-fold-search t) - (body (copy-marker (point)))) - (goto-char (point-min)) - (when (re-search-forward "^content-length:[ \t]\\([0-9]+\\)" body t) - (delete-region (match-beginning 1) (match-end 1)) - (insert (number-to-string length))) - (goto-char (point-min)) - (when (re-search-forward - "^x-content-length:[ \t]\\([0-9]+\\)" body t) - (delete-region (match-beginning 1) (match-end 1)) - (insert (number-to-string length))) - (goto-char (point-min)) - (when (re-search-forward "^lines:[ \t]\\([0-9]+\\)" body t) - (delete-region (match-beginning 1) (match-end 1)) - (insert (number-to-string lines))))))) (let ((func gnus-article-edit-done-function) (buf (current-buffer)) (start (window-start))) diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index 3d7325d36..0538280f5 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -246,12 +246,9 @@ the Gcc: header for archiving purposes." (set (make-local-variable 'gnus-newsgroup-name) ,group) (gnus-run-hooks 'gnus-message-setup-hook) (if (eq major-mode 'message-mode) - ;; Make mml-buffer-list local. - ;; Restore global mml-buffer-list value as mbl. - ;; What a hack! -- Shenghuo - (let ((mml-buffer-list mml-buffer-list)) - (setq mml-buffer-list mbl) - (make-local-variable 'mml-buffer-list) + (let ((mbl1 mml-buffer-list)) + (setq mml-buffer-list mbl) ;; Global value + (set (make-local-variable 'mml-buffer-list) mbl1);; Local value (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)) (mml-destroy-buffers) (setq mml-buffer-list mbl))) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 01d7daeeb..0448d5750 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -7929,10 +7929,31 @@ groups." no-highlight) "Make edits to the current article permanent." (interactive) + (save-excursion + ;; The buffer restriction contains the entire article if it exists. + (when (article-goto-body) + (let ((lines (count-lines (point) (point-max))) + (length (- (point-max) (point))) + (case-fold-search t) + (body (copy-marker (point)))) + (goto-char (point-min)) + (when (re-search-forward "^content-length:[ \t]\\([0-9]+\\)" body t) + (delete-region (match-beginning 1) (match-end 1)) + (insert (number-to-string length))) + (goto-char (point-min)) + (when (re-search-forward + "^x-content-length:[ \t]\\([0-9]+\\)" body t) + (delete-region (match-beginning 1) (match-end 1)) + (insert (number-to-string length))) + (goto-char (point-min)) + (when (re-search-forward "^lines:[ \t]\\([0-9]+\\)" body t) + (delete-region (match-beginning 1) (match-end 1)) + (insert (number-to-string lines)))))) ;; Replace the article. (let ((buf (current-buffer))) (with-temp-buffer (insert-buffer-substring buf) + (if (and (not read-only) (not (gnus-request-replace-article (cdr gnus-article-current) (car gnus-article-current) diff --git a/lisp/gnus-uu.el b/lisp/gnus-uu.el index f4ff2ea15..fcf4d4ce7 100644 --- a/lisp/gnus-uu.el +++ b/lisp/gnus-uu.el @@ -1896,7 +1896,7 @@ is t." (let ((map (make-sparse-keymap))) (set-keymap-parent map (current-local-map)) (use-local-map map)) - (local-set-key "\C-c\C-c" 'gnus-summary-edit-article-done) + ;;(local-set-key "\C-c\C-c" 'gnus-summary-edit-article-done) (local-set-key "\C-c\C-c" 'gnus-uu-post-news-inews) (local-set-key "\C-c\C-s" 'gnus-uu-post-news-inews) (local-set-key "\C-c\C-i" 'gnus-uu-post-insert-binary-in-article) -- 2.25.1