emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master dd60f94: Explicitly make the rest of erc-compat.el obsolete


From: Stefan Kangas
Subject: master dd60f94: Explicitly make the rest of erc-compat.el obsolete
Date: Sun, 26 Sep 2021 12:16:22 -0400 (EDT)

branch: master
commit dd60f94747d2ad2115fa6aefd3c556da7243e1a9
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    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'.
---
 lisp/obsolete/erc-compat.el | 31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/lisp/obsolete/erc-compat.el b/lisp/obsolete/erc-compat.el
index 9972e92..ef47ab7 100644
--- a/lisp/obsolete/erc-compat.el
+++ b/lisp/obsolete/erc-compat.el
@@ -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)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]