*** empty log message ***
[gnus] / lisp / nnheader.el
index 5751973..e0de0a4 100644 (file)
@@ -2,7 +2,7 @@
 ;; Copyright (C) 1987,88,89,90,93,94,95,96,97,98 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
-;;     Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
 
 ;; This file is part of GNU Emacs.
@@ -241,8 +241,9 @@ on your system, you could say something like:
                       (setq ref2 (substring in-reply-to (match-beginning 0)
                                             (match-end 0)))
                       (when (> (length ref2) (length ref))
-                        (setq ref ref2))))
-                "")))
+                        (setq ref ref2)))
+                     ref)
+                nil)))
           ;; Chars.
           0
           ;; Lines.
@@ -562,7 +563,7 @@ If FILE is t, return the buffer contents as a string."
 
 (defsubst nnheader-file-to-number (file)
   "Take a file name and return the article number."
-  (if (not (boundp 'jka-compr-compression-info-list))
+  (if (string= nnheader-numerical-short-files "^[0-9]+$")
       (string-to-int file)
     (string-match nnheader-numerical-short-files file)
     (string-to-int (match-string 0 file))))
@@ -594,21 +595,27 @@ If FILE is t, return the buffer contents as a string."
   "Fold continuation lines in the current buffer."
   (nnheader-replace-regexp "\\(\r?\n[ \t]+\\)+" " "))
 
-(defun nnheader-translate-file-chars (file)
+(defun nnheader-translate-file-chars (file &optional full)
+  "Translate FILE into something that can be a file name.
+If FULL, translate everything."
   (if (null nnheader-file-name-translation-alist)
       ;; No translation is necessary.
       file
-    ;; We translate -- but only the file name.  We leave the directory
-    ;; alone.
     (let* ((i 0)
           trans leaf path len)
-      (if (string-match "/[^/]+\\'" file)
-         ;; This is needed on NT's and stuff.
-         (setq leaf (substring file (1+ (match-beginning 0)))
-               path (substring file 0 (1+ (match-beginning 0))))
-       ;; Fall back on this.
-       (setq leaf (file-name-nondirectory file)
-             path (file-name-directory file)))
+      (if full
+         ;; Do complete translation.
+         (setq leaf (copy-sequence file)
+               path "")
+       ;; We translate -- but only the file name.  We leave the directory
+       ;; alone.
+       (if (string-match "/[^/]+\\'" file)
+           ;; This is needed on NT's and stuff.
+           (setq leaf (substring file (1+ (match-beginning 0)))
+                 path (substring file 0 (1+ (match-beginning 0))))
+         ;; Fall back on this.
+         (setq leaf (file-name-nondirectory file)
+               path (file-name-directory file))))
       (setq len (length leaf))
       (while (< i len)
        (when (setq trans (cdr (assq (aref leaf i)
@@ -629,9 +636,9 @@ The first string in ARGS can be a format string."
 (defun nnheader-get-report (backend)
   "Get the most recent report from BACKEND."
   (condition-case ()
-      (message "%s" (symbol-value (intern (format "%s-status-string"
+      (nnheader-message 5 "%s" (symbol-value (intern (format "%s-status-string"
                                                  backend))))
-    (error (message ""))))
+    (error (nnheader-message 5 ""))))
 
 (defun nnheader-insert (format &rest args)
   "Clear the communication buffer and insert FORMAT and ARGS into the buffer.
@@ -766,7 +773,9 @@ find-file-hooks, etc.
   (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)
+       (find-file-hooks nil)
        (coding-system-for-read nnheader-file-coding-system))
     (insert-file-contents filename visit beg end replace)))
 
@@ -776,6 +785,7 @@ find-file-hooks, etc.
        (default-major-mode 'fundamental-mode)
        (enable-local-variables nil)
         (after-insert-file-functions nil)
+       (find-file-hooks nil)
        (coding-system-for-read nnheader-file-coding-system))
     (apply 'find-file-noselect args)))