Mercurial > emacs
comparison lisp/gnus/nndraft.el @ 110571:fd5269f6af5a
nndraft.el (nndraft-retrieve-headers): Insert Lines and Chars headers for prettier summary display.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Sat, 25 Sep 2010 15:07:55 +0000 |
parents | 93e093c035a0 |
children | 415e87a42437 |
comparison
equal
deleted
inserted
replaced
110569:5e158658b471 | 110571:fd5269f6af5a |
---|---|
77 | 77 |
78 (deffoo nndraft-retrieve-headers (articles &optional group server fetch-old) | 78 (deffoo nndraft-retrieve-headers (articles &optional group server fetch-old) |
79 (nndraft-possibly-change-group group) | 79 (nndraft-possibly-change-group group) |
80 (with-current-buffer nntp-server-buffer | 80 (with-current-buffer nntp-server-buffer |
81 (erase-buffer) | 81 (erase-buffer) |
82 (let* (article) | 82 (let (article lines chars) |
83 ;; We don't support fetching by Message-ID. | 83 ;; We don't support fetching by Message-ID. |
84 (if (stringp (car articles)) | 84 (if (stringp (car articles)) |
85 'headers | 85 'headers |
86 (while articles | 86 (while articles |
87 (narrow-to-region (point) (point)) | 87 (narrow-to-region (point) (point)) |
89 (setq article (pop articles)) group server (current-buffer)) | 89 (setq article (pop articles)) group server (current-buffer)) |
90 (goto-char (point-min)) | 90 (goto-char (point-min)) |
91 (if (search-forward "\n\n" nil t) | 91 (if (search-forward "\n\n" nil t) |
92 (forward-line -1) | 92 (forward-line -1) |
93 (goto-char (point-max))) | 93 (goto-char (point-max))) |
94 (setq lines (count-lines (point) (point-max)) | |
95 chars (- (point-max) (point))) | |
94 (delete-region (point) (point-max)) | 96 (delete-region (point) (point-max)) |
95 (goto-char (point-min)) | 97 (goto-char (point-min)) |
96 (insert (format "221 %d Article retrieved.\n" article)) | 98 (insert (format "221 %d Article retrieved.\n" article)) |
99 (insert (format "Lines: %d\nChars: %d\n" lines chars)) | |
97 (widen) | 100 (widen) |
98 (goto-char (point-max)) | 101 (goto-char (point-max)) |
99 (insert ".\n"))) | 102 (insert ".\n"))) |
100 | 103 |
101 (nnheader-fold-continuation-lines) | 104 (nnheader-fold-continuation-lines) |