comparison lisp/window-xemacs.el @ 284:558f606b08ae r21-0b40

Import from CVS: tag r21-0b40
author cvs
date Mon, 13 Aug 2007 10:34:13 +0200
parents 7df0dd720c89
children 57709be46d1b
comparison
equal deleted inserted replaced
283:fa3d41851a08 284:558f606b08ae
37 37
38 (defgroup windows nil 38 (defgroup windows nil
39 "Windows within a frame." 39 "Windows within a frame."
40 :group 'environment) 40 :group 'environment)
41 41
42 (defun recenter (n &optional window) 42 (defun recenter (&optional n window)
43 "Center point in WINDOW and redisplay frame. With N, put point on line N. 43 "Center point in WINDOW and redisplay frame. With N, put point on line N.
44 The desired position of point is always relative to the window. 44 The desired position of point is always relative to the window.
45 Just C-u as prefix means put point in the center of the window. 45 Just C-u as prefix means put point in the center of the window.
46 No N (i.e., it is nil) erases the entire frame and then 46 No N (i.e., it is nil) erases the entire frame and then
47 redraws with point in the center of the window. 47 redraws with point in the center of the window.
55 "Select the ARG'th different window on this frame, going backwards. 55 "Select the ARG'th different window on this frame, going backwards.
56 This is just like calling `other-window' with the arg negated." 56 This is just like calling `other-window' with the arg negated."
57 (interactive "p") 57 (interactive "p")
58 (other-window (- arg) all-frames device)) 58 (other-window (- arg) all-frames device))
59 59
60 (defun windows-of-buffer (&optional buffer) 60 (defalias 'windows-of-buffer 'get-buffer-window-list)
61 "Return a list of windows that have BUFFER in them.
62 If BUFFER is not specified, the current buffer will be used."
63 (or (bufferp buffer)
64 (if (stringp buffer)
65 (setq buffer (or (get-buffer buffer)
66 (get-file-buffer buffer)))
67 (setq buffer (current-buffer))))
68 (let* ((firstwin (next-window nil nil t))
69 (wind firstwin)
70 (done nil)
71 window-list)
72 (while (not done)
73 (if (eq (window-buffer wind) buffer)
74 (setq window-list (append window-list (list wind))))
75 (setq wind (next-window wind nil t))
76 (setq done (eq wind firstwin)))
77 window-list))
78 61
79 (defun buffer-in-multiple-windows-p (&optional buffer) 62 (defun buffer-in-multiple-windows-p (&optional buffer)
80 "Return t if BUFFER is in multiple windows. 63 "Return t if BUFFER is in multiple windows.
81 If BUFFER is not specified, the current buffer will be used." 64 If BUFFER is not specified, the current buffer will be used."
82 (setq buffer (or buffer 65 (setq buffer (or buffer