comparison lisp/prim/obsolete.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 1a767b41a199
children 54cc21c15cbb
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details. 20 ;; General Public License for more details.
21 21
22 ;; You should have received a copy of the GNU General Public License 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 23 ;; along with XEmacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 24 ;; Free Software Foundation, 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA. 25 ;; Boston, MA 02111-1307, USA.
26 26
27 ;;; The obsoleteness support used to be scattered throughout various 27 ;;; The obsoleteness support used to be scattered throughout various
28 ;;; source files. We put the stuff in one place to remove the junkiness 28 ;;; source files. We put the stuff in one place to remove the junkiness
29 ;;; from other source files and to facilitate creating/updating things 29 ;;; from other source files and to facilitate creating/updating things
36 This makes calling OLDFUN equivalent to calling NEWFUN and marks OLDFUN 36 This makes calling OLDFUN equivalent to calling NEWFUN and marks OLDFUN
37 as obsolete." 37 as obsolete."
38 (define-function oldfun newfun) 38 (define-function oldfun newfun)
39 (make-obsolete oldfun newfun)) 39 (make-obsolete oldfun newfun))
40 40
41 (defsubst define-compatible-function-alias (oldfun newfun)
42 "Define OLDFUN as a compatible alias for function NEWFUN.
43 This makes calling OLDFUN equivalent to calling NEWFUN and marks OLDFUN
44 as provided for compatibility only."
45 (define-function oldfun newfun)
46 (make-compatible oldfun newfun))
47
48 (defsubst define-obsolete-variable-alias (oldvar newvar) 41 (defsubst define-obsolete-variable-alias (oldvar newvar)
49 "Define OLDVAR as an obsolete alias for varction NEWVAR. 42 "Define OLDVAR as an obsolete alias for varction NEWVAR.
50 This makes referencing or setting OLDVAR equivalent to referencing or 43 This makes referencing or setting OLDVAR equivalent to referencing or
51 setting NEWVAR and marks OLDVAR as obsolete." 44 setting NEWVAR and marks OLDVAR as obsolete."
52 (defvaralias oldvar newvar) 45 (defvaralias oldvar newvar)
53 (make-obsolete-variable oldvar newvar)) 46 (make-obsolete-variable oldvar newvar))
54 47
55 (defsubst define-compatible-variable-alias (oldvar newvar)
56 "Define OLDVAR as a compatible alias for varction NEWVAR.
57 This makes referencing or setting OLDVAR equivalent to referencing or
58 setting NEWVAR and marks OLDVAR as provided for compatibility only."
59 (defvaralias oldvar newvar)
60 (make-compatible-variable oldvar newvar))
61
62 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; device stuff 48 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; device stuff
63 49
64 (make-compatible-variable 'window-system "use (console-type)") 50 (make-obsolete-variable 'window-system "use (console-type)")
65 (make-obsolete-variable 'meta-flag 51 (make-obsolete-variable 'meta-flag
66 "use the `set-input-mode' function instead.") 52 "use the `set-input-mode' function instead.")
67 53
68 (defun x-display-color-p (&optional device) 54 (defun x-display-color-p (&optional device)
69 "Returns non-nil if DEVICE is a color device." 55 "Returns non-nil if DEVICE is a color device."
70 (eq 'color (device-class device))) 56 (eq 'color (device-class device)))
71 (make-compatible 'x-display-color-p 'device-class) 57 (make-obsolete 'x-display-color-p 'device-class)
72 58
73 (define-function 'x-color-display-p 'x-display-color-p) 59 (define-function 'x-color-display-p 'x-display-color-p)
74 (make-compatible 'x-display-color-p 'device-class) 60 (make-obsolete 'x-display-color-p 'device-class)
75 61
76 (defun x-display-grayscale-p (&optional device) 62 (defun x-display-grayscale-p (&optional device)
77 "Returns non-nil if DEVICE is a grayscale device." 63 "Returns non-nil if DEVICE is a grayscale device."
78 (eq 'grayscale (device-class device))) 64 (eq 'grayscale (device-class device)))
79 (make-compatible 'x-display-grayscale-p 'device-class) 65 (make-obsolete 'x-display-grayscale-p 'device-class)
80 66
81 (define-function 'x-grayscale-display-p 'x-display-grayscale-p) 67 (define-function 'x-grayscale-display-p 'x-display-grayscale-p)
82 (make-compatible 'x-display-grayscale-p 'device-class) 68 (make-obsolete 'x-display-grayscale-p 'device-class)
83 69
84 (define-compatible-function-alias 'x-display-pixel-width 'device-pixel-width) 70 (define-obsolete-function-alias 'x-display-pixel-width 'device-pixel-width)
85 (define-compatible-function-alias 'x-display-pixel-height 71 (define-obsolete-function-alias 'x-display-pixel-height
86 'device-pixel-height) 72 'device-pixel-height)
87 (define-compatible-function-alias 'x-display-planes 'device-bitplanes) 73 (define-obsolete-function-alias 'x-display-planes 'device-bitplanes)
88 (define-compatible-function-alias 'x-display-color-cells 'device-color-cells) 74 (define-obsolete-function-alias 'x-display-color-cells 'device-color-cells)
89 75
90 (define-obsolete-function-alias 'baud-rate 'device-baud-rate) 76 (define-obsolete-function-alias 'baud-rate 'device-baud-rate)
91 77
92 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; events 78 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; events
93 79
258 (define-obsolete-variable-alias 'default-frame-alist 'default-frame-plist) 244 (define-obsolete-variable-alias 'default-frame-alist 'default-frame-plist)
259 (define-obsolete-variable-alias 'default-x-frame-alist 'default-x-frame-plist) 245 (define-obsolete-variable-alias 'default-x-frame-alist 'default-x-frame-plist)
260 (define-obsolete-variable-alias 'default-tty-frame-alist 246 (define-obsolete-variable-alias 'default-tty-frame-alist
261 'default-tty-frame-plist) 247 'default-tty-frame-plist)
262 248
263 (make-compatible 'frame-parameters 'frame-property) 249 (make-obsolete 'frame-parameters 'frame-property)
264 (defun frame-parameters (&optional frame) 250 (defun frame-parameters (&optional frame)
265 "Return the parameters-alist of frame FRAME. 251 "Return the parameters-alist of frame FRAME.
266 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol. 252 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.
267 The meaningful PARMs depend on the kind of frame. 253 The meaningful PARMs depend on the kind of frame.
268 If FRAME is omitted, return information on the currently selected frame. 254 If FRAME is omitted, return information on the currently selected frame.
277 ;; destructive. Since most callers now use `frame-parameters', we'll 263 ;; destructive. Since most callers now use `frame-parameters', we'll
278 ;; do it this way. Should probably change this at some point in the 264 ;; do it this way. Should probably change this at some point in the
279 ;; future. 265 ;; future.
280 (destructive-plist-to-alist (frame-properties frame))) 266 (destructive-plist-to-alist (frame-properties frame)))
281 267
282 (make-compatible 'modify-frame-parameters 'set-frame-properties) 268 (make-obsolete 'modify-frame-parameters 'set-frame-properties)
283 (defun modify-frame-parameters (frame alist) 269 (defun modify-frame-parameters (frame alist)
284 "Modify the properties of frame FRAME according to ALIST. 270 "Modify the properties of frame FRAME according to ALIST.
285 ALIST is an alist of properties to change and their new values. 271 ALIST is an alist of properties to change and their new values.
286 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol. 272 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.
287 The meaningful PARMs depend on the kind of frame. 273 The meaningful PARMs depend on the kind of frame.
320 "use after-change-functions; which is a list of functions rather than a single function.") 306 "use after-change-functions; which is a list of functions rather than a single function.")
321 307
322 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; insertion and deletion 308 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; insertion and deletion
323 309
324 (define-obsolete-function-alias 'insert-and-inherit 'insert) 310 (define-obsolete-function-alias 'insert-and-inherit 'insert)
325 (define-obsolete-function-alias 'insert-before-markers-and-inherit 311 (define-obsolete-function-alias 'insert-before-markers-and-inerhit
326 'insert-before-markers) 312 'insert-before-markers)
327 313
328 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; keymaps 314 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; keymaps
329 315
330 (defun keymap-parent (keymap) 316 (defun keymap-parent (keymap)
331 "Returns the first parent of the given keymap." 317 "Returns the first parent of the given keymap."
332 (car (keymap-parents keymap))) 318 (car (keymap-parents keymap)))
333 (make-compatible 'keymap-parent 'keymap-parents) 319 (make-obsolete 'keymap-parent 'keymap-parents)
334 320
335 (defun set-keymap-parent (keymap parent) 321 (defun set-keymap-parent (keymap parent)
336 "Makes the given keymap have (only) the given parent." 322 "Makes the given keymap have (only) the given parent."
337 (set-keymap-parents keymap (if parent (list parent) '())) 323 (set-keymap-parents keymap (if parent (list parent) '()))
338 parent) 324 parent)
339 (make-compatible 'set-keymap-parent 'set-keymap-parents) 325 (make-obsolete 'set-keymap-parent 'set-keymap-parents)
340 326
341 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; menu stuff 327 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; menu stuff
342 328
343 (defun add-menu-item (menu-path item-name function enabled-p &optional before) 329 (defun add-menu-item (menu-path item-name function enabled-p &optional before)
344 "Obsolete. See the function `add-menu-button'." 330 "Obsolete. See the function `add-menu-button'."
391 377
392 (make-obsolete-variable 'executing-macro 'executing-kbd-macro) 378 (make-obsolete-variable 'executing-macro 'executing-kbd-macro)
393 379
394 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; modeline 380 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; modeline
395 381
396 (define-compatible-function-alias 'redraw-mode-line 'redraw-modeline) 382 (define-obsolete-function-alias 'redraw-mode-line 'redraw-modeline)
397 (define-compatible-function-alias 'force-mode-line-update 383 (define-obsolete-function-alias 'force-mode-line-update
398 'redraw-modeline) ;; FSF compatibility 384 'redraw-modeline) ;; FSF compatibility
399 (define-compatible-variable-alias 'mode-line-map 'modeline-map) 385 (define-obsolete-variable-alias 'mode-line-map 'modeline-map)
400 (define-compatible-variable-alias 'mode-line-buffer-identification 386 (define-obsolete-variable-alias 'mode-line-buffer-identification
401 'modeline-buffer-identification) 387 'modeline-buffer-identification)
402 (define-compatible-variable-alias 'mode-line-process 'modeline-process) 388 (define-obsolete-variable-alias 'mode-line-process 'modeline-process)
403 (define-compatible-variable-alias 'mode-line-modified 'modeline-modified) 389 (define-obsolete-variable-alias 'mode-line-modified 'modeline-modified)
404 (make-compatible-variable 'mode-line-inverse-video 390 (make-obsolete-variable 'mode-line-inverse-video
405 "use set-face-highlight-p and set-face-reverse-p") 391 "use set-face-highlight-p and set-face-reverse-p")
406 (define-compatible-variable-alias 'default-mode-line-format 392 (define-obsolete-variable-alias 'default-mode-line-format
407 'default-modeline-format) 393 'default-modeline-format)
408 (define-compatible-variable-alias 'mode-line-format 'modeline-format) 394 (define-obsolete-variable-alias 'mode-line-format 'modeline-format)
409 (define-compatible-variable-alias 'mode-line-menu 'modeline-menu) 395 (define-obsolete-variable-alias 'mode-line-menu 'modeline-menu)
410 396
411 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; mouse 397 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; mouse
412 398
413 ;;; (defun mouse-eval-last-sexpr (event) 399 ;;; (defun mouse-eval-last-sexpr (event)
414 ;;; (interactive "@e") 400 ;;; (interactive "@e")
593 (define-obsolete-function-alias 'pixmap-contributes-to-line-height-p 579 (define-obsolete-function-alias 'pixmap-contributes-to-line-height-p
594 'glyph-contrib-p-instance) 580 'glyph-contrib-p-instance)
595 (define-obsolete-function-alias 'set-pixmap-contributes-to-line-height 581 (define-obsolete-function-alias 'set-pixmap-contributes-to-line-height
596 'set-glyph-contrib-p) 582 'set-glyph-contrib-p)
597 583
598 ;; the functionality of column.el has been moved into C
599 (defalias 'display-column-mode 'column-number-mode)
600
601 (defun x-color-values (color &optional frame)
602 "Return a description of the color named COLOR on frame FRAME.
603 The value is a list of integer RGB values--(RED GREEN BLUE).
604 These values appear to range from 0 to 65280 or 65535, depending
605 on the system; white is (65280 65280 65280) or (65535 65535 65535).
606 If FRAME is omitted or nil, use the selected frame."
607 (color-instance-rgb-components (make-color-instance color)))
608 (make-compatible 'x-color-values 'color-instance-rgb-components)
609
610 ;; Two loser functions which shouldn't be used.
611 (make-obsolete 'following-char 'char-after)
612 (make-obsolete 'preceding-char 'char-after)
613
614 ;;; obsoloete.el ends here