]> code.delx.au - gnu-emacs/commitdiff
Revert the gnus-replace-in-string change, fix arguments, reapply
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 12 Feb 2016 07:24:30 +0000 (18:24 +1100)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 12 Feb 2016 07:24:30 +0000 (18:24 +1100)
17 files changed:
lisp/gnus/gnus-art.el
lisp/gnus/gnus-bookmark.el
lisp/gnus/gnus-gravatar.el
lisp/gnus/gnus-group.el
lisp/gnus/gnus-msg.el
lisp/gnus/gnus-sum.el
lisp/gnus/gnus-util.el
lisp/gnus/mail-source.el
lisp/gnus/mailcap.el
lisp/gnus/message.el
lisp/gnus/mm-decode.el
lisp/gnus/nnir.el
lisp/gnus/nnmaildir.el
lisp/gnus/nnml.el
lisp/gnus/nnrss.el
lisp/gnus/spam-report.el
lisp/gnus/spam.el

index 68d07c70ee85b0658553abf08910b44d5978070d..920544d5c51bb425d936bdce13acef77ffdace03 100644 (file)
@@ -7521,7 +7521,7 @@ address, `ask' if unsure and `invalid' if the string is invalid."
        (list gnus-button-mid-or-mail-heuristic-alist)
        (result 0) rate regexp lpartlen elem)
     (setq lpartlen
-         (length (replace-regexp-in-string mid-or-mail "^\\(.*\\)@.*$" "\\1")))
+         (length (replace-regexp-in-string "^\\(.*\\)@.*$" "\\1" mid-or-mail)))
     (gnus-message 8 "`%s', length of local part=`%s'." mid-or-mail lpartlen)
     ;; Certain special cases...
     (when (string-match
@@ -7592,7 +7592,7 @@ address, `ask' if unsure and `invalid' if the string is invalid."
       (setq guessed
            ;; get rid of surrounding angles...
            (funcall pref
-                    (replace-regexp-in-string mid-or-mail "^<\\|>$" "")))
+                    (replace-regexp-in-string "^<\\|>$" "" mid-or-mail)))
       (if (or (eq 'mid guessed) (eq 'mail guessed))
          (setq pref guessed)
        (setq pref 'ask)))
@@ -7624,13 +7624,13 @@ as a symbol to FUN."
   "Call `describe-function' when pushing the corresponding URL button."
   (describe-function
    (intern
-    (replace-regexp-in-string url gnus-button-handle-describe-prefix ""))))
+    (replace-regexp-in-string gnus-button-handle-describe-prefix "" url))))
 
 (defun gnus-button-handle-describe-variable (url)
   "Call `describe-variable' when pushing the corresponding URL button."
   (describe-variable
    (intern
-    (replace-regexp-in-string url gnus-button-handle-describe-prefix ""))))
+    (replace-regexp-in-string gnus-button-handle-describe-prefix "" url))))
 
 (defun gnus-button-handle-symbol (url)
 "Display help on variable or function.
@@ -7644,7 +7644,7 @@ Calls `describe-variable' or `describe-function'."
 (defun gnus-button-handle-describe-key (url)
   "Call `describe-key' when pushing the corresponding URL button."
   (let* ((key-string
-         (replace-regexp-in-string url gnus-button-handle-describe-prefix ""))
+         (replace-regexp-in-string gnus-button-handle-describe-prefix "" url))
         (keys (ignore-errors (eval `(kbd ,key-string)))))
     (if keys
        (describe-key keys)
@@ -7652,31 +7652,30 @@ Calls `describe-variable' or `describe-function'."
 
 (defun gnus-button-handle-apropos (url)
   "Call `apropos' when pushing the corresponding URL button."
-  (apropos (replace-regexp-in-string
-           url gnus-button-handle-describe-prefix "")))
+  (apropos (replace-regexp-in-string gnus-button-handle-describe-prefix "" url)))
 
 (defun gnus-button-handle-apropos-command (url)
   "Call `apropos' when pushing the corresponding URL button."
   (apropos-command
-   (replace-regexp-in-string url gnus-button-handle-describe-prefix "")))
+   (replace-regexp-in-string gnus-button-handle-describe-prefix "" url)))
 
 (defun gnus-button-handle-apropos-variable (url)
   "Call `apropos' when pushing the corresponding URL button."
   (funcall
    (if (fboundp 'apropos-variable) 'apropos-variable 'apropos)
-   (replace-regexp-in-string url gnus-button-handle-describe-prefix "")))
+   (replace-regexp-in-string gnus-button-handle-describe-prefix "" url)))
 
 (defun gnus-button-handle-apropos-documentation (url)
   "Call `apropos' when pushing the corresponding URL button."
   (funcall
    (if (fboundp 'apropos-documentation) 'apropos-documentation 'apropos)
-   (replace-regexp-in-string url gnus-button-handle-describe-prefix "")))
+   (replace-regexp-in-string gnus-button-handle-describe-prefix "" url)))
 
 (defun gnus-button-handle-library (url)
   "Call `locate-library' when pushing the corresponding URL button."
   (gnus-message 9 "url=`%s'" url)
   (let* ((lib (locate-library url))
-        (file (replace-regexp-in-string (or lib "") "\\.elc" ".el")))
+        (file (replace-regexp-in-string "\\.elc" ".el" (or lib ""))))
     (if (not lib)
        (gnus-message 1 "Cannot locale library `%s'." url)
       (find-file-read-only file))))
@@ -8274,7 +8273,7 @@ url is put as the `gnus-button-url' overlay property on the button."
   "Fetch a man page."
   (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url)
   (when (eq gnus-button-man-handler 'woman)
-    (setq url (replace-regexp-in-string url "([1-9][X1a-z]*).*\\'" "")))
+    (setq url (replace-regexp-in-string "([1-9][X1a-z]*).*\\'" "" url)))
   (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url)
   (funcall gnus-button-man-handler url))
 
@@ -8290,7 +8289,7 @@ url is put as the `gnus-button-url' overlay property on the button."
    ((string-match "([^)\"]+)[^\"]+" url)
     (setq url
          (replace-regexp-in-string
-          (replace-regexp-in-string url "[\n\t ]+" " ") "\"" ""))
+          "\"" "" (replace-regexp-in-string "[\n\t ]+" " " url)))
     (gnus-info-find-node url))
    (t (error "Can't parse %s" url))))
 
