From: yamaoka Date: Thu, 6 Mar 2003 02:27:51 +0000 (+0000) Subject: Synch to Oort Gnus. X-Git-Tag: t-gnus-6_15_17-00-quimby~23 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=2137157d7559475ada7b4e469b785d33a9d0d473;p=elisp%2Fgnus.git- Synch to Oort Gnus. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a49762b..81b1f55 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2003-03-06 Jesper Harder + + * nnimap.el (nnimap-request-accept-article): Use delete-region. + + * html2text.el (html2text-clean-dtdd, html2text-delete-tags) + (html2text-delete-single-tag, html2text-clean-anchor) + (html2text-remove-tags): Use delete-region. + (html2text-fix-paragraphs): Simplify. + + * mml1991.el (mml1991-mailcrypt-sign, mml1991-mailcrypt-encrypt) + (mml1991-gpg-sign, mml1991-gpg-encrypt, mml1991-pgg-sign) + (mml1991-pgg-encrypt, mml1991-pgg-encrypt): Use delete-region, not + kill-region. + 2003-03-04 John Paul Wallington * gnus-agent.el (gnus-agent-enable-expiration) diff --git a/lisp/html2text.el b/lisp/html2text.el index 22ae79b..4b89f8f 100644 --- a/lisp/html2text.el +++ b/lisp/html2text.el @@ -1,6 +1,5 @@ ;;; html2text.el --- a simple html to plain text converter - -;; Copyright (C) 2002 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003 Free Software Foundation, Inc. ;; Author: Joakim Hove @@ -287,9 +286,8 @@ formatting, and then moved afterward.") (while (< item-nr items) (setq item-nr (1+ item-nr)) (re-search-forward "
\\([ ]*\\)" (point-max) t) - (if (match-string 1) - (kill-region (point) (- (point) (string-width (match-string 1)))) - ) + (when (match-string 1) + (delete-region (point) (- (point) (string-width (match-string 1))))) (let ((def-p1 (point)) (def-p2 0)) (re-search-forward "\\([ ]*\\)\\(
\\|
\\)" (point-max) t) @@ -299,25 +297,17 @@ formatting, and then moved afterward.") (mw2 (string-width (match-string 2))) (mw (+ mw1 mw2))) (goto-char (- (point) mw)) - (kill-region (point) (+ (point) mw1)) - (setq def-p2 (point)) - ) - ) + (delete-region (point) (+ (point) mw1)) + (setq def-p2 (point)))) (setq def-p2 (- (point) (string-width (match-string 2))))) - (put-text-property def-p1 def-p2 'face 'bold) - ) - ) - ) - ) + (put-text-property def-p1 def-p2 'face 'bold))))) (defun html2text-delete-tags (p1 p2 p3 p4) - (kill-region p1 p2) - (kill-region (- p3 (- p2 p1)) (- p4 (- p2 p1))) - ) + (delete-region p1 p2) + (delete-region (- p3 (- p2 p1)) (- p4 (- p2 p1)))) (defun html2text-delete-single-tag (p1 p2) - (kill-region p1 p2) - ) + (delete-region p1 p2)) (defun html2text-clean-hr (p1 p2) (html2text-delete-single-tag p1 p2) @@ -379,7 +369,7 @@ formatting, and then moved afterward.") ;; surely improve upon this. (let* ((attr-list (html2text-get-attr p1 p2 "a")) (href (html2text-attr-value attr-list "href"))) - (kill-region p1 p4) + (delete-region p1 p4) (when href (goto-char p1) (insert (substring href 1 -1 )) @@ -446,17 +436,14 @@ fashion, quite close to pure guess-work. It does work in some cases though." ;; Removing lonely
on a single line, if they are left intact we ;; dont have any paragraphs at all. (html2text-buffer-head) - (while (< (point) (point-max)) + (while (not (eobp)) (let ((p1 (point))) (forward-paragraph 1) ;;(message "Kaller fix med p1=%s p2=%s " p1 (1- (point))) (sleep-for 5) (html2text-fix-paragraph p1 (1- (point))) (goto-char p1) - (if (< (point) (point-max)) - (forward-paragraph 1)) - ) - ) - ) + (when (not (eobp)) + (forward-paragraph 1))))) ;; ;; @@ -478,11 +465,7 @@ See the documentation for that variable." (while (re-search-forward (format "\\(]*>\\)" tag) (point-max) t) (let ((p1 (point))) (search-backward "<") - (kill-region (point) p1) - ) - ) - ) - ) + (delete-region (point) p1))))) (defun html2text-format-tags () "See the variable \"html2text-format-tag-list\" for documentation" diff --git a/lisp/mml1991.el b/lisp/mml1991.el index 78afa4f..66cd459 100644 --- a/lisp/mml1991.el +++ b/lisp/mml1991.el @@ -1,5 +1,5 @@ -;;; mml-gpg-old.el --- Old PGP message format (RFC 1991) support for MML -;; Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +;;; mml1991.el --- Old PGP message format (RFC 1991) support for MML +;; Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. ;; Author: Sascha Ldecke , ;; Simon Josefsson (Mailcrypt interface, Gnus glue) @@ -53,10 +53,9 @@ ;; Save MIME Content[^ ]+: headers from signing (goto-char (point-min)) (while (looking-at "^Content[^ ]+:") (forward-line)) - (if (> (point) (point-min)) - (progn - (setq headers (buffer-string)) - (kill-region (point-min) (point)))) + (unless (bobp) + (setq headers (buffer-string)) + (delete-region (point-min) (point))) (goto-char (point-max)) (unless (bolp) (insert "\n")) @@ -74,7 +73,7 @@ (replace-match "" t t)) (quoted-printable-encode-region (point-min) (point-max)) (set-buffer text) - (kill-region (point-min) (point-max)) + (delete-region (point-min) (point-max)) (if headers (insert headers)) (insert "\n") (insert-buffer signature) @@ -96,9 +95,8 @@ ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED (goto-char (point-min)) (while (looking-at "^Content[^ ]+:") (forward-line)) - (if (> (point) (point-min)) - (progn - (kill-region (point-min) (point)))) + (unless (bobp) + (delete-region (point-min) (point))) (mm-with-unibyte-current-buffer-mule4 (with-temp-buffer (setq cipher (current-buffer)) @@ -119,7 +117,7 @@ (while (re-search-forward "\r+$" nil t) (replace-match "" t t)) (set-buffer text) - (kill-region (point-min) (point-max)) + (delete-region (point-min) (point-max)) ;;(insert "Content-Type: application/pgp-encrypted\n\n") ;;(insert "Version: 1\n\n") (insert "\n") @@ -138,10 +136,9 @@ ;; Save MIME Content[^ ]+: headers from signing (goto-char (point-min)) (while (looking-at "^Content[^ ]+:") (forward-line)) - (if (> (point) (point-min)) - (progn - (setq headers (buffer-string)) - (kill-region (point-min) (point)))) + (unless (bobp) + (setq headers (buffer-string)) + (delete-region (point-min) (point))) (goto-char (point-max)) (unless (bolp) (insert "\n")) @@ -159,7 +156,7 @@ (replace-match "" t t)) (quoted-printable-encode-region (point-min) (point-max)) (set-buffer text) - (kill-region (point-min) (point-max)) + (delete-region (point-min) (point-max)) (if headers (insert headers)) (insert "\n") (insert-buffer signature) @@ -172,9 +169,8 @@ ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED (goto-char (point-min)) (while (looking-at "^Content[^ ]+:") (forward-line)) - (if (> (point) (point-min)) - (progn - (kill-region (point-min) (point)))) + (unless (bobp) + (delete-region (point-min) (point))) (mm-with-unibyte-current-buffer-mule4 (with-temp-buffer (flet ((gpg-encrypt-func @@ -207,7 +203,7 @@ (while (re-search-forward "\r+$" nil t) (replace-match "" t t)) (set-buffer text) - (kill-region (point-min) (point-max)) + (delete-region (point-min) (point-max)) ;;(insert "Content-Type: application/pgp-encrypted\n\n") ;;(insert "Version: 1\n\n") (insert "\n") @@ -228,7 +224,7 @@ (unless (eobp) ;; no headers? (setq headers (buffer-substring (point-min) (point))) (forward-line) ;; skip header/body separator - (kill-region (point-min) (point))) + (delete-region (point-min) (point))) (quoted-printable-decode-region (point-min) (point-max)) (unless (let ((pgg-default-user-id (or (message-options-get 'message-sender) @@ -236,7 +232,7 @@ (pgg-sign-region (point-min) (point-max) t)) (pop-to-buffer pgg-errors-buffer) (error "Encrypt error")) - (kill-region (point-min) (point-max)) + (delete-region (point-min) (point-max)) (insert-buffer pgg-output-buffer) (goto-char (point-min)) (while (re-search-forward "\r+$" nil t) @@ -252,9 +248,8 @@ ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED (goto-char (point-min)) (while (looking-at "^Content[^ ]+:") (forward-line)) - (if (> (point) (point-min)) - (progn - (kill-region (point-min) (point)))) + (unless (bobp) + (delete-region (point-min) (point))) (unless (pgg-encrypt-region (point-min) (point-max) (split-string @@ -266,7 +261,7 @@ sign) (pop-to-buffer pgg-errors-buffer) (error "Encrypt error")) - (kill-region (point-min) (point-max)) + (delete-region (point-min) (point-max)) ;;(insert "Content-Type: application/pgp-encrypted\n\n") ;;(insert "Version: 1\n\n") (insert "\n") diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 699059b..48c1b55 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -1446,7 +1446,7 @@ function is generally only called when Gnus is shutting down." ;; remove any 'From blabla' lines, some IMAP servers ;; reject the entire message otherwise. (when (looking-at "^From[^:]") - (kill-region (point) (progn (forward-line) (point)))) + (delete-region (point) (progn (forward-line) (point)))) ;; turn into rfc822 format (\r\n eol's) (while (search-forward "\n" nil t) (replace-match "\r\n"))