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