@@ -8429,8 +8428,8 @@ url is put as the `gnus-button-url' overlay property on the button."
          (funcall func)
        (message-position-on-field (caar args)))
       (insert (replace-regexp-in-string
-              (mapconcat 'identity (reverse (cdar args)) ", ")
-              "\r\n" "\n" t))
+              "\r\n" "\n"
+              (mapconcat 'identity (reverse (cdar args)) ", ") nil t))
       (setq args (cdr args)))
     (if subject
        (message-goto-body)
index cb3de92a2aefd553ab9657682dcfa99e5f198906..66fc6106799f0efa5b74ca743ceaeb3cb5e1763b 100644 (file)
@@ -226,7 +226,7 @@ So the cdr of each bookmark is an alist too.")
                   "-" (car subject) "-" (cadr subject)))
         (default-name-1
           ;; Strip "[]" chars from the bookmark name:
-          (replace-regexp-in-string default-name-0 "[]_[]" ""))
+          (replace-regexp-in-string "[]_[]" "" default-name-0))
         (name (read-from-minibuffer
                (format "Set bookmark (%s): " default-name-1)
                nil nil nil nil
index 28caed2e80d5c45f415b6a254dc438385f4a4709..89be8640c532b1e908754739793f9a5cbd60c5e0 100644 (file)
@@ -95,7 +95,8 @@ Set image category to CATEGORY."
              (when (if real-name
                        (re-search-forward
                         (concat (replace-regexp-in-string
-                                 (regexp-quote real-name) "[\t ]+" "[\t\n ]+")
+                                 "[\t ]+" "[\t\n ]+"
+                                 (regexp-quote real-name))
                                 "\\|"
                                 (regexp-quote mail-address))
                         nil t)
index 18e899b7bce61f30e917737e796818976f372060..b702e2f42ca4e133c235e1db28735bf530abc724 100644 (file)
@@ -2197,7 +2197,7 @@ if it is not a list."
       (setq group
            (encode-coding-string
             group (gnus-group-name-charset nil group))))
-    (replace-regexp-in-string group "\n" "")))
+    (replace-regexp-in-string "\n" "" group)))
 
 ;;;###autoload
 (defun gnus-fetch-group (group &optional articles)
@@ -2456,8 +2456,8 @@ the bug number, and browsing the URL must return mbox output."
          (end-of-line)
          (insert (format ", %s@%s" (car ids)
                          (replace-regexp-in-string
-                          (replace-regexp-in-string mbox-url "^http://" "")
-                          "/.*$" ""))))))
+                          "/.*$" ""
+                          (replace-regexp-in-string "^http://" "" mbox-url)))))))
     (gnus-group-read-ephemeral-group
      (format "nndoc+ephemeral:bug#%s"
             (mapconcat 'number-to-string ids ","))
index dec0e4e81e8dd903ddd5a6c927027c1cc36092b8..43a496942e31522f8443433ff5a202cafea63944 100644 (file)
@@ -1135,8 +1135,8 @@ See the variable `gnus-user-agent'."
            (when (memq 'gnus gnus-user-agent)
              (concat "Gnus/"
                      (replace-regexp-in-string
-                      (format "%1.8f" (gnus-continuum-version gnus-version))
-                      "0+\\'" "")
+                      "0+\\'" ""
+                      (format "%1.8f" (gnus-continuum-version gnus-version)))
                      " (" gnus-version ")")))
           (emacs-v (gnus-emacs-version)))
       (concat gnus-v (when (and gnus-v emacs-v) " ")
index dfdf8e1896675ab04114bce8173ee49dd67c4989..688646f3e82c2d0240dae4edf304316ed7508fd8 100644 (file)
@@ -9085,7 +9085,7 @@ non-numeric or nil fetch the number specified by the
   (gnus-warp-to-article)
   (when (and (stringp message-id)
             (not (zerop (length message-id))))
-    (setq message-id (replace-regexp-in-string message-id " " ""))
+    (setq message-id (replace-regexp-in-string " " "" message-id))
     ;; Construct the correct Message-ID if necessary.
     ;; Suggested by tale@pawl.rpi.edu.
     (unless (string-match "^<" message-id)
@@ -9563,10 +9563,10 @@ article.  If BACKWARD (the prefix) is non-nil, search backward instead."
 
 (defun gnus-summary-print-truncate-and-quote (string &optional len)
   "Truncate to LEN and quote all \"(\"'s in STRING."
-  (replace-regexp-in-string (if (and len (> (length string) len))
+  (replace-regexp-in-string "[()]" "\\\\\\&"
+                           (if (and len (> (length string) len))
                                (substring string 0 len)
-                             string)
-                           "[()]" "\\\\\\&"))
+                             string)))
 
 (defun gnus-summary-print-article (&optional filename n)
   "Generate and print a PostScript image of the process-marked (mail) articles.
index eee80fdd6bc27cc78d7c877632409a957cba5385..284f094f7a5e29a11b4b8d7914cea635ca71c4a3 100644 (file)
@@ -407,7 +407,7 @@ Cache the result as a text property stored in DATE."
 
 (defun gnus-mode-string-quote (string)
   "Quote all \"%\"'s in STRING."
-  (replace-regexp-in-string string "%" "%%"))
+  (replace-regexp-in-string "%" "%%" string))
 
 ;; Make a hash table (default and minimum size is 256).
 ;; Optional argument HASHSIZE specifies the table size.
index d360f5f71fe219c0764a5ca91da87b682673c3c3..2388a1afa57a5aaddc37414ff62bad8b9643bff3 100644 (file)
@@ -603,8 +603,8 @@ If CONFIRM is non-nil, ask for confirmation before removing a file."
          currday (+ currday (* low2days (nth 1 (current-time)))))
     (while files
       (let* ((ffile (car files))
-            (bfile (replace-regexp-in-string
-                    ffile "\\`.*/\\([^/]+\\)\\'" "\\1"))
+            (bfile (replace-regexp-in-string "\\`.*/\\([^/]+\\)\\'" "\\1"
+                                             ffile))
             (filetime (nth 5 (file-attributes ffile)))
             (fileday (* (car filetime) high2days))
             (fileday (+ fileday (* low2days (nth 1 filetime)))))
index a82768fed043c3538ca302a0506fc1cd2f6075d0..609a8f4d64b5b64f5a4906649ef67b0a82f69287 100644 (file)
@@ -1028,11 +1028,12 @@ If FORCE, re-parse even if already parsed."
                              (replace-regexp-in-string
                               ;; Replace mailcap's `%s' placeholder
                               ;; with dired's `?' placeholder
+                              "%s" "?"
                               (replace-regexp-in-string
                                ;; Remove the final filename placeholder
-                               command "[ \t\n]*\\('\\)?%s\\1?[ \t\n]*\\'" ""
-                               nil t)
-                              "%s" "?" nil t))))
+                               "[ \t\n]*\\('\\)?%s\\1?[ \t\n]*\\'" ""
+                               command nil t)
+                              nil t))))
                             common-mime-info)))))
     commands))
 
