Mercurial > hg > xemacs-beta
annotate lisp/obsolete.el @ 5635:2fc3f2f35523
Put back compatibility alias for #'cl-puthash, used by 21.4's setf expansion
2012-01-02 Aidan Kehoe <kehoea@parhasard.net>
* obsolete.el (cl-puthash): Put back a compatibility alias for
this, setf-expansion of #'gethash calls it on 21.4, so it will
occur in packages for a while to come.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Mon, 02 Jan 2012 13:35:31 +0000 |
parents | 10f179710250 |
children | cc6f0266bc36 |
rev | line source |
---|---|
428 | 1 ;;; obsolete.el --- obsoleteness support |
2 | |
3 ;; Copyright (C) 1985-1994, 1997 Free Software Foundation, Inc. | |
4 ;; Copyright (C) 1994, 1995 Amdahl Corporation. | |
5 ;; Copyright (C) 1995 Sun Microsystems. | |
5175 | 6 ;; Copyright (C) 2002, 2004, 2010 Ben Wing. |
428 | 7 |
8 ;; Maintainer: XEmacs Development Team | |
9 ;; Keywords: internal, dumped | |
10 | |
11 ;; This file is part of XEmacs. | |
12 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5255
diff
changeset
|
13 ;; XEmacs is free software: you can redistribute it and/or modify it |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5255
diff
changeset
|
14 ;; under the terms of the GNU General Public License as published by the |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5255
diff
changeset
|
15 ;; Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5255
diff
changeset
|
16 ;; option) any later version. |
428 | 17 |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5255
diff
changeset
|
18 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5255
diff
changeset
|
19 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5255
diff
changeset
|
20 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5255
diff
changeset
|
21 ;; for more details. |
428 | 22 |
23 ;; You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5255
diff
changeset
|
24 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>. |
428 | 25 |
26 ;;; Synched up with: Not in FSF. | |
27 | |
28 ;;; Commentary: | |
29 | |
30 ;; This file is dumped with XEmacs. | |
31 | |
32 ;; The obsoleteness support used to be scattered throughout various | |
33 ;; source files. We put the stuff in one place to remove the junkiness | |
34 ;; from other source files and to facilitate creating/updating things | |
35 ;; like sysdep.el. | |
36 | |
37 ;;; Code: | |
38 | |
39 (defsubst define-obsolete-function-alias (oldfun newfun) | |
40 "Define OLDFUN as an obsolete alias for function NEWFUN. | |
41 This makes calling OLDFUN equivalent to calling NEWFUN and marks OLDFUN | |
42 as obsolete." | |
43 (define-function oldfun newfun) | |
44 (make-obsolete oldfun newfun)) | |
45 | |
46 (defsubst define-compatible-function-alias (oldfun newfun) | |
47 "Define OLDFUN as a compatible alias for function NEWFUN. | |
48 This makes calling OLDFUN equivalent to calling NEWFUN and marks OLDFUN | |
49 as provided for compatibility only." | |
50 (define-function oldfun newfun) | |
51 (make-compatible oldfun newfun)) | |
52 | |
53 (defsubst define-obsolete-variable-alias (oldvar newvar) | |
54 "Define OLDVAR as an obsolete alias for variable NEWVAR. | |
55 This makes referencing or setting OLDVAR equivalent to referencing or | |
56 setting NEWVAR and marks OLDVAR as obsolete. | |
57 If OLDVAR was bound and NEWVAR was not, Set NEWVAR to OLDVAR. | |
58 | |
444 | 59 Note: Use this before any other references (defvar/defcustom) to NEWVAR." |
428 | 60 (let ((needs-setting (and (boundp oldvar) (not (boundp newvar)))) |
61 (value (and (boundp oldvar) (symbol-value oldvar)))) | |
62 (defvaralias oldvar newvar) | |
63 (make-obsolete-variable oldvar newvar) | |
64 (and needs-setting (set newvar value)))) | |
65 | |
66 (defsubst define-compatible-variable-alias (oldvar newvar) | |
67 "Define OLDVAR as a compatible alias for variable NEWVAR. | |
68 This makes referencing or setting OLDVAR equivalent to referencing or | |
69 setting NEWVAR and marks OLDVAR as provided for compatibility only." | |
70 (defvaralias oldvar newvar) | |
71 (make-compatible-variable oldvar newvar)) | |
72 | |
5175 | 73 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; buffers |
74 | |
75 (define-obsolete-function-alias 'show-buffer 'set-window-buffer) | |
76 (define-obsolete-function-alias 'buffer-flush-undo 'buffer-disable-undo) | |
77 (make-compatible 'eval-current-buffer 'eval-buffer) | |
78 | |
79 (defun buffer-local-value (variable buffer) | |
80 "Return the value of VARIABLE in BUFFER. | |
81 If VARIABLE does not have a buffer-local binding in BUFFER, the value | |
82 is the default binding of variable." | |
83 (symbol-value-in-buffer variable buffer)) | |
84 (make-compatible 'buffer-local-value 'symbol-value-in-buffer) | |
85 | |
428 | 86 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; device stuff |
87 | |
88 (make-compatible-variable 'window-system "use (console-type)") | |
89 | |
90 (defun x-display-color-p (&optional device) | |
91 "Return t if DEVICE is a color device." | |
92 (eq 'color (device-class device))) | |
93 (make-compatible 'x-display-color-p 'device-class) | |
94 | |
95 (define-function 'x-color-display-p 'x-display-color-p) | |
96 (make-compatible 'x-display-color-p 'device-class) | |
97 | |
98 (defun x-display-grayscale-p (&optional device) | |
99 "Return t if DEVICE is a grayscale device." | |
100 (eq 'grayscale (device-class device))) | |
101 (make-compatible 'x-display-grayscale-p 'device-class) | |
102 | |
103 (define-function 'x-grayscale-display-p 'x-display-grayscale-p) | |
104 (make-compatible 'x-display-grayscale-p 'device-class) | |
105 | |
106 (define-compatible-function-alias 'x-display-pixel-width 'device-pixel-width) | |
107 (define-compatible-function-alias 'x-display-pixel-height 'device-pixel-height) | |
108 (define-compatible-function-alias 'x-display-planes 'device-bitplanes) | |
109 (define-compatible-function-alias 'x-display-color-cells 'device-color-cells) | |
110 | |
111 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; events | |
112 | |
113 (define-obsolete-function-alias 'menu-event-p 'misc-user-event-p) | |
114 (make-obsolete-variable 'unread-command-char 'unread-command-events) | |
115 | |
116 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; extents | |
117 | |
118 (make-obsolete 'set-window-dot 'set-window-point) | |
119 | |
120 (define-obsolete-function-alias 'extent-buffer 'extent-object) | |
1024 | 121 (define-compatible-variable-alias 'parse-sexp-lookup-properties |
122 'lookup-syntax-properties) | |
428 | 123 |
124 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; frames | |
5175 | 125 |
428 | 126 (defun frame-first-window (frame) |
127 "Return the topmost, leftmost window of FRAME. | |
128 If omitted, FRAME defaults to the currently selected frame." | |
129 (frame-highest-window frame 0)) | |
130 (make-compatible 'frame-first-window 'frame-highest-window) | |
131 | |
132 (define-obsolete-variable-alias 'initial-frame-alist 'initial-frame-plist) | |
133 (define-obsolete-variable-alias 'minibuffer-frame-alist | |
134 'minibuffer-frame-plist) | |
135 (define-obsolete-variable-alias 'pop-up-frame-alist 'pop-up-frame-plist) | |
136 (define-obsolete-variable-alias 'special-display-frame-alist | |
137 'special-display-frame-plist) | |
138 | |
139 ;; Defined in C. | |
140 | |
141 (define-obsolete-variable-alias 'default-frame-alist 'default-frame-plist) | |
142 (define-obsolete-variable-alias 'default-x-frame-alist 'default-x-frame-plist) | |
143 (define-obsolete-variable-alias 'default-tty-frame-alist | |
144 'default-tty-frame-plist) | |
145 | |
146 (make-compatible 'frame-parameters 'frame-property) | |
147 (defun frame-parameters (&optional frame) | |
148 "Return the parameters-alist of frame FRAME. | |
149 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol. | |
150 The meaningful PARMs depend on the kind of frame. | |
151 If FRAME is omitted, return information on the currently selected frame. | |
152 | |
153 See the variables `default-frame-plist', `default-x-frame-plist', and | |
154 `default-tty-frame-plist' for a description of the parameters meaningful | |
155 for particular types of frames." | |
156 (or frame (setq frame (selected-frame))) | |
157 ;; #### This relies on a `copy-sequence' of the user properties in | |
158 ;; `frame-properties'. Removing that would make `frame-properties' more | |
159 ;; efficient but this function less efficient, as we couldn't be | |
160 ;; destructive. Since most callers now use `frame-parameters', we'll | |
161 ;; do it this way. Should probably change this at some point in the | |
162 ;; future. | |
163 (destructive-plist-to-alist (frame-properties frame))) | |
164 | |
883 | 165 (make-compatible 'frame-parameter 'frame-property) |
166 (defun frame-parameter (frame parameter) | |
167 "Return FRAME's value for parameter PARAMETER. | |
168 If FRAME is nil, describe the currently selected frame." | |
169 (cdr (assq parameter (frame-parameters frame)))) | |
170 | |
428 | 171 (make-compatible 'modify-frame-parameters 'set-frame-properties) |
172 (defun modify-frame-parameters (frame alist) | |
173 "Modify the properties of frame FRAME according to ALIST. | |
174 ALIST is an alist of properties to change and their new values. | |
175 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol. | |
176 The meaningful PARMs depend on the kind of frame. | |
177 | |
178 See `set-frame-properties' for built-in property names." | |
179 ;; it would be nice to be destructive here but that's not safe. | |
180 (set-frame-properties frame (alist-to-plist alist))) | |
181 | |
182 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; faces | |
183 | |
184 (define-obsolete-function-alias 'list-faces-display 'edit-faces) | |
185 (define-obsolete-function-alias 'list-faces 'face-list) | |
186 | |
5175 | 187 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; fonts and colors |
428 | 188 |
5175 | 189 (defun x-color-values (color &optional frame) |
190 "Return a description of the color named COLOR on frame FRAME. | |
191 The value is a list of integer RGB values--(RED GREEN BLUE). | |
192 These values appear to range from 0 to 65280 or 65535, depending | |
193 on the system; white is (65280 65280 65280) or (65535 65535 65535). | |
194 If FRAME is omitted or nil, use the selected frame." | |
195 (color-instance-rgb-components (make-color-instance color))) | |
196 (make-compatible 'x-color-values 'color-instance-rgb-components) | |
428 | 197 |
5175 | 198 (make-obsolete 'mswindows-color-list 'color-list) |
199 (make-obsolete 'tty-color-list 'color-list) | |
200 (make-compatible 'list-fonts 'font-list) | |
428 | 201 |
202 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; hooks | |
203 | |
204 (make-compatible-variable 'lisp-indent-hook 'lisp-indent-function) | |
205 (make-compatible-variable 'comment-indent-hook 'comment-indent-function) | |
206 (make-obsolete-variable 'temp-buffer-show-hook | |
207 'temp-buffer-show-function) | |
208 (make-obsolete-variable 'inhibit-local-variables | |
209 "use `enable-local-variables' (with the reversed sense).") | |
210 (make-obsolete-variable 'suspend-hooks 'suspend-hook) | |
211 (make-obsolete-variable 'first-change-function 'first-change-hook) | |
212 (make-obsolete-variable 'before-change-function | |
213 "use before-change-functions; which is a list of functions rather than a single function.") | |
214 (make-obsolete-variable 'after-change-function | |
215 "use after-change-functions; which is a list of functions rather than a single function.") | |
216 | |
5175 | 217 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; insertion, deletion, movement |
428 | 218 |
219 (define-compatible-function-alias 'insert-and-inherit 'insert) | |
220 (define-compatible-function-alias 'insert-before-markers-and-inherit | |
221 'insert-before-markers) | |
222 | |
5175 | 223 (define-compatible-function-alias 'line-beginning-position 'point-at-bol) |
224 (define-compatible-function-alias 'line-end-position 'point-at-eol) | |
225 | |
226 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; Lisp engine, basic Lisp stuff | |
227 | |
228 (make-obsolete 'function-called-at-point 'function-at-point) | |
229 | |
230 ;; As of 21.5, #'throw is a special operator. This makes bytecode using it | |
231 ;; compiled for 21.4 fail; making this function available works around that. | |
232 (defun obsolete-throw (tag value) | |
233 "Ugly compatibility hack. | |
234 | |
235 See the implementation of #'funcall in eval.c. This should be removed once | |
236 we no longer encounter bytecode from 21.4." | |
237 (throw tag value)) | |
238 | |
239 (make-obsolete | |
240 'obsolete-throw | |
241 "it says `obsolete' in the name, you know you shouldn't be using this.") | |
242 | |
243 (define-compatible-function-alias 'cl-mapc 'mapc) | |
244 | |
5387
5f5d48053e86
Drop #'cl-finite-do, defalias #'cl-float-limits to #'ignore in dumped XEmacs
Aidan Kehoe <kehoea@parhasard.net>
parents:
5368
diff
changeset
|
245 ;; Various non-XEmacs code can call this, because it used not be |
5f5d48053e86
Drop #'cl-finite-do, defalias #'cl-float-limits to #'ignore in dumped XEmacs
Aidan Kehoe <kehoea@parhasard.net>
parents:
5368
diff
changeset
|
246 ;; called automatically at dump time. |
5f5d48053e86
Drop #'cl-finite-do, defalias #'cl-float-limits to #'ignore in dumped XEmacs
Aidan Kehoe <kehoea@parhasard.net>
parents:
5368
diff
changeset
|
247 (define-function 'cl-float-limits 'ignore) |
5f5d48053e86
Drop #'cl-finite-do, defalias #'cl-float-limits to #'ignore in dumped XEmacs
Aidan Kehoe <kehoea@parhasard.net>
parents:
5368
diff
changeset
|
248 (make-obsolete 'cl-float-limits "this is called at dump time in 21.5 and \ |
5f5d48053e86
Drop #'cl-finite-do, defalias #'cl-float-limits to #'ignore in dumped XEmacs
Aidan Kehoe <kehoea@parhasard.net>
parents:
5368
diff
changeset
|
249 later, no need to call it in user code.") |
5f5d48053e86
Drop #'cl-finite-do, defalias #'cl-float-limits to #'ignore in dumped XEmacs
Aidan Kehoe <kehoea@parhasard.net>
parents:
5368
diff
changeset
|
250 |
5327
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
251 ;; XEmacs; old compiler macros meant that this was called directly |
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
252 ;; from compiled code, and we need to provide a version of it for a |
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
253 ;; couple of years at least because of that. Aidan Kehoe, Mon Oct 4 |
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
254 ;; 12:06:41 IST 2010 |
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
255 (defun cl-delete-duplicates (cl-seq cl-keys cl-copy) |
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
256 (apply (if cl-copy #'remove-duplicates #'delete-duplicates) cl-seq cl-keys)) |
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
257 |
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
258 (make-obsolete 'cl-delete-duplicates 'delete-duplicates) |
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
259 |
5635
2fc3f2f35523
Put back compatibility alias for #'cl-puthash, used by 21.4's setf expansion
Aidan Kehoe <kehoea@parhasard.net>
parents:
5583
diff
changeset
|
260 ;; This occurs because of setf expansion by 21.4, changing the affected |
2fc3f2f35523
Put back compatibility alias for #'cl-puthash, used by 21.4's setf expansion
Aidan Kehoe <kehoea@parhasard.net>
parents:
5583
diff
changeset
|
261 ;; packages won't fix that. |
2fc3f2f35523
Put back compatibility alias for #'cl-puthash, used by 21.4's setf expansion
Aidan Kehoe <kehoea@parhasard.net>
parents:
5583
diff
changeset
|
262 (define-obsolete-function-alias 'cl-puthash 'puthash) |
2fc3f2f35523
Put back compatibility alias for #'cl-puthash, used by 21.4's setf expansion
Aidan Kehoe <kehoea@parhasard.net>
parents:
5583
diff
changeset
|
263 |
5175 | 264 ; old names |
265 (define-compatible-function-alias 'byte-code-function-p | |
266 'compiled-function-p) ;FSFmacs | |
267 | |
268 (define-compatible-function-alias 'interactive-form | |
269 'function-interactive) ;GNU 21.1 | |
5583
10f179710250
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5562
diff
changeset
|
270 (define-function 'assq-delete-all 'remassq) ;GNU 21.1 |
10f179710250
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5562
diff
changeset
|
271 (make-compatible 'assq-delete-all "use (delete* ITEM SEQUENCE :key #'car)") |
5175 | 272 |
273 (defun makehash (&optional test) | |
274 "Create a new hash table. | |
275 Optional first argument TEST specifies how to compare keys in the table. | |
276 Predefined tests are `eq', `eql', and `equal'. Default is `eql'." | |
277 (make-hash-table :test test)) | |
278 (make-compatible 'makehash 'make-hash-table) | |
279 | |
280 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; keys, keymaps | |
428 | 281 |
282 (defun keymap-parent (keymap) | |
283 "Return the first parent of the given keymap." | |
284 (car (keymap-parents keymap))) | |
285 (make-compatible 'keymap-parent 'keymap-parents) | |
286 | |
287 (defun set-keymap-parent (keymap parent) | |
288 "Make the given keymap have (only) the given parent." | |
289 (set-keymap-parents keymap (if parent (list parent) '())) | |
290 parent) | |
291 (make-compatible 'set-keymap-parent 'set-keymap-parents) | |
292 | |
5208
9fa29ec759e3
Implement suggest-key-bindings in terms of teach-extended-commands-p
Aidan Kehoe <kehoea@parhasard.net>
parents:
5175
diff
changeset
|
293 (make-compatible-variable 'suggest-key-bindings 'teach-extended-commands-p) |
9fa29ec759e3
Implement suggest-key-bindings in terms of teach-extended-commands-p
Aidan Kehoe <kehoea@parhasard.net>
parents:
5175
diff
changeset
|
294 |
5175 | 295 ;; too bad there's not a way to check for aref, assq, and nconc |
296 ;; being called on the values of functions known to return keymaps, | |
297 ;; or known to return vectors of events instead of strings... | |
298 | |
299 ;;; Yes there is; make compiler macros for aref, assq, nconc, checking that | |
300 ;;; the car of the relevant argument is sane. | |
301 | |
302 (make-obsolete-variable 'executing-macro 'executing-kbd-macro) | |
303 | |
428 | 304 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; menu stuff |
305 | |
4317
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
306 (defun add-menu-item (menu-path item-name function enabled-p &optional before) |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
307 "Obsolete. See the function `add-menu-button'." |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
308 (or item-name (error "must specify an item name")) |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
309 (declare-fboundp (add-menu-button menu-path (vector item-name function enabled-p) before))) |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
310 (make-obsolete 'add-menu-item 'add-menu-button) |
428 | 311 |
4317
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
312 (defun add-menu (menu-path menu-name menu-items &optional before) |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
313 "See the function `add-submenu'." |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
314 (or menu-name (error "must specify a menu name")) |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
315 (or menu-items (error "must specify some menu items")) |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
316 (declare-fboundp (add-submenu menu-path (cons menu-name menu-items) before))) |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
317 ;; Can't make this obsolete. easymenu depends on it. |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
318 (make-compatible 'add-menu 'add-submenu) |
428 | 319 |
4317
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
320 (define-obsolete-function-alias 'package-get-download-menu |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
321 'package-ui-download-menu) |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
322 |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
323 (unless (featurep 'menubar) |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
324 ;; Don't provide the last three functions unless the menubar feature is |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
325 ;; available. This approach (with #'unintern) avoids warnings about lost |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
326 ;; docstrings since make-docfile doesn't parse bytecode. |
4783
e29fcfd8df5f
Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4677
diff
changeset
|
327 (mapc #'unintern '(add-menu-item add-menu package-get-download-menu))) |
1365 | 328 |
428 | 329 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; minibuffer |
330 | |
331 (define-compatible-function-alias 'read-minibuffer | |
332 'read-expression) ; misleading name | |
333 (define-compatible-function-alias 'read-input 'read-string) | |
334 | |
335 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; modeline | |
336 | |
337 (define-compatible-function-alias 'redraw-mode-line 'redraw-modeline) | |
338 (define-compatible-function-alias 'force-mode-line-update | |
339 'redraw-modeline) ;; FSF compatibility | |
340 (define-compatible-variable-alias 'mode-line-map 'modeline-map) | |
341 (define-compatible-variable-alias 'mode-line-buffer-identification | |
342 'modeline-buffer-identification) | |
343 (define-compatible-variable-alias 'mode-line-process 'modeline-process) | |
344 (define-compatible-variable-alias 'mode-line-modified 'modeline-modified) | |
345 (make-compatible-variable 'mode-line-inverse-video | |
346 "use set-face-highlight-p and set-face-reverse-p") | |
347 (define-compatible-variable-alias 'default-mode-line-format | |
348 'default-modeline-format) | |
349 (define-compatible-variable-alias 'mode-line-format 'modeline-format) | |
350 (define-compatible-variable-alias 'mode-line-menu 'modeline-menu) | |
351 | |
352 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; mouse | |
353 | |
354 ;;; (defun mouse-eval-last-sexpr (event) | |
355 ;;; (interactive "@e") | |
356 ;;; (save-excursion | |
357 ;;; (mouse-set-point event) | |
358 ;;; (eval-last-sexp nil))) | |
359 | |
360 (define-obsolete-function-alias 'mouse-eval-last-sexpr 'mouse-eval-sexp) | |
361 | |
362 (defun read-mouse-position (frame) | |
363 (cdr (mouse-position (frame-device frame)))) | |
364 (make-obsolete 'read-mouse-position 'mouse-position) | |
365 | |
5175 | 366 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; paths |
367 | |
368 (defvar Info-default-directory-list nil | |
369 "This used to be the initial value of Info-directory-list. | |
370 If you want to change the locations where XEmacs looks for info files, | |
371 set Info-directory-list.") | |
372 (make-obsolete-variable 'Info-default-directory-list 'Info-directory-list) | |
373 | |
374 (defvar init-file-user nil | |
375 "This used to be the name of the user whose init file was read at startup.") | |
376 (make-obsolete-variable 'init-file-user 'load-user-init-file-p) | |
377 | |
378 (define-obsolete-function-alias 'pui-add-install-directory | |
379 'pui-set-local-package-get-directory) ; misleading name | |
380 | |
428 | 381 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; redisplay |
382 | |
383 (defun redraw-display (&optional device) | |
384 (if (eq device t) | |
385 (mapcar 'redisplay-device (device-list)) | |
386 (redisplay-device device))) | |
387 | |
5175 | 388 ;; the functionality of column.el has been moved into C |
389 ;; Function obsoleted for XEmacs 20.0/February 1997. | |
390 (defalias 'display-column-mode 'column-number-mode) | |
391 | |
392 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; selections | |
393 | |
394 (define-obsolete-function-alias 'isearch-yank-x-selection | |
395 'isearch-yank-selection) | |
396 (define-obsolete-function-alias 'isearch-yank-x-clipboard | |
397 'isearch-yank-clipboard) | |
398 | |
399 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; text and strings | |
777 | 400 |
401 (define-obsolete-function-alias 'sref 'aref) | |
402 | |
403 (defun char-bytes (character) | |
404 "Return number of bytes a CHARACTER occupies in a string or buffer. | |
405 It always returns 1 in XEmacs, and in recent FSF Emacs versions." | |
406 1) | |
407 (make-obsolete 'char-bytes "This function always returns 1") | |
408 | |
860 | 409 (defun find-non-ascii-charset-string (string) |
410 "Return a list of charsets in the STRING except ascii. | |
411 It might be available for compatibility with Mule 2.3, | |
412 because its `find-charset-string' ignores ASCII charset." | |
5368
ed74d2ca7082
Use ', not #', when a given symbol may not have a function binding at read time
Aidan Kehoe <kehoea@parhasard.net>
parents:
5327
diff
changeset
|
413 (delq 'ascii (and-fboundp 'charsets-in-string (charsets-in-string string)))) |
860 | 414 (make-obsolete 'find-non-ascii-charset-string |
415 "use (delq 'ascii (charsets-in-string STRING)) instead.") | |
416 | |
417 (defun find-non-ascii-charset-region (start end) | |
418 "Return a list of charsets except ascii in the region between START and END. | |
419 It might be available for compatibility with Mule 2.3, | |
420 because its `find-charset-string' ignores ASCII charset." | |
5368
ed74d2ca7082
Use ', not #', when a given symbol may not have a function binding at read time
Aidan Kehoe <kehoea@parhasard.net>
parents:
5327
diff
changeset
|
421 (delq 'ascii (and-fboundp 'charsets-in-region |
4222 | 422 (charsets-in-region start end)))) |
860 | 423 (make-obsolete 'find-non-ascii-charset-region |
424 "use (delq 'ascii (charsets-in-region START END)) instead.") | |
818 | 425 |
3555 | 426 ;; < 21.5 compatibility, eg. https://bugzilla.redhat.com/201524#c2 |
427 (define-obsolete-function-alias 'string-to-char-list 'string-to-list) | |
428 | |
428 | 429 ;; Two loser functions which shouldn't be used. |
430 (make-obsolete 'following-char 'char-after) | |
431 (make-obsolete 'preceding-char 'char-before) | |
432 | |
5175 | 433 |
434 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; misc | |
435 | |
436 ;; (defun user-original-login-name () | |
437 ;; "Return user's login name from original login. | |
438 ;; This tries to remain unaffected by `su', by looking in environment variables." | |
439 ;; (or (getenv "LOGNAME") (getenv "USER") (user-login-name))) | |
440 (define-obsolete-function-alias 'user-original-login-name 'user-login-name) | |
441 | |
428 | 442 ;; Keywords already do The Right Thing in XEmacs |
443 (make-compatible 'define-widget-keywords "Just use them") | |
444 | |
5229
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
5208
diff
changeset
|
445 (define-function 'purecopy 'identity) |
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
5208
diff
changeset
|
446 (make-obsolete 'purecopy "purespace is not available in XEmacs.") |
4995
8431b52e43b1
Move the various map* functions to C; add #'map-into.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4885
diff
changeset
|
447 |
5255
b5611afbcc76
Support process plists, for greater GNU compatibility.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5229
diff
changeset
|
448 (define-compatible-function-alias 'process-get 'get) |
b5611afbcc76
Support process plists, for greater GNU compatibility.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5229
diff
changeset
|
449 (define-compatible-function-alias 'process-put 'put) |
b5611afbcc76
Support process plists, for greater GNU compatibility.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5229
diff
changeset
|
450 (define-compatible-function-alias 'process-plist 'object-plist) |
b5611afbcc76
Support process plists, for greater GNU compatibility.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5229
diff
changeset
|
451 (define-compatible-function-alias 'set-process-plist 'object-setplist) |
b5611afbcc76
Support process plists, for greater GNU compatibility.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5229
diff
changeset
|
452 |
5327
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
453 (define-function 'memql 'member*) |
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
454 (make-compatible 'memql "use the more full-featured `member*' instead.") |
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
455 |
5562
855b667dea13
Drop cl-macro-environment in favour of byte-compile-macro-environment.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5475
diff
changeset
|
456 (define-obsolete-variable-alias 'cl-macro-environment |
855b667dea13
Drop cl-macro-environment in favour of byte-compile-macro-environment.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5475
diff
changeset
|
457 'byte-compile-macro-environment) |
855b667dea13
Drop cl-macro-environment in favour of byte-compile-macro-environment.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5475
diff
changeset
|
458 |
5583
10f179710250
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5562
diff
changeset
|
459 ;; Actual implementations of these functions are in cl-extra.el, after |
10f179710250
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5562
diff
changeset
|
460 ;; cl-macs is loaded, since those implementations use #'labels and |
10f179710250
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5562
diff
changeset
|
461 ;; #'symbol-macrolet. These APIs were always XEmacs-specific, were never |
10f179710250
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5562
diff
changeset
|
462 ;; widely used, and it was always more readable and more compatible to use |
10f179710250
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5562
diff
changeset
|
463 ;; the CL functions. |
10f179710250
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5562
diff
changeset
|
464 (make-obsolete 'remassoc "use delete* with :test #'equal, :key #'car") |
10f179710250
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5562
diff
changeset
|
465 (make-obsolete 'remassq "use delete* with :test #'eq, :key #'car") |
10f179710250
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5562
diff
changeset
|
466 (make-obsolete 'remrassoc "use delete* with :test #'equal, :key #'cdr") |
10f179710250
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5562
diff
changeset
|
467 (make-obsolete 'remrassq "use delete* with :test #'eq, :key #'cdr") |
10f179710250
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5562
diff
changeset
|
468 |
428 | 469 (provide 'obsolete) |
470 ;;; obsolete.el ends here |