Make more erc function aliases obsolete

* lisp/erc/erc-compat.el (erc-propertize, erc-view-mode-enter)
(erc-function-arglist, erc-delete-dups)
(erc-replace-regexp-in-string): Make these aliases obsolete.

* lisp/erc/erc-capab.el (erc-capab-identify-add-prefix)
(erc-capab-identify-remove/set-identified-flag):
* lisp/erc/erc-dcc.el (erc-dcc-chat-parse-output)
(erc-dcc-unquote-filename, pcomplete/erc-mode/DCC):
* lisp/erc/erc-list.el (erc-list-menu-mode, erc-list-button)
(erc-list-make-string):
* lisp/erc/erc-log.el (erc-log-standardize-name):
* lisp/erc/erc-match.el (erc-log-matches-make-buffer):
* lisp/erc/erc-networks.el (erc-server-select):
* lisp/erc/erc.el (erc-message-english-PART)
(erc-update-mode-line-buffer, erc-format-my-nick)
(erc-format-@nick, erc-get-user-mode-prefix, erc-display-prompt)
(erc-part-reason-zippy, erc-quit-reason-zippy, erc-get-arglist)
(erc-toggle-debug-irc-protocol, erc-log-irc-protocol)
(erc-migrate-modules): Adjust callers.
This commit is contained in:
Stefan Kangas 2020-08-07 13:54:50 +02:00
parent b44a5d849e
commit 7ed61d6193
8 changed files with 67 additions and 67 deletions

View file

