+2003-03-03 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * mail-source.el (mail-source-delete-old-incoming-confirm): Fixed
+ doc-string.
+
+2003-03-03 Jesper Harder <harder@ifa.au.dk>
+
+ * nnrss.el (nnrss-decode-entities-unibyte-string): Use `buffer-string'.
+ * nndoc.el (nndoc-dissect-mime-parts-sub): do.
+ * nndb.el (nndb-request-accept-article, nndb-status-message): do.
+ * mm-url.el (mm-url-decode-entities-string): do.
+ * mml1991.el (mml1991-mailcrypt-sign, mml1991-gpg-sign): do.
+ * mm-decode.el (mm-find-raw-part-by-type): do.
+ * message.el (message-send-mail-partially)
+ (message-send-mail-with-sendmail): do.
+ * gnus-uu.el (gnus-uu-save-article, gnus-uu-reginize-string): do.
+ * gnus-kill.el (gnus-pp-gnus-kill): do.
+ * gnus-art.el (gnus-article-treat-unfold-headers)
+ (gnus-article-encrypt-body): do.
+
+2003-02-24 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * mail-source.el (mail-source-delete-incoming): Allow integer value.
+ (mail-source-delete-old-incoming-confirm): New variable.
+ (mail-source-delete-old-incoming): Use it. New function.
+ (mail-source-callback): Call `mail-source-delete-old-incoming' if
+ `mail-source-delete-incoming' is a nonnegative integer.
+
+2003-03-03 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gnus-msg.el (gnus-extended-version): Fix for 'emacs-gnus-config.
+ (gnus-user-agent): Fixed typo.
+
2003-03-03 Kevin Greiner <kgreiner@xpediantsolutions.com>
* gnus-agent.el (gnus-agent-enable-expiration): Fixed documentation.
(while (not (eobp))
(save-restriction
(mail-header-narrow-to-field)
- (let ((header (buffer-substring (point-min) (point-max))))
+ (let ((header (buffer-string)))
(with-temp-buffer
(insert header)
(goto-char (point-min))
(search-forward field nil t))
(prog2
(message-narrow-to-field)
- (buffer-substring (point-min) (point-max))
+ (buffer-string)
(delete-region (point-min) (point-max))
(widen))))
'("Content-Type:" "Content-Transfer-Encoding:"
(insert "\n t"))
(insert ")")
(prog1
- (buffer-substring (point-min) (point-max))
+ (buffer-string)
(kill-buffer (current-buffer))))))
(defun gnus-execute-1 (function regexp form header)
(defcustom gnus-user-agent 'emacs-gnus-type
"Which information should be exposed in the User-Agent header.
-It can be one of the symbols `gnus' \(show only Gnus version\) `emacs-gnus'
+It can be one of the symbols `gnus' \(show only Gnus version\), `emacs-gnus'
\(show only Emacs and Gnus versions\), `emacs-gnus-config' \(same as
`emacs-gnus' plus system configuration\), `emacs-gnus-type' \(same as
`emacs-gnus' plus system type\) or a custom string. If you set it to a
(setq body (buffer-substring (1- (point)) (point-max)))
(narrow-to-region (point-min) (point))
(if (not (setq headers gnus-uu-digest-headers))
- (setq sorthead (buffer-substring (point-min) (point-max)))
+ (setq sorthead (buffer-string))
(while headers
(setq headline (car headers))
(setq headers (cdr headers))
(while (re-search-forward "[ \t]+" nil t)
(replace-match "[ \t]+" t t))
- (buffer-substring (point-min) (point-max))))
+ (buffer-string)))
(defun gnus-uu-get-list-of-articles (n)
;; If N is non-nil, the article numbers of the N next articles
:type 'integer)
(defcustom mail-source-delete-incoming nil
- "*If non-nil, delete incoming files after handling."
+ "*If non-nil, delete incoming files after handling.
+If t, delete immediately, if nil, never delete. If a positive number, delete
+files older than number of days."
+ ;; Note: The removing happens in `mail-source-callback', i.e. no old
+ ;; incoming files will be deleted, unless you receive new mail.
+ ;;
+ ;; You may also set this to `nil' and call `mail-source-delete-old-incoming'
+ ;; from a hook or interactively.
+ :group 'mail-source
+ :type '(choice (const :tag "immediately" t)
+ (const :tag "never" nil)
+ (integer :tag "days")))
+
+(defcustom mail-source-delete-old-incoming-confirm t
+ "*If non-nil, ask for for confirmation before deleting old incoming files.
+This variable only applies when `mail-source-delete-incoming' is a positive
+number."
:group 'mail-source
:type 'boolean)
(setq newname (make-temp-name newprefix)))
newname))))
+(defun mail-source-delete-old-incoming (&optional age confirm)
+ "Remove incoming files older than AGE days.
+If CONFIRM is non-nil, ask for confirmation before removing a file."
+ (interactive "P")
+ (let* ((high2days (/ 65536.0 60 60 24));; convert high bits to days
+ (low2days (/ 1.0 65536.0)) ;; convert low bits to days
+ (diff (if (natnump age) age 30));; fallback, if no valid AGE given
+ currday files)
+ (setq files (directory-files
+ mail-source-directory t
+ (concat mail-source-incoming-file-prefix "*"))
+ currday (* (car (current-time)) high2days)
+ currday (+ currday (* low2days (nth 1 (current-time)))))
+ (while files
+ (let* ((ffile (car files))
+ (bfile (gnus-replace-in-string
+ ffile "\\`.*/\\([^/]+\\)\\'" "\\1"))
+ (filetime (nth 5 (file-attributes ffile)))
+ (fileday (* (car filetime) high2days))
+ (fileday (+ fileday (* low2days (nth 1 filetime)))))
+ (setq files (cdr files))
+ (when (and (> (- currday fileday) diff)
+ (gnus-message 8 "File `%s' is older than %s day(s)"
+ bfile diff)
+ (or (not confirm)
+ (y-or-n-p (concat "Remove file `" bfile "'? "))))
+ (delete-file ffile))))))
+
(defun mail-source-callback (callback info)
"Call CALLBACK on the mail file, and then remove the mail file.
Pass INFO on to CALLBACK."
(funcall callback mail-source-crash-box info)
(when (file-exists-p mail-source-crash-box)
;; Delete or move the incoming mail out of the way.
- (if mail-source-delete-incoming
+ (if (eq mail-source-delete-incoming t)
(delete-file mail-source-crash-box)
(let ((incoming
(mail-source-make-complex-temp-name
mail-source-directory))))
(unless (file-exists-p (file-name-directory incoming))
(make-directory (file-name-directory incoming) t))
- (rename-file mail-source-crash-box incoming t)))))))
+ (rename-file mail-source-crash-box incoming t)
+ ;; remove old incoming files?
+ (when (natnump mail-source-delete-incoming)
+ (mail-source-delete-old-incoming
+ mail-source-delete-incoming
+ mail-source-delete-old-incoming-confirm))))))))
(defun mail-source-movemail (from to)
"Move FROM to TO using movemail."
(message-remove-header "Lines")
(goto-char (point-max))
(insert "Mime-Version: 1.0\n")
- (setq header (buffer-substring (point-min) (point-max))))
+ (setq header (buffer-string)))
(goto-char (point-max))
(insert (format "Content-Type: message/partial; id=\"%s\"; number=%d; total=%d\n\n"
id n total))
(replace-match "; "))
(if (not (zerop (buffer-size)))
(error "Sending...failed to %s"
- (buffer-substring (point-min) (point-max)))))))
+ (buffer-string))))))
(when (bufferp errbuf)
(kill-buffer errbuf)))))
(if notp
(not (equal (car ctl) type))
(equal (car ctl) type)))
- (setq result (buffer-substring (point-min) (point-max)))))))
+ (setq result (buffer-string))))))
(forward-line 1)
(setq start (point)))
(when (and (not result) start)
(if notp
(not (equal (car ctl) type))
(equal (car ctl) type)))
- (setq result (buffer-substring (point-min) (point-max)))))))
+ (setq result (buffer-string))))))
result))
(defvar mm-security-handle nil)
(with-temp-buffer
(insert string)
(mm-url-decode-entities)
- (buffer-substring (point-min) (point-max))))
+ (buffer-string)))
(defun mm-url-form-encode-xwfu (chunk)
"Escape characters in a string for application/x-www-form-urlencoded.
(while (looking-at "^Content[^ ]+:") (forward-line))
(if (> (point) (point-min))
(progn
- (setq headers (buffer-substring (point-min) (point)))
+ (setq headers (buffer-string))
(kill-region (point-min) (point))))
(goto-char (point-max))
(unless (bolp)
(while (looking-at "^Content[^ ]+:") (forward-line))
(if (> (point) (point-min))
(progn
- (setq headers (buffer-substring (point-min) (point)))
+ (setq headers (buffer-string))
(kill-region (point-min) (point))))
(goto-char (point-max))
(unless (bolp)
(nntp-send-buffer "^[23].*\n"))
(set-buffer nntp-server-buffer)
- (setq msg (buffer-substring (point-min) (point-max)))
+ (setq msg (buffer-string))
(or (string-match "^\\([0-9]+\\)" msg)
(error "nndb: %s" msg))
(setq art (substring msg (match-beginning 1) (match-end 1)))
(deffoo nndb-status-message (&optional server)
"Return server status as a string."
(set-buffer nntp-server-buffer)
- (buffer-substring (point-min) (point-max)))
+ (buffer-string))
;; Import stuff from nntp
subtype "plain"))
;; Prepare the article and summary inserts.
(unless article-insert
- (setq article-insert (buffer-substring (point-min) (point-max))
+ (setq article-insert (buffer-string)
head-end head-begin))
;; Fix MIME-Version
(unless (string-match "MIME-Version:" article-insert)
(mm-with-unibyte-buffer
(insert string)
(mm-url-decode-entities-nbsp)
- (buffer-substring (point-min) (point-max))))
+ (buffer-string)))
(defalias 'nnrss-insert 'nnrss-insert-w3)
+2003-03-03 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gnus.texi (Mail and Post): Updated `gnus-user-agent'.
+ (Mail Source Customization): Added `mail-source-delete-incoming'
+ and `mail-source-delete-old-incoming-confirm'.
+
2003-03-01 Jesper Harder <harder@ifa.au.dk>
* gnus.texi (Troubleshooting): Fix typo.
* gnus.texi: New values, 'to-list and 'cc-list, for
gnus-boring-article-headers.
-
+
2003-02-28 Teodor Zlatanov <tzz@lifelogs.com>
* gnus.texi (Extending the spam elisp package): added mention of
(\e$BLuCm\e(B: T-gnus \e$B$G$O8=:_$3$NJQ?t$K$h$k@)8f$O5!G=$7$^$;$s!#\e(B) \e$B$3$NJQ?t$O!"$I\e(B
\e$B$N>pJs$,\e(B User-Agent \e$B%X%C%@!<$KDDNs$5$l$k$+$r@)8f$7$^$9!#$=$l$O<!$N%7%s%\\e(B
-\e$B%k$^$?$OJ8;zNs$N$&$A$N$I$l$+$G$"$k$3$H$,$G$-$^$9\e(B: @code{full} (\e$BA4>pJs$r\e(B
-\e$B8+$;$k!"$9$J$o$A\e(B Emacs \e$B$H\e(B Gnus \e$B$N%P!<%8%g%s$H%7%9%F%`9=@.\e(B)\e$B!"\e(B
-@code{emacs-gnus} (Emacs \e$B$H\e(B Gnus \e$B$N%P!<%8%g%s$@$1$r8+$;$k\e(B)\e$B!"\e(B
-@code{emacs-gnus-type} (@code{emacs-gnus} \e$B$HF1$8!\%7%9%F%`%?%$%W\e(B)\e$B!"\e(B
-@code{gnus} (Gnus \e$B$N%P!<%8%g%s$@$1$r8+$;$k\e(B)\e$B!"$^$?$O9%$_$NJ8;zNs!#$3$l$r\e(B
-\e$BJ8;zNs$K$9$k$H$-$O!"@5$7$$%U%)!<%^%C%H$r;H$C$F$$$k$3$H$r3NG'$7$F2<$5\e(B
-\e$B$$\e(B (RFC2616 \e$B;2>H\e(B)\e$B!#\e(B
+\e$B%k$^$?$OJ8;zNs$N$&$A$N$I$l$+$G$"$k$3$H$,$G$-$^$9\e(B: @code{gnus} (Gnus \e$B$N%P!<\e(B
+\e$B%8%g%s$N$_\e(B)\e$B!"\e(B@code{emacs-gnus} (Emacs \e$B$H\e(B Gnus \e$B$N%P!<%8%g%s$@$1\e(B)\e$B!"\e(B
+@code{emacs-gnus-config} (@code{emacs-gnus} \e$B$HF1$8!\%7%9%F%`9=@.\e(B)\e$B!"\e(B
+@code{emacs-gnus-type} (@code{emacs-gnus}) \e$B$HF1$8!\%7%9%F%`%?%$%W\e(B)\e$B!"$^$?\e(B
+\e$B$O9%$_$NJ8;zNs!#$3$l$rJ8;zNs$K$9$k$H$-$O!"@5$7$$%U%)!<%^%C%H$K$J$C$F$$$k\e(B
+\e$B$3$H$r3N$+$a$F2<$5$$\e(B (RFC2616 \e$B;2>H\e(B)\e$B!#\e(B
@end table
\e$B$"$J$?$O<+J,$,Aw$k%a%C%;!<%8$NDV$j$rD4$Y$?$$$H;W$&$+$bCN$l$^$;$s!#$b$7$/\e(B
@item mail-source-delete-incoming
@vindex mail-source-delete-incoming
@code{nil} \e$B$G$J$1$l$P!"F~$C$FMh$?%U%!%$%k$O!"$=$l$r=hM}$7$?8e$K>C5n$5$l\e(B
-\e$B$^$9!#\e(B
+\e$B$^$9!#\e(B@code{t} \e$B$G$O%U%!%$%k$r$?$@$A$K>C5n$7!"\e(B@code{nil} \e$B$G$O$$$+$J$k%U%!\e(B
+\e$B%$%k$b>C$7$^$;$s!#@5$N?t$@$C$?>l9g$O!"$=$NF|?t0J>e$K8E$$%U%!%$%k$r>C5n$7\e(B
+\e$B$^$9\e(B (\e$B$3$l$O?7Ce%a!<%k$r<h$j9~$`$H$-$@$19T$J$o$l$^$9\e(B)\e$B!#\e(B
+@code{mail-source-delete-incoming} \e$B$r\e(B @code{nil} \e$B$K$7$F$*$$$F!"\e(B
+@code{mail-source-delete-old-incoming} \e$B$r%U%C%/$^$?$O<jF0$G8F$s$G$bNI$$\e(B
+\e$B$G$9!#\e(B
+
+@item mail-source-delete-old-incoming-confirm
+@vindex mail-source-delete-old-incoming-confirm
+\e$BHs\e(B-@code{nil} \e$B$@$C$?$i!"8E$$\e(B incoming (\e$B%a!<%k$NE~Ce;~$K;H$o$l$?\e(B) \e$B%U%!%$\e(B
+\e$B%k$r>C5n$9$k$H$-$K3NG'$r5a$a$^$9!#$3$NJQ?t\e(B
+\e$B$O\e(B @code{mail-source-delete-incoming} \e$B$,@5$N?t$G$"$k>l9g$@$1;H$o$l$^$9!#\e(B
@item mail-source-ignore-errors
@vindex mail-source-ignore-errors
@cindex User-Agent
This variable controls which information should be exposed in the
-User-Agent header. It can be one of the symbols @code{full} (show full
-information, i.e. Emacs and Gnus version and system configuration),
-@code{emacs-gnus} (show only Emacs and Gnus version),
-@code{emacs-gnus-type} (same as @code{emacs-gnus} plus system type),
-@code{gnus} (show only Gnus version) or a custom string. If you set it
-to a string, be sure to use a valid format, see RFC 2616.
+User-Agent header. It can be one of the symbols @code{gnus} (show only
+Gnus version), @code{emacs-gnus} (show only Emacs and Gnus versions),
+@code{emacs-gnus-config} (same as @code{emacs-gnus} plus system
+configuration), @code{emacs-gnus-type} (same as @code{emacs-gnus} plus
+system type) or a custom string. If you set it to a string, be sure to
+use a valid format, see RFC 2616."
@end table
@item mail-source-delete-incoming
@vindex mail-source-delete-incoming
-If non-@code{nil}, delete incoming files after handling them.
+If non-@code{nil}, delete incoming files after handling them. If
+@code{t}, delete the files immediately, if @code{nil}, never delete any
+files. If a positive number, delete files older than number of days
+(This will only happen, when reveiving new mail). You may also set
+@code{mail-source-delete-incoming} to @code{nil} and call
+@code{mail-source-delete-old-incoming} from a hook or interactively.
+
+@item mail-source-delete-old-incoming-confirm
+@vindex mail-source-delete-old-incoming-confirm
+If @code{non-nil}, ask for for confirmation before deleting old incoming
+files. This variable only applies when
+@code{mail-source-delete-incoming} is a positive number.
@item mail-source-ignore-errors
@vindex mail-source-ignore-errors