comparison lisp/info.el @ 5270:3acaa0fc09be

Use #'some, #'every, etc. for composing boolean operations on lists. 2010-09-16 Aidan Kehoe <kehoea@parhasard.net> * info.el (Info-insert-dir): * format.el (format-deannotate-region): * files.el (cd, save-buffers-kill-emacs): Use #'some, #'every and related functions for applying boolean operations to lists, instead of rolling our own ones that cons and don't short-circuit.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 16 Sep 2010 15:58:10 +0100
parents 3ff01259c4a2
children f00192e1cd49 308d34e9f07d
comparison
equal deleted inserted replaced
5269:90a0084b3541 5270:3acaa0fc09be
862 sets the *info* buffer's `default-directory' to the first directory we 862 sets the *info* buffer's `default-directory' to the first directory we
863 actually get any text from." 863 actually get any text from."
864 (if (and Info-dir-contents Info-dir-file-attributes 864 (if (and Info-dir-contents Info-dir-file-attributes
865 ;; Verify that none of the files we used has changed 865 ;; Verify that none of the files we used has changed
866 ;; since we used it. 866 ;; since we used it.
867 (eval (cons 'and 867 (every #'(lambda (elt)
868 (mapcar #'(lambda (elt) 868 (let ((curr (file-attributes (car elt))))
869 (let ((curr (file-attributes (car elt)))) 869 ;; Don't compare the access time.
870 ;; Don't compare the access time. 870 (if curr (setcar (nthcdr 4 curr) 0))
871 (if curr (setcar (nthcdr 4 curr) 0)) 871 (setcar (nthcdr 4 (cdr elt)) 0)
872 (setcar (nthcdr 4 (cdr elt)) 0) 872 (equal (cdr elt) curr)))
873 (equal (cdr elt) curr))) 873 Info-dir-file-attributes))
874 Info-dir-file-attributes))))
875 (insert Info-dir-contents) 874 (insert Info-dir-contents)
876 (let ((dirs (reverse Info-directory-list)) 875 (let ((dirs (reverse Info-directory-list))
877 buffers lbuffers buffer others nodes dirs-done) 876 buffers lbuffers buffer others nodes dirs-done)
878 877
879 (setq Info-dir-file-attributes nil) 878 (setq Info-dir-file-attributes nil)