;;; 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 <hove@phys.ntnu.no>
(while (< item-nr items)
(setq item-nr (1+ item-nr))
(re-search-forward "<dt>\\([ ]*\\)" (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 "\\([ ]*\\)\\(</dt>\\|<dd>\\)" (point-max) t)
(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)
;; 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 ))
;; Removing lonely <br> 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)))))
;;
;; </Functions to be called to fix up paragraphs>
(while (re-search-forward (format "\\(</?%s[^>]*>\\)" 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"
-;;; 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 <sascha@meta-x.de>,
;; Simon Josefsson <simon@josefsson.org> (Mailcrypt interface, Gnus glue)
;; 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"))
(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)
;; 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))
(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")
;; 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"))
(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)
;; 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
(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")
(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)
(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)
;; 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
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")