index 540736c0e5758995f84040e70047c1734d2d361e..0a806467058bec85288992308e36832c7c6e9731 100644 (file)
@@ -8309,7 +8309,8 @@ From headers in the original article."
       (dolist (string (mail-header-parse-addresses value 'raw))
        (setq string
              (replace-regexp-in-string
-              (replace-regexp-in-string string "^ +\\| +$" "") "\n" ""))
+              "\n" ""
+              (replace-regexp-in-string "^ +\\| +$" "" string)))
        (ecomplete-add-item 'mail (car (mail-header-parse-address string))
                            string))))
   (ecomplete-save))
index c861b9a8a29afaa228aab8026ef0e219f8bfcc68..383aeded66fc35f80d10ce4632d341c36b7ee664 100644 (file)
@@ -1353,12 +1353,12 @@ string if you do not like underscores."
 
 (defun mm-file-name-delete-control (filename)
   "Delete control characters from FILENAME."
-  (replace-regexp-in-string filename "[\x00-\x1f\x7f]" ""))
+  (replace-regexp-in-string "[\x00-\x1f\x7f]" "" filename))
 
 (defun mm-file-name-delete-gotchas (filename)
   "Delete shell gotchas from FILENAME."
-  (setq filename (replace-regexp-in-string filename "[<>|]" ""))
-  (replace-regexp-in-string filename "^[.-]+" ""))
+  (setq filename (replace-regexp-in-string "[<>|]" "" filename))
+  (replace-regexp-in-string "^[.-]+" "" filename))
 
 (defun mm-save-part (handle &optional prompt)
   "Write HANDLE to a file.
index a36dba429b0e3782729b88a8639e1f8c70f32dda..7614002a92018436463a83b21628a92d8616ba05 100644 (file)
@@ -929,16 +929,17 @@ ready to be added to the list of search results."
     ;; Set group to dirnam without any leading dots or slashes,
     ;; and with all subsequent slashes replaced by dots
     (let ((group (replace-regexp-in-string
-                 (replace-regexp-in-string dirnam "^[./\\]" "" nil t)
-                 "[/\\]" "." nil t)))
-
-      (vector (gnus-group-full-name group server)
-             (if (string-match "\\`nnmaildir:" (gnus-group-server server))
-                 (nnmaildir-base-name-to-article-number
-                  (substring article 0 (string-match ":" article))
-                  group nil)
-               (string-to-number article))
-             (string-to-number score)))))
+                 "[/\\]" "."
+                 (replace-regexp-in-string "^[./\\]" "" dirnam nil t)
+                 nil t)))
+
+    (vector (gnus-group-full-name group server)
+           (if (string-match "\\`nnmaildir:" (gnus-group-server server))
+               (nnmaildir-base-name-to-article-number
+                (substring article 0 (string-match ":" article))
+                group nil)
+             (string-to-number article))
+           (string-to-number score)))))
 
 ;;; Search Engine Interfaces:
 
