Move compiler macros to gnus-clfns.el; load gnus-clfns.el.
[elisp/gnus.git-] / lisp / gnus-util.el
index ba7cbc9..9c665a9 100644 (file)
 
 ;;; Code:
 
-(require 'custom)
 (eval-when-compile (require 'cl))
+(eval-when-compile (require 'static))
+
+(require 'custom)
 (require 'nnheader)
 (require 'message)
 (require 'time-date)
-(eval-when-compile (require 'static))
 
 (eval-and-compile
   (autoload 'rmail-insert-rmail-file-header "rmail")
 
 (defun gnus-dd-mmm (messy-date)
   "Return a string like DD-MMM from a big messy string."
-  (format-time-string "%d-%b" (safe-date-to-time messy-date)))
+  (condition-case ()
+      (format-time-string "%d-%b" (safe-date-to-time messy-date))
+    (error "  -   ")))
 
 (defmacro gnus-date-get-time (date)
   "Convert DATE string to Emacs time.
@@ -534,6 +537,7 @@ If N, return the Nth ancestor instead."
              first 't2
              last 't1))
        ((gnus-functionp function)
+       ;; Do nothing.
        )
        (t
        (error "Invalid sort spec: %s" function))))
@@ -985,40 +989,28 @@ ARG is passed to the first function."
        (throw 'found nil)))
     t))
 
-(static-if (boundp 'MULE)
-    (defun gnus-write-active-file-as-coding-system
-      (coding-system file hashtb &optional full-names)
-      (let ((output-coding-system coding-system))
-       (with-temp-file file
-         (mapatoms
-          (lambda (sym)
-            (when (and sym
-                       (boundp sym)
-                       (symbol-value sym))
-              (insert (format "%s %d %d y\n"
-                              (if full-names
-                                  (symbol-name sym)
-                                (gnus-group-real-name (symbol-name sym)))
-                              (cdr (symbol-value sym))
-                              (car (symbol-value sym))))))
-          hashtb))))
-  (defun gnus-write-active-file-as-coding-system
-    (coding-system file hashtb &optional full-names)
-    (let ((coding-system-for-write coding-system))
-      (with-temp-file file
-       (mapatoms
-        (lambda (sym)
-          (when (and sym
-                     (boundp sym)
-                     (symbol-value sym))
-            (insert (format "%s %d %d y\n"
-                            (if full-names
-                                (symbol-name sym)
-                              (gnus-group-real-name (symbol-name sym)))
-                            (cdr (symbol-value sym))
-                            (car (symbol-value sym))))))
-        hashtb))))
-  )
+(defun gnus-write-active-file-as-coding-system (coding-system file hashtb
+                                                             &optional
+                                                             full-names)
+  (let ((output-coding-system coding-system)
+       (coding-system-for-write coding-system))
+    (with-temp-file file
+      (mapatoms
+       (lambda (sym)
+        (when (and sym
+                   (boundp sym)
+                   (symbol-value sym))
+          (insert (format "%S %d %d y\n"
+                          (if full-names
+                              sym
+                            (intern (gnus-group-real-name (symbol-name sym))))
+                          (or (cdr (symbol-value sym))
+                              (car (symbol-value sym)))
+                          (car (symbol-value sym))))))
+       hashtb)
+      (goto-char (point-max))
+      (while (search-backward "\\." nil t)
+       (delete-char 1)))))
 
 (provide 'gnus-util)