Mercurial > hg > xemacs-beta
comparison lisp/obsolete.el @ 371:cc15677e0335 r21-2b1
Import from CVS: tag r21-2b1
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:03:08 +0200 |
parents | a4f53d9b3154 |
children | 8626e4521993 |
comparison
equal
deleted
inserted
replaced
370:bd866891f083 | 371:cc15677e0335 |
---|---|
72 (make-compatible-variable oldvar newvar)) | 72 (make-compatible-variable oldvar newvar)) |
73 | 73 |
74 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; device stuff | 74 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; device stuff |
75 | 75 |
76 (make-compatible-variable 'window-system "use (console-type)") | 76 (make-compatible-variable 'window-system "use (console-type)") |
77 (make-obsolete-variable 'meta-flag | |
78 "use the `set-input-mode' function instead.") | |
79 | 77 |
80 (defun x-display-color-p (&optional device) | 78 (defun x-display-color-p (&optional device) |
81 "Return t if DEVICE is a color device." | 79 "Return t if DEVICE is a color device." |
82 (eq 'color (device-class device))) | 80 (eq 'color (device-class device))) |
83 (make-compatible 'x-display-color-p 'device-class) | 81 (make-compatible 'x-display-color-p 'device-class) |
96 (define-compatible-function-alias 'x-display-pixel-width 'device-pixel-width) | 94 (define-compatible-function-alias 'x-display-pixel-width 'device-pixel-width) |
97 (define-compatible-function-alias 'x-display-pixel-height 'device-pixel-height) | 95 (define-compatible-function-alias 'x-display-pixel-height 'device-pixel-height) |
98 (define-compatible-function-alias 'x-display-planes 'device-bitplanes) | 96 (define-compatible-function-alias 'x-display-planes 'device-bitplanes) |
99 (define-compatible-function-alias 'x-display-color-cells 'device-color-cells) | 97 (define-compatible-function-alias 'x-display-color-cells 'device-color-cells) |
100 | 98 |
101 (define-obsolete-function-alias 'baud-rate 'device-baud-rate) | |
102 | |
103 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; events | 99 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; events |
104 | 100 |
105 (define-obsolete-function-alias 'menu-event-p 'misc-user-event-p) | 101 (define-obsolete-function-alias 'menu-event-p 'misc-user-event-p) |
106 (make-obsolete-variable 'unread-command-char 'unread-command-events) | 102 (make-obsolete-variable 'unread-command-char 'unread-command-events) |
107 (make-obsolete 'sleep-for-millisecs "use sleep-for with a float") | |
108 | 103 |
109 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; extents | 104 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; extents |
110 | 105 |
111 (defun extent-data (extent) | |
112 "Obsolete. Return the `data' property of EXTENT." | |
113 (extent-property extent 'data)) | |
114 (make-obsolete 'set-window-dot 'set-window-point) | 106 (make-obsolete 'set-window-dot 'set-window-point) |
115 | 107 |
116 (defun set-extent-data (extent data) | |
117 "Obsolete. Set the `data' property of EXTENT." | |
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) | 108 (define-obsolete-function-alias 'extent-buffer 'extent-object) |
122 | 109 |
123 (defun set-extent-attribute (extent attr &optional clearp) | |
124 ;; obsoleteness info will be displayed, so no need for docstring. | |
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) | |
138 ;; obsoleteness info will be displayed, so no need for docstring. | |
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) | |
145 ;; obsoleteness info will be displayed, so no need for docstring. | |
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) | |
151 ;; obsoleteness info will be displayed, so no need for docstring. | |
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 | 110 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; 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) | |
247 ;; obsoleteness info will be displayed, so no need for docstring. | |
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) | 111 (defun frame-first-window (frame) |
255 "Return the topmost, leftmost window of FRAME. | 112 "Return the topmost, leftmost window of FRAME. |
256 If omitted, FRAME defaults to the currently selected frame." | 113 If omitted, FRAME defaults to the currently selected frame." |
257 (frame-highest-window frame 0)) | 114 (frame-highest-window frame 0)) |
258 (make-compatible 'frame-first-window 'frame-highest-window) | 115 (make-compatible 'frame-first-window 'frame-highest-window) |
304 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; faces | 161 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; faces |
305 | 162 |
306 (define-obsolete-function-alias 'list-faces-display 'edit-faces) | 163 (define-obsolete-function-alias 'list-faces-display 'edit-faces) |
307 (define-obsolete-function-alias 'list-faces 'face-list) | 164 (define-obsolete-function-alias 'list-faces 'face-list) |
308 | 165 |
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 | |
316 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; paths | 166 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; paths |
317 | 167 |
318 (defvar Info-default-directory-list nil | 168 (defvar Info-default-directory-list nil |
319 "This used to be the initial value of Info-directory-list. | 169 "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, | 170 If you want to change the locations where XEmacs looks for info files, |
321 set Info-directory-list.") | 171 set Info-directory-list.") |
322 (make-obsolete-variable 'Info-default-directory-list 'Info-directory-list) | 172 (make-obsolete-variable 'Info-default-directory-list 'Info-directory-list) |
323 | 173 |
324 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; hooks | 174 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; hooks |
325 | 175 |
326 (make-obsolete-variable 'auto-fill-hook 'auto-fill-function) | 176 (make-compatible-variable 'lisp-indent-hook 'lisp-indent-function) |
327 (make-obsolete-variable 'blink-paren-hook 'blink-paren-function) | 177 (make-compatible-variable 'comment-indent-hook 'comment-indent-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 | 178 (make-obsolete-variable 'temp-buffer-show-hook |
331 'temp-buffer-show-function) | 179 'temp-buffer-show-function) |
332 (make-obsolete-variable 'inhibit-local-variables | 180 (make-obsolete-variable 'inhibit-local-variables |
333 "use `enable-local-variables' (with the reversed sense).") | 181 "use `enable-local-variables' (with the reversed sense).") |
334 (make-obsolete-variable 'suspend-hooks 'suspend-hook) | 182 (make-obsolete-variable 'suspend-hooks 'suspend-hook) |
371 (or menu-items (error (gettext "must specify some menu items"))) | 219 (or menu-items (error (gettext "must specify some menu items"))) |
372 (add-submenu menu-path (cons menu-name menu-items) before)) | 220 (add-submenu menu-path (cons menu-name menu-items) before)) |
373 ;; Can't make this obsolete. easymenu depends on it. | 221 ;; Can't make this obsolete. easymenu depends on it. |
374 (make-compatible 'add-menu 'add-submenu) | 222 (make-compatible 'add-menu 'add-submenu) |
375 | 223 |
376 (define-obsolete-function-alias 'popup-menu-up-p 'popup-up-p) | |
377 | |
378 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; minibuffer | 224 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; minibuffer |
379 | 225 |
380 (define-compatible-function-alias 'read-minibuffer | 226 (define-compatible-function-alias 'read-minibuffer |
381 'read-expression) ; misleading name | 227 'read-expression) ; misleading name |
382 (define-compatible-function-alias 'read-input 'read-string) | 228 (define-compatible-function-alias 'read-input 'read-string) |
383 (make-obsolete 'read-no-blanks-input 'read-string) ; mocklisp crud | |
384 | 229 |
385 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; misc | 230 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; misc |
386 | 231 |
387 ;; (defun user-original-login-name () | 232 ;; (defun user-original-login-name () |
388 ;; "Return user's login name from original login. | 233 ;; "Return user's login name from original login. |
389 ;; This tries to remain unaffected by `su', by looking in environment variables." | 234 ;; This tries to remain unaffected by `su', by looking in environment variables." |
390 ;; (or (getenv "LOGNAME") (getenv "USER") (user-login-name))) | 235 ;; (or (getenv "LOGNAME") (getenv "USER") (user-login-name))) |
391 (define-obsolete-function-alias 'user-original-login-name 'user-login-name) | 236 (define-obsolete-function-alias 'user-original-login-name 'user-login-name) |
392 | 237 |
393 ; old names | 238 ; old names |
394 (define-obsolete-function-alias 'wholenump 'natnump) | |
395 (define-obsolete-function-alias 'show-buffer 'set-window-buffer) | 239 (define-obsolete-function-alias 'show-buffer 'set-window-buffer) |
396 (define-obsolete-function-alias 'buffer-flush-undo 'buffer-disable-undo) | 240 (define-obsolete-function-alias 'buffer-flush-undo 'buffer-disable-undo) |
397 (define-obsolete-function-alias 'eval-current-buffer 'eval-buffer) | 241 (make-compatible 'eval-current-buffer 'eval-buffer) |
398 (define-obsolete-function-alias 'byte-code-function-p | 242 (define-compatible-function-alias 'byte-code-function-p |
399 'compiled-function-p) ;FSFmacs | 243 'compiled-function-p) ;FSFmacs |
400 | 244 |
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 | 245 ;; 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, | 246 ;; being called on the values of functions known to return keymaps, |
408 ;; or known to return vectors of events instead of strings... | 247 ;; 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 | 248 |
413 (make-obsolete-variable 'executing-macro 'executing-kbd-macro) | 249 (make-obsolete-variable 'executing-macro 'executing-kbd-macro) |
414 | 250 |
415 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; modeline | 251 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; modeline |
416 | 252 |
441 | 277 |
442 (defun read-mouse-position (frame) | 278 (defun read-mouse-position (frame) |
443 (cdr (mouse-position (frame-device frame)))) | 279 (cdr (mouse-position (frame-device frame)))) |
444 (make-obsolete 'read-mouse-position 'mouse-position) | 280 (make-obsolete 'read-mouse-position 'mouse-position) |
445 | 281 |
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 | 282 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; redisplay |
461 | 283 |
462 (defun redraw-display (&optional device) | 284 (defun redraw-display (&optional device) |
463 (if (eq device t) | 285 (if (eq device t) |
464 (mapcar 'redisplay-device (device-list)) | 286 (mapcar 'redisplay-device (device-list)) |
465 (redisplay-device device))) | 287 (redisplay-device device))) |
466 | 288 |
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 | 289 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; window-system objects |
551 | 290 |
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 | 291 ;; the functionality of column.el has been moved into C |
292 ;; Function obsoleted for XEmacs 20.0/February 1997. | |
620 (defalias 'display-column-mode 'column-number-mode) | 293 (defalias 'display-column-mode 'column-number-mode) |
621 | 294 |
622 (defun x-color-values (color &optional frame) | 295 (defun x-color-values (color &optional frame) |
623 "Return a description of the color named COLOR on frame FRAME. | 296 "Return a description of the color named COLOR on frame FRAME. |
624 The value is a list of integer RGB values--(RED GREEN BLUE). | 297 The value is a list of integer RGB values--(RED GREEN BLUE). |
671 (setq idx (1+ idx) i (1+ i))) | 344 (setq idx (1+ idx) i (1+ i))) |
672 string)) | 345 string)) |
673 | 346 |
674 ;; ### This function is not compatible with FSF in some cases. Hard | 347 ;; ### 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. | 348 ;; to fix, because it is hard to trace the logic of the FSF function. |
676 ;; In case we need the exact behavior, we can always copy the FSF | 349 ;; In case we need the exact behaviour, we can always copy the FSF |
677 ;; version, which is very long and does lots of unnecessary stuff. | 350 ;; version, which is very long and does lots of unnecessary stuff. |
678 (defun truncate-string-to-width (str end-column &optional start-column padding) | 351 (defun truncate-string-to-width (str end-column &optional start-column padding) |
679 "Truncate string STR to end at column END-COLUMN. | 352 "Truncate string STR to end at column END-COLUMN. |
680 The optional 2nd arg START-COLUMN, if non-nil, specifies | 353 The optional 2nd arg START-COLUMN, if non-nil, specifies |
681 the starting column; that means to return the characters occupying | 354 the starting column; that means to return the characters occupying |