aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/obsolete
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/obsolete')
-rw-r--r--lisp/obsolete/erc-compat.el164
-rw-r--r--lisp/obsolete/tpu-edt.el12
2 files changed, 165 insertions, 11 deletions
diff --git a/lisp/obsolete/erc-compat.el b/lisp/obsolete/erc-compat.el
new file mode 100644
index 00000000000..7ef30d822ff
--- /dev/null
+++ b/lisp/obsolete/erc-compat.el
@@ -0,0 +1,164 @@
1;;; erc-compat.el --- ERC compatibility code for XEmacs
2
3;; Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc.
4
5;; Author: Alex Schroeder <alex@gnu.org>
6;; Maintainer: Amin Bandali <bandali@gnu.org>
7;; URL: https://www.emacswiki.org/emacs/ERC
8;; Obsolete-since: 28.1
9
10;; This file is part of GNU Emacs.
11
12;; GNU Emacs is free software: you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation, either version 3 of the License, or
15;; (at your option) any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
24
25;;; Commentary:
26
27;; This mostly defines stuff that cannot be worked around easily.
28
29;;; Code:
30
31(require 'format-spec)
32
33;;;###autoload(autoload 'erc-define-minor-mode "erc-compat")
34(defalias 'erc-define-minor-mode 'define-minor-mode)
35(put 'erc-define-minor-mode 'edebug-form-spec 'define-minor-mode)
36
37(defun erc-decode-coding-string (s coding-system)
38 "Decode S using CODING-SYSTEM."
39 (decode-coding-string s coding-system t))
40
41(defun erc-encode-coding-string (s coding-system)
42 "Encode S using CODING-SYSTEM.
43Return the same string, if the encoding operation is trivial.
44See `erc-encoding-coding-alist'."
45 (encode-coding-string s coding-system t))
46
47(define-obsolete-function-alias 'erc-propertize #'propertize "28.1")
48(define-obsolete-function-alias 'erc-view-mode-enter #'view-mode-enter "28.1")
49(autoload 'help-function-arglist "help-fns")
50(define-obsolete-function-alias 'erc-function-arglist #'help-function-arglist "28.1")
51(define-obsolete-function-alias 'erc-delete-dups #'delete-dups "28.1")
52(define-obsolete-function-alias 'erc-replace-regexp-in-string #'replace-regexp-in-string "28.1")
53
54(defun erc-set-write-file-functions (new-val)
55 (set (make-local-variable 'write-file-functions) new-val))
56
57(defvar erc-emacs-build-time
58 (if (or (stringp emacs-build-time) (not emacs-build-time))
59 emacs-build-time
60 (format-time-string "%Y-%m-%d" emacs-build-time))
61 "Time at which Emacs was dumped out, or nil if not available.")
62
63;; Emacs 21 and XEmacs do not have user-emacs-directory, but XEmacs
64;; has user-init-directory.
65(defvar erc-user-emacs-directory
66 (cond ((boundp 'user-emacs-directory)
67 user-emacs-directory)
68 ((boundp 'user-init-directory)
69 user-init-directory)
70 (t "~/.emacs.d/"))
71 "Directory beneath which additional per-user Emacs-specific files
72are placed.
73Note that this should end with a directory separator.")
74
75(defun erc-replace-match-subexpression-in-string
76 (newtext string match subexp start &optional fixedcase literal)
77 "Replace the subexpression SUBEXP of the last match in STRING with NEWTEXT.
78MATCH is the text which matched the subexpression (see `match-string').
79START is the beginning position of the last match (see `match-beginning').
80See `replace-match' for explanations of FIXEDCASE and LITERAL."
81 (replace-match newtext fixedcase literal string subexp))
82
83(define-obsolete-function-alias 'erc-with-selected-window
84 #'with-selected-window "28.1")
85(define-obsolete-function-alias 'erc-cancel-timer #'cancel-timer "28.1")
86(define-obsolete-function-alias 'erc-make-obsolete #'make-obsolete "28.1")
87(define-obsolete-function-alias 'erc-make-obsolete-variable
88 #'make-obsolete-variable "28.1")
89
90;; Provide a simpler replacement for `member-if'
91(defun erc-member-if (predicate list)
92 "Find the first item satisfying PREDICATE in LIST.
93Return the sublist of LIST whose car matches."
94 (let ((ptr list))
95 (catch 'found
96 (while ptr
97 (when (funcall predicate (car ptr))
98 (throw 'found ptr))
99 (setq ptr (cdr ptr))))))
100
101;; Provide a simpler replacement for `delete-if'
102(defun erc-delete-if (predicate seq)
103 "Remove all items satisfying PREDICATE in SEQ.
104This is a destructive function: it reuses the storage of SEQ
105whenever possible."
106 ;; remove from car
107 (while (when (funcall predicate (car seq))
108 (setq seq (cdr seq))))
109 ;; remove from cdr
110 (let ((ptr seq)
111 (next (cdr seq)))
112 (while next
113 (when (funcall predicate (car next))
114 (setcdr ptr (if (consp next)
115 (cdr next)
116 nil)))
117 (setq ptr (cdr ptr))
118 (setq next (cdr ptr))))
119 seq)
120
121;; Provide a simpler replacement for `remove-if-not'
122(defun erc-remove-if-not (predicate seq)
123 "Remove all items not satisfying PREDICATE in SEQ.
124This is a non-destructive function; it makes a copy of SEQ to
125avoid corrupting the original SEQ."
126 (let (newseq)
127 (dolist (el seq)
128 (when (funcall predicate el)
129 (setq newseq (cons el newseq))))
130 (nreverse newseq)))
131
132;; Copied from cl-extra.el
133(defun erc-subseq (seq start &optional end)
134 "Return the subsequence of SEQ from START to END.
135If END is omitted, it defaults to the length of the sequence.
136If START or END is negative, it counts from the end."
137 (if (stringp seq) (substring seq start end)
138 (let (len)
139 (and end (< end 0) (setq end (+ end (setq len (length seq)))))
140 (if (< start 0) (setq start (+ start (or len (setq len (length seq))))))
141 (cond ((listp seq)
142 (if (> start 0) (setq seq (nthcdr start seq)))
143 (if end
144 (let ((res nil))
145 (while (>= (setq end (1- end)) start)
146 (push (pop seq) res))
147 (nreverse res))
148 (copy-sequence seq)))
149 (t
150 (or end (setq end (or len (length seq))))
151 (let ((res (make-vector (max (- end start) 0) nil))
152 (i 0))
153 (while (< start end)
154 (aset res i (aref seq start))
155 (setq i (1+ i) start (1+ start)))
156 res))))))
157
158(provide 'erc-compat)
159
160;;; erc-compat.el ends here
161;;
162;; Local Variables:
163;; generated-autoload-file: "erc-loaddefs.el"
164;; End:
diff --git a/lisp/obsolete/tpu-edt.el b/lisp/obsolete/tpu-edt.el
index d71f79c87be..0de7aa096d6 100644
--- a/lisp/obsolete/tpu-edt.el
+++ b/lisp/obsolete/tpu-edt.el
@@ -287,14 +287,6 @@
287;;; 287;;;
288;;; User Configurable Variables 288;;; User Configurable Variables
289;;; 289;;;
290(defcustom tpu-have-ispell t
291 "Non-nil means `tpu-spell-check' uses `ispell-region' for spell checking.
292Otherwise, use `spell-region'."
293 :type 'boolean
294 :group 'tpu)
295(make-obsolete-variable 'tpu-have-ispell "the `spell' package is obsolete."
296 "23.1")
297
298(defcustom tpu-kill-buffers-silently nil 290(defcustom tpu-kill-buffers-silently nil
299 "If non-nil, TPU-edt kills modified buffers without asking." 291 "If non-nil, TPU-edt kills modified buffers without asking."
300 :type 'boolean 292 :type 'boolean
@@ -315,7 +307,6 @@ Otherwise, use `spell-region'."
315;;; Global Keymaps 307;;; Global Keymaps
316;;; 308;;;
317 309
318(define-obsolete-variable-alias 'GOLD-map 'tpu-gold-map "23.1")
319(defvar tpu-gold-map 310(defvar tpu-gold-map
320 (let ((map (make-keymap))) 311 (let ((map (make-keymap)))
321 ;; Previously we used escape sequences here. We now instead presume 312 ;; Previously we used escape sequences here. We now instead presume
@@ -892,8 +883,7 @@ With argument, fill and justify."
892if no region is selected." 883if no region is selected."
893 (interactive) 884 (interactive)
894 (let ((m (tpu-mark))) 885 (let ((m (tpu-mark)))
895 (apply (if tpu-have-ispell 'ispell-region 886 (apply 'ispell-region
896 'spell-region)
897 (if m 887 (if m
898 (if (> m (point)) (list (point) m) 888 (if (> m (point)) (list (point) m)
899 (list m (point))) 889 (list m (point)))