Commit 9efc29a2 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen
Browse files

Remove several gnus-util compat functions

* 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.
parent 9bcefcf0
......@@ -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)
......
......@@ -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))
......
......@@ -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)
......
......@@ -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))
......
......@@ -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;
......
......@@ -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)
......
......@@ -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)
......
......@@ -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"
......
......@@ -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 " "))
......
......@@ -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)))
......
......@@ -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
......
......@@ -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"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment