0
|
1 ;;; obsolete.el --- obsoleteness support.
|
|
2
|
|
3 ;;;; Copyright (C) 1985-1994 Free Software Foundation, Inc.
|
|
4 ;;;; Copyright (C) 1994, 1995 Amdahl Corporation.
|
|
5 ;;;; Copyright (C) 1995 Sun Microsystems.
|
|
6
|
|
7 ;; Maintainer: XEmacs
|
|
8 ;; Keywords: internal
|
|
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
|
|
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
24 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
25
|
|
26 ;;; The obsoleteness support used to be scattered throughout various
|
|
27 ;;; source files. We put the stuff in one place to remove the junkiness
|
|
28 ;;; from other source files and to facilitate creating/updating things
|
|
29 ;;; like sysdep.el.
|
|
30
|
|
31 ;;; Synched up with: Not in FSF.
|
|
32
|
|
33 (defsubst define-obsolete-function-alias (oldfun newfun)
|
|
34 "Define OLDFUN as an obsolete alias for function NEWFUN.
|
|
35 This makes calling OLDFUN equivalent to calling NEWFUN and marks OLDFUN
|
|
36 as obsolete."
|
|
37 (define-function oldfun newfun)
|
|
38 (make-obsolete oldfun newfun))
|
|
39
|
|
40 (defsubst define-obsolete-variable-alias (oldvar newvar)
|
|
41 "Define OLDVAR as an obsolete alias for varction NEWVAR.
|
|
42 This makes referencing or setting OLDVAR equivalent to referencing or
|
|
43 setting NEWVAR and marks OLDVAR as obsolete."
|
|
44 (defvaralias oldvar newvar)
|
|
45 (make-obsolete-variable oldvar newvar))
|
|
46
|
|
47 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; device stuff
|
|
48
|
|
49 (make-obsolete-variable 'window-system "use (console-type)")
|
|
50 (make-obsolete-variable 'meta-flag
|
|
51 "use the `set-input-mode' function instead.")
|
|
52
|
|
53 (defun x-display-color-p (&optional device)
|
|
54 "Returns non-nil if DEVICE is a color device."
|
|
55 (eq 'color (device-class device)))
|
|
56 (make-obsolete 'x-display-color-p 'device-class)
|
|
57
|
|
58 (define-function 'x-color-display-p 'x-display-color-p)
|
|
59 (make-obsolete 'x-display-color-p 'device-class)
|
|
60
|
|
61 (defun x-display-grayscale-p (&optional device)
|
|
62 "Returns non-nil if DEVICE is a grayscale device."
|
|
63 (eq 'grayscale (device-class device)))
|
|
64 (make-obsolete 'x-display-grayscale-p 'device-class)
|
|
65
|
|
66 (define-function 'x-grayscale-display-p 'x-display-grayscale-p)
|
|
67 (make-obsolete 'x-display-grayscale-p 'device-class)
|
|
68
|
|
69 (define-obsolete-function-alias 'x-display-pixel-width 'device-pixel-width)
|
|
70 (define-obsolete-function-alias 'x-display-pixel-height
|
|
71 'device-pixel-height)
|
|
72 (define-obsolete-function-alias 'x-display-planes 'device-bitplanes)
|
|
73 (define-obsolete-function-alias 'x-display-color-cells 'device-color-cells)
|
|
74
|
|
75 (define-obsolete-function-alias 'baud-rate 'device-baud-rate)
|
|
76
|
|
77 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; events
|
|
78
|
|
79 (define-obsolete-function-alias 'menu-event-p 'misc-user-event-p)
|
|
80 (make-obsolete-variable 'unread-command-char 'unread-command-events)
|
|
81 (make-obsolete 'sleep-for-millisecs "use sleep-for with a float")
|
|
82
|
|
83 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; extents
|
|
84
|
|
85 (defun extent-data (extent)
|
|
86 "Obsolete. Returns the `data' property of the given extent."
|
|
87 (extent-property extent 'data))
|
|
88 (make-obsolete 'set-window-dot 'set-window-point)
|
|
89
|
|
90 (defun set-extent-data (extent data)
|
|
91 "Obsolete. Sets the `data' property of the given extent."
|
|
92 (set-extent-property extent 'data data))
|
|
93 (make-obsolete 'set-extent-data 'set-extent-property)
|
|
94
|
|
95 (define-obsolete-function-alias 'extent-buffer 'extent-object)
|
|
96
|
|
97 (defun set-extent-attribute (extent attr &optional clearp)
|
|
98 "" ;; obsoleteness info will be displayed, so no need for anything more.
|
|
99 (cond ((eq attr 'write-protected)
|
|
100 (set-extent-property extent 'read-only t))
|
|
101 ((eq attr 'unhighlight)
|
|
102 (set-extent-property extent 'mouse-face nil))
|
|
103 ((eq attr 'writable)
|
|
104 (set-extent-property extent 'read-only nil))
|
|
105 ((eq attr 'visible)
|
|
106 (set-extent-property extent 'invisible nil))
|
|
107 (t
|
|
108 (set-extent-property extent attr t))))
|
|
109 (make-obsolete 'set-extent-attribute 'set-extent-property)
|
|
110
|
|
111 (defun extent-glyph (extent)
|
|
112 "" ;; obsoleteness info will be displayed, so no need for anything more.
|
|
113 (or (extent-begin-glyph extent)
|
|
114 (extent-end-glyph extent)))
|
|
115 (make-obsolete 'extent-glyph
|
|
116 "use `extent-begin-glyph' or `extent-end-glyph' instead.")
|
|
117
|
|
118 (defun extent-layout (extent)
|
|
119 "" ;; obsoleteness info will be displayed, so no need for anything more.
|
|
120 (extent-begin-glyph-layout extent))
|
|
121 (make-obsolete 'extent-layout
|
|
122 "use `extent-begin-glyph-layout' or `extent-end-glyph-layout' instead.")
|
|
123
|
|
124 (defun set-extent-layout (extent layout)
|
|
125 "" ;; obsoleteness info will be displayed, so no need for anything more.
|
|
126 (set-extent-begin-glyph-layout extent layout))
|
|
127 (make-obsolete 'set-extent-layout
|
|
128 "use `set-extent-begin-glyph-layout' or `set-extent-end-glyph-layout' instead.")
|
|
129
|
|
130 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; frames
|
|
131
|
|
132 (define-obsolete-variable-alias 'select-screen-hook 'select-frame-hook)
|
|
133 (define-obsolete-variable-alias 'deselect-screen-hook 'deselect-frame-hook)
|
|
134 (define-obsolete-variable-alias 'auto-raise-screen 'auto-raise-frame)
|
|
135 (define-obsolete-variable-alias 'auto-lower-screen 'auto-lower-frame)
|
|
136 (define-obsolete-variable-alias 'get-screen-for-buffer-default-screen-name
|
|
137 'get-frame-for-buffer-default-frame-name)
|
|
138
|
|
139 (define-obsolete-function-alias 'buffer-dedicated-screen
|
|
140 'buffer-dedicated-frame)
|
|
141 (define-obsolete-function-alias 'deiconify-screen 'deiconify-frame)
|
|
142 (define-obsolete-function-alias 'delete-screen 'delete-frame)
|
|
143 (define-obsolete-function-alias 'event-screen 'event-frame)
|
|
144 (define-obsolete-function-alias 'find-file-other-screen 'find-file-other-frame)
|
|
145 (define-obsolete-function-alias 'find-file-read-only-other-screen
|
|
146 'find-file-read-only-other-frame)
|
|
147 (define-obsolete-function-alias 'live-screen-p 'frame-live-p)
|
|
148 (define-obsolete-function-alias 'screen-height 'frame-height)
|
|
149 (define-obsolete-function-alias 'screen-iconified-p 'frame-iconified-p)
|
|
150 (define-obsolete-function-alias 'screen-list 'frame-list)
|
|
151 (define-obsolete-function-alias 'screen-live-p 'frame-live-p)
|
|
152 (define-obsolete-function-alias 'screen-name 'frame-name)
|
|
153 (define-obsolete-function-alias 'screen-parameters 'frame-parameters)
|
|
154 (define-obsolete-function-alias 'screen-pixel-height 'frame-pixel-height)
|
|
155 (define-obsolete-function-alias 'screen-pixel-width 'frame-pixel-width)
|
|
156 (define-obsolete-function-alias 'screen-root-window 'frame-root-window)
|
|
157 (define-obsolete-function-alias 'screen-selected-window 'frame-selected-window)
|
|
158 (define-obsolete-function-alias 'screen-totally-visible-p
|
|
159 'frame-totally-visible-p)
|
|
160 (define-obsolete-function-alias 'screen-visible-p 'frame-visible-p)
|
|
161 (define-obsolete-function-alias 'screen-width 'frame-width)
|
|
162 (define-obsolete-function-alias 'screenp 'framep)
|
|
163 (define-obsolete-function-alias 'get-screen-for-buffer 'get-frame-for-buffer)
|
|
164 (define-obsolete-function-alias 'get-screen-for-buffer-noselect
|
|
165 'get-frame-for-buffer-noselect)
|
|
166 (define-obsolete-function-alias 'get-other-screen 'get-other-frame)
|
|
167 (define-obsolete-function-alias 'iconify-screen 'iconify-frame)
|
|
168 (define-obsolete-function-alias 'lower-screen 'lower-frame)
|
|
169 (define-obsolete-function-alias 'mail-other-screen 'mail-other-frame)
|
|
170 (define-obsolete-function-alias 'make-screen 'make-frame)
|
|
171 (define-obsolete-function-alias 'make-screen-invisible 'make-frame-invisible)
|
|
172 (define-obsolete-function-alias 'make-screen-visible 'make-frame-visible)
|
|
173 (define-obsolete-function-alias 'modify-screen-parameters
|
|
174 'modify-frame-parameters)
|
|
175 (define-obsolete-function-alias 'new-screen 'new-frame)
|
|
176 (define-obsolete-function-alias 'next-screen 'next-frame)
|
|
177 (define-obsolete-function-alias 'next-multiscreen-window
|
|
178 'next-multiframe-window)
|
|
179 (define-obsolete-function-alias 'other-screen 'other-frame)
|
|
180 (define-obsolete-function-alias 'previous-screen 'previous-frame)
|
|
181 (define-obsolete-function-alias 'previous-multiscreen-window
|
|
182 'previous-multiframe-window)
|
|
183 (define-obsolete-function-alias 'raise-screen 'raise-frame)
|
|
184 (define-obsolete-function-alias 'redraw-screen 'redraw-frame)
|
|
185 (define-obsolete-function-alias 'select-screen 'select-frame)
|
|
186 (define-obsolete-function-alias 'selected-screen 'selected-frame)
|
|
187 (define-obsolete-function-alias 'set-buffer-dedicated-screen
|
|
188 'set-buffer-dedicated-frame)
|
|
189 (define-obsolete-function-alias 'set-screen-height 'set-frame-height)
|
|
190 (define-obsolete-function-alias 'set-screen-position 'set-frame-position)
|
|
191 (define-obsolete-function-alias 'set-screen-size 'set-frame-size)
|
|
192 (define-obsolete-function-alias 'set-screen-width 'set-frame-width)
|
|
193 (define-obsolete-function-alias 'show-temp-buffer-in-current-screen
|
|
194 'show-temp-buffer-in-current-frame)
|
|
195 (define-obsolete-function-alias 'switch-to-buffer-other-screen
|
|
196 'switch-to-buffer-other-frame)
|
|
197 (define-obsolete-function-alias 'visible-screen-list 'visible-frame-list)
|
|
198 (define-obsolete-function-alias 'window-screen 'window-frame)
|
|
199 (define-obsolete-function-alias 'x-set-screen-pointer
|
|
200 'set-frame-pointer)
|
|
201 (define-obsolete-function-alias 'x-set-frame-pointer
|
|
202 'set-frame-pointer)
|
|
203
|
|
204 (define-obsolete-variable-alias 'screen-title-format 'frame-title-format)
|
|
205 (define-obsolete-variable-alias 'screen-icon-title-format
|
|
206 'frame-icon-title-format)
|
|
207 (define-obsolete-variable-alias 'terminal-screen 'terminal-frame)
|
|
208 (define-obsolete-variable-alias 'delete-screen-hook 'delete-frame-hook)
|
|
209 (define-obsolete-variable-alias 'create-screen-hook 'create-frame-hook)
|
|
210 (define-obsolete-variable-alias 'mouse-enter-screen-hook
|
|
211 'mouse-enter-frame-hook)
|
|
212 (define-obsolete-variable-alias 'mouse-leave-screen-hook
|
|
213 'mouse-leave-frame-hook)
|
|
214 (define-obsolete-variable-alias 'map-screen-hook 'map-frame-hook)
|
|
215 (define-obsolete-variable-alias 'unmap-screen-hook 'unmap-frame-hook)
|
|
216 (define-obsolete-variable-alias 'default-screen-alist 'default-frame-alist)
|
|
217 (define-obsolete-variable-alias 'default-screen-name 'default-frame-name)
|
|
218 (define-obsolete-variable-alias 'x-screen-defaults 'default-x-frame-alist)
|
|
219
|
|
220 (defun x-create-screen (parms window-id)
|
|
221 ""
|
|
222 (if (not (eq 'x (device-type (selected-device))))
|
|
223 (error "Cannot create X frames on non-X device"))
|
|
224 (make-frame (append parms (list (list 'window-id window-id)))
|
|
225 (selected-device)))
|
|
226 (make-obsolete 'x-create-screen 'make-frame)
|
|
227
|
|
228 (defun frame-first-window (frame)
|
|
229 "Returns the topmost, leftmost window of FRAME.
|
|
230 If omitted, FRAME defaults to the currently selected frame."
|
|
231 (frame-highest-window frame 0))
|
|
232 (make-obsolete 'frame-first-window 'frame-highest-window)
|
|
233
|
|
234 (define-obsolete-variable-alias 'initial-frame-alist 'initial-frame-plist)
|
|
235 (define-obsolete-variable-alias 'minibuffer-frame-alist
|
|
236 'minibuffer-frame-plist)
|
|
237 (define-obsolete-variable-alias 'pop-up-frame-alist 'pop-up-frame-plist)
|
|
238 (define-obsolete-variable-alias 'special-display-frame-alist
|
|
239 'special-display-frame-plist)
|
|
240
|
|
241 ;; Defined in C.
|
|
242
|
|
243 (define-obsolete-variable-alias 'default-frame-alist 'default-frame-plist)
|
|
244 (define-obsolete-variable-alias 'default-x-frame-alist 'default-x-frame-plist)
|
|
245 (define-obsolete-variable-alias 'default-tty-frame-alist
|
|
246 'default-tty-frame-plist)
|
|
247
|
|
248 (make-obsolete 'frame-parameters 'frame-property)
|
|
249 (defun frame-parameters (&optional frame)
|
|
250 "Return the parameters-alist of frame FRAME.
|
|
251 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.
|
|
252 The meaningful PARMs depend on the kind of frame.
|
|
253 If FRAME is omitted, return information on the currently selected frame.
|
|
254
|
|
255 See the variables `default-frame-plist', `default-x-frame-plist', and
|
|
256 `default-tty-frame-plist' for a description of the parameters meaningful
|
|
257 for particular types of frames."
|
|
258 (or frame (setq frame (selected-frame)))
|
|
259 ;; #### This relies on a `copy-sequence' of the user properties in
|
|
260 ;; `frame-properties'. Removing that would make `frame-properties' more
|
|
261 ;; efficient but this function less efficient, as we couldn't be
|
|
262 ;; destructive. Since most callers now use `frame-parameters', we'll
|
|
263 ;; do it this way. Should probably change this at some point in the
|
|
264 ;; future.
|
|
265 (destructive-plist-to-alist (frame-properties frame)))
|
|
266
|
|
267 (make-obsolete 'modify-frame-parameters 'set-frame-properties)
|
|
268 (defun modify-frame-parameters (frame alist)
|
|
269 "Modify the properties of frame FRAME according to ALIST.
|
|
270 ALIST is an alist of properties to change and their new values.
|
|
271 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.
|
|
272 The meaningful PARMs depend on the kind of frame.
|
|
273
|
|
274 See `set-frame-properties' for built-in property names."
|
|
275 ;; it would be nice to be destructive here but that's not safe.
|
|
276 (set-frame-properties frame (alist-to-plist alist)))
|
|
277
|
|
278 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; faces
|
|
279
|
|
280 (define-obsolete-function-alias 'list-faces-display 'edit-faces)
|
|
281 (define-obsolete-function-alias 'list-faces 'face-list)
|
|
282
|
|
283 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; files
|
|
284
|
|
285 (make-obsolete-variable 'trim-versions-without-asking 'delete-old-versions)
|
|
286 ;;; Old XEmacs name; kept around for compatibility.
|
|
287 (define-obsolete-variable-alias 'after-write-file-hooks 'after-save-hook)
|
|
288 (define-obsolete-function-alias 'truename 'file-truename)
|
|
289
|
|
290 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; hooks
|
|
291
|
|
292 (make-obsolete-variable 'auto-fill-hook 'auto-fill-function)
|
|
293 (make-obsolete-variable 'blink-paren-hook 'blink-paren-function)
|
|
294 (make-obsolete-variable 'lisp-indent-hook 'lisp-indent-function)
|
|
295 (make-obsolete-variable 'comment-indent-hook 'comment-indent-function)
|
|
296 (make-obsolete-variable 'temp-buffer-show-hook
|
|
297 'temp-buffer-show-function)
|
|
298 (make-obsolete-variable 'inhibit-local-variables
|
|
299 "use `enable-local-variables' (with the reversed sense).")
|
|
300 (make-obsolete-variable 'suspend-hooks 'suspend-hook)
|
|
301 (make-obsolete-variable 'first-change-function 'first-change-hook)
|
|
302 (make-obsolete-variable 'before-change-function
|
|
303 "use before-change-functions; which is a list of functions rather than a single function.")
|
|
304 (make-obsolete-variable 'after-change-function
|
|
305 "use after-change-functions; which is a list of functions rather than a single function.")
|
|
306
|
|
307 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; insertion and deletion
|
|
308
|
|
309 (define-obsolete-function-alias 'insert-and-inherit 'insert)
|
|
310 (define-obsolete-function-alias 'insert-before-markers-and-inerhit
|
|
311 'insert-before-markers)
|
|
312
|
|
313 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; keymaps
|
|
314
|
|
315 (defun keymap-parent (keymap)
|
|
316 "Returns the first parent of the given keymap."
|
|
317 (car (keymap-parents keymap)))
|
|
318 (make-obsolete 'keymap-parent 'keymap-parents)
|
|
319
|
|
320 (defun set-keymap-parent (keymap parent)
|
|
321 "Makes the given keymap have (only) the given parent."
|
|
322 (set-keymap-parents keymap (if parent (list parent) '()))
|
|
323 parent)
|
|
324 (make-obsolete 'set-keymap-parent 'set-keymap-parents)
|
|
325
|
|
326 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; menu stuff
|
|
327
|
|
328 (defun add-menu-item (menu-path item-name function enabled-p &optional before)
|
|
329 "Obsolete. See the function `add-menu-button'."
|
|
330 (or item-name (error "must specify an item name"))
|
|
331 (add-menu-button menu-path (vector item-name function enabled-p) before))
|
|
332 (make-obsolete 'add-menu-item 'add-menu-button)
|
|
333
|
|
334 (defun add-menu (menu-path menu-name menu-items &optional before)
|
|
335 "Obsolete. See the function `add-submenu'."
|
|
336 (or menu-name (error (gettext "must specify a menu name")))
|
|
337 (or menu-items (error (gettext "must specify some menu items")))
|
|
338 (add-submenu menu-path (cons menu-name menu-items) before))
|
|
339 (make-obsolete 'add-menu 'add-submenu)
|
|
340
|
|
341 (define-obsolete-function-alias 'popup-menu-up-p 'popup-up-p)
|
|
342
|
|
343 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; minibuffer
|
|
344
|
|
345 (define-obsolete-function-alias 'read-minibuffer
|
|
346 'read-expression) ; misleading name
|
|
347 (define-obsolete-function-alias 'read-input 'read-string)
|
|
348 (make-obsolete 'read-no-blanks-input 'read-string) ; mocklisp crud
|
|
349
|
|
350 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; misc
|
|
351
|
|
352 ;; (defun user-original-login-name ()
|
|
353 ;; "Return user's login name from original login.
|
|
354 ;; This tries to remain unaffected by `su', by looking in environment variables."
|
|
355 ;; (or (getenv "LOGNAME") (getenv "USER") (user-login-name)))
|
|
356 (define-obsolete-function-alias 'user-original-login-name 'user-login-name)
|
|
357
|
|
358 ; old names
|
|
359 (define-obsolete-function-alias 'show-buffer 'set-window-buffer)
|
|
360 (define-obsolete-function-alias 'buffer-flush-undo 'buffer-disable-undo)
|
|
361 (define-obsolete-function-alias 'eval-current-buffer 'eval-buffer)
|
|
362 (define-obsolete-function-alias 'byte-code-function-p
|
|
363 'compiled-function-p) ;FSFmacs
|
|
364
|
|
365 ;;(make-obsolete 'mod '%) ; mod and % are different now
|
|
366
|
|
367 (make-obsolete 'ring-mod 'mod)
|
|
368
|
|
369 (make-obsolete 'current-time-seconds 'current-time)
|
|
370 ;; too bad there's not a way to check for aref, assq, and nconc
|
|
371 ;; being called on the values of functions known to return keymaps,
|
|
372 ;; or known to return vectors of events instead of strings...
|
|
373
|
|
374 (define-obsolete-function-alias 'run-special-hook-with-args
|
|
375 'run-hook-with-args-until-success)
|
|
376
|
|
377 (make-obsolete-variable 'executing-macro 'executing-kbd-macro)
|
|
378
|
|
379 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; modeline
|
|
380
|
|
381 (define-obsolete-function-alias 'redraw-mode-line 'redraw-modeline)
|
|
382 (define-obsolete-function-alias 'force-mode-line-update
|
|
383 'redraw-modeline) ;; FSF compatibility
|
|
384 (define-obsolete-variable-alias 'mode-line-map 'modeline-map)
|
|
385 (define-obsolete-variable-alias 'mode-line-buffer-identification
|
|
386 'modeline-buffer-identification)
|
|
387 (define-obsolete-variable-alias 'mode-line-process 'modeline-process)
|
|
388 (define-obsolete-variable-alias 'mode-line-modified 'modeline-modified)
|
|
389 (make-obsolete-variable 'mode-line-inverse-video
|
|
390 "use set-face-highlight-p and set-face-reverse-p")
|
|
391 (define-obsolete-variable-alias 'default-mode-line-format
|
|
392 'default-modeline-format)
|
|
393 (define-obsolete-variable-alias 'mode-line-format 'modeline-format)
|
|
394 (define-obsolete-variable-alias 'mode-line-menu 'modeline-menu)
|
|
395
|
|
396 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; mouse
|
|
397
|
|
398 ;;; (defun mouse-eval-last-sexpr (event)
|
|
399 ;;; (interactive "@e")
|
|
400 ;;; (save-excursion
|
|
401 ;;; (mouse-set-point event)
|
|
402 ;;; (eval-last-sexp nil)))
|
|
403
|
|
404 (define-obsolete-function-alias 'mouse-eval-last-sexpr 'mouse-eval-sexp)
|
|
405
|
|
406 (defun read-mouse-position (frame)
|
|
407 (cdr (mouse-position (frame-device frame))))
|
|
408 (make-obsolete 'read-mouse-position 'mouse-position)
|
|
409
|
|
410 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; `point'
|
|
411
|
|
412 (define-obsolete-function-alias 'dot 'point)
|
|
413 (define-obsolete-function-alias 'dot-marker 'point-marker)
|
|
414 (define-obsolete-function-alias 'dot-min 'point-min)
|
|
415 (define-obsolete-function-alias 'dot-max 'point-max)
|
|
416 (define-obsolete-function-alias 'window-dot 'window-point)
|
|
417 (define-obsolete-function-alias 'set-window-dot 'set-window-point)
|
|
418
|
|
419 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; processes
|
|
420
|
|
421 (define-obsolete-function-alias 'send-string 'process-send-string)
|
|
422 (define-obsolete-function-alias 'send-region 'process-send-region)
|
|
423
|
|
424 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; redisplay
|
|
425
|
|
426 (defun redraw-display (&optional device)
|
|
427 (if (eq device t)
|
|
428 (mapcar 'redisplay-device (device-list))
|
|
429 (redisplay-device device)))
|
|
430
|
|
431 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; stuff replaced by specifiers
|
|
432
|
|
433 (defun screen-scrollbar-width (&optional screen)
|
|
434 ;; specifier-specs is the inverse of set-specifier, but
|
|
435 ;; the way this function was defined, specifier-instance
|
|
436 ;; is closer.
|
|
437 (specifier-instance scrollbar-width (or screen (selected-frame))))
|
|
438 (make-obsolete 'screen-scrollbar-width
|
|
439 "use (specifier-instance scrollbar-width ...).")
|
|
440
|
|
441 (defun set-screen-scrollbar-width (screen value)
|
|
442 (set-specifier scrollbar-width (cons screen value)))
|
|
443 (make-obsolete 'set-screen-scrollbar-width
|
|
444 "use (set-specifier scrollbar-width ...).")
|
|
445
|
|
446 (defun set-screen-left-margin-width (value &optional screen)
|
|
447 (set-specifier left-margin-width
|
|
448 (cons (or screen (selected-frame)) value)))
|
|
449 (make-obsolete 'set-screen-left-margin-width
|
|
450 "use (set-specifier left-margin-width ...).")
|
|
451
|
|
452 (defun set-screen-right-margin-width (value &optional screen)
|
|
453 (set-specifier right-margin-width
|
|
454 (cons (or screen (selected-frame)) value)))
|
|
455 (make-obsolete 'set-screen-right-margin-width
|
|
456 "use (set-specifier right-margin-width ...).")
|
|
457
|
|
458 (defun set-buffer-left-margin-width (value &optional buffer)
|
|
459 (set-specifier left-margin-width (cons (or buffer (current-buffer)) value)))
|
|
460 (make-obsolete 'set-buffer-left-margin-width
|
|
461 "use (set-specifier left-margin-width ...).")
|
|
462
|
|
463 (defun set-buffer-right-margin-width (value &optional buffer)
|
|
464 (set-specifier right-margin-width (cons (or buffer (current-buffer)) value)))
|
|
465 (make-obsolete 'set-buffer-right-margin-width
|
|
466 "use (set-specifier right-margin-width ...).")
|
|
467
|
|
468 (defun screen-left-margin-width (&optional screen)
|
|
469 (specifier-specs left-margin-width (or screen (selected-frame))))
|
|
470 (make-obsolete 'screen-left-margin-width
|
|
471 "use (specifier-specs left-margin-width ...).")
|
|
472
|
|
473 (defun screen-right-margin-width (&optional screen)
|
|
474 (specifier-specs right-margin-width (or screen (selected-frame))))
|
|
475 (make-obsolete 'screen-right-margin-width
|
|
476 "use (specifier-specs right-margin-width ...).")
|
|
477
|
|
478 (defun buffer-left-margin-width (&optional buffer)
|
|
479 (specifier-specs left-margin-width (or buffer (current-buffer))))
|
|
480 (make-obsolete 'buffer-left-margin-width
|
|
481 "use (specifier-specs left-margin-width ...).")
|
|
482
|
|
483 (defun buffer-right-margin-width (&optional buffer)
|
|
484 (specifier-specs right-margin-width (or buffer (current-buffer))))
|
|
485 (make-obsolete 'buffer-right-margin-width
|
|
486 "use (specifier-specs right-margin-width ...).")
|
|
487
|
|
488 (defun x-set-frame-icon-pixmap (frame image-instance &optional mask-ignored)
|
|
489 "Set the icon of the given frame to the given image instance,
|
|
490 which should be an image instance object (as returned by
|
|
491 `make-image-instance'), a glyph object (as returned by `make-glyph'),
|
|
492 or nil. If a glyph object is given, the glyph will be instantiated on
|
|
493 the frame to produce an image instance object.
|
|
494
|
|
495 If the given image instance has a mask, that will be used as the icon mask;
|
|
496 however, not all window managers support this.
|
|
497
|
|
498 The window manager is also not required to support color pixmaps,
|
|
499 only bitmaps (one plane deep).
|
|
500
|
|
501 Optional third argument is ignored. If you're concerned about this
|
|
502 incomplete backwards incompatibility, you should convert your code
|
|
503 to use `frame-icon-glyph' -- you can specify a mask for an XBM file
|
|
504 using the standard image instantiator format."
|
|
505 (if (glyphp image-instance)
|
|
506 (setq image-instance (glyph-image-instance image-instance frame)))
|
|
507 (set-glyph-image frame-icon-glyph image-instance frame))
|
|
508 (make-obsolete 'x-set-frame-icon-pixmap
|
|
509 "use (set-glyph-image frame-icon-glyph ...).")
|
|
510 (defalias 'x-set-screen-icon-pixmap 'x-set-frame-icon-pixmap)
|
|
511 (make-obsolete 'x-set-screen-icon-pixmap
|
|
512 "use (set-glyph-image frame-icon-glyph ...).")
|
|
513
|
|
514 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; window-system objects
|
|
515
|
|
516 (define-obsolete-function-alias 'pixel-name 'color-name)
|
|
517
|
|
518 ;; compatibility function -- a front-end to make-glyph
|
|
519 (defun make-pixmap (name &optional locale)
|
|
520 "Create a glyph with NAME as an image specifier and locale LOCALE.
|
|
521 The file should be in `XBM' or `XPM' format.
|
|
522 If the XBMLANGPATH environment variable is set, it will be searched for
|
|
523 matching files. Next, the directories listed in the `x-bitmap-file-path'
|
|
524 variable will be searched (this variable is initialized from the
|
|
525 \"*bitmapFilePath\" resource). Finally, the XEmacs etc/ directory
|
|
526 (the value of `data-directory') will be searched.
|
|
527 The file argument may also be a list of the form (width height data) where
|
|
528 width and height are the size in pixels, and data is a string, containing
|
|
529 the raw bits of the bitmap. (Bitmaps specified this way can only be one bit
|
|
530 deep.)
|
|
531 If compiled with support for XPM, the file argument may also be a string
|
|
532 which is the contents of an XPM file (that is, a string beginning with the
|
|
533 characters \"/* XPM */\"; see the XPM documentation).
|
|
534 The optional second argument is the specifier locale for this pixmap glyph.
|
|
535 The returned object is a glyph object. To get the actual pixmap object for
|
|
536 a given frame, use the function `glyph-instance'."
|
|
537 (if (consp name)
|
|
538 (setq name (vector 'xbm :data name)))
|
|
539 (make-glyph name))
|
|
540 (make-obsolete 'make-pixmap 'make-glyph)
|
|
541
|
|
542 (defun make-cursor (name &optional fg bg device)
|
|
543 "Creates a pointer image instance with NAME as an image specifier.
|
|
544 The optional second and third arguments are the foreground and background
|
|
545 colors. They may be color name strings or `pixel' objects.
|
|
546 The optional fourth argument is the device on which to allocate the cursor
|
|
547 (defaults to the selected device).
|
|
548 This allocates a new pointer in the X server, and signals an error if the
|
|
549 pointer is unknown or cannot be allocated.
|
|
550
|
|
551 A pointer name can take many different forms. It can be:
|
|
552 - any of the standard cursor names from appendix B of the Xlib manual
|
|
553 (also known as the file <X11/cursorfont.h>) minus the XC_ prefix;
|
|
554 - the name of a font, and glyph index into it of the form
|
|
555 \"FONT fontname index [[mask-font] mask-index]\";
|
|
556 - the name of a bitmap or pixmap file;
|
|
557 - or an image instance object, as returned by `make-image-instance'.
|
|
558
|
|
559 If it is an image instance or pixmap file, and that pixmap comes with a
|
|
560 mask, then that mask will be used. If it is an image instance, it must
|
|
561 have only one plane, since X pointers may only have two colors. If it is a
|
|
562 pixmap file, then the file will be read in monochrome.
|
|
563
|
|
564 If it is a bitmap file, and if a bitmap file whose name is the name of the
|
|
565 pointer with \"msk\" or \"Mask\" appended exists, then that second bitmap
|
|
566 will be used as the mask. For example, a pair of files might be named
|
|
567 \"pointer.xbm\" and \"pointer.xbmmsk\".
|
|
568
|
|
569 The returned object is a normal, first-class lisp object. The way you
|
|
570 `deallocate' the pointer is the way you deallocate any other lisp object:
|
|
571 you drop all pointers to it and allow it to be garbage collected. When
|
|
572 these objects are GCed, the underlying X data is deallocated as well."
|
|
573 ;; #### ignores fg and bg
|
|
574 (make-image-instance name device '(pointer)))
|
|
575 (make-obsolete 'make-cursor 'make-image-instance)
|
|
576
|
|
577 (define-obsolete-function-alias 'pixmap-width 'glyph-width)
|
|
578 (define-obsolete-function-alias 'pixmap-contributes-to-line-height-p
|
|
579 'glyph-contrib-p-instance)
|
|
580 (define-obsolete-function-alias 'set-pixmap-contributes-to-line-height
|
|
581 'set-glyph-contrib-p)
|
|
582
|