@ -170,11 +170,11 @@ PARSED is an `erc-parsed' response struct."
(string-match "^\\([-\\+]\\)\\(.+\\)$" msg))
(setf (erc-response.contents parsed)
(if erc-capab-identify-mode
(erc-propertize (match-string 2 msg)
'erc-identified
(if (string= (match-string 1 msg) "+")
1
0))
(propertize (match-string 2 msg)
'erc-identified
(if (string= (match-string 1 msg) "+")
1
0))
(match-string 2 msg)))
nil)))
@ -190,9 +190,9 @@ PARSED is an `erc-parsed' response struct."
;; assuming the first use of `nickname' is the sender's nick
(re-search-forward (regexp-quote nickname) nil t))
(goto-char (match-beginning 0))
(insert (erc-propertize erc-capab-identify-prefix
'font-lock-face
'erc-capab-identify-unidentified))))))
(insert (propertize erc-capab-identify-prefix
'font-lock-face
'erc-capab-identify-unidentified))))))
(defun erc-capab-identify-get-unidentified-nickname (parsed)
"Return the nickname of the user if unidentified.

View file

@ -43,12 +43,12 @@ Return the same string, if the encoding operation is trivial.
See `erc-encoding-coding-alist'."
(encode-coding-string s coding-system t))
(defalias 'erc-propertize 'propertize)
(defalias 'erc-view-mode-enter 'view-mode-enter)
(define-obsolete-function-alias 'erc-propertize #'propertize "28.1")
(define-obsolete-function-alias 'erc-view-mode-enter #'view-mode-enter "28.1")
(autoload 'help-function-arglist "help-fns")
(defalias 'erc-function-arglist 'help-function-arglist)
(defalias 'erc-delete-dups 'delete-dups)
(defalias 'erc-replace-regexp-in-string 'replace-regexp-in-string)
(define-obsolete-function-alias 'erc-function-arglist #'help-function-arglist "28.1")
(define-obsolete-function-alias 'erc-delete-dups #'delete-dups "28.1")
(define-obsolete-function-alias 'erc-replace-regexp-in-string #'replace-regexp-in-string "28.1")
(defun erc-set-write-file-functions (new-val)
(set (make-local-variable 'write-file-functions) new-val))

View file

@ -423,7 +423,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc."
#'(lambda (elt)
(eq (plist-get elt :type) 'CHAT))
erc-dcc-list)))
('close (erc-delete-dups
('close (delete-dups
(mapcar (lambda (elt) (symbol-name (plist-get elt :type)))
erc-dcc-list)))
('get (mapcar #'erc-dcc-nick
@ -636,8 +636,8 @@ that subcommand."
(define-inline erc-dcc-unquote-filename (filename)
(inline-quote
(erc-replace-regexp-in-string "\\\\\\\\" "\\"
(erc-replace-regexp-in-string "\\\\\"" "\"" ,filename t t) t t)))
(replace-regexp-in-string "\\\\\\\\" "\\"
(replace-regexp-in-string "\\\\\"" "\"" ,filename t t) t t)))
(defun erc-dcc-handle-ctcp-send (proc query nick login host to)
"This is called if a CTCP DCC SEND subcommand is sent to the client.
@ -1193,8 +1193,8 @@ other client."
(setq posn (match-end 0))
(erc-display-message
nil nil proc
'dcc-chat-privmsg ?n (erc-propertize erc-dcc-from 'font-lock-face
'erc-nick-default-face) ?m line))
'dcc-chat-privmsg ?n (propertize erc-dcc-from 'font-lock-face
'erc-nick-default-face) ?m line))
(setq erc-dcc-unprocessed-output (substring str posn)))))
(defun erc-dcc-chat-buffer-killed ()

View file

@ -71,13 +71,13 @@
(defun erc-list-make-string (channel users topic)
(concat
channel
(erc-propertize " "
'display (list 'space :align-to erc-list-nusers-column)
'face 'fixed-pitch)
(propertize " "
'display (list 'space :align-to erc-list-nusers-column)
'face 'fixed-pitch)
users
(erc-propertize " "
'display (list 'space :align-to erc-list-topic-column)
'face 'fixed-pitch)
(propertize " "
'display (list 'space :align-to erc-list-topic-column)
'face 'fixed-pitch)
topic))
;; Insert a record into the list buffer.
@ -143,19 +143,19 @@
;; Helper function that makes a buttonized column header.
(defun erc-list-button (title column)
(erc-propertize title
'column-number column
'help-echo "mouse-1: sort by column"
'mouse-face 'header-line-highlight
'keymap erc-list-menu-sort-button-map))
(propertize title
'column-number column
'help-echo "mouse-1: sort by column"
'mouse-face 'header-line-highlight
'keymap erc-list-menu-sort-button-map))
(define-derived-mode erc-list-menu-mode special-mode "ERC-List"
"Major mode for editing a list of irc channels."
(setq header-line-format
(concat
(erc-propertize " "
'display '(space :align-to 0)
'face 'fixed-pitch)
(propertize " "
'display '(space :align-to 0)
'face 'fixed-pitch)
(erc-list-make-string (erc-list-button "Channel" 1)
(erc-list-button "# Users" 2)
"Topic")))

View file

@ -334,7 +334,7 @@ This will not work with full paths, only names.
Any unsafe characters in the name are replaced with \"!\". The
filename is downcased."
(downcase (erc-replace-regexp-in-string
(downcase (replace-regexp-in-string
"[/\\]" "!" (convert-standard-filename filename))))
(defun erc-current-logfile (&optional buffer)

View file

@ -577,9 +577,9 @@ See `erc-log-match-format'."
(with-current-buffer buffer
(unless buffer-already
(insert " == Type \"q\" to dismiss messages ==\n")
(erc-view-mode-enter nil (lambda (buffer)
(when (y-or-n-p "Discard messages? ")
(kill-buffer buffer)))))
(view-mode-enter nil (lambda (buffer)
(when (y-or-n-p "Discard messages? ")
(kill-buffer buffer)))))
buffer)))
(defun erc-log-matches-come-back (proc parsed)

View file

@ -812,7 +812,7 @@ As an example:
(let* ((completion-ignore-case t)
(net (intern
(completing-read "Network: "
(erc-delete-dups
(delete-dups
(mapcar (lambda (x)
(list (symbol-name (nth 1 x))))
erc-server-alist)))))

View file

@ -1863,7 +1863,7 @@ buffer rather than a server buffer.")
;; modify `transforms' to specify what needs to be changed
;; each item is in the format '(old . new)
(let ((transforms '((pcomplete . completion))))
(erc-delete-dups
(delete-dups
(mapcar (lambda (m) (or (cdr (assoc m transforms)) m))
mods))))
@ -2316,7 +2316,7 @@ and appears in face `erc-input-face' in the buffer."
(setq result (concat result network-name
" << " line "\n")))
result)
(erc-propertize
(propertize
(concat network-name " >> " string
(if (/= ?\n
(aref string
@ -2339,7 +2339,7 @@ If ARG is non-nil, show the *erc-protocol* buffer."
(interactive "P")
(let* ((buf (get-buffer-create "*erc-protocol*")))
(with-current-buffer buf
(erc-view-mode-enter)
(view-mode-enter)
(when (null (current-local-map))
(let ((inhibit-read-only t))
(insert (erc-make-notice "This buffer displays all IRC protocol traffic exchanged with each server.\n"))
@ -2773,7 +2773,7 @@ See also `erc-server-send'."
(defun erc-get-arglist (fun)
"Return the argument list of a function without the parens."
(let ((arglist (format "%S" (erc-function-arglist fun))))
(let ((arglist (format "%S" (help-function-arglist fun))))
(if (string-match "\\`(\\(.*\\))\\'" arglist)
(match-string 1 arglist)
arglist)))
@ -3558,7 +3558,7 @@ If S is non-nil, it will be used as the quit reason."
If S is non-nil, it will be used as the quit reason."
(or s
(if (fboundp 'yow)
(erc-replace-regexp-in-string "\n" "" (yow))
(replace-regexp-in-string "\n" "" (yow))
(erc-quit/part-reason-default))))
(make-obsolete 'erc-quit-reason-zippy "it will be removed." "24.4")
@ -3585,7 +3585,7 @@ If S is non-nil, it will be used as the part reason."
If S is non-nil, it will be used as the quit reason."
(or s
(if (fboundp 'yow)
(erc-replace-regexp-in-string "\n" "" (yow))
(replace-regexp-in-string "\n" "" (yow))
(erc-quit/part-reason-default))))
(make-obsolete 'erc-part-reason-zippy "it will be removed." "24.4")
@ -4001,13 +4001,13 @@ If FACE is non-nil, it will be used to propertize the prompt. If it is nil,
;; Do not extend the text properties when typing at the end
;; of the prompt, but stuff typed in front of the prompt
;; shall remain part of the prompt.
(setq prompt (erc-propertize prompt
'start-open t ; XEmacs
'rear-nonsticky t ; Emacs
'erc-prompt t
'field t
'front-sticky t
'read-only t))
(setq prompt (propertize prompt
'start-open t ; XEmacs
'rear-nonsticky t ; Emacs
'erc-prompt t
'field t
'front-sticky t
'read-only t))
(erc-put-text-property 0 (1- (length prompt))
'font-lock-face (or face 'erc-prompt-face)
prompt)
@ -4390,15 +4390,15 @@ See also `erc-format-nick-function'."
(defun erc-get-user-mode-prefix (user)
(when user
(cond ((erc-channel-user-owner-p user)
(erc-propertize "~" 'help-echo "owner"))
(propertize "~" 'help-echo "owner"))
((erc-channel-user-admin-p user)
(erc-propertize "&" 'help-echo "admin"))
(propertize "&" 'help-echo "admin"))
((erc-channel-user-op-p user)
(erc-propertize "@" 'help-echo "operator"))
(propertize "@" 'help-echo "operator"))
((erc-channel-user-halfop-p user)
(erc-propertize "%" 'help-echo "half-op"))
(propertize "%" 'help-echo "half-op"))
((erc-channel-user-voice-p user)
(erc-propertize "+" 'help-echo "voice"))
(propertize "+" 'help-echo "voice"))
(t ""))))
(defun erc-format-@nick (&optional user _channel-data)
@ -4409,7 +4409,7 @@ prefix. Use CHANNEL-DATA to determine op and voice status. See
also `erc-format-nick-function'."
(when user
(let ((nick (erc-server-user-nickname user)))
(concat (erc-propertize
(concat (propertize
(erc-get-user-mode-prefix nick)
'font-lock-face 'erc-nick-prefix-face)
nick))))
@ -4422,12 +4422,12 @@ also `erc-format-nick-function'."
(nick (erc-current-nick))
(mode (erc-get-user-mode-prefix nick)))
(concat
(erc-propertize open 'font-lock-face 'erc-default-face)
(erc-propertize mode 'font-lock-face 'erc-my-nick-prefix-face)
(erc-propertize nick 'font-lock-face 'erc-my-nick-face)
(erc-propertize close 'font-lock-face 'erc-default-face)))
(propertize open 'font-lock-face 'erc-default-face)
(propertize mode 'font-lock-face 'erc-my-nick-prefix-face)
(propertize nick 'font-lock-face 'erc-my-nick-face)
(propertize close 'font-lock-face 'erc-default-face)))
(let ((prefix "> "))
(erc-propertize prefix 'font-lock-face 'erc-default-face))))
(propertize prefix 'font-lock-face 'erc-default-face))))
(defun erc-echo-notice-in-default-buffer (s parsed buffer _sender)
"Echos a private notice in the default buffer, namely the
@ -6489,16 +6489,16 @@ if `erc-away' is non-nil."
(fill-region (point-min) (point-max))
(buffer-string))))
(setq header-line-format
(erc-replace-regexp-in-string
(replace-regexp-in-string
"%"
"%%"
(if face
(erc-propertize header 'help-echo help-echo
'face face)
(erc-propertize header 'help-echo help-echo))))))
(propertize header 'help-echo help-echo
'face face)
(propertize header 'help-echo help-echo))))))
(t (setq header-line-format
(if face
(erc-propertize header 'face face)
(propertize header 'face face)
header)))))))
(force-mode-line-update)))
@ -6765,7 +6765,7 @@ functions."
nick user host channel
(if (not (string= reason ""))
(format ": %s"
(erc-replace-regexp-in-string "%" "%%" reason))
(replace-regexp-in-string "%" "%%" reason))
"")))))