comparison lisp/gnus/gnus-uu.el @ 44514:8bfbcb957964

(gnus-uu-binhex-article, gnus-uu-reginize-string, gnus-uu-expand-numbers) (gnus-uu-post-make-mime, gnus-uu-post-encoded): Don't assume point-min == 1.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 12 Apr 2002 03:13:23 +0000
parents 7782e54757bb
children 695cf19ef79e d7ddb3e565de
comparison
equal deleted inserted replaced
44513:ce14b691fc8b 44514:8bfbcb957964
1001 (beginning-of-line) 1001 (beginning-of-line)
1002 (setq start-char (point)) 1002 (setq start-char (point))
1003 (if (looking-at gnus-uu-binhex-begin-line) 1003 (if (looking-at gnus-uu-binhex-begin-line)
1004 (progn 1004 (progn
1005 (setq state (list 'begin)) 1005 (setq state (list 'begin))
1006 (write-region 1 1 gnus-uu-binhex-article-name)) 1006 (write-region (point-min) (point-min)
1007 gnus-uu-binhex-article-name))
1007 (setq state (list 'middle))) 1008 (setq state (list 'middle)))
1008 (goto-char (point-max)) 1009 (goto-char (point-max))
1009 (re-search-backward (concat gnus-uu-binhex-body-line "\\|" 1010 (re-search-backward (concat gnus-uu-binhex-body-line "\\|"
1010 gnus-uu-binhex-end-line) 1011 gnus-uu-binhex-end-line)
1011 nil t) 1012 nil t)
1113 1114
1114 (goto-char 1) 1115 (goto-char 1)
1115 (while (re-search-forward "[ \t]+" nil t) 1116 (while (re-search-forward "[ \t]+" nil t)
1116 (replace-match "[ \t]+" t t)) 1117 (replace-match "[ \t]+" t t))
1117 1118
1118 (buffer-substring 1 (point-max)))) 1119 (buffer-substring (point-min) (point-max))))
1119 1120
1120 (defun gnus-uu-get-list-of-articles (n) 1121 (defun gnus-uu-get-list-of-articles (n)
1121 ;; If N is non-nil, the article numbers of the N next articles 1122 ;; If N is non-nil, the article numbers of the N next articles
1122 ;; will be returned. 1123 ;; will be returned.
1123 ;; If any articles have been marked as processable, they will be 1124 ;; If any articles have been marked as processable, they will be
1209 (while (re-search-forward "[0-9]+" nil t) 1210 (while (re-search-forward "[0-9]+" nil t)
1210 (replace-match 1211 (replace-match
1211 (format "%06d" 1212 (format "%06d"
1212 (string-to-int (buffer-substring 1213 (string-to-int (buffer-substring
1213 (match-beginning 0) (match-end 0)))))) 1214 (match-beginning 0) (match-end 0))))))
1214 (setq string (buffer-substring 1 (point-max))) 1215 (setq string (buffer-substring (point-min) (point-max)))
1215 (setcar (car string-list) string) 1216 (setcar (car string-list) string)
1216 (setq string-list (cdr string-list)))) 1217 (setq string-list (cdr string-list))))
1217 out-list)) 1218 out-list))
1218 1219
1219 1220
1947 (save-restriction 1948 (save-restriction
1948 (set-buffer gnus-message-buffer) 1949 (set-buffer gnus-message-buffer)
1949 (goto-char (point-min)) 1950 (goto-char (point-min))
1950 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$")) 1951 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
1951 (forward-line -1) 1952 (forward-line -1)
1952 (narrow-to-region 1 (point)) 1953 (narrow-to-region (point-min) (point))
1953 (unless (mail-fetch-field "mime-version") 1954 (unless (mail-fetch-field "mime-version")
1954 (widen) 1955 (widen)
1955 (insert "MIME-Version: 1.0\n")) 1956 (insert "MIME-Version: 1.0\n"))
1956 (widen))) 1957 (widen)))
1957 1958
2037 (save-excursion 2038 (save-excursion
2038 (set-buffer (setq uubuf (gnus-get-buffer-create encoded-buffer-name))) 2039 (set-buffer (setq uubuf (gnus-get-buffer-create encoded-buffer-name)))
2039 (erase-buffer) 2040 (erase-buffer)
2040 (insert-buffer-substring post-buf beg-binary end-binary) 2041 (insert-buffer-substring post-buf beg-binary end-binary)
2041 (goto-char (point-min)) 2042 (goto-char (point-min))
2042 (setq length (count-lines 1 (point-max))) 2043 (setq length (count-lines (point-min) (point-max)))
2043 (setq parts (/ length gnus-uu-post-length)) 2044 (setq parts (/ length gnus-uu-post-length))
2044 (unless (< (% length gnus-uu-post-length) 4) 2045 (unless (< (% length gnus-uu-post-length) 4)
2045 (incf parts))) 2046 (incf parts)))
2046 2047
2047 (when gnus-uu-post-separate-description 2048 (when gnus-uu-post-separate-description
2050 2051
2051 (goto-char (point-min)) 2052 (goto-char (point-min))
2052 (re-search-forward 2053 (re-search-forward
2053 (concat "^" (regexp-quote mail-header-separator) "$") nil t) 2054 (concat "^" (regexp-quote mail-header-separator) "$") nil t)
2054 (beginning-of-line) 2055 (beginning-of-line)
2055 (setq header (buffer-substring 1 (point))) 2056 (setq header (buffer-substring (point-min) (point)))
2056 2057
2057 (goto-char (point-min)) 2058 (goto-char (point-min))
2058 (when gnus-uu-post-separate-description 2059 (when gnus-uu-post-separate-description
2059 (when (re-search-forward "^Subject: " nil t) 2060 (when (re-search-forward "^Subject: " nil t)
2060 (end-of-line) 2061 (end-of-line)