comparison lisp/nnheader.el @ 15559:8d8bf85d356a

Synched with Gnus 5.2.31.
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Sat, 29 Jun 1996 00:29:17 +0000
parents 530d0d516a42
children 7fc1577aa8e7
comparison
equal deleted inserted replaced
15558:18364c2808f7 15559:8d8bf85d356a
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 (boundp 'ange-ftp-path-format)
601 (when (string-match (car ange-ftp-path-format) path)
602 (ange-ftp-re-read-dir path))
603 (if (boundp 'efs-path-regexp)
604 (when (string-match efs-path-regexp path)
605 (efs-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)