]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove several gnus-util compat functions
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 13 Feb 2016 06:40:34 +0000 (17:40 +1100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 13 Feb 2016 06:40:34 +0000 (17:40 +1100)
* lisp/gnus/gnus-util.el (gnus-set-process-query-on-exit-flag): Remove.
(gnus-read-shell-command): Remove.
(gnus-match-substitute-replacement): Remove.
(gnus-string-match-p): Remove.
(gnus-string-prefix-p): Remove.

12 files changed:
lisp/gnus/gnus-art.el
lisp/gnus/gnus-msg.el
lisp/gnus/gnus-notifications.el
lisp/gnus/gnus-sum.el
lisp/gnus/gnus-util.el
lisp/gnus/mm-decode.el
lisp/gnus/mml-sec.el
lisp/gnus/nnimap.el
lisp/gnus/nnir.el
lisp/gnus/nnmaildir.el
lisp/gnus/nntp.el
lisp/gnus/spam-report.el

index e22d422c548457f3ade688873244dc8407014105..4858c2a663ee9e9a1dedf2908fabbc53bf62b091 100644 (file)
@@ -2459,7 +2459,7 @@ long lines if and only if arg is positive."
                   ;; The command is a string, so we interpret the command
                   ;; as a, well, command, and fork it off.
                   (let ((process-connection-type nil))
-                    (gnus-set-process-query-on-exit-flag
+                    (set-process-query-on-exit-flag
                      (start-process
                       "article-x-face" nil shell-file-name
                       shell-command-switch gnus-article-x-face-command)
@@ -4126,8 +4126,7 @@ and the raw article including all headers will be piped."
       (setq command
            (if (and (eq command 'default) default)
                default
-             (gnus-read-shell-command "Shell command on this article: "
-                                      default))))
+             (read-shell-command "Shell command on this article: " default))))
     (when (string-equal command "")
       (if default
          (setq command default)
index 43a496942e31522f8443433ff5a202cafea63944..e2b8dcc51e4bee49d367cab8a584c8fdd9e4f1a9 100644 (file)
@@ -1904,10 +1904,10 @@ this is a reply."
                  (cond
                   ((stringp value)
                    (if (and matched-string
-                            (gnus-string-match-p "\\\\[&[:digit:]]" value)
+                            (string-match-p "\\\\[&[:digit:]]" value)
                             (match-beginning 1))
-                       (gnus-match-substitute-replacement value nil nil
-                                                          matched-string)
+                       (match-substitute-replacement value nil nil
+                                                     matched-string)
                      value))
                   ((or (symbolp value)
                        (functionp value))
index d0b0202788ddd07fdc07a31be5ce410c31777a88..2f6d6a8b61961d8af42be7729386665e3b4f910b 100644 (file)
@@ -182,8 +182,9 @@ This is typically a function to add in
                                address
                                (cond ((functionp gnus-ignored-from-addresses)
                                       (funcall gnus-ignored-from-addresses address))
-                                     (t (gnus-string-match-p (gnus-ignored-from-addresses)
-                                                             address))))
+                                     (t (string-match-p
+                                        (gnus-ignored-from-addresses)
+                                        address))))
                     (let* ((photo-file (gnus-notifications-get-photo-file address))
                            (notification-id (gnus-notifications-notify
                                              (or (car address-components) address)
index 2c87ba1573ad69aa20ee764634c1926c486aa5f5..a20816054bcebadf886ff9645f1d3be6f37f7cdc 100644 (file)
@@ -12061,7 +12061,7 @@ no matter what the properties `:decode' and `:headers' are."
         command result)
     (unless (numberp (car articles))
       (error "No article to pipe"))
-    (setq command (gnus-read-shell-command
+    (setq command (read-shell-command
                   (concat "Shell command on "
                           (if (cdr articles)
                               (format "these %d articles" (length articles))
index 23c6cd92cfb4b07f39d9fa3eeff42a3edd773e57..5e6b66dfb4bf76cbca410e87343ae714728f6f53 100644 (file)
@@ -1656,15 +1656,6 @@ empty directories from OLD-PATH."
   (ignore-errors
     (set-file-modes filename mode)))
 
-(if (fboundp 'set-process-query-on-exit-flag)
-    (defalias 'gnus-set-process-query-on-exit-flag
-      'set-process-query-on-exit-flag)
-  (defalias 'gnus-set-process-query-on-exit-flag
-    'process-kill-without-query))
-
-(defalias 'gnus-read-shell-command
-  (if (fboundp 'read-shell-command) 'read-shell-command 'read-string))
-
 (declare-function image-size "image.c" (spec &optional pixels frame))
 
 (defun gnus-rescale-image (image size)
@@ -1715,48 +1706,6 @@ The first found will be returned if a file has hard or symbolic links."
                      (memq elem list))))
     found))
 
-(eval-and-compile
-  (cond
-   ((fboundp 'match-substitute-replacement)
-    (defalias 'gnus-match-substitute-replacement 'match-substitute-replacement))
-   (t
-    (defun gnus-match-substitute-replacement (replacement &optional fixedcase literal string subexp)
-      "Return REPLACEMENT as it will be inserted by `replace-match'.
-In other words, all back-references in the form `\\&' and `\\N'
-are substituted with actual strings matched by the last search.
-Optional FIXEDCASE, LITERAL, STRING and SUBEXP have the same
-meaning as for `replace-match'.
-
-This is the definition of match-substitute-replacement in subr.el from GNU Emacs."
-      (let ((match (match-string 0 string)))
-       (save-match-data
-         (set-match-data (mapcar (lambda (x)
-                                   (if (numberp x)
-                                       (- x (match-beginning 0))
-                                     x))
-                                 (match-data t)))
-         (replace-match replacement fixedcase literal match subexp)))))))
-
-(if (fboundp 'string-match-p)
-    (defalias 'gnus-string-match-p 'string-match-p)
-  (defsubst gnus-string-match-p (regexp string &optional start)
-    "\
-Same as `string-match' except this function does not change the match data."
-    (save-match-data
-      (string-match regexp string start))))
-
-(if (fboundp 'string-prefix-p)
-    (defalias 'gnus-string-prefix-p 'string-prefix-p)
-  (defun gnus-string-prefix-p (str1 str2 &optional ignore-case)
-    "Return non-nil if STR1 is a prefix of STR2.
-If IGNORE-CASE is non-nil, the comparison is done without paying attention
-to case differences."
-    (and (<= (length str1) (length str2))
-        (let ((prefix (substring str2 0 (length str1))))
-          (if ignore-case
-              (string-equal (downcase str1) (downcase prefix))
-            (string-equal str1 prefix))))))
-
 (defun gnus-test-list (list predicate)
   "To each element of LIST apply PREDICATE.
 Return nil if LIST is no list or is empty or some test returns nil;
index 383aeded66fc35f80d10ce4632d341c36b7ee664..28b08af243982774bbe8100660e109819bee71a5 100644 (file)
@@ -28,7 +28,6 @@
 (eval-when-compile (require 'cl))
 
 (autoload 'gnus-map-function "gnus-util")
-(autoload 'gnus-read-shell-command "gnus-util")
 
 (autoload 'mm-inline-partial "mm-partial")
 (autoload 'mm-inline-external-body "mm-extern")
@@ -1451,7 +1450,7 @@ text/\\(\\sw+\\)\\(?:;\\s-*charset=\\([^\"'>]+\\)\\)?[^>]*>" nil t)
 Use CMD as the process."
   (let ((name (mail-content-type-get (mm-handle-type handle) 'name))
        (command (or cmd
-                    (gnus-read-shell-command
+                    (read-shell-command
                      "Shell command on MIME part: " mm-last-shell-command))))
     (mm-with-unibyte-buffer
       (mm-insert-part handle)
index 4744187994ac50fd66dc1e20b9876c3246080341..bc7c0ac52107991631b49630cafdb51cf689efdc 100644 (file)
@@ -704,9 +704,9 @@ be present in the keyring."
                       ;; In contrast, signing requires secret key.
                       (mml-secure-secret-key-exists-p context subkey))
                   (or (not fingerprint)
-                      (gnus-string-match-p (concat fingerprint "$") fpr)
-                      (gnus-string-match-p (concat fingerprint "$")
-                                           (epg-sub-key-fingerprint subkey))))
+                      (string-match-p (concat fingerprint "$") fpr)
+                      (string-match-p (concat fingerprint "$")
+                                      (epg-sub-key-fingerprint subkey))))
              (throw 'break t)))))))
 
 (defun mml-secure-find-usable-keys (context name usage &optional justone)
index eefe1a140b7555c7531df6f3a1c18b39d9c899ce..a53d6cd11c0fe161c1eb7718bf171ffe6dc7bb5e 100644 (file)
@@ -437,7 +437,7 @@ textual parts.")
               :success " OK "
               :starttls-function
               (lambda (capabilities)
-                (when (gnus-string-match-p "STARTTLS" capabilities)
+                (when (string-match-p "STARTTLS" capabilities)
                   "1 STARTTLS\r\n"))))
             (stream (car stream-list))
             (props (cdr stream-list))
@@ -459,15 +459,15 @@ textual parts.")
              (nnheader-report 'nnimap "Unable to contact %s:%s via %s"
                               nnimap-address (car ports) nnimap-stream)
              'no-connect)
-         (gnus-set-process-query-on-exit-flag stream nil)
-         (if (not (gnus-string-match-p "[*.] \\(OK\\|PREAUTH\\)" greeting))
+         (set-process-query-on-exit-flag stream nil)
+         (if (not (string-match-p "[*.] \\(OK\\|PREAUTH\\)" greeting))
              (nnheader-report 'nnimap "%s" greeting)
            ;; Store the greeting (for debugging purposes).
            (setf (nnimap-greeting nnimap-object) greeting)
            (setf (nnimap-capabilities nnimap-object)
                  (mapcar #'upcase
                          (split-string capabilities)))
-           (unless (gnus-string-match-p "[*.] PREAUTH" greeting)
+           (unless (string-match-p "[*.] PREAUTH" greeting)
              (if (not (setq credentials
                             (if (eq nnimap-authenticator 'anonymous)
                                 (list "anonymous"
index 7614002a92018436463a83b21628a92d8616ba05..6c2d11396cb549a095dbab9f03e6de21d00bfc1e 100644 (file)
@@ -1669,7 +1669,7 @@ actually)."
             (server (cadr (gnus-server-to-method srv)))
             (groupspec (mapconcat
                         (lambda (x)
-                          (if (gnus-string-match-p "gmane" x)
+                          (if (string-match-p "gmane" x)
                               (format "group:%s" (gnus-group-short-name x))
                             (error "Can't search non-gmane groups: %s" x)))
                           groups " "))
index e34a13b45614bc41bf7ef774eca89a47c96110d8..cebdc95876fec189765e3b6a47f1ee2a1987d87e 100644 (file)
@@ -97,14 +97,14 @@ See `nnmaildir-flag-mark-mapping'."
 
 (defun nnmaildir--ensure-suffix (filename)
   "Ensure that FILENAME contains the suffix \":2,\"."
-  (if (gnus-string-match-p ":2," filename)
+  (if (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 (gnus-string-match-p "^:2," suffix)
+  (unless (string-match-p "^:2," suffix)
     (error "Invalid suffix `%s'" suffix))
   (let* ((flags (substring suffix 3))
         (flags-as-list (append flags nil))
@@ -117,7 +117,7 @@ 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 (gnus-string-match-p "^:2," suffix)
+  (unless (string-match-p "^:2," suffix)
     (error "Invalid suffix `%s'" suffix))
   (let* ((flags (substring suffix 3))
         (flags-as-list (append flags nil))
@@ -848,11 +848,11 @@ by nnmaildir-request-article.")
              (when (or
                     ;; first look for marks in suffix, if it's valid...
                     (when (and (stringp suffix)
-                               (gnus-string-prefix-p ":2," suffix))
+                               (string-prefix-p ":2," suffix))
                       (or
-                       (not (gnus-string-match-p
+                       (not (string-match-p
                              (string (nnmaildir--mark-to-flag 'read)) suffix))
-                       (gnus-string-match-p
+                       (string-match-p
                         (string (nnmaildir--mark-to-flag 'tick)) suffix)))
                     ;; then look in marks directories
                     (not (file-exists-p (concat cdir prefix)))
index 6108b5a77685b3a8e468b024679a343ea785bbcc..e6483c2046ad2136d57032804d2fd8a05af62190 100644 (file)
@@ -1302,7 +1302,7 @@ If SEND-IF-FORCE, only send authinfo to the server if the
         ;; Use TCP-keepalive so that connections that pass through a NAT router
         ;; don't hang when left idle.
         (set-network-process-option process :keepalive t))
-      (gnus-set-process-query-on-exit-flag process nil)
+      (set-process-query-on-exit-flag process nil)
       (if (and (nntp-wait-for process "^2.*\n" buffer nil t)
               (memq (process-status process) '(open run)))
          (prog1
index 0b58dc8c25b0f10f9f565bd466d04d968a33196b..88854e0425355fa2b855936e34d6c5db373108d1 100644 (file)
@@ -255,7 +255,7 @@ This is initialized based on `user-mail-address'."
                 80))
          (error "Could not open connection to %s" host))
       (set-marker (process-mark tcp-connection) (point-min))
-      (gnus-set-process-query-on-exit-flag tcp-connection nil)
+      (set-process-query-on-exit-flag tcp-connection nil)
       (process-send-string
        tcp-connection
        (format "GET %s HTTP/1.1\nUser-Agent: %s\nHost: %s\n\n"