Explicitly make the rest of erc-compat.el obsolete
* lisp/obsolete/erc-compat.el (erc-decode-coding-string) (erc-encode-coding-string, erc-set-write-file-functions) (erc-emacs-build-time, erc-replace-match-subexpression-in-string) (erc-member-if, erc-delete-if, erc-remove-if-not, erc-subseq): Explicitly declare obsolete. (erc-define-minor-mode): Make into obsolete function alias for 'define-minor-mode'. (erc-user-emacs-directory): Make into obsolete variable alias for 'user-emacs-directory'.
This commit is contained in:
parent
8bb28e740d
commit
dd60f94747
1 changed files with 15 additions and 16 deletions
|
@ -31,16 +31,19 @@
|
|||
(require 'format-spec)
|
||||
|
||||
;;;###autoload(autoload 'erc-define-minor-mode "erc-compat")
|
||||
(defalias 'erc-define-minor-mode #'define-minor-mode)
|
||||
(define-obsolete-function-alias 'erc-define-minor-mode
|
||||
#'define-minor-mode "28.1")
|
||||
|
||||
(defun erc-decode-coding-string (s coding-system)
|
||||
"Decode S using CODING-SYSTEM."
|
||||
(declare (obsolete decode-coding-string "28.1"))
|
||||
(decode-coding-string s coding-system t))
|
||||
|
||||
(defun erc-encode-coding-string (s coding-system)
|
||||
"Encode S using CODING-SYSTEM.
|
||||
Return the same string, if the encoding operation is trivial.
|
||||
See `erc-encoding-coding-alist'."
|
||||
(declare (obsolete encode-coding-string "28.1"))
|
||||
(encode-coding-string s coding-system t))
|
||||
|
||||
(define-obsolete-function-alias 'erc-propertize #'propertize "28.1")
|
||||
|
@ -51,6 +54,7 @@ See `erc-encoding-coding-alist'."
|
|||
(define-obsolete-function-alias 'erc-replace-regexp-in-string #'replace-regexp-in-string "28.1")
|
||||
|
||||
(defun erc-set-write-file-functions (new-val)
|
||||
(declare (obsolete nil "28.1"))
|
||||
(set (make-local-variable 'write-file-functions) new-val))
|
||||
|
||||
(defvar erc-emacs-build-time
|
||||
|
@ -58,18 +62,8 @@ See `erc-encoding-coding-alist'."
|
|||
emacs-build-time
|
||||
(format-time-string "%Y-%m-%d" emacs-build-time))
|
||||
"Time at which Emacs was dumped out, or nil if not available.")
|
||||
|
||||
;; Emacs 21 and XEmacs do not have user-emacs-directory, but XEmacs
|
||||
;; has user-init-directory.
|
||||
(defvar erc-user-emacs-directory
|
||||
(cond ((boundp 'user-emacs-directory)
|
||||
user-emacs-directory)
|
||||
((boundp 'user-init-directory)
|
||||
user-init-directory)
|
||||
(t "~/.emacs.d/"))
|
||||
"Directory beneath which additional per-user Emacs-specific files
|
||||
are placed.
|
||||
Note that this should end with a directory separator.")
|
||||
(make-obsolete-variable 'erc-emacs-build-time 'emacs-build-time "28.1")
|
||||
(define-obsolete-variable-alias 'erc-user-emacs-directory 'user-emacs-directory "28.1")
|
||||
|
||||
(defun erc-replace-match-subexpression-in-string
|
||||
(newtext string _match subexp _start &optional fixedcase literal)
|
||||
|
@ -77,6 +71,7 @@ Note that this should end with a directory separator.")
|
|||
MATCH is the text which matched the subexpression (see `match-string').
|
||||
START is the beginning position of the last match (see `match-beginning').
|
||||
See `replace-match' for explanations of FIXEDCASE and LITERAL."
|
||||
(declare (obsolete replace-match "28.1"))
|
||||
(replace-match newtext fixedcase literal string subexp))
|
||||
|
||||
(define-obsolete-function-alias 'erc-with-selected-window
|
||||
|
@ -86,10 +81,11 @@ See `replace-match' for explanations of FIXEDCASE and LITERAL."
|
|||
(define-obsolete-function-alias 'erc-make-obsolete-variable
|
||||
#'make-obsolete-variable "28.1")
|
||||
|
||||
;; Provide a simpler replacement for `member-if'
|
||||
;; Provide a simpler replacement for `cl-member-if'
|
||||
(defun erc-member-if (predicate list)
|
||||
"Find the first item satisfying PREDICATE in LIST.
|
||||
Return the sublist of LIST whose car matches."
|
||||
(declare (obsolete cl-member-if "28.1"))
|
||||
(let ((ptr list))
|
||||
(catch 'found
|
||||
(while ptr
|
||||
|
@ -97,11 +93,12 @@ Return the sublist of LIST whose car matches."
|
|||
(throw 'found ptr))
|
||||
(setq ptr (cdr ptr))))))
|
||||
|
||||
;; Provide a simpler replacement for `delete-if'
|
||||
;; Provide a simpler replacement for `cl-delete-if'
|
||||
(defun erc-delete-if (predicate seq)
|
||||
"Remove all items satisfying PREDICATE in SEQ.
|
||||
This is a destructive function: it reuses the storage of SEQ
|
||||
whenever possible."
|
||||
(declare (obsolete cl-delete-if "28.1"))
|
||||
;; remove from car
|
||||
(while (when (funcall predicate (car seq))
|
||||
(setq seq (cdr seq))))
|
||||
|
@ -117,11 +114,12 @@ whenever possible."
|
|||
(setq next (cdr ptr))))
|
||||
seq)
|
||||
|
||||
;; Provide a simpler replacement for `remove-if-not'
|
||||
;; Provide a simpler replacement for `cl-remove-if-not'
|
||||
(defun erc-remove-if-not (predicate seq)
|
||||
"Remove all items not satisfying PREDICATE in SEQ.
|
||||
This is a non-destructive function; it makes a copy of SEQ to
|
||||
avoid corrupting the original SEQ."
|
||||
(declare (obsolete cl-remove-if-not "28.1"))
|
||||
(let (newseq)
|
||||
(dolist (el seq)
|
||||
(when (funcall predicate el)
|
||||
|
@ -133,6 +131,7 @@ avoid corrupting the original SEQ."
|
|||
"Return the subsequence of SEQ from START to END.
|
||||
If END is omitted, it defaults to the length of the sequence.
|
||||
If START or END is negative, it counts from the end."
|
||||
(declare (obsolete cl-subseq "28.1"))
|
||||
(if (stringp seq) (substring seq start end)
|
||||
(let (len)
|
||||
(and end (< end 0) (setq end (+ end (setq len (length seq)))))
|
||||
|
|
Loading…
Add table
Reference in a new issue