+2004-04-25 Jesper Harder <harder@ifa.au.dk>
+
+ * spam-stat.el (spam-stat-score-buffer): Simplify mapcar usage.
+ Use mapc when appropriate.
+
+ * sieve-manage.el (sieve-manage-open): do.
+
+ * nnweb.el (nnweb-insert-html): do.
+
+ * nnvirtual.el (nnvirtual-catchup-group, nnvirtual-partition-sequence)
+ (nnvirtual-partition-sequence, nnvirtual-create-mapping): do.
+
+ * nnspool.el (nnspool-request-group): do.
+
+ * nnrss.el (nnrss-opml-export, nnrss-find-el, nnrss-order-hrefs):
+ do.
+
+ * nnml.el (nnml-request-update-info): do.
+
+ * nnmh.el (nnmh-request-group, nnmh-request-list-1, nnmh-active-number)
+ (nnmh-request-create-group, nnmh-update-gnus-unreads): do.
+
+ * nnimap.el (nnimap-request-close, nnimap-acl-edit)
+ (nnimap-request-set-mark): do.
+
+ * nnfolder.el (nnfolder-request-update-info): do.
+
+ * mm-view.el (mm-pkcs7-signed-magic, mm-pkcs7-enveloped-magic):
+ do.
+
+ * mml.el (mml-destroy-buffers, mml-compute-boundary-1): do.
+
+ * gnus-uu.el (gnus-uu-find-articles-matching): do.
+
+ * gnus-topic.el (gnus-topic-check-topology, gnus-topic-remove-group):
+ do.
+
+ * gnus-sum.el (gnus-summary-fetch-faq, gnus-read-move-group-name):
+ do.
+
+ * gnus-score.el (gnus-score-load-file, gnus-sort-score-files): do.
+
+ * gnus-nocem.el (gnus-nocem-scan-groups): do.
+
+ * gnus-int.el (gnus-start-news-server): do.
+
+ * gnus-group.el (gnus-group-make-kiboze-group)
+ (gnus-group-browse-foreign-server): do.
+
2004-04-22 Teodor Zlatanov <tzz@bwh.harvard.edu>
* spam.el (spam-necessary-extra-headers): get the extra headers we
(list
(read-string "nnkiboze group name: ")
(read-string "Source groups (regexp): ")
- (let ((headers (mapcar (lambda (group) (list group))
+ (let ((headers (mapcar 'list
'("subject" "from" "number" "date" "message-id"
"references" "chars" "lines" "xref"
"followup" "all" "body" "head")))
;; Suggested by mapjph@bath.ac.uk.
(completing-read
"Address: "
- (mapcar (lambda (server) (list server))
- gnus-secondary-servers)))
+ (mapcar 'list gnus-secondary-servers)))
;; We got a server name.
how))))
(gnus-browse-foreign-server method))
;; Read server name with completion.
(setq gnus-nntp-server
(completing-read "NNTP server: "
- (mapcar (lambda (server) (list server))
+ (mapcar 'list
(cons (list gnus-nntp-server)
gnus-secondary-servers))
nil nil gnus-nntp-server)))
(and gnus-nocem-check-from
(let ((case-fold-search t))
(catch 'ok
- (mapcar
+ (mapc
(lambda (author)
(if (consp author)
(setq author (car author)))
;; files.
(when (and files (not global))
(setq lists (apply 'append lists
- (mapcar (lambda (file)
- (gnus-score-load-file file))
+ (mapcar 'gnus-score-load-file
(if adapt-file (cons adapt-file files)
files)))))
(when (and eval (not global))
(lambda (file)
(cons (inline (gnus-score-file-rank file)) file))
files)))
- (mapcar
- (lambda (f) (cdr f))
- (sort alist 'car-less-than-car)))))
+ (mapcar 'cdr (sort alist 'car-less-than-car)))))
(defun gnus-score-find-alist (group)
"Return list of score files for GROUP.
(when current-prefix-arg
(completing-read
"FAQ dir: " (and (listp gnus-group-faq-directory)
- (mapcar (lambda (file) (list file))
+ (mapcar 'list
gnus-group-faq-directory))))))
(let (gnus-faq-buffer)
(when (setq gnus-faq-buffer
(t
(gnus-completing-read-with-default
nil prom
- (mapcar (lambda (el) (list el))
- (nreverse split-name))
+ (mapcar 'list (nreverse split-name))
nil nil nil
'gnus-group-history))))
(to-method (gnus-server-to-method (gnus-group-method to-newsgroup))))
(pop topics)))
;; Go through all living groups and make sure that
;; they belong to some topic.
- (let* ((tgroups (apply 'append (mapcar (lambda (entry) (cdr entry))
- gnus-topic-alist)))
+ (let* ((tgroups (apply 'append (mapcar 'cdr gnus-topic-alist)))
(entry (last (assoc (caar gnus-topic-topology) gnus-topic-alist)))
(newsrc (cdr gnus-newsrc-alist))
group)
(let ((use-marked (and (not n) (not (gnus-region-active-p))
gnus-group-marked t))
(groups (gnus-group-process-prefix n)))
- (mapcar
+ (mapc
(lambda (group)
(gnus-group-remove-mark group use-marked)
(let ((topicl (assoc (gnus-current-topic) gnus-topic-alist))
;; Expand numbers, sort, and return the list of article
;; numbers.
- (mapcar (lambda (sub) (cdr sub))
+ (mapcar 'cdr
(sort (gnus-uu-expand-numbers
list-of-subjects
(not do-not-translate))
;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 }
(defvar mm-pkcs7-signed-magic
(mm-string-as-unibyte
- (apply 'concat
- (mapcar 'char-to-string
- (list ?\x30 ?\x5c ?\x28 ?\x80 ?\x5c ?\x7c ?\x81 ?\x2e ?\x5c
- ?\x7c ?\x82 ?\x2e ?\x2e ?\x5c ?\x7c ?\x83 ?\x2e ?\x2e
- ?\x2e ?\x5c ?\x29 ?\x06 ?\x09 ?\x5c ?\x2a ?\x86 ?\x48
- ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x02)))))
+ (mapconcat 'char-to-string
+ (list ?\x30 ?\x5c ?\x28 ?\x80 ?\x5c ?\x7c ?\x81 ?\x2e ?\x5c
+ ?\x7c ?\x82 ?\x2e ?\x2e ?\x5c ?\x7c ?\x83 ?\x2e ?\x2e
+ ?\x2e ?\x5c ?\x29 ?\x06 ?\x09 ?\x5c ?\x2a ?\x86 ?\x48
+ ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x02) "")))
;; id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 }
(defvar mm-pkcs7-enveloped-magic
(mm-string-as-unibyte
- (apply 'concat
- (mapcar 'char-to-string
- (list ?\x30 ?\x5c ?\x28 ?\x80 ?\x5c ?\x7c ?\x81 ?\x2e ?\x5c
- ?\x7c ?\x82 ?\x2e ?\x2e ?\x5c ?\x7c ?\x83 ?\x2e ?\x2e
- ?\x2e ?\x5c ?\x29 ?\x06 ?\x09 ?\x5c ?\x2a ?\x86 ?\x48
- ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x03)))))
+ (mapconcat 'char-to-string
+ (list ?\x30 ?\x5c ?\x28 ?\x80 ?\x5c ?\x7c ?\x81 ?\x2e ?\x5c
+ ?\x7c ?\x82 ?\x2e ?\x2e ?\x5c ?\x7c ?\x83 ?\x2e ?\x2e
+ ?\x2e ?\x5c ?\x29 ?\x06 ?\x09 ?\x5c ?\x2a ?\x86 ?\x48
+ ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x03) "")))
(defun mm-view-pkcs7-get-type (handle)
(mm-with-unibyte-buffer
(defun mml-destroy-buffers ()
(let (kill-buffer-hook)
- (mapcar 'kill-buffer mml-buffer-list)
+ (mapc 'kill-buffer mml-buffer-list)
(setq mml-buffer-list nil)))
(defun mml-parse ()
(incf mml-multipart-number)))
(throw 'not-unique nil))))
((eq (car cont) 'multipart)
- (mapcar 'mml-compute-boundary-1 (cddr cont))))
+ (mapc 'mml-compute-boundary-1 (cddr cont))))
t))
(defun mml-make-boundary (number)
(nnheader-message 8 "Updating marks for %s..." group)
(nnfolder-open-marks group server)
;; Update info using `nnfolder-marks'.
- (mapcar (lambda (pred)
- (unless (memq (cdr pred) gnus-article-unpropagated-mark-lists)
- (gnus-info-set-marks
- info
- (gnus-update-alist-soft
- (cdr pred)
- (cdr (assq (cdr pred) nnfolder-marks))
- (gnus-info-marks info))
- t)))
- gnus-article-mark-lists)
+ (mapc (lambda (pred)
+ (unless (memq (cdr pred) gnus-article-unpropagated-mark-lists)
+ (gnus-info-set-marks
+ info
+ (gnus-update-alist-soft
+ (cdr pred)
+ (cdr (assq (cdr pred) nnfolder-marks))
+ (gnus-info-marks info))
+ t)))
+ gnus-article-mark-lists)
(let ((seen (cdr (assq 'read nnfolder-marks))))
(gnus-info-set-read info
(if (and (integerp (car seen))
All buffers that have been created by that
backend should be killed. (Not the nntp-server-buffer, though.) This
function is generally only called when Gnus is shutting down."
- (mapcar (lambda (server) (nnimap-close-server (car server)))
- nnimap-server-buffer-alist)
+ (mapc (lambda (server) (nnimap-close-server (car server)))
+ nnimap-server-buffer-alist)
(setq nnimap-server-buffer-alist nil))
(deffoo nnimap-status-message (&optional server)
(if (memq 'dormant cmdmarks)
(setq cmdmarks (cons 'tick cmdmarks))))
;; remove stuff we are forbidden to store
- (mapcar (lambda (mark)
- (if (imap-message-flag-permanent-p
- (nnimap-mark-to-flag mark))
- (setq marks (cons mark marks))))
- cmdmarks)
+ (mapc (lambda (mark)
+ (if (imap-message-flag-permanent-p
+ (nnimap-mark-to-flag mark))
+ (setq marks (cons mark marks))))
+ cmdmarks)
(when (and range marks)
(cond ((eq what 'del)
(imap-message-flags-del
(error "Your server does not support ACL editing"))
(with-current-buffer nnimap-server-buffer
;; delete all removed identifiers
- (mapcar (lambda (old-acl)
- (unless (assoc (car old-acl) new-acls)
- (or (imap-mailbox-acl-delete (car old-acl) mailbox)
- (error "Can't delete ACL for %s" (car old-acl)))))
- old-acls)
+ (mapc (lambda (old-acl)
+ (unless (assoc (car old-acl) new-acls)
+ (or (imap-mailbox-acl-delete (car old-acl) mailbox)
+ (error "Can't delete ACL for %s" (car old-acl)))))
+ old-acls)
;; set all changed acl's
- (mapcar (lambda (new-acl)
- (let ((new-rights (cdr new-acl))
- (old-rights (cdr (assoc (car new-acl) old-acls))))
- (unless (and old-rights new-rights
- (string= old-rights new-rights))
- (or (imap-mailbox-acl-set (car new-acl) new-rights mailbox)
- (error "Can't set ACL for %s to %s" (car new-acl)
- new-rights)))))
- new-acls)
+ (mapc (lambda (new-acl)
+ (let ((new-rights (cdr new-acl))
+ (old-rights (cdr (assoc (car new-acl) old-acls))))
+ (unless (and old-rights new-rights
+ (string= old-rights new-rights))
+ (or (imap-mailbox-acl-set (car new-acl) new-rights mailbox)
+ (error "Can't set ACL for %s to %s" (car new-acl)
+ new-rights)))))
+ new-acls)
t)))
\f
(nnheader-re-read-dir pathname)
(setq dir
(sort
- (mapcar (lambda (name) (string-to-int name))
+ (mapcar 'string-to-int
(directory-files pathname nil "^[0-9]+$" t))
'<))
(cond
(nnmh-request-list-1 rdir))))
;; For each directory, generate an active file line.
(unless (string= (expand-file-name nnmh-toplev) dir)
- (let ((files (mapcar
- (lambda (name) (string-to-int name))
- (directory-files dir nil "^[0-9]+$" t))))
+ (let ((files (mapcar 'string-to-int
+ (directory-files dir nil "^[0-9]+$" t))))
(when files
(save-excursion
(set-buffer nntp-server-buffer)
nnmh-group-alist)
(nnmh-possibly-create-directory group)
(nnmh-possibly-change-directory group server)
- (let ((articles (mapcar
- (lambda (file)
- (string-to-int file))
- (directory-files
- nnmh-current-directory nil "^[0-9]+$"))))
+ (let ((articles (mapcar 'string-to-int
+ (directory-files
+ nnmh-current-directory nil "^[0-9]+$"))))
(when articles
(setcar active (apply 'min articles))
(setcdr active (apply 'max articles))))))
(gnus-make-directory dir))
;; Find the highest number in the group.
(let ((files (sort
- (mapcar
- (lambda (f)
- (string-to-int f))
- (directory-files dir nil "^[0-9]+$"))
+ (mapcar 'string-to-int
+ (directory-files dir nil "^[0-9]+$"))
'>)))
(when files
(setcdr active (car files)))))
;; articles in this folder. The articles that are "new" will be
;; marked as unread by Gnus.
(let* ((dir nnmh-current-directory)
- (files (sort (mapcar (function (lambda (name) (string-to-int name)))
+ (files (sort (mapcar 'string-to-int
(directory-files nnmh-current-directory
nil "^[0-9]+$" t))
'<))
(nnheader-message 8 "Updating marks for %s..." group)
(nnml-open-marks group server)
;; Update info using `nnml-marks'.
- (mapcar (lambda (pred)
- (unless (memq (cdr pred) gnus-article-unpropagated-mark-lists)
- (gnus-info-set-marks
- info
- (gnus-update-alist-soft
- (cdr pred)
- (cdr (assq (cdr pred) nnml-marks))
- (gnus-info-marks info))
- t)))
- gnus-article-mark-lists)
+ (mapc (lambda (pred)
+ (unless (memq (cdr pred) gnus-article-unpropagated-mark-lists)
+ (gnus-info-set-marks
+ info
+ (gnus-update-alist-soft
+ (cdr pred)
+ (cdr (assq (cdr pred) nnml-marks))
+ (gnus-info-marks info))
+ t)))
+ gnus-article-mark-lists)
(let ((seen (cdr (assq 'read nnml-marks))))
(gnus-info-set-read info
(if (and (integerp (car seen))
" <ownerName>" (user-full-name) "</ownerName>\n"
" </head>\n"
" <body>\n"))
- (mapcar (lambda (sub)
- (insert (concat
- " <outline text=\"" (car sub) "\" xmlUrl=\""
- (cadr sub) "\"/>\n")))
- nnrss-group-alist)
+ (mapc (lambda (sub)
+ (insert (concat
+ " <outline text=\"" (car sub) "\" xmlUrl=\""
+ (cadr sub) "\"/>\n")))
+ nnrss-group-alist)
(insert (concat
" </body>\n"
"</opml>\n")))
(defun nnrss-find-el (tag data &optional found-list)
"Find the all matching elements in the data.
Careful with this on large documents!"
- (if (listp data)
- (mapcar (lambda (bit)
- (when (car-safe bit)
- (when (equal tag (car bit))
- (setq found-list
- (append found-list
- (list bit))))
- (if (and (listp (car-safe (caddr bit)))
- (not (stringp (caddr bit))))
- (setq found-list
- (append found-list
- (nnrss-find-el
- tag (caddr bit))))
- (setq found-list
- (append found-list
- (nnrss-find-el
- tag (cddr bit)))))))
- data))
+ (when (listp data)
+ (mapc (lambda (bit)
+ (when (car-safe bit)
+ (when (equal tag (car bit))
+ (setq found-list
+ (append found-list
+ (list bit))))
+ (if (and (listp (car-safe (caddr bit)))
+ (not (stringp (caddr bit))))
+ (setq found-list
+ (append found-list
+ (nnrss-find-el
+ tag (caddr bit))))
+ (setq found-list
+ (append found-list
+ (nnrss-find-el
+ tag (cddr bit)))))))
+ data))
found-list)
(defun nnrss-rsslink-p (el)
rss-onsite-in rdf-onsite-in xml-onsite-in
rss-offsite-end rdf-offsite-end xml-offsite-end
rss-offsite-in rdf-offsite-in xml-offsite-in)
- (mapcar (lambda (href)
- (if (not (null href))
- (cond ((string-match "\\.rss$" href)
- (nnrss-match-macro
- base-uri href rss-onsite-end rss-offsite-end))
- ((string-match "\\.rdf$" href)
- (nnrss-match-macro
- base-uri href rdf-onsite-end rdf-offsite-end))
- ((string-match "\\.xml$" href)
- (nnrss-match-macro
- base-uri href xml-onsite-end xml-offsite-end))
- ((string-match "rss" href)
- (nnrss-match-macro
- base-uri href rss-onsite-in rss-offsite-in))
- ((string-match "rdf" href)
- (nnrss-match-macro
- base-uri href rdf-onsite-in rdf-offsite-in))
- ((string-match "xml" href)
- (nnrss-match-macro
- base-uri href xml-onsite-in xml-offsite-in)))))
- hrefs)
+ (mapc (lambda (href)
+ (if (not (null href))
+ (cond ((string-match "\\.rss$" href)
+ (nnrss-match-macro
+ base-uri href rss-onsite-end rss-offsite-end))
+ ((string-match "\\.rdf$" href)
+ (nnrss-match-macro
+ base-uri href rdf-onsite-end rdf-offsite-end))
+ ((string-match "\\.xml$" href)
+ (nnrss-match-macro
+ base-uri href xml-onsite-end xml-offsite-end))
+ ((string-match "rss" href)
+ (nnrss-match-macro
+ base-uri href rss-onsite-in rss-offsite-in))
+ ((string-match "rdf" href)
+ (nnrss-match-macro
+ base-uri href rdf-onsite-in rdf-offsite-in))
+ ((string-match "xml" href)
+ (nnrss-match-macro
+ base-uri href xml-onsite-in xml-offsite-in)))))
+ hrefs)
(append
rss-onsite-end rdf-onsite-end xml-onsite-end
rss-onsite-in rdf-onsite-in xml-onsite-in
;; Yes, completely empty spool directories *are* possible.
;; Fix by Sudish Joseph <joseph@cis.ohio-state.edu>
(when (setq dir (directory-files pathname nil "^[0-9]+$" t))
- (setq dir
- (sort (mapcar (lambda (name) (string-to-int name)) dir) '<)))
+ (setq dir (sort (mapcar 'string-to-int dir) '<)))
(if dir
(nnheader-insert
"211 %d %d %d %s\n" (length dir) (car dir)
(let ((gnus-group-marked (copy-sequence nnvirtual-component-groups))
(gnus-expert-user t))
;; Make sure all groups are activated.
- (mapcar
+ (mapc
(lambda (g)
(when (not (numberp (gnus-group-unread g)))
(gnus-activate-group g)))
the result."
(when (numberp (cdr-safe articles))
(setq articles (list articles)))
- (let ((carticles (mapcar (lambda (g) (list g))
- nnvirtual-component-groups))
+ (let ((carticles (mapcar 'list nnvirtual-component-groups))
a i j article entry)
(while (setq a (pop articles))
(if (atom a)
(setq entry (assoc (car article) carticles))
(setcdr entry (cons (cdr article) (cdr entry))))
(setq i (1+ i))))
- (mapcar (lambda (x) (setcdr x (nreverse (cdr x))))
- carticles)
+ (mapc (lambda (x) (setcdr x (nreverse (cdr x))))
+ carticles)
carticles))
;; Into all-unreads we put (g unreads).
;; Into all-marks we put (g marks).
;; We also increment cnt and tot here, and compute M (max of sizes).
- (mapcar (lambda (g)
- (setq active (gnus-activate-group g)
- min (car active)
- max (cdr active))
- (when (and active (>= max min) (not (zerop max)))
- ;; store active information
- (push (list g (- max min -1) max) actives)
- ;; collect unread/mark info for later
- (setq unreads (gnus-list-of-unread-articles g))
- (setq marks (gnus-info-marks (gnus-get-info g)))
- (when gnus-use-cache
- (push (cons 'cache
- (gnus-cache-articles-in-group g))
- marks))
- (push (cons g unreads) all-unreads)
- (push (cons g marks) all-marks)
- ;; count groups, total #articles, and max size
- (setq size (- max min -1))
- (setq cnt (1+ cnt)
- tot (+ tot size)
- M (max M size))))
- nnvirtual-component-groups)
-
+ (mapc (lambda (g)
+ (setq active (gnus-activate-group g)
+ min (car active)
+ max (cdr active))
+ (when (and active (>= max min) (not (zerop max)))
+ ;; store active information
+ (push (list g (- max min -1) max) actives)
+ ;; collect unread/mark info for later
+ (setq unreads (gnus-list-of-unread-articles g))
+ (setq marks (gnus-info-marks (gnus-get-info g)))
+ (when gnus-use-cache
+ (push (cons 'cache
+ (gnus-cache-articles-in-group g))
+ marks))
+ (push (cons g unreads) all-unreads)
+ (push (cons g marks) all-marks)
+ ;; count groups, total #articles, and max size
+ (setq size (- max min -1))
+ (setq cnt (1+ cnt)
+ tot (+ tot size)
+ M (max M size))))
+ nnvirtual-component-groups)
+
;; Number of articles in the virtual group.
(setq nnvirtual-mapping-len tot)
(nth 1 parse)
" "))
(insert ">\n")
- (mapcar 'nnweb-insert-html (nth 2 parse))
+ (mapc 'nnweb-insert-html (nth 2 parse))
(insert "</" (symbol-name (car parse)) ">\n")))
(defun nnweb-parse-find (type parse &optional maxdepth)
to work in."
(setq buffer (or buffer (format " *sieve* %s:%d" server (or port 2000))))
(with-current-buffer (get-buffer-create buffer)
- (mapcar 'make-variable-buffer-local sieve-manage-local-variables)
+ (mapc 'make-variable-buffer-local sieve-manage-local-variables)
(sieve-manage-disable-multibyte)
(buffer-disable-undo)
(setq sieve-manage-server (or server sieve-manage-server))
(defun spam-stat-score-buffer ()
"Return a score describing the spam-probability for this buffer."
(setq spam-stat-score-data (spam-stat-buffer-words-with-scores))
- (let* ((probs (mapcar (lambda (e) (cadr e)) spam-stat-score-data))
+ (let* ((probs (mapcar 'cadr spam-stat-score-data))
(prod (apply #'* probs)))
(/ prod (+ prod (apply #'* (mapcar #'(lambda (x) (- 1 x))
probs))))))