X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fgnus.git-;a=blobdiff_plain;f=lisp%2Fnnheader.el;h=d378f0374b1250c56213594dbf89320f1b1505d1;hp=696f7c96016c05dbbc48427b7b5a997671297310;hb=625b891fc07e1e5fc5f2658176b6c0e3cb244ee0;hpb=3aca09c100b6c60da9524bebf9c9eed6ad3e0174 diff --git a/lisp/nnheader.el b/lisp/nnheader.el index 696f7c9..d378f03 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -471,12 +471,12 @@ the line could be found." (when (file-exists-p file) (if (eq nnheader-max-head-length t) ;; Just read the entire file. - (mm-insert-file-contents file) + (nnheader-insert-file-contents file) ;; Read 1K blocks until we find a separator. (let ((beg 0) format-alist) (while (and (eq nnheader-head-chop-length - (nth 1 (mm-insert-file-contents + (nth 1 (nnheader-insert-file-contents file nil beg (incf beg nnheader-head-chop-length)))) (prog1 (not (search-forward "\n\n" nil t)) @@ -765,25 +765,18 @@ If FILE, find the \".../etc/PACKAGE\" file instead." (defvar nnheader-file-coding-system 'raw-text "Coding system used in file backends of Gnus.") -(defun mm-insert-file-contents (filename &optional visit beg end replace) +(defun nnheader-insert-file-contents (filename &optional visit beg end replace) "Like `insert-file-contents', q.v., but only reads in the file. A buffer may be modified in several ways after reading into the buffer due to advanced Emacs features, such as file-name-handlers, format decoding, find-file-hooks, etc. This function ensures that none of these modifications will take place." - (let ((format-alist nil) - (auto-mode-alist (nnheader-auto-mode-alist)) - (default-major-mode 'fundamental-mode) - (enable-local-variables nil) - (after-insert-file-functions nil) - (enable-local-eval nil) - (find-file-hooks nil) - (coding-system-for-read nnheader-file-coding-system)) - (insert-file-contents filename visit beg end replace))) + (let ((coding-system-for-read nnheader-file-coding-system)) + (mm-insert-file-contents filename visit beg end replace))) (defun nnheader-find-file-noselect (&rest args) (let ((format-alist nil) - (auto-mode-alist (nnheader-auto-mode-alist)) + (auto-mode-alist (mm-auto-mode-alist)) (default-major-mode 'fundamental-mode) (enable-local-variables nil) (after-insert-file-functions nil) @@ -792,16 +785,6 @@ find-file-hooks, etc. (coding-system-for-read nnheader-file-coding-system)) (apply 'find-file-noselect args))) -(defun nnheader-auto-mode-alist () - "Return an `auto-mode-alist' with only the .gz (etc) thingies." - (let ((alist auto-mode-alist) - out) - (while alist - (when (listp (cdar alist)) - (push (car alist) out)) - (pop alist)) - (nreverse out))) - (defun nnheader-directory-regular-files (dir) "Return a list of all regular files in DIR." (let ((files (directory-files dir t))