* 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.
;; 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)
(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)
(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))
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)
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))
(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)
(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;
(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")
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)
;; 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)
: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))
(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"
(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 " "))
(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))
(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))
(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)))
;; 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
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"