@@ -1341,9 +1342,9 @@ Tested with swish-e-2.0.1 on Windows NT 4.0."
             (string-match "^[./\\]*\\(.*\\)$" dirnam)
             ;; "/" -> "."
             (setq group (replace-regexp-in-string
-                        (match-string 1 dirnam) "/" "."))
+                        "/" "." (match-string 1 dirnam)))
             ;; Windows "\\" -> "."
-            (setq group (replace-regexp-in-string group "\\\\" "."))
+            (setq group (replace-regexp-in-string "\\\\" "." group))
 
             (push (vector (gnus-group-full-name group server)
                           (string-to-number artno)
@@ -1415,7 +1416,7 @@ Tested with swish-e-2.0.1 on Windows NT 4.0."
        (when (string-match prefix dirnam)
          (setq dirnam (replace-match "" t t dirnam)))
        (push (vector (gnus-group-full-name
-                       (replace-regexp-in-string dirnam "/" ".") server)
+                       (replace-regexp-in-string "/" "." dirnam) server)
                      (string-to-number artno)
                      (string-to-number score))
              artlist))
@@ -1614,7 +1615,8 @@ actually)."
                                (if (file-directory-p
                                     (setq group
                                           (replace-regexp-in-string
-                                           group "\\." "/" nil t)))
+                                           "\\." "/"
+                                           group nil t)))
                                    group))))))
                     (unless group
                       (error "Cannot locate directory for group"))
