;; Decide whether to append to a file or to an Emacs buffer.
(let ((outbuf (get-file-buffer filename)))
(if (not outbuf)
- (append-to-file (point-min) (point-max) filename)
+ (mm-append-to-file (point-min) (point-max) filename)
;; File has been visited, in buffer OUTBUF.
(set-buffer outbuf)
(let ((buffer-read-only nil)
(insert "\n"))
(insert "\n"))
(goto-char (point-max))
- (append-to-file (point-min) (point-max) filename)))
+ (mm-append-to-file (point-min) (point-max) filename)))
;; File has been visited, in buffer OUTBUF.
(set-buffer outbuf)
(let ((buffer-read-only nil))
(throw 'found nil)))
t))
-(defun gnus-write-active-file (file hashtb)
+(defun gnus-write-active-file (file hashtb &optional full-names)
(with-temp-file file
(mapatoms
(lambda (sym)
(when (and sym
(boundp sym)
(symbol-value sym))
- (insert (format "%s %d %d y\n"
- (gnus-group-real-name (symbol-name sym))
- (cdr (symbol-value sym))
+ (insert (format "%S %d %d y\n"
+ (if full-names
+ sym
+ (intern (gnus-group-real-name (symbol-name sym))))
+ (or (cdr (symbol-value sym))
+ (car (symbol-value sym)))
(car (symbol-value sym))))))
- hashtb)))
+ hashtb)
+ (goto-char (point-max))
+ (while (search-backward "\\." nil t)
+ (delete-char 1))))
(provide 'gnus-util)