209
|
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.
|
|
6
|
|
7 ;; Maintainer: XEmacs Development Team
|
|
8 ;; Keywords: internal, dumped
|
|
9
|
|
10 ;; This file is part of XEmacs.
|
|
11
|
|
12 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
13 ;; under the terms of the GNU General Public License as published by
|
|
14 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
15 ;; any later version.
|
|
16
|
|
17 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20 ;; General Public License for more details.
|
|
21
|
|
22 ;; You should have received a copy of the GNU General Public License
|
272
|
23 ;; along with XEmacs; see the file COPYING. If not, write to the
|
209
|
24 ;; Free Software Foundation, 59 Temple Place - Suite 330,
|
|
25 ;; Boston, MA 02111-1307, USA.
|
|
26
|
|
27 ;;; Synched up with: Not in FSF.
|
|
28
|
|
29 ;;; Commentary:
|
|
30
|
|
31 ;; This file is dumped with XEmacs.
|
|
32
|
|
33 ;; The obsoleteness support used to be scattered throughout various
|
|
34 ;; source files. We put the stuff in one place to remove the junkiness
|
|
35 ;; from other source files and to facilitate creating/updating things
|
|
36 ;; like sysdep.el.
|
|
37
|
|
38 ;;; Code:
|
|
39
|
|
40 (defsubst define-obsolete-function-alias (oldfun newfun)
|
|
41 "Define OLDFUN as an obsolete alias for function NEWFUN.
|
|
42 This makes calling OLDFUN equivalent to calling NEWFUN and marks OLDFUN
|
|
43 as obsolete."
|
|
44 (define-function oldfun newfun)
|
|
45 (make-obsolete oldfun newfun))
|
|
46
|
|
47 (defsubst define-compatible-function-alias (oldfun newfun)
|
|
48 "Define OLDFUN as a compatible alias for function NEWFUN.
|
|
49 This makes calling OLDFUN equivalent to calling NEWFUN and marks OLDFUN
|
|
50 as provided for compatibility only."
|
|
51 (define-function oldfun newfun)
|
|
52 (make-compatible oldfun newfun))
|
|
53
|
|
54 (defsubst define-obsolete-variable-alias (oldvar newvar)
|
|
55 "Define OLDVAR as an obsolete alias for variable NEWVAR.
|
|
56 This makes referencing or setting OLDVAR equivalent to referencing or
|
272
|
57 setting NEWVAR and marks OLDVAR as obsolete.
|
209
|
58 If OLDVAR was bound and NEWVAR was not, Set NEWVAR to OLDVAR.
|
|
59
|
|
60 Note: Use this before any other references (defvar/defcustom) to NEWVAR"
|
|
61 (let ((needs-setting (and (boundp oldvar) (not (boundp newvar))))
|
|
62 (value (and (boundp oldvar) (symbol-value oldvar))))
|
|
63 (defvaralias oldvar newvar)
|
|
64 (make-obsolete-variable oldvar newvar)
|
|
65 (and needs-setting (set newvar value))))
|
|
66
|
|
67 (defsubst define-compatible-variable-alias (oldvar newvar)
|
|
68 "Define OLDVAR as a compatible alias for variable NEWVAR.
|
|
69 This makes referencing or setting OLDVAR equivalent to referencing or
|
|
70 setting NEWVAR and marks OLDVAR as provided for compatibility only."
|
|
71 (defvaralias oldvar newvar)
|
|
72 (make-compatible-variable oldvar newvar))
|
|
73
|
|
74 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; device stuff
|
|
75
|
|
76 (make-compatible-variable 'window-system "use (console-type)")
|
|
77 (make-obsolete-variable 'meta-flag
|
|
78 "use the `set-input-mode' function instead.")
|
|
79
|
|
80 (defun x-display-color-p (&optional device)
|
272
|
81 "Return t if DEVICE is a color device."
|
209
|
82 (eq 'color (device-class device)))
|
|
83 (make-compatible 'x-display-color-p 'device-class)
|
|
84
|
|
85 (define-function 'x-color-display-p 'x-display-color-p)
|
|
86 (make-compatible 'x-display-color-p 'device-class)
|
|
87
|
|
88 (defun x-display-grayscale-p (&optional device)
|
272
|
89 "Return t if DEVICE is a grayscale device."
|
209
|
90 (eq 'grayscale (device-class device)))
|
|
91 (make-compatible 'x-display-grayscale-p 'device-class)
|
|
92
|
|
93 (define-function 'x-grayscale-display-p 'x-display-grayscale-p)
|
|
94 (make-compatible 'x-display-grayscale-p 'device-class)
|
|
95
|
284
|
96 (define-compatible-function-alias 'x-display-pixel-width 'device-pixel-width)
|
|
97 (define-compatible-function-alias 'x-display-pixel-height 'device-pixel-height)
|
|
98 (define-compatible-function-alias 'x-display-planes 'device-bitplanes)
|
|
99 (define-compatible-function-alias 'x-display-color-cells 'device-color-cells)
|
209
|
100
|
|
101 (define-obsolete-function-alias 'baud-rate 'device-baud-rate)
|
|
102
|
|
103 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; events
|
|
104
|
|
105 (define-obsolete-function-alias 'menu-event-p 'misc-user-event-p)
|
|
106 (make-obsolete-variable 'unread-command-char 'unread-command-events)
|
|
107 (make-obsolete 'sleep-for-millisecs "use sleep-for with a float")
|
|
108
|
|
109 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; extents
|
|
110
|
|
111 (defun extent-data (extent)
|
272
|
112 "Obsolete. Return the `data' property of EXTENT."
|
209
|
113 (extent-property extent 'data))
|
|
114 (make-obsolete 'set-window-dot 'set-window-point)
|
|
115
|
|
116 (defun set-extent-data (extent data)
|
272
|
117 "Obsolete. Set the `data' property of EXTENT."
|
209
|
118 (set-extent-property extent 'data data))
|
|
119 (make-obsolete 'set-extent-data 'set-extent-property)
|
|
120
|
|
121 (define-obsolete-function-alias 'extent-buffer 'extent-object)
|
|
122
|
|
123 (defun set-extent-attribute (extent attr &optional clearp)
|
284
|
124 ;; obsoleteness info will be displayed, so no need for docstring.
|
209
|
125 (cond ((eq attr 'write-protected)
|
|
126 (set-extent-property extent 'read-only t))
|
|
127 ((eq attr 'unhighlight)
|
|
128 (set-extent-property extent 'mouse-face nil))
|
|
129 ((eq attr 'writable)
|
|
130 (set-extent-property extent 'read-only nil))
|
|
131 ((eq attr 'visible)
|
|
132 (set-extent-property extent 'invisible nil))
|
|
133 (t
|
|
134 (set-extent-property extent attr t))))
|
|
135 (make-obsolete 'set-extent-attribute 'set-extent-property)
|
|
136
|
|
137 (defun extent-glyph (extent)
|
284
|
138 ;; obsoleteness info will be displayed, so no need for docstring.
|
209
|
139 (or (extent-begin-glyph extent)
|
|
140 (extent-end-glyph extent)))
|
|
141 (make-obsolete 'extent-glyph
|
|
142 "use `extent-begin-glyph' or `extent-end-glyph' instead.")
|
|
143
|
|
144 (defun extent-layout (extent)
|
284
|
145 ;; obsoleteness info will be displayed, so no need for docstring.
|
209
|
146 (extent-begin-glyph-layout extent))
|
|
147 (make-obsolete 'extent-layout
|
|
148 "use `extent-begin-glyph-layout' or `extent-end-glyph-layout' instead.")
|
|
149
|
|
150 (defun set-extent-layout (extent layout)
|
284
|
151 ;; obsoleteness info will be displayed, so no need for docstring.
|
209
|
152 (set-extent-begin-glyph-layout extent layout))
|
|
153 (make-obsolete 'set-extent-layout
|
|
154 "use `set-extent-begin-glyph-layout' or `set-extent-end-glyph-layout' instead.")
|
|
155
|
|
156 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; frames
|
|
157
|
|
158 (define-obsolete-variable-alias 'select-screen-hook 'select-frame-hook)
|
|
159 (define-obsolete-variable-alias 'deselect-screen-hook 'deselect-frame-hook)
|
|
160 (define-obsolete-variable-alias 'auto-raise-screen 'auto-raise-frame)
|
|
161 (define-obsolete-variable-alias 'auto-lower-screen 'auto-lower-frame)
|
|
162 (define-obsolete-variable-alias 'get-screen-for-buffer-default-screen-name
|
|
163 'get-frame-for-buffer-default-frame-name)
|
|
164
|
|
165 (define-obsolete-function-alias 'buffer-dedicated-screen
|
|
166 'buffer-dedicated-frame)
|
|
167 (define-obsolete-function-alias 'deiconify-screen 'deiconify-frame)
|
|
168 (define-obsolete-function-alias 'delete-screen 'delete-frame)
|
|
169 (define-obsolete-function-alias 'event-screen 'event-frame)
|
|
170 (define-obsolete-function-alias 'find-file-other-screen 'find-file-other-frame)
|
|
171 (define-obsolete-function-alias 'find-file-read-only-other-screen
|
|
172 'find-file-read-only-other-frame)
|
|
173 (define-obsolete-function-alias 'live-screen-p 'frame-live-p)
|
|
174 (define-obsolete-function-alias 'screen-height 'frame-height)
|
|
175 (define-obsolete-function-alias 'screen-iconified-p 'frame-iconified-p)
|
|
176 (define-obsolete-function-alias 'screen-list 'frame-list)
|
|
177 (define-obsolete-function-alias 'screen-live-p 'frame-live-p)
|
|
178 (define-obsolete-function-alias 'screen-name 'frame-name)
|
|
179 (define-obsolete-function-alias 'screen-parameters 'frame-parameters)
|
|
180 (define-obsolete-function-alias 'screen-pixel-height 'frame-pixel-height)
|
|
181 (define-obsolete-function-alias 'screen-pixel-width 'frame-pixel-width)
|
|
182 (define-obsolete-function-alias 'screen-root-window 'frame-root-window)
|
|
183 (define-obsolete-function-alias 'screen-selected-window 'frame-selected-window)
|
|
184 (define-obsolete-function-alias 'screen-totally-visible-p
|
|
185 'frame-totally-visible-p)
|
|
186 (define-obsolete-function-alias 'screen-visible-p 'frame-visible-p)
|
|
187 (define-obsolete-function-alias 'screen-width 'frame-width)
|
|
188 (define-obsolete-function-alias 'screenp 'framep)
|
|
189 (define-obsolete-function-alias 'get-screen-for-buffer 'get-frame-for-buffer)
|
|
190 (define-obsolete-function-alias 'get-screen-for-buffer-noselect
|
|
191 'get-frame-for-buffer-noselect)
|
|
192 (define-obsolete-function-alias 'get-other-screen 'get-other-frame)
|
|
193 (define-obsolete-function-alias 'iconify-screen 'iconify-frame)
|
|
194 (define-obsolete-function-alias 'lower-screen 'lower-frame)
|
|
195 (define-obsolete-function-alias 'mail-other-screen 'mail-other-frame)
|
|
196 (define-obsolete-function-alias 'make-screen 'make-frame)
|
|
197 (define-obsolete-function-alias 'make-screen-invisible 'make-frame-invisible)
|
|
198 (define-obsolete-function-alias 'make-screen-visible 'make-frame-visible)
|
|
199 (define-obsolete-function-alias 'modify-screen-parameters
|
|
200 'modify-frame-parameters)
|
|
201 (define-obsolete-function-alias 'new-screen 'new-frame)
|
|
202 (define-obsolete-function-alias 'next-screen 'next-frame)
|
|
203 (define-obsolete-function-alias 'next-multiscreen-window
|
|
204 'next-multiframe-window)
|
|
205 (define-obsolete-function-alias 'other-screen 'other-frame)
|
|
206 (define-obsolete-function-alias 'previous-screen 'previous-frame)
|
|
207 (define-obsolete-function-alias 'previous-multiscreen-window
|
|
208 'previous-multiframe-window)
|
|
209 (define-obsolete-function-alias 'raise-screen 'raise-frame)
|
|
210 (define-obsolete-function-alias 'redraw-screen 'redraw-frame)
|
|
211 (define-obsolete-function-alias 'select-screen 'select-frame)
|
|
212 (define-obsolete-function-alias 'selected-screen 'selected-frame)
|
|
213 (define-obsolete-function-alias 'set-buffer-dedicated-screen
|
|
214 'set-buffer-dedicated-frame)
|
|
215 (define-obsolete-function-alias 'set-screen-height 'set-frame-height)
|
|
216 (define-obsolete-function-alias 'set-screen-position 'set-frame-position)
|
|
217 (define-obsolete-function-alias 'set-screen-size 'set-frame-size)
|
|
218 (define-obsolete-function-alias 'set-screen-width 'set-frame-width)
|
|
219 (define-obsolete-function-alias 'show-temp-buffer-in-current-screen
|
|
220 'show-temp-buffer-in-current-frame)
|
|
221 (define-obsolete-function-alias 'switch-to-buffer-other-screen
|
|
222 'switch-to-buffer-other-frame)
|
|
223 (define-obsolete-function-alias 'visible-screen-list 'visible-frame-list)
|
|
224 (define-obsolete-function-alias 'window-screen 'window-frame)
|
|
225 (define-obsolete-function-alias 'x-set-screen-pointer
|
|
226 'set-frame-pointer)
|
|
227 (define-obsolete-function-alias 'x-set-frame-pointer
|
|
228 'set-frame-pointer)
|
|
229
|
|
230 (define-obsolete-variable-alias 'screen-title-format 'frame-title-format)
|
|
231 (define-obsolete-variable-alias 'screen-icon-title-format
|
|
232 'frame-icon-title-format)
|
|
233 (define-obsolete-variable-alias 'terminal-screen 'terminal-frame)
|
|
234 (define-obsolete-variable-alias 'delete-screen-hook 'delete-frame-hook)
|
|
235 (define-obsolete-variable-alias 'create-screen-hook 'create-frame-hook)
|
|
236 (define-obsolete-variable-alias 'mouse-enter-screen-hook
|
|
237 'mouse-enter-frame-hook)
|
|
238 (define-obsolete-variable-alias 'mouse-leave-screen-hook
|
|
239 'mouse-leave-frame-hook)
|
|
240 (define-obsolete-variable-alias 'map-screen-hook 'map-frame-hook)
|
|
241 (define-obsolete-variable-alias 'unmap-screen-hook 'unmap-frame-hook)
|
|
242 (define-obsolete-variable-alias 'default-screen-alist 'default-frame-alist)
|
|
243 (define-obsolete-variable-alias 'default-screen-name 'default-frame-name)
|
|
244 (define-obsolete-variable-alias 'x-screen-defaults 'default-x-frame-alist)
|
|
245
|
|
246 (defun x-create-screen (parms window-id)
|
284
|
247 ;; obsoleteness info will be displayed, so no need for docstring.
|
209
|
248 (if (not (eq 'x (device-type (selected-device))))
|
|
249 (error "Cannot create X frames on non-X device"))
|
|
250 (make-frame (append parms (list (list 'window-id window-id)))
|
|
251 (selected-device)))
|
|
252 (make-obsolete 'x-create-screen 'make-frame)
|
|
253
|
|
254 (defun frame-first-window (frame)
|
272
|
255 "Return the topmost, leftmost window of FRAME.
|
209
|
256 If omitted, FRAME defaults to the currently selected frame."
|
|
257 (frame-highest-window frame 0))
|
|
258 (make-compatible 'frame-first-window 'frame-highest-window)
|
|
259
|
|
260 (define-obsolete-variable-alias 'initial-frame-alist 'initial-frame-plist)
|
|
261 (define-obsolete-variable-alias 'minibuffer-frame-alist
|
|
262 'minibuffer-frame-plist)
|
|
263 (define-obsolete-variable-alias 'pop-up-frame-alist 'pop-up-frame-plist)
|
|
264 (define-obsolete-variable-alias 'special-display-frame-alist
|
|
265 'special-display-frame-plist)
|
|
266
|
|
267 ;; Defined in C.
|
|
268
|
|
269 (define-obsolete-variable-alias 'default-frame-alist 'default-frame-plist)
|
|
270 (define-obsolete-variable-alias 'default-x-frame-alist 'default-x-frame-plist)
|
|
271 (define-obsolete-variable-alias 'default-tty-frame-alist
|
|
272 'default-tty-frame-plist)
|
|
273
|
|
274 (make-compatible 'frame-parameters 'frame-property)
|
|
275 (defun frame-parameters (&optional frame)
|
|
276 "Return the parameters-alist of frame FRAME.
|
|
277 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.
|
|
278 The meaningful PARMs depend on the kind of frame.
|
|
279 If FRAME is omitted, return information on the currently selected frame.
|
|
280
|
|
281 See the variables `default-frame-plist', `default-x-frame-plist', and
|
|
282 `default-tty-frame-plist' for a description of the parameters meaningful
|
|
283 for particular types of frames."
|
|
284 (or frame (setq frame (selected-frame)))
|
|
285 ;; #### This relies on a `copy-sequence' of the user properties in
|
|
286 ;; `frame-properties'. Removing that would make `frame-properties' more
|
|
287 ;; efficient but this function less efficient, as we couldn't be
|
|
288 ;; destructive. Since most callers now use `frame-parameters', we'll
|
|
289 ;; do it this way. Should probably change this at some point in the
|
|
290 ;; future.
|
|
291 (destructive-plist-to-alist (frame-properties frame)))
|
|
292
|
|
293 (make-compatible 'modify-frame-parameters 'set-frame-properties)
|
|
294 (defun modify-frame-parameters (frame alist)
|
|
295 "Modify the properties of frame FRAME according to ALIST.
|
|
296 ALIST is an alist of properties to change and their new values.
|
|
297 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.
|
|
298 The meaningful PARMs depend on the kind of frame.
|
|
299
|
|
300 See `set-frame-properties' for built-in property names."
|
|
301 ;; it would be nice to be destructive here but that's not safe.
|
|
302 (set-frame-properties frame (alist-to-plist alist)))
|
|
303
|
|
304 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; faces
|
|
305
|
|
306 (define-obsolete-function-alias 'list-faces-display 'edit-faces)
|
|
307 (define-obsolete-function-alias 'list-faces 'face-list)
|
|
308
|
|
309 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; files
|
|
310
|
|
311 (make-obsolete-variable 'trim-versions-without-asking 'delete-old-versions)
|
|
312 ;;; Old XEmacs name; kept around for compatibility.
|
|
313 (define-obsolete-variable-alias 'after-write-file-hooks 'after-save-hook)
|
|
314 (define-obsolete-function-alias 'truename 'file-truename)
|
|
315
|
274
|
316 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; paths
|
|
317
|
|
318 (defvar Info-default-directory-list nil
|
|
319 "This used to be the initial value of Info-directory-list.
|
|
320 If you want to change the locations where XEmacs looks for info files,
|
|
321 set Info-directory-list.")
|
|
322 (make-obsolete-variable 'Info-default-directory-list 'Info-directory-list)
|
|
323
|
209
|
324 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; hooks
|
|
325
|
|
326 (make-obsolete-variable 'auto-fill-hook 'auto-fill-function)
|
|
327 (make-obsolete-variable 'blink-paren-hook 'blink-paren-function)
|
|
328 (make-obsolete-variable 'lisp-indent-hook 'lisp-indent-function)
|
|
329 (make-obsolete-variable 'comment-indent-hook 'comment-indent-function)
|
|
330 (make-obsolete-variable 'temp-buffer-show-hook
|
|
331 'temp-buffer-show-function)
|
|
332 (make-obsolete-variable 'inhibit-local-variables
|
|
333 "use `enable-local-variables' (with the reversed sense).")
|
|
334 (make-obsolete-variable 'suspend-hooks 'suspend-hook)
|
|
335 (make-obsolete-variable 'first-change-function 'first-change-hook)
|
|
336 (make-obsolete-variable 'before-change-function
|
|
337 "use before-change-functions; which is a list of functions rather than a single function.")
|
|
338 (make-obsolete-variable 'after-change-function
|
|
339 "use after-change-functions; which is a list of functions rather than a single function.")
|
|
340
|
|
341 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; insertion and deletion
|
|
342
|
|
343 (define-compatible-function-alias 'insert-and-inherit 'insert)
|
|
344 (define-compatible-function-alias 'insert-before-markers-and-inherit
|
|
345 'insert-before-markers)
|
|
346
|
|
347 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; keymaps
|
|
348
|
|
349 (defun keymap-parent (keymap)
|
272
|
350 "Return the first parent of the given keymap."
|
209
|
351 (car (keymap-parents keymap)))
|
|
352 (make-compatible 'keymap-parent 'keymap-parents)
|
|
353
|
|
354 (defun set-keymap-parent (keymap parent)
|
272
|
355 "Make the given keymap have (only) the given parent."
|
209
|
356 (set-keymap-parents keymap (if parent (list parent) '()))
|
|
357 parent)
|
|
358 (make-compatible 'set-keymap-parent 'set-keymap-parents)
|
|
359
|
|
360 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; menu stuff
|
|
361
|
|
362 (defun add-menu-item (menu-path item-name function enabled-p &optional before)
|
|
363 "Obsolete. See the function `add-menu-button'."
|
|
364 (or item-name (error "must specify an item name"))
|
|
365 (add-menu-button menu-path (vector item-name function enabled-p) before))
|
|
366 (make-obsolete 'add-menu-item 'add-menu-button)
|
|
367
|
|
368 (defun add-menu (menu-path menu-name menu-items &optional before)
|
|
369 "See the function `add-submenu'."
|
|
370 (or menu-name (error (gettext "must specify a menu name")))
|
|
371 (or menu-items (error (gettext "must specify some menu items")))
|
|
372 (add-submenu menu-path (cons menu-name menu-items) before))
|
|
373 ;; Can't make this obsolete. easymenu depends on it.
|
|
374 (make-compatible 'add-menu 'add-submenu)
|
|
375
|
|
376 (define-obsolete-function-alias 'popup-menu-up-p 'popup-up-p)
|
|
377
|
|
378 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; minibuffer
|
|
379
|
|
380 (define-compatible-function-alias 'read-minibuffer
|
|
381 'read-expression) ; misleading name
|
|
382 (define-compatible-function-alias 'read-input 'read-string)
|
|
383 (make-obsolete 'read-no-blanks-input 'read-string) ; mocklisp crud
|
|
384
|
|
385 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; misc
|
|
386
|
|
387 ;; (defun user-original-login-name ()
|
|
388 ;; "Return user's login name from original login.
|
|
389 ;; This tries to remain unaffected by `su', by looking in environment variables."
|
|
390 ;; (or (getenv "LOGNAME") (getenv "USER") (user-login-name)))
|
|
391 (define-obsolete-function-alias 'user-original-login-name 'user-login-name)
|
|
392
|
|
393 ; old names
|
|
394 (define-obsolete-function-alias 'wholenump 'natnump)
|
|
395 (define-obsolete-function-alias 'show-buffer 'set-window-buffer)
|
|
396 (define-obsolete-function-alias 'buffer-flush-undo 'buffer-disable-undo)
|
|
397 (define-obsolete-function-alias 'eval-current-buffer 'eval-buffer)
|
|
398 (define-obsolete-function-alias 'byte-code-function-p
|
|
399 'compiled-function-p) ;FSFmacs
|
|
400
|
|
401 ;;(make-obsolete 'mod '%) ; mod and % are different now
|
|
402
|
|
403 (make-obsolete 'ring-mod 'mod)
|
|
404
|
|
405 (make-obsolete 'current-time-seconds 'current-time)
|
|
406 ;; too bad there's not a way to check for aref, assq, and nconc
|
|
407 ;; being called on the values of functions known to return keymaps,
|
|
408 ;; or known to return vectors of events instead of strings...
|
|
409
|
|
410 (define-obsolete-function-alias 'run-special-hook-with-args
|
|
411 'run-hook-with-args-until-success)
|
|
412
|
|
413 (make-obsolete-variable 'executing-macro 'executing-kbd-macro)
|
|
414
|
|
415 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; modeline
|
|
416
|
|
417 (define-compatible-function-alias 'redraw-mode-line 'redraw-modeline)
|
|
418 (define-compatible-function-alias 'force-mode-line-update
|
|
419 'redraw-modeline) ;; FSF compatibility
|
|
420 (define-compatible-variable-alias 'mode-line-map 'modeline-map)
|
|
421 (define-compatible-variable-alias 'mode-line-buffer-identification
|
|
422 'modeline-buffer-identification)
|
|
423 (define-compatible-variable-alias 'mode-line-process 'modeline-process)
|
|
424 (define-compatible-variable-alias 'mode-line-modified 'modeline-modified)
|
|
425 (make-compatible-variable 'mode-line-inverse-video
|
|
426 "use set-face-highlight-p and set-face-reverse-p")
|
|
427 (define-compatible-variable-alias 'default-mode-line-format
|
|
428 'default-modeline-format)
|
|
429 (define-compatible-variable-alias 'mode-line-format 'modeline-format)
|
|
430 (define-compatible-variable-alias 'mode-line-menu 'modeline-menu)
|
|
431
|
|
432 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; mouse
|
|
433
|
|
434 ;;; (defun mouse-eval-last-sexpr (event)
|
|
435 ;;; (interactive "@e")
|
|
436 ;;; (save-excursion
|
|
437 ;;; (mouse-set-point event)
|
|
438 ;;; (eval-last-sexp nil)))
|
|
439
|
|
440 (define-obsolete-function-alias 'mouse-eval-last-sexpr 'mouse-eval-sexp)
|
|
441
|
|
442 (defun read-mouse-position (frame)
|
|
443 (cdr (mouse-position (frame-device frame))))
|
|
444 (make-obsolete 'read-mouse-position 'mouse-position)
|
|
445
|
|
446 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; `point'
|
|
447
|
|
448 (define-obsolete-function-alias 'dot 'point)
|
|
449 (define-obsolete-function-alias 'dot-marker 'point-marker)
|
|
450 (define-obsolete-function-alias 'dot-min 'point-min)
|
|
451 (define-obsolete-function-alias 'dot-max 'point-max)
|
|
452 (define-obsolete-function-alias 'window-dot 'window-point)
|
|
453 (define-obsolete-function-alias 'set-window-dot 'set-window-point)
|
|
454
|
|
455 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; processes
|
|
456
|
|
457 (define-obsolete-function-alias 'send-string 'process-send-string)
|
|
458 (define-obsolete-function-alias 'send-region 'process-send-region)
|
|
459
|
|
460 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; redisplay
|
|
461
|
|
462 (defun redraw-display (&optional device)
|
|
463 (if (eq device t)
|
|
464 (mapcar 'redisplay-device (device-list))
|
|
465 (redisplay-device device)))
|
|
466
|
|
467 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; stuff replaced by specifiers
|
|
468
|
|
469 (defun screen-scrollbar-width (&optional screen)
|
|
470 ;; specifier-specs is the inverse of set-specifier, but
|
|
471 ;; the way this function was defined, specifier-instance
|
|
472 ;; is closer.
|
|
473 (specifier-instance scrollbar-width (or screen (selected-frame))))
|
|
474 (make-obsolete 'screen-scrollbar-width
|
|
475 "use (specifier-instance scrollbar-width ...).")
|
|
476
|
|
477 (defun set-screen-scrollbar-width (screen value)
|
|
478 (set-specifier scrollbar-width (cons screen value)))
|
|
479 (make-obsolete 'set-screen-scrollbar-width
|
|
480 "use (set-specifier scrollbar-width ...).")
|
|
481
|
|
482 (defun set-screen-left-margin-width (value &optional screen)
|
|
483 (set-specifier left-margin-width
|
|
484 (cons (or screen (selected-frame)) value)))
|
|
485 (make-obsolete 'set-screen-left-margin-width
|
|
486 "use (set-specifier left-margin-width ...).")
|
|
487
|
|
488 (defun set-screen-right-margin-width (value &optional screen)
|
|
489 (set-specifier right-margin-width
|
|
490 (cons (or screen (selected-frame)) value)))
|
|
491 (make-obsolete 'set-screen-right-margin-width
|
|
492 "use (set-specifier right-margin-width ...).")
|
|
493
|
|
494 (defun set-buffer-left-margin-width (value &optional buffer)
|
|
495 (set-specifier left-margin-width (cons (or buffer (current-buffer)) value)))
|
|
496 (make-obsolete 'set-buffer-left-margin-width
|
|
497 "use (set-specifier left-margin-width ...).")
|
|
498
|
|
499 (defun set-buffer-right-margin-width (value &optional buffer)
|
|
500 (set-specifier right-margin-width (cons (or buffer (current-buffer)) value)))
|
|
501 (make-obsolete 'set-buffer-right-margin-width
|
|
502 "use (set-specifier right-margin-width ...).")
|
|
503
|
|
504 (defun screen-left-margin-width (&optional screen)
|
|
505 (specifier-specs left-margin-width (or screen (selected-frame))))
|
|
506 (make-obsolete 'screen-left-margin-width
|
|
507 "use (specifier-specs left-margin-width ...).")
|
|
508
|
|
509 (defun screen-right-margin-width (&optional screen)
|
|
510 (specifier-specs right-margin-width (or screen (selected-frame))))
|
|
511 (make-obsolete 'screen-right-margin-width
|
|
512 "use (specifier-specs right-margin-width ...).")
|
|
513
|
|
514 (defun buffer-left-margin-width (&optional buffer)
|
|
515 (specifier-specs left-margin-width (or buffer (current-buffer))))
|
|
516 (make-obsolete 'buffer-left-margin-width
|
|
517 "use (specifier-specs left-margin-width ...).")
|
|
518
|
|
519 (defun buffer-right-margin-width (&optional buffer)
|
|
520 (specifier-specs right-margin-width (or buffer (current-buffer))))
|
|
521 (make-obsolete 'buffer-right-margin-width
|
|
522 "use (specifier-specs right-margin-width ...).")
|
|
523
|
|
524 (defun x-set-frame-icon-pixmap (frame image-instance &optional mask-ignored)
|
|
525 "Set the icon of the given frame to the given image instance,
|
|
526 which should be an image instance object (as returned by
|
|
527 `make-image-instance'), a glyph object (as returned by `make-glyph'),
|
|
528 or nil. If a glyph object is given, the glyph will be instantiated on
|
|
529 the frame to produce an image instance object.
|
|
530
|
|
531 If the given image instance has a mask, that will be used as the icon mask;
|
|
532 however, not all window managers support this.
|
|
533
|
|
534 The window manager is also not required to support color pixmaps,
|
|
535 only bitmaps (one plane deep).
|
|
536
|
|
537 Optional third argument is ignored. If you're concerned about this
|
|
538 incomplete backwards incompatibility, you should convert your code
|
|
539 to use `frame-icon-glyph' -- you can specify a mask for an XBM file
|
|
540 using the standard image instantiator format."
|
|
541 (if (glyphp image-instance)
|
|
542 (setq image-instance (glyph-image-instance image-instance frame)))
|
|
543 (set-glyph-image frame-icon-glyph image-instance frame))
|
|
544 (make-obsolete 'x-set-frame-icon-pixmap
|
|
545 "use (set-glyph-image frame-icon-glyph ...).")
|
|
546 (defalias 'x-set-screen-icon-pixmap 'x-set-frame-icon-pixmap)
|
|
547 (make-obsolete 'x-set-screen-icon-pixmap
|
|
548 "use (set-glyph-image frame-icon-glyph ...).")
|
|
549
|
|
550 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; window-system objects
|
|
551
|
|
552 (define-obsolete-function-alias 'pixel-name 'color-name)
|
|
553
|
|
554 ;; compatibility function -- a front-end to make-glyph
|
|
555 (defun make-pixmap (name &optional locale)
|
|
556 "Create a glyph with NAME as an image specifier and locale LOCALE.
|
|
557 The file should be in `XBM' or `XPM' format.
|
|
558 If the XBMLANGPATH environment variable is set, it will be searched for
|
|
559 matching files. Next, the directories listed in the `x-bitmap-file-path'
|
|
560 variable will be searched (this variable is initialized from the
|
|
561 \"*bitmapFilePath\" resource). Finally, the XEmacs etc/ directory
|
|
562 (the value of `data-directory') will be searched.
|
|
563 The file argument may also be a list of the form (width height data) where
|
|
564 width and height are the size in pixels, and data is a string, containing
|
|
565 the raw bits of the bitmap. (Bitmaps specified this way can only be one bit
|
|
566 deep.)
|
|
567 If compiled with support for XPM, the file argument may also be a string
|
|
568 which is the contents of an XPM file (that is, a string beginning with the
|
|
569 characters \"/* XPM */\"; see the XPM documentation).
|
|
570 The optional second argument is the specifier locale for this pixmap glyph.
|
|
571 The returned object is a glyph object. To get the actual pixmap object for
|
|
572 a given frame, use the function `glyph-instance'."
|
|
573 (if (consp name)
|
|
574 (setq name (vector 'xbm :data name)))
|
|
575 (make-glyph name))
|
|
576 (make-obsolete 'make-pixmap 'make-glyph)
|
|
577
|
|
578 (defun make-cursor (name &optional fg bg device)
|
|
579 "Creates a pointer image instance with NAME as an image specifier.
|
|
580 The optional second and third arguments are the foreground and background
|
|
581 colors. They may be color name strings or `pixel' objects.
|
|
582 The optional fourth argument is the device on which to allocate the cursor
|
|
583 (defaults to the selected device).
|
|
584 This allocates a new pointer in the X server, and signals an error if the
|
|
585 pointer is unknown or cannot be allocated.
|
|
586
|
|
587 A pointer name can take many different forms. It can be:
|
|
588 - any of the standard cursor names from appendix B of the Xlib manual
|
|
589 (also known as the file <X11/cursorfont.h>) minus the XC_ prefix;
|
|
590 - the name of a font, and glyph index into it of the form
|
|
591 \"FONT fontname index [[mask-font] mask-index]\";
|
|
592 - the name of a bitmap or pixmap file;
|
|
593 - or an image instance object, as returned by `make-image-instance'.
|
|
594
|
|
595 If it is an image instance or pixmap file, and that pixmap comes with a
|
|
596 mask, then that mask will be used. If it is an image instance, it must
|
|
597 have only one plane, since X pointers may only have two colors. If it is a
|
|
598 pixmap file, then the file will be read in monochrome.
|
|
599
|
|
600 If it is a bitmap file, and if a bitmap file whose name is the name of the
|
|
601 pointer with \"msk\" or \"Mask\" appended exists, then that second bitmap
|
|
602 will be used as the mask. For example, a pair of files might be named
|
|
603 \"pointer.xbm\" and \"pointer.xbmmsk\".
|
|
604
|
|
605 The returned object is a normal, first-class lisp object. The way you
|
|
606 `deallocate' the pointer is the way you deallocate any other lisp object:
|
|
607 you drop all pointers to it and allow it to be garbage collected. When
|
|
608 these objects are GCed, the underlying X data is deallocated as well."
|
|
609 ;; #### ignores fg and bg
|
|
610 (make-image-instance name device '(pointer)))
|
|
611 (make-obsolete 'make-cursor 'make-image-instance)
|
|
612
|
|
613 (define-obsolete-function-alias 'pixmap-width 'glyph-width)
|
|
614 (define-obsolete-function-alias 'pixmap-contributes-to-line-height-p
|
|
615 'glyph-contrib-p-instance)
|
|
616 (define-obsolete-function-alias 'set-pixmap-contributes-to-line-height
|
|
617 'set-glyph-contrib-p)
|
|
618
|
|
619 ;; the functionality of column.el has been moved into C
|
|
620 (defalias 'display-column-mode 'column-number-mode)
|
|
621
|
|
622 (defun x-color-values (color &optional frame)
|
|
623 "Return a description of the color named COLOR on frame FRAME.
|
|
624 The value is a list of integer RGB values--(RED GREEN BLUE).
|
|
625 These values appear to range from 0 to 65280 or 65535, depending
|
|
626 on the system; white is (65280 65280 65280) or (65535 65535 65535).
|
|
627 If FRAME is omitted or nil, use the selected frame."
|
|
628 (color-instance-rgb-components (make-color-instance color)))
|
|
629 (make-compatible 'x-color-values 'color-instance-rgb-components)
|
|
630
|
|
631 ;; Two loser functions which shouldn't be used.
|
|
632 (make-obsolete 'following-char 'char-after)
|
|
633 (make-obsolete 'preceding-char 'char-before)
|
|
634
|
|
635
|
|
636 ;; The following several functions are useful in GNU Emacs 20 because
|
|
637 ;; of the multibyte "characters" the internal representation of which
|
|
638 ;; leaks into Lisp. In XEmacs/Mule they are trivial and unnecessary.
|
|
639 ;; We provide them for compatibility reasons solely.
|
|
640
|
|
641 (defun string-to-sequence (string type)
|
|
642 "Convert STRING to a sequence of TYPE which contains characters in STRING.
|
|
643 TYPE should be `list' or `vector'.
|
|
644 Multibyte characters are concerned."
|
|
645 (ecase type
|
|
646 (list
|
|
647 (mapcar #'identity string))
|
|
648 (vector
|
|
649 (mapvector #'identity string))))
|
|
650
|
|
651 (defun string-to-list (string)
|
|
652 "Return a list of characters in STRING."
|
|
653 (mapcar #'identity string))
|
|
654
|
|
655 (defun string-to-vector (string)
|
|
656 "Return a vector of characters in STRING."
|
|
657 (mapvector #'identity string))
|
|
658
|
|
659 (defun store-substring (string idx obj)
|
|
660 "Embed OBJ (string or character) at index IDX of STRING."
|
|
661 (let* ((str (cond ((stringp obj) obj)
|
|
662 ((characterp obj) (char-to-string obj))
|
|
663 (t (error
|
|
664 "Invalid argument (should be string or character): %s"
|
|
665 obj))))
|
|
666 (string-len (length string))
|
|
667 (len (length str))
|
|
668 (i 0))
|
|
669 (while (and (< i len) (< idx string-len))
|
|
670 (aset string idx (aref str i))
|
|
671 (setq idx (1+ idx) i (1+ i)))
|
|
672 string))
|
|
673
|
|
674 ;; ### This function is not compatible with FSF in some cases. Hard
|
|
675 ;; to fix, because it is hard to trace the logic of the FSF function.
|
367
|
676 ;; In case we need the exact behavior, we can always copy the FSF
|
209
|
677 ;; version, which is very long and does lots of unnecessary stuff.
|
|
678 (defun truncate-string-to-width (str end-column &optional start-column padding)
|
|
679 "Truncate string STR to end at column END-COLUMN.
|
|
680 The optional 2nd arg START-COLUMN, if non-nil, specifies
|
|
681 the starting column; that means to return the characters occupying
|
|
682 columns START-COLUMN ... END-COLUMN of STR.
|
|
683
|
|
684 The optional 3rd arg PADDING, if non-nil, specifies a padding character
|
|
685 to add at the end of the result if STR doesn't reach column END-COLUMN,
|
|
686 or if END-COLUMN comes in the middle of a character in STR.
|
|
687 PADDING is also added at the beginning of the result
|
|
688 if column START-COLUMN appears in the middle of a character in STR.
|
|
689
|
|
690 If PADDING is nil, no padding is added in these cases, so
|
|
691 the resulting string may be narrower than END-COLUMN."
|
|
692 (or start-column
|
|
693 (setq start-column 0))
|
|
694 (let ((len (length str)))
|
|
695 (concat (substring str (min start-column len) (min end-column len))
|
|
696 (and padding (> end-column len)
|
|
697 (make-string (- end-column len) padding)))))
|
|
698
|
|
699 (defalias 'truncate-string 'truncate-string-to-width)
|
|
700 (make-obsolete 'truncate-string 'truncate-string-to-width)
|
|
701
|
|
702 ;; Keywords already do The Right Thing in XEmacs
|
|
703 (make-compatible 'define-widget-keywords "Just use them")
|
|
704
|
|
705 (make-obsolete 'function-called-at-point 'function-at-point)
|
|
706
|
|
707 ;;; obsolete.el ends here
|