Fix single-quoting style in PDF manuals
[gnus] / lisp / nnmaildir.el
index caf2820..21fa5b3 100644 (file)
    )
 ]
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
-(eval-and-compile
-  (require 'nnheader)
-  (require 'gnus)
-  (require 'gnus-util)
-  (require 'gnus-range)
-  (require 'gnus-start)
-  (require 'gnus-int)
-  (require 'message))
+(require 'nnheader)
+(require 'gnus)
+(require 'gnus-util)
+(require 'gnus-range)
+(require 'gnus-start)
+(require 'gnus-int)
+(require 'message)
+(require 'nnmail)
+
 (eval-when-compile
-  (require 'cl)
-  (require 'nnmail))
+  (require 'cl))
 
 (defconst nnmaildir-version "Gnus")
 
@@ -100,14 +96,14 @@ See `nnmaildir-flag-mark-mapping'."
 
 (defun nnmaildir--ensure-suffix (filename)
   "Ensure that FILENAME contains the suffix \":2,\"."
-  (if (string-match-p ":2," filename)
+  (if (gnus-string-match-p ":2," filename)
       filename
     (concat filename ":2,")))
 
 (defun nnmaildir--add-flag (flag suffix)
   "Return a copy of SUFFIX where FLAG is set.
 SUFFIX should start with \":2,\"."
-  (unless (string-match-p "^:2," suffix)
+  (unless (gnus-string-match-p "^:2," suffix)
     (error "Invalid suffix `%s'" suffix))
   (let* ((flags (substring suffix 3))
         (flags-as-list (append flags nil))
@@ -120,23 +116,13 @@ SUFFIX should start with \":2,\"."
 (defun nnmaildir--remove-flag (flag suffix)
   "Return a copy of SUFFIX where FLAG is cleared.
 SUFFIX should start with \":2,\"."
-  (unless (string-match-p "^:2," suffix)
+  (unless (gnus-string-match-p "^:2," suffix)
     (error "Invalid suffix `%s'" suffix))
   (let* ((flags (substring suffix 3))
         (flags-as-list (append flags nil))
         (new-flags (concat (delq flag flags-as-list))))
     (concat ":2," new-flags)))
 
-(defun nnmaildir--article-set-flags (article new-suffix curdir)
-  (let* ((prefix (nnmaildir--art-prefix article))
-        (suffix (nnmaildir--art-suffix article))
-        (article-file (concat curdir prefix suffix))
-        (new-name (concat curdir prefix new-suffix)))
-    (unless (file-exists-p article-file)
-      (error "Couldn't find article file %s" article-file))
-    (rename-file article-file new-name 'replace)
-    (setf (nnmaildir--art-suffix article) new-suffix)))
-
 (defvar nnmaildir-article-file-name nil
   "*The filename of the most recently requested article.  This variable is set
 by nnmaildir-request-article.")
@@ -212,6 +198,16 @@ by nnmaildir-request-article.")
   (gnm          nil)                      ;; flag: split from mail-sources?
   (target-prefix nil :type string))        ;; symlink target prefix
 
+(defun nnmaildir--article-set-flags (article new-suffix curdir)
+  (let* ((prefix (nnmaildir--art-prefix article))
+        (suffix (nnmaildir--art-suffix article))
+        (article-file (concat curdir prefix suffix))
+        (new-name (concat curdir prefix new-suffix)))
+    (unless (file-exists-p article-file)
+      (error "Couldn't find article file %s" article-file))
+    (rename-file article-file new-name 'replace)
+    (setf (nnmaildir--art-suffix article) new-suffix)))
+
 (defun nnmaildir--expired-article (group article)
   (setf (nnmaildir--art-nov article) nil)
   (let ((flist  (nnmaildir--grp-flist group))
@@ -856,11 +852,11 @@ by nnmaildir-request-article.")
              (when (or
                     ;; first look for marks in suffix, if it's valid...
                     (when (and (stringp suffix)
-                               (string-prefix-p ":2," suffix))
+                               (gnus-string-prefix-p ":2," suffix))
                       (or
-                       (not (string-match-p
+                       (not (gnus-string-match-p
                              (string (nnmaildir--mark-to-flag 'read)) suffix))
-                       (string-match-p
+                       (gnus-string-match-p
                         (string (nnmaildir--mark-to-flag 'tick)) suffix)))
                     ;; then look in marks directories
                     (not (file-exists-p (concat cdir prefix)))