Mercurial > hg > xemacs-beta
annotate lisp/obsolete.el @ 5553:62edcc6a11ec
Add an assertion about argument order to #'apply-partially compiler macro
lisp/ChangeLog addition:
2011-08-24 Aidan Kehoe <kehoea@parhasard.net>
* cl-macs.el (apply-partially):
Add an assertion to this compiler macro, requiring that the order
of the placeholders corresponding to the arguments in the
constants vector of the constructed compiled function be the same
as the order of the arguments to #'apply-partially.
tests/ChangeLog addition:
2011-08-24 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el:
Add a test of apply partially that depends on the relative order
of its arguments.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Wed, 24 Aug 2011 11:06:41 +0100 |
parents | 248176c74e6b |
children | 855b667dea13 |
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 |
5175 | 260 ; old names |
261 (define-compatible-function-alias 'byte-code-function-p | |
262 'compiled-function-p) ;FSFmacs | |
263 | |
264 (define-compatible-function-alias 'interactive-form | |
265 'function-interactive) ;GNU 21.1 | |
266 (define-compatible-function-alias 'assq-delete-all | |
267 'remassq) ;GNU 21.1 | |
268 | |
269 (defun makehash (&optional test) | |
270 "Create a new hash table. | |
271 Optional first argument TEST specifies how to compare keys in the table. | |
272 Predefined tests are `eq', `eql', and `equal'. Default is `eql'." | |
273 (make-hash-table :test test)) | |
274 (make-compatible 'makehash 'make-hash-table) | |
275 | |
276 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; keys, keymaps | |
428 | 277 |
278 (defun keymap-parent (keymap) | |
279 "Return the first parent of the given keymap." | |
280 (car (keymap-parents keymap))) | |
281 (make-compatible 'keymap-parent 'keymap-parents) | |
282 | |
283 (defun set-keymap-parent (keymap parent) | |
284 "Make the given keymap have (only) the given parent." | |
285 (set-keymap-parents keymap (if parent (list parent) '())) | |
286 parent) | |
287 (make-compatible 'set-keymap-parent 'set-keymap-parents) | |
288 | |
5208
9fa29ec759e3
Implement suggest-key-bindings in terms of teach-extended-commands-p
Aidan Kehoe <kehoea@parhasard.net>
parents:
5175
diff
changeset
|
289 (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
|
290 |
5175 | 291 ;; too bad there's not a way to check for aref, assq, and nconc |
292 ;; being called on the values of functions known to return keymaps, | |
293 ;; or known to return vectors of events instead of strings... | |
294 | |
295 ;;; Yes there is; make compiler macros for aref, assq, nconc, checking that | |
296 ;;; the car of the relevant argument is sane. | |
297 | |
298 (make-obsolete-variable 'executing-macro 'executing-kbd-macro) | |
299 | |
428 | 300 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; menu stuff |
301 | |
4317
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
302 (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
|
303 "Obsolete. See the function `add-menu-button'." |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
304 (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
|
305 (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
|
306 (make-obsolete 'add-menu-item 'add-menu-button) |
428 | 307 |
4317
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
308 (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
|
309 "See the function `add-submenu'." |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
310 (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
|
311 (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
|
312 (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
|
313 ;; 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
|
314 (make-compatible 'add-menu 'add-submenu) |
428 | 315 |
4317
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
316 (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
|
317 'package-ui-download-menu) |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
318 |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
319 (unless (featurep 'menubar) |
15d36164ebd7
Eliminate lost docstring warnings on 21.5.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4222
diff
changeset
|
320 ;; 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
|
321 ;; 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
|
322 ;; 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
|
323 (mapc #'unintern '(add-menu-item add-menu package-get-download-menu))) |
1365 | 324 |
428 | 325 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; minibuffer |
326 | |
327 (define-compatible-function-alias 'read-minibuffer | |
328 'read-expression) ; misleading name | |
329 (define-compatible-function-alias 'read-input 'read-string) | |
330 | |
331 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; modeline | |
332 | |
333 (define-compatible-function-alias 'redraw-mode-line 'redraw-modeline) | |
334 (define-compatible-function-alias 'force-mode-line-update | |
335 'redraw-modeline) ;; FSF compatibility | |
336 (define-compatible-variable-alias 'mode-line-map 'modeline-map) | |
337 (define-compatible-variable-alias 'mode-line-buffer-identification | |
338 'modeline-buffer-identification) | |
339 (define-compatible-variable-alias 'mode-line-process 'modeline-process) | |
340 (define-compatible-variable-alias 'mode-line-modified 'modeline-modified) | |
341 (make-compatible-variable 'mode-line-inverse-video | |
342 "use set-face-highlight-p and set-face-reverse-p") | |
343 (define-compatible-variable-alias 'default-mode-line-format | |
344 'default-modeline-format) | |
345 (define-compatible-variable-alias 'mode-line-format 'modeline-format) | |
346 (define-compatible-variable-alias 'mode-line-menu 'modeline-menu) | |
347 | |
348 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; mouse | |
349 | |
350 ;;; (defun mouse-eval-last-sexpr (event) | |
351 ;;; (interactive "@e") | |
352 ;;; (save-excursion | |
353 ;;; (mouse-set-point event) | |
354 ;;; (eval-last-sexp nil))) | |
355 | |
356 (define-obsolete-function-alias 'mouse-eval-last-sexpr 'mouse-eval-sexp) | |
357 | |
358 (defun read-mouse-position (frame) | |
359 (cdr (mouse-position (frame-device frame)))) | |
360 (make-obsolete 'read-mouse-position 'mouse-position) | |
361 | |
5175 | 362 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; paths |
363 | |
364 (defvar Info-default-directory-list nil | |
365 "This used to be the initial value of Info-directory-list. | |
366 If you want to change the locations where XEmacs looks for info files, | |
367 set Info-directory-list.") | |
368 (make-obsolete-variable 'Info-default-directory-list 'Info-directory-list) | |
369 | |
370 (defvar init-file-user nil | |
371 "This used to be the name of the user whose init file was read at startup.") | |
372 (make-obsolete-variable 'init-file-user 'load-user-init-file-p) | |
373 | |
374 (define-obsolete-function-alias 'pui-add-install-directory | |
375 'pui-set-local-package-get-directory) ; misleading name | |
376 | |
428 | 377 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; redisplay |
378 | |
379 (defun redraw-display (&optional device) | |
380 (if (eq device t) | |
381 (mapcar 'redisplay-device (device-list)) | |
382 (redisplay-device device))) | |
383 | |
5175 | 384 ;; the functionality of column.el has been moved into C |
385 ;; Function obsoleted for XEmacs 20.0/February 1997. | |
386 (defalias 'display-column-mode 'column-number-mode) | |
387 | |
388 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; selections | |
389 | |
390 (define-obsolete-function-alias 'isearch-yank-x-selection | |
391 'isearch-yank-selection) | |
392 (define-obsolete-function-alias 'isearch-yank-x-clipboard | |
393 'isearch-yank-clipboard) | |
394 | |
395 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; text and strings | |
777 | 396 |
397 (define-obsolete-function-alias 'sref 'aref) | |
398 | |
399 (defun char-bytes (character) | |
400 "Return number of bytes a CHARACTER occupies in a string or buffer. | |
401 It always returns 1 in XEmacs, and in recent FSF Emacs versions." | |
402 1) | |
403 (make-obsolete 'char-bytes "This function always returns 1") | |
404 | |
860 | 405 (defun find-non-ascii-charset-string (string) |
406 "Return a list of charsets in the STRING except ascii. | |
407 It might be available for compatibility with Mule 2.3, | |
408 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
|
409 (delq 'ascii (and-fboundp 'charsets-in-string (charsets-in-string string)))) |
860 | 410 (make-obsolete 'find-non-ascii-charset-string |
411 "use (delq 'ascii (charsets-in-string STRING)) instead.") | |
412 | |
413 (defun find-non-ascii-charset-region (start end) | |
414 "Return a list of charsets except ascii in the region between START and END. | |
415 It might be available for compatibility with Mule 2.3, | |
416 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
|
417 (delq 'ascii (and-fboundp 'charsets-in-region |
4222 | 418 (charsets-in-region start end)))) |
860 | 419 (make-obsolete 'find-non-ascii-charset-region |
420 "use (delq 'ascii (charsets-in-region START END)) instead.") | |
818 | 421 |
3555 | 422 ;; < 21.5 compatibility, eg. https://bugzilla.redhat.com/201524#c2 |
423 (define-obsolete-function-alias 'string-to-char-list 'string-to-list) | |
424 | |
428 | 425 ;; Two loser functions which shouldn't be used. |
426 (make-obsolete 'following-char 'char-after) | |
427 (make-obsolete 'preceding-char 'char-before) | |
428 | |
5175 | 429 |
430 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; misc | |
431 | |
432 ;; (defun user-original-login-name () | |
433 ;; "Return user's login name from original login. | |
434 ;; This tries to remain unaffected by `su', by looking in environment variables." | |
435 ;; (or (getenv "LOGNAME") (getenv "USER") (user-login-name))) | |
436 (define-obsolete-function-alias 'user-original-login-name 'user-login-name) | |
437 | |
428 | 438 ;; Keywords already do The Right Thing in XEmacs |
439 (make-compatible 'define-widget-keywords "Just use them") | |
440 | |
5229
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
5208
diff
changeset
|
441 (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
|
442 (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
|
443 |
5255
b5611afbcc76
Support process plists, for greater GNU compatibility.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5229
diff
changeset
|
444 (define-compatible-function-alias 'process-get 'get) |
b5611afbcc76
Support process plists, for greater GNU compatibility.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5229
diff
changeset
|
445 (define-compatible-function-alias 'process-put 'put) |
b5611afbcc76
Support process plists, for greater GNU compatibility.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5229
diff
changeset
|
446 (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
|
447 (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
|
448 |
5327
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
449 (define-function 'memql 'member*) |
d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5255
diff
changeset
|
450 (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
|
451 |
428 | 452 (provide 'obsolete) |
453 ;;; obsolete.el ends here |