index 4b154432c7e581212d809f00c2a7f9ec3f534709..e34a13b45614bc41bf7ef774eca89a47c96110d8 100644 (file)
@@ -657,12 +657,12 @@ by nnmaildir-request-article.")
 
 (defun nnmaildir--system-name ()
   (replace-regexp-in-string
+   ":" "\\072"
    (replace-regexp-in-string
-    (replace-regexp-in-string
-     (system-name)
-     "\\\\" "\\134" nil 'literal)
-    "/" "\\057" nil 'literal)
-   ":" "\\072" nil 'literal))
+    "/" "\\057"
+    (replace-regexp-in-string "\\\\" "\\134" (system-name) nil 'literal)
+    nil 'literal)
+   nil 'literal))
 
 (defun nnmaildir-request-type (_group &optional _article)
   'mail)
@@ -956,7 +956,8 @@ by nnmaildir-request-article.")
                        group (symbol-value group)
                        ro (nnmaildir--param pgname 'read-only))
                  (insert (replace-regexp-in-string
-                          (nnmaildir--grp-name group) " " "\\ " nil t)
+                          " " "\\ "
+                          (nnmaildir--grp-name group) nil t)
                          " ")
                   (princ (nnmaildir--group-maxnum nnmaildir--cur-server group)
                         nntp-server-buffer)
@@ -985,7 +986,7 @@ by nnmaildir-request-article.")
          (princ (nnmaildir--group-maxnum nnmaildir--cur-server group)
                 nntp-server-buffer)
          (insert " "
-                 (replace-regexp-in-string gname " " "\\ " nil t)
+                 (replace-regexp-in-string " " "\\ " gname nil t)
                  "\n")))))
   'group)
 
@@ -1116,7 +1117,7 @@ by nnmaildir-request-article.")
        (insert " ")
        (princ (nnmaildir--group-maxnum nnmaildir--cur-server group)
               nntp-server-buffer)
-       (insert " " (replace-regexp-in-string gname " " "\\ " nil t) "\n")
+       (insert " " (replace-regexp-in-string " " "\\ " gname nil t) "\n")
        t))))
 
 (defun nnmaildir-request-create-group (gname &optional server _args)
@@ -1278,7 +1279,7 @@ by nnmaildir-request-article.")
              (insert "\t" (nnmaildir--nov-get-beg nov) "\t"
                      (nnmaildir--art-msgid article) "\t"
                      (nnmaildir--nov-get-mid nov) "\tXref: nnmaildir "
-                     (replace-regexp-in-string gname " " "\\ " nil t) ":")
+                     (replace-regexp-in-string " " "\\ " gname nil t) ":")
              (princ num nntp-server-buffer)
              (insert "\t" (nnmaildir--nov-get-end nov) "\n"))))
     (catch 'return
index 5b471e8d7363038538dbf0f54a9e7f9d2c392974..4976f25795e83d84b9faa6f51f051ca275e985ff 100644 (file)
@@ -1078,7 +1078,6 @@ Use the nov database for the current group if available."
                (let* ((oldfile (nnml-article-to-file old-number))
                       (newfile
                        (replace-regexp-in-string
-                        oldfile
                         ;; nnml-use-compressed-files might be any string, but
                         ;; probably it's sufficient to take into account only
                         ;; "\\.[a-z0-9]+".  Note that we can't only use the
@@ -1087,7 +1086,8 @@ Use the nov database for the current group if available."
                         ;; value.
                         (concat
                          "\\(" old-number-string "\\)\\(\\(\\.[a-z0-9]+\\)?\\)$")
-                        (concat new-number-string "\\2"))))
+                        (concat new-number-string "\\2")
+                        oldfile)))
                  (with-current-buffer nntp-server-buffer
                    (nnmail-find-file oldfile)
                    ;; Update the Xref header in the article itself:
index 6d2d16ab41bff89496481339e0d861d85ceeeecb..6168e5a281b1cf64172ebf791279e60a9e62f5d4 100644 (file)
@@ -111,7 +111,7 @@ for decoding when the cdr that the data specify is not available.")
 ;;; Interface functions
 
 (defsubst nnrss-format-string (string)
-  (replace-regexp-in-string string " *\n *" " "))
+  (replace-regexp-in-string " *\n *" " " string))
 
 (defun nnrss-decode-group-name (group)
   (if (and group (mm-coding-system-p 'utf-8))
@@ -291,7 +291,7 @@ for decoding when the cdr that the data specify is not available.")
                        (let ((rfc2047-encoding-type 'mime)
                              rfc2047-encode-max-chars)
                          (rfc2047-encode-string
-                          (replace-regexp-in-string group "[\t\n ]+" "_")))))
+                          (replace-regexp-in-string "[\t\n ]+" "_" group)))))
        (when nnrss-content-function
          (funcall nnrss-content-function e group article))))
     (cond
@@ -804,9 +804,10 @@ It is useful when `(setq nnrss-use-local t)'."
                 node))
         (cleaned-text (if text
                           (replace-regexp-in-string
+                           "\r\n" "\n"
                            (replace-regexp-in-string
-                            text "^[\000-\037\177]+\\|^ +\\| +$" "")
-                           "\r\n" "\n"))))
+                            "^[\000-\037\177]+\\|^ +\\| +$" ""
+                            text)))))
     (if (string-equal "" cleaned-text)
        nil
       cleaned-text)))
index eb7d862e99c42c4402c3b0c40406766ac8634d42..0b58dc8c25b0f10f9f565bd466d04d968a33196b 100644 (file)
@@ -163,12 +163,12 @@ submitted at once.  Internal variable.")
         (concat
          "/"
          (replace-regexp-in-string
+          "/" ":"
           (replace-regexp-in-string
+           "^.*article.gmane.org/" ""
            (replace-regexp-in-string
-            (mail-header-xref (gnus-summary-article-header article))
-            "/raw" ":silent")
-           "^.*article.gmane.org/" "")
-          "/" ":"))))
+            "/raw" ":silent"
+            (mail-header-xref (gnus-summary-article-header article))))))))
        (spam-report-gmane-use-article-number
        (spam-report-url-ping
         rpt-host
@@ -207,8 +207,8 @@ submitted at once.  Internal variable.")
            (when host
              (when (string-equal "permalink.gmane.org" host)
                (setq host rpt-host)
-               (setq report (replace-regexp-in-string
-                             report "/\\([0-9]+\\)$" ":\\1")))
+               (setq report (replace-regexp-in-string "/\\([0-9]+\\)$" ":\\1"
+                                                    report)))
              (setq url (format "http://%s%s" host report)))
            (if (not (and host report url))
                (gnus-message
@@ -227,7 +227,7 @@ the function specified by `spam-report-url-ping-function'."
 
 (defcustom spam-report-user-mail-address
   (and (stringp user-mail-address)
-       (replace-regexp-in-string user-mail-address "@" "<at>"))
+       (replace-regexp-in-string "@" "<at>" user-mail-address))
   "Mail address of this user used for spam reports to Gmane.
 This is initialized based on `user-mail-address'."
   :type '(choice string
index 39181eaa62f61b931fd3c2cb583f14559cea1b8b..d3224004f15f65006191e50d19c4341babd1e328 100644 (file)
@@ -1200,18 +1200,18 @@ Note this has to be fast."
         (cond
          ((eq header 'X-Spam-Status)
           (string-to-number (replace-regexp-in-string
-                             header-content
                              spam-spamassassin-score-regexp
-                             "\\1")))
+                             "\\1"
+                             header-content)))
          ;; for CRM checking, it's probably faster to just do the string match
          ((string-match "( pR: \\([0-9.-]+\\)" header-content)
           (- (string-to-number (match-string 1 header-content))))
          ((eq header 'X-Bogosity)
           (string-to-number (replace-regexp-in-string
+                             ",.*" ""
                              (replace-regexp-in-string
-                              header-content
-                              ".*spamicity=" "")
-                             ",.*" "")))
+                              ".*spamicity=" ""
+                              header-content))))
          (t nil))
       nil)))