comparison lisp/gnus/nnheader.el @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children 0293115a14e9
comparison
equal deleted inserted replaced
1:c0c6a60d29db 2:ac2d302a0011
568 (save-excursion 568 (save-excursion
569 (goto-char (point-min)) 569 (goto-char (point-min))
570 (while (re-search-forward "\r$" nil t) 570 (while (re-search-forward "\r$" nil t)
571 (delete-backward-char 1)))) 571 (delete-backward-char 1))))
572 572
573 (defun nnheader-file-size (file)
574 "Return the file size of FILE or 0."
575 (or (nth 7 (file-attributes file)) 0))
576
577 (defun nnheader-find-etc-directory (package)
578 "Go through the path and find the \".../etc/PACKAGE\" directory."
579 (let ((path load-path)
580 dir result)
581 ;; We try to find the dir by looking at the load path,
582 ;; stripping away the last component and adding "etc/".
583 (while path
584 (if (and (car path)
585 (file-exists-p
586 (setq dir (concat
587 (file-name-directory
588 (directory-file-name (car path)))
589 "etc/" package "/")))
590 (file-directory-p dir))
591 (setq result dir
592 path nil)
593 (setq path (cdr path))))
594 result))
595
596 (defvar ange-ftp-path-format)
597 (defvar efs-path-regexp)
598 (defun nnheader-re-read-dir (path)
599 "Re-read directory PATH if PATH is on a remote system."
600 (if (and (fboundp 'efs-re-read-dir) (boundp 'efs-path-regexp))
601 (when (string-match efs-path-regexp path)
602 (efs-re-read-dir path))
603 (if (and (fboundp 'ange-ftp-re-read-dir) (boundp 'ange-ftp-path-format))
604 (when (string-match (car ange-ftp-path-format) path)
605 (ange-ftp-re-read-dir path)))))
606
573 (fset 'nnheader-run-at-time 'run-at-time) 607 (fset 'nnheader-run-at-time 'run-at-time)
574 (fset 'nnheader-cancel-timer 'cancel-timer) 608 (fset 'nnheader-cancel-timer 'cancel-timer)
575 (fset 'nnheader-find-file-noselect 'find-file-noselect) 609 (fset 'nnheader-find-file-noselect 'find-file-noselect)
576 (fset 'nnheader-insert-file-contents-literally 610 (fset 'nnheader-insert-file-contents-literally
577 'insert-file-contents-literally) 611 'insert-file-contents-literally)