Some fixes to follow coding conventions in files maintained by FSF.
[emacs.git] / lisp / frame.el
blob7720b796e8f25b962da016a8bfdc63a2bad7d5c9
1 ;;; frame.el --- multi-frame management independent of window systems
3 ;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001
4 ;; Free Software Foundation, Inc.
6 ;; Maintainer: FSF
7 ;; Keywords: internal
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
26 ;;; Commentary:
28 ;;; Code:
30 (defvar frame-creation-function nil
31 "Window-system dependent function to call to create a new frame.
32 The window system startup file should set this to its frame creation
33 function, which should take an alist of parameters as its argument.")
35 ;;; The initial value given here for used to ask for a minibuffer.
36 ;;; But that's not necessary, because the default is to have one.
37 ;;; By not specifying it here, we let an X resource specify it.
38 (defcustom initial-frame-alist nil
39 "*Alist of frame parameters for creating the initial X window frame.
40 You can set this in your `.emacs' file; for example,
41 (setq initial-frame-alist '((top . 1) (left . 1) (width . 80) (height . 55)))
42 Parameters specified here supersede the values given in `default-frame-alist'.
44 If the value calls for a frame without a minibuffer, and you have not created
45 a minibuffer frame on your own, one is created according to
46 `minibuffer-frame-alist'.
48 You can specify geometry-related options for just the initial frame
49 by setting this variable in your `.emacs' file; however, they won't
50 take effect until Emacs reads `.emacs', which happens after first creating
51 the frame. If you want the frame to have the proper geometry as soon
52 as it appears, you need to use this three-step process:
53 * Specify X resources to give the geometry you want.
54 * Set `default-frame-alist' to override these options so that they
55 don't affect subsequent frames.
56 * Set `initial-frame-alist' in a way that matches the X resources,
57 to override what you put in `default-frame-alist'."
58 :type '(repeat (cons :format "%v"
59 (symbol :tag "Parameter")
60 (sexp :tag "Value")))
61 :group 'frames)
63 (defcustom minibuffer-frame-alist '((width . 80) (height . 2))
64 "*Alist of frame parameters for initially creating a minibuffer frame.
65 You can set this in your `.emacs' file; for example,
66 (setq minibuffer-frame-alist
67 '((top . 1) (left . 1) (width . 80) (height . 2)))
68 Parameters specified here supersede the values given in
69 `default-frame-alist', for a minibuffer frame."
70 :type '(repeat (cons :format "%v"
71 (symbol :tag "Parameter")
72 (sexp :tag "Value")))
73 :group 'frames)
75 (defcustom pop-up-frame-alist nil
76 "*Alist of frame parameters used when creating pop-up frames.
77 Pop-up frames are used for completions, help, and the like.
78 This variable can be set in your init file, like this:
79 (setq pop-up-frame-alist '((width . 80) (height . 20)))
80 These supersede the values given in `default-frame-alist',
81 for pop-up frames."
82 :type '(repeat (cons :format "%v"
83 (symbol :tag "Parameter")
84 (sexp :tag "Value")))
85 :group 'frames)
87 (setq pop-up-frame-function
88 (function (lambda ()
89 (make-frame pop-up-frame-alist))))
91 (defcustom special-display-frame-alist
92 '((height . 14) (width . 80) (unsplittable . t))
93 "*Alist of frame parameters used when creating special frames.
94 Special frames are used for buffers whose names are in
95 `special-display-buffer-names' and for buffers whose names match
96 one of the regular expressions in `special-display-regexps'.
97 This variable can be set in your init file, like this:
98 (setq special-display-frame-alist '((width . 80) (height . 20)))
99 These supersede the values given in `default-frame-alist'."
100 :type '(repeat (cons :format "%v"
101 (symbol :tag "Parameter")
102 (sexp :tag "Value")))
103 :group 'frames)
105 (defun special-display-popup-frame (buffer &optional args)
106 "Display BUFFER in its own frame, reusing an existing window if any.
107 Return the window chosen.
108 Currently we do not insist on selecting the window within its frame.
109 If ARGS is an alist, use it as a list of frame parameter specs.
110 If ARGS is a list whose car is a symbol,
111 use (car ARGS) as a function to do the work.
112 Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
113 (if (and args (symbolp (car args)))
114 (apply (car args) buffer (cdr args))
115 (let ((window (get-buffer-window buffer t)))
116 (if window
117 ;; If we have a window already, make it visible.
118 (let ((frame (window-frame window)))
119 (make-frame-visible frame)
120 (raise-frame frame)
121 window)
122 ;; If no window yet, make one in a new frame.
123 (let ((frame (make-frame (append args special-display-frame-alist))))
124 (set-window-buffer (frame-selected-window frame) buffer)
125 (set-window-dedicated-p (frame-selected-window frame) t)
126 (frame-selected-window frame))))))
128 (defun handle-delete-frame (event)
129 "Handle delete-frame events from the X server."
130 (interactive "e")
131 (let ((frame (posn-window (event-start event)))
132 (i 0)
133 (tail (frame-list)))
134 (while tail
135 (and (frame-visible-p (car tail))
136 (not (eq (car tail) frame))
137 (setq i (1+ i)))
138 (setq tail (cdr tail)))
139 (if (> i 0)
140 (delete-frame frame t)
141 ;; Gildea@x.org says it is ok to ask questions before terminating.
142 (save-buffers-kill-emacs))))
144 ;;;; Arrangement of frames at startup
146 ;;; 1) Load the window system startup file from the lisp library and read the
147 ;;; high-priority arguments (-q and the like). The window system startup
148 ;;; file should create any frames specified in the window system defaults.
150 ;;; 2) If no frames have been opened, we open an initial text frame.
152 ;;; 3) Once the init file is done, we apply any newly set parameters
153 ;;; in initial-frame-alist to the frame.
155 ;; These are now called explicitly at the proper times,
156 ;; since that is easier to understand.
157 ;; Actually using hooks within Emacs is bad for future maintenance. --rms.
158 ;; (add-hook 'before-init-hook 'frame-initialize)
159 ;; (add-hook 'window-setup-hook 'frame-notice-user-settings)
161 ;;; If we create the initial frame, this is it.
162 (defvar frame-initial-frame nil)
164 ;; Record the parameters used in frame-initialize to make the initial frame.
165 (defvar frame-initial-frame-alist)
167 (defvar frame-initial-geometry-arguments nil)
169 ;;; startup.el calls this function before loading the user's init
170 ;;; file - if there is no frame with a minibuffer open now, create
171 ;;; one to display messages while loading the init file.
172 (defun frame-initialize ()
173 "Create an initial frame if necessary."
174 ;; Are we actually running under a window system at all?
175 (if (and window-system (not noninteractive) (not (eq window-system 'pc)))
176 (progn
177 ;; Turn on special-display processing only if there's a window system.
178 (setq special-display-function 'special-display-popup-frame)
180 ;; If there is no frame with a minibuffer besides the terminal
181 ;; frame, then we need to create the opening frame. Make sure
182 ;; it has a minibuffer, but let initial-frame-alist omit the
183 ;; minibuffer spec.
184 (or (delq terminal-frame (minibuffer-frame-list))
185 (progn
186 (setq frame-initial-frame-alist
187 (append initial-frame-alist default-frame-alist nil))
188 (or (assq 'horizontal-scroll-bars frame-initial-frame-alist)
189 (setq frame-initial-frame-alist
190 (cons '(horizontal-scroll-bars . t)
191 frame-initial-frame-alist)))
192 (setq default-minibuffer-frame
193 (setq frame-initial-frame
194 (make-frame frame-initial-frame-alist)))
195 ;; Delete any specifications for window geometry parameters
196 ;; so that we won't reapply them in frame-notice-user-settings.
197 ;; It would be wrong to reapply them then,
198 ;; because that would override explicit user resizing.
199 (setq initial-frame-alist
200 (frame-remove-geometry-params initial-frame-alist))))
201 ;; At this point, we know that we have a frame open, so we
202 ;; can delete the terminal frame.
203 (delete-frame terminal-frame)
204 (setq terminal-frame nil))
206 ;; No, we're not running a window system. Use make-terminal-frame if
207 ;; we support that feature, otherwise arrange to cause errors.
208 (or (eq window-system 'pc)
209 (setq frame-creation-function
210 (if (fboundp 'tty-create-frame-with-faces)
211 'tty-create-frame-with-faces
212 (function
213 (lambda (parameters)
214 (error
215 "Can't create multiple frames without a window system"))))))))
217 (defvar frame-notice-user-settings t
218 "Non-nil means function `frame-notice-user-settings' wasn't run yet.")
220 ;;; startup.el calls this function after loading the user's init
221 ;;; file. Now default-frame-alist and initial-frame-alist contain
222 ;;; information to which we must react; do what needs to be done.
223 (defun frame-notice-user-settings ()
224 "Act on user's init file settings of frame parameters.
225 React to settings of `default-frame-alist', `initial-frame-alist' there."
226 ;; Make menu-bar-mode and default-frame-alist consistent.
227 (when (boundp 'menu-bar-mode)
228 (let ((default (assq 'menu-bar-lines default-frame-alist)))
229 (if default
230 (setq menu-bar-mode (not (eq (cdr default) 0)))
231 (setq default-frame-alist
232 (cons (cons 'menu-bar-lines (if menu-bar-mode 1 0))
233 default-frame-alist)))))
235 ;; Make tool-bar-mode and default-frame-alist consistent. Don't do
236 ;; it in batch mode since that would leave a tool-bar-lines
237 ;; parameter in default-frame-alist in a dumped Emacs, which is not
238 ;; what we want.
239 (when (and (boundp 'tool-bar-mode)
240 (not noninteractive))
241 (let ((default (assq 'tool-bar-lines default-frame-alist)))
242 (if default
243 (setq tool-bar-mode (not (eq (cdr default) 0)))
244 (setq default-frame-alist
245 (cons (cons 'tool-bar-lines (if tool-bar-mode 1 0))
246 default-frame-alist)))))
248 ;; Creating and deleting frames may shift the selected frame around,
249 ;; and thus the current buffer. Protect against that. We don't
250 ;; want to use save-excursion here, because that may also try to set
251 ;; the buffer of the selected window, which fails when the selected
252 ;; window is the minibuffer.
253 (let ((old-buffer (current-buffer)))
255 (when (and frame-notice-user-settings
256 (null frame-initial-frame))
257 ;; This case happens when we don't have a window system, and
258 ;; also for MS-DOS frames.
259 (let ((parms (frame-parameters frame-initial-frame)))
260 ;; Don't change the frame names.
261 (setq parms (delq (assq 'name parms) parms))
262 ;; Can't modify the minibuffer parameter, so don't try.
263 (setq parms (delq (assq 'minibuffer parms) parms))
264 (modify-frame-parameters nil
265 (if (null window-system)
266 (append initial-frame-alist
267 default-frame-alist
268 parms
269 nil)
270 ;; initial-frame-alist and
271 ;; default-frame-alist were already
272 ;; applied in pc-win.el.
273 parms))
274 (if (null window-system) ;; MS-DOS does this differently in pc-win.el
275 (let ((newparms (frame-parameters))
276 (frame (selected-frame)))
277 (tty-handle-reverse-video frame newparms)
278 ;; If we changed the background color, we need to update
279 ;; the background-mode parameter, and maybe some faces,
280 ;; too.
281 (when (assq 'background-color newparms)
282 (unless (or (assq 'background-mode initial-frame-alist)
283 (assq 'background-mode default-frame-alist))
284 (frame-set-background-mode frame))
285 (face-set-after-frame-default frame))))))
287 ;; If the initial frame is still around, apply initial-frame-alist
288 ;; and default-frame-alist to it.
289 (when (frame-live-p frame-initial-frame)
291 ;; When tool-bar has been switched off, correct the frame size
292 ;; by the lines added in x-create-frame for the tool-bar and
293 ;; switch `tool-bar-mode' off.
294 (when (display-graphic-p)
295 (let ((tool-bar-lines (or (assq 'tool-bar-lines initial-frame-alist)
296 (assq 'tool-bar-lines default-frame-alist))))
297 (when (and tool-bar-originally-present
298 (or (null tool-bar-lines)
299 (null (cdr tool-bar-lines))
300 (eq 0 (cdr tool-bar-lines))))
301 (let* ((char-height (frame-char-height frame-initial-frame))
302 (image-height tool-bar-images-pixel-height)
303 (margin (cond ((and (consp tool-bar-button-margin)
304 (integerp (cdr tool-bar-button-margin))
305 (> tool-bar-button-margin 0))
306 (cdr tool-bar-button-margin))
307 ((and (integerp tool-bar-button-margin)
308 (> tool-bar-button-margin 0))
309 tool-bar-button-margin)
310 (t 0)))
311 (relief (if (and (integerp tool-bar-button-relief)
312 (> tool-bar-button-relief 0))
313 tool-bar-button-relief 3))
314 (lines (/ (+ image-height
315 (* 2 margin)
316 (* 2 relief)
317 (1- char-height))
318 char-height))
319 (height (frame-parameter frame-initial-frame 'height))
320 (newparms (list (cons 'height (- height lines))))
321 (initial-top (cdr (assq 'top
322 frame-initial-geometry-arguments)))
323 (top (frame-parameter frame-initial-frame 'top)))
324 (when (and (consp initial-top) (eq '- (car initial-top)))
325 (setq newparms
326 (append newparms
327 `((top . ,(+ top (* lines char-height))))
328 nil)))
329 (modify-frame-parameters frame-initial-frame newparms)
330 (tool-bar-mode -1)))))
332 ;; The initial frame we create above always has a minibuffer.
333 ;; If the user wants to remove it, or make it a minibuffer-only
334 ;; frame, then we'll have to delete the current frame and make a
335 ;; new one; you can't remove or add a root window to/from an
336 ;; existing frame.
338 ;; NOTE: default-frame-alist was nil when we created the
339 ;; existing frame. We need to explicitly include
340 ;; default-frame-alist in the parameters of the screen we
341 ;; create here, so that its new value, gleaned from the user's
342 ;; .emacs file, will be applied to the existing screen.
343 (if (not (eq (cdr (or (assq 'minibuffer initial-frame-alist)
344 (assq 'minibuffer default-frame-alist)
345 '(minibuffer . t)))
347 ;; Create the new frame.
348 (let (parms new)
349 ;; If the frame isn't visible yet, wait till it is.
350 ;; If the user has to position the window,
351 ;; Emacs doesn't know its real position until
352 ;; the frame is seen to be visible.
353 (while (not (cdr (assq 'visibility
354 (frame-parameters frame-initial-frame))))
355 (sleep-for 1))
356 (setq parms (frame-parameters frame-initial-frame))
358 ;; Get rid of `name' unless it was specified explicitly before.
359 (or (assq 'name frame-initial-frame-alist)
360 (setq parms (delq (assq 'name parms) parms)))
362 (setq parms (append initial-frame-alist
363 default-frame-alist
364 parms
365 nil))
367 ;; Get rid of `reverse', because that was handled
368 ;; when we first made the frame.
369 (setq parms (cons '(reverse) (delq (assq 'reverse parms) parms)))
371 (if (assq 'height frame-initial-geometry-arguments)
372 (setq parms (assq-delete-all 'height parms)))
373 (if (assq 'width frame-initial-geometry-arguments)
374 (setq parms (assq-delete-all 'width parms)))
375 (if (assq 'left frame-initial-geometry-arguments)
376 (setq parms (assq-delete-all 'left parms)))
377 (if (assq 'top frame-initial-geometry-arguments)
378 (setq parms (assq-delete-all 'top parms)))
379 (setq new
380 (make-frame
381 ;; Use the geometry args that created the existing
382 ;; frame, rather than the parms we get for it.
383 (append frame-initial-geometry-arguments
384 '((user-size . t) (user-position . t))
385 parms)))
386 ;; The initial frame, which we are about to delete, may be
387 ;; the only frame with a minibuffer. If it is, create a
388 ;; new one.
389 (or (delq frame-initial-frame (minibuffer-frame-list))
390 (make-initial-minibuffer-frame nil))
392 ;; If the initial frame is serving as a surrogate
393 ;; minibuffer frame for any frames, we need to wean them
394 ;; onto a new frame. The default-minibuffer-frame
395 ;; variable must be handled similarly.
396 (let ((users-of-initial
397 (filtered-frame-list
398 (function (lambda (frame)
399 (and (not (eq frame frame-initial-frame))
400 (eq (window-frame
401 (minibuffer-window frame))
402 frame-initial-frame)))))))
403 (if (or users-of-initial
404 (eq default-minibuffer-frame frame-initial-frame))
406 ;; Choose an appropriate frame. Prefer frames which
407 ;; are only minibuffers.
408 (let* ((new-surrogate
409 (car
410 (or (filtered-frame-list
411 (function
412 (lambda (frame)
413 (eq (cdr (assq 'minibuffer
414 (frame-parameters frame)))
415 'only))))
416 (minibuffer-frame-list))))
417 (new-minibuffer (minibuffer-window new-surrogate)))
419 (if (eq default-minibuffer-frame frame-initial-frame)
420 (setq default-minibuffer-frame new-surrogate))
422 ;; Wean the frames using frame-initial-frame as
423 ;; their minibuffer frame.
424 (mapcar
425 (function
426 (lambda (frame)
427 (modify-frame-parameters
428 frame (list (cons 'minibuffer new-minibuffer)))))
429 users-of-initial))))
431 ;; Redirect events enqueued at this frame to the new frame.
432 ;; Is this a good idea?
433 (redirect-frame-focus frame-initial-frame new)
435 ;; Finally, get rid of the old frame.
436 (delete-frame frame-initial-frame t))
438 ;; Otherwise, we don't need all that rigamarole; just apply
439 ;; the new parameters.
440 (let (newparms allparms tail)
441 (setq allparms (append initial-frame-alist
442 default-frame-alist nil))
443 (if (assq 'height frame-initial-geometry-arguments)
444 (setq allparms (assq-delete-all 'height allparms)))
445 (if (assq 'width frame-initial-geometry-arguments)
446 (setq allparms (assq-delete-all 'width allparms)))
447 (if (assq 'left frame-initial-geometry-arguments)
448 (setq allparms (assq-delete-all 'left allparms)))
449 (if (assq 'top frame-initial-geometry-arguments)
450 (setq allparms (assq-delete-all 'top allparms)))
451 (setq tail allparms)
452 ;; Find just the parms that have changed since we first
453 ;; made this frame. Those are the ones actually set by
454 ;; the init file. For those parms whose values we already knew
455 ;; (such as those spec'd by command line options)
456 ;; it is undesirable to specify the parm again
457 ;; once the user has seen the frame and been able to alter it
458 ;; manually.
459 (while tail
460 (let (newval oldval)
461 (setq oldval (assq (car (car tail))
462 frame-initial-frame-alist))
463 (setq newval (cdr (assq (car (car tail)) allparms)))
464 (or (and oldval (eq (cdr oldval) newval))
465 (setq newparms
466 (cons (cons (car (car tail)) newval) newparms))))
467 (setq tail (cdr tail)))
468 (setq newparms (nreverse newparms))
469 (modify-frame-parameters frame-initial-frame
470 newparms)
471 ;; If we changed the background color,
472 ;; we need to update the background-mode parameter
473 ;; and maybe some faces too.
474 (when (assq 'background-color newparms)
475 (unless (assq 'background-mode newparms)
476 (frame-set-background-mode frame-initial-frame))
477 (face-set-after-frame-default frame-initial-frame)))))
479 ;; Restore the original buffer.
480 (set-buffer old-buffer)
482 ;; Make sure the initial frame can be GC'd if it is ever deleted.
483 ;; Make sure frame-notice-user-settings does nothing if called twice.
484 (setq frame-notice-user-settings nil)
485 (setq frame-initial-frame nil)))
487 (defun make-initial-minibuffer-frame (display)
488 (let ((parms (append minibuffer-frame-alist '((minibuffer . only)))))
489 (if display
490 (make-frame-on-display display parms)
491 (make-frame parms))))
493 ;;;; Creation of additional frames, and other frame miscellanea
495 (defun get-other-frame ()
496 "Return some frame other than the current frame.
497 Create one if necessary. Note that the minibuffer frame, if separate,
498 is not considered (see `next-frame')."
499 (let ((s (if (equal (next-frame (selected-frame)) (selected-frame))
500 (make-frame)
501 (next-frame (selected-frame)))))
504 (defun next-multiframe-window ()
505 "Select the next window, regardless of which frame it is on."
506 (interactive)
507 (select-window (next-window (selected-window)
508 (> (minibuffer-depth) 0)
509 t)))
511 (defun previous-multiframe-window ()
512 "Select the previous window, regardless of which frame it is on."
513 (interactive)
514 (select-window (previous-window (selected-window)
515 (> (minibuffer-depth) 0)
516 t)))
518 (defun make-frame-on-display (display &optional parameters)
519 "Make a frame on display DISPLAY.
520 The optional second argument PARAMETERS specifies additional frame parameters."
521 (interactive "sMake frame on display: ")
522 (or (string-match "\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" display)
523 (error "Invalid display, not HOST:SERVER or HOST:SERVER.SCREEN"))
524 (make-frame (cons (cons 'display display) parameters)))
526 (defun make-frame-command ()
527 "Make a new frame, and select it if the terminal displays only one frame."
528 (interactive)
529 (if (and window-system (not (eq window-system 'pc)))
530 (make-frame)
531 (select-frame (make-frame))))
533 (defvar before-make-frame-hook nil
534 "Functions to run before a frame is created.")
536 (defvar after-make-frame-functions nil
537 "Functions to run after a frame is created.
538 The functions are run with one arg, the newly created frame.")
540 (defvar after-setting-font-hook nil
541 "Functions to run after a frame's font has been changed.")
543 ;; Alias, kept temporarily.
544 (defalias 'new-frame 'make-frame)
546 (defun make-frame (&optional parameters)
547 "Return a newly created frame displaying the current buffer.
548 Optional argument PARAMETERS is an alist of parameters for the new frame.
549 Each element of PARAMETERS should have the form (NAME . VALUE), for example:
551 (name . STRING) The frame should be named STRING.
553 (width . NUMBER) The frame should be NUMBER characters in width.
554 (height . NUMBER) The frame should be NUMBER text lines high.
556 You cannot specify either `width' or `height', you must use neither or both.
558 (minibuffer . t) The frame should have a minibuffer.
559 (minibuffer . nil) The frame should have no minibuffer.
560 (minibuffer . only) The frame should contain only a minibuffer.
561 (minibuffer . WINDOW) The frame should use WINDOW as its minibuffer window.
563 Before the frame is created (via `frame-creation-function'), functions on the
564 hook `before-make-frame-hook' are run. After the frame is created, functions
565 on `after-make-frame-functions' are run with one arg, the newly created frame."
566 (interactive)
567 (run-hooks 'before-make-frame-hook)
568 (let ((frame (funcall frame-creation-function parameters)))
569 (run-hook-with-args 'after-make-frame-functions frame)
570 frame))
572 (defun filtered-frame-list (predicate)
573 "Return a list of all live frames which satisfy PREDICATE."
574 (let* ((frames (frame-list))
575 (list frames))
576 (while (consp frames)
577 (unless (funcall predicate (car frames))
578 (setcar frames nil))
579 (setq frames (cdr frames)))
580 (delq nil list)))
582 (defun minibuffer-frame-list ()
583 "Return a list of all frames with their own minibuffers."
584 (filtered-frame-list
585 (function (lambda (frame)
586 (eq frame (window-frame (minibuffer-window frame)))))))
588 (defun frames-on-display-list (&optional display)
589 "Return a list of all frames on DISPLAY.
590 DISPLAY is a name of a display, a string of the form HOST:SERVER.SCREEN.
591 If DISPLAY is omitted or nil, it defaults to the selected frame's display."
592 (let* ((display (or display (frame-parameter nil 'display)))
593 (func #'(lambda (frame)
594 (eq (frame-parameter frame 'display) display))))
595 (filtered-frame-list func)))
597 (defun framep-on-display (&optional display)
598 "Return the type of frames on DISPLAY.
599 DISPLAY may be a display name or a frame. If it is a frame, its type is
600 returned.
601 If DISPLAY is omitted or nil, it defaults to the selected frame's display.
602 All frames on a given display are of the same type."
603 (or (framep display)
604 (framep (car (frames-on-display-list display)))))
606 (defun frame-remove-geometry-params (param-list)
607 "Return the parameter list PARAM-LIST, but with geometry specs removed.
608 This deletes all bindings in PARAM-LIST for `top', `left', `width',
609 `height', `user-size' and `user-position' parameters.
610 Emacs uses this to avoid overriding explicit moves and resizings from
611 the user during startup."
612 (setq param-list (cons nil param-list))
613 (let ((tail param-list))
614 (while (consp (cdr tail))
615 (if (and (consp (car (cdr tail)))
616 (memq (car (car (cdr tail)))
617 '(height width top left user-position user-size)))
618 (progn
619 (setq frame-initial-geometry-arguments
620 (cons (car (cdr tail)) frame-initial-geometry-arguments))
621 (setcdr tail (cdr (cdr tail))))
622 (setq tail (cdr tail)))))
623 (setq frame-initial-geometry-arguments
624 (nreverse frame-initial-geometry-arguments))
625 (cdr param-list))
628 (defcustom focus-follows-mouse t
629 "*Non-nil if window system changes focus when you move the mouse."
630 :type 'boolean
631 :group 'frames
632 :version "20.3")
634 (defun other-frame (arg)
635 "Select the ARG'th different visible frame, and raise it.
636 All frames are arranged in a cyclic order.
637 This command selects the frame ARG steps away in that order.
638 A negative ARG moves in the opposite order."
639 (interactive "p")
640 (let ((frame (selected-frame)))
641 (while (> arg 0)
642 (setq frame (next-frame frame))
643 (while (not (eq (frame-visible-p frame) t))
644 (setq frame (next-frame frame)))
645 (setq arg (1- arg)))
646 (while (< arg 0)
647 (setq frame (previous-frame frame))
648 (while (not (eq (frame-visible-p frame) t))
649 (setq frame (previous-frame frame)))
650 (setq arg (1+ arg)))
651 (select-frame frame)
652 (raise-frame frame)
653 ;; Ensure, if possible, that frame gets input focus.
654 (when (eq window-system 'w32)
655 (w32-focus-frame frame))
656 (cond (focus-follows-mouse
657 (unless (eq window-system 'w32)
658 (set-mouse-position (selected-frame) (1- (frame-width)) 0)))
660 (when (eq window-system 'x)
661 (x-focus-frame frame))))))
663 (defun make-frame-names-alist ()
664 (let* ((current-frame (selected-frame))
665 (falist
666 (cons
667 (cons (frame-parameter current-frame 'name) current-frame) nil))
668 (frame (next-frame nil t)))
669 (while (not (eq frame current-frame))
670 (progn
671 (setq falist (cons (cons (frame-parameter frame 'name) frame) falist))
672 (setq frame (next-frame frame t))))
673 falist))
675 (defvar frame-name-history nil)
676 (defun select-frame-by-name (name)
677 "Select the frame whose name is NAME and raise it.
678 If there is no frame by that name, signal an error."
679 (interactive
680 (let* ((frame-names-alist (make-frame-names-alist))
681 (default (car (car frame-names-alist)))
682 (input (completing-read
683 (format "Select Frame (default %s): " default)
684 frame-names-alist nil t nil 'frame-name-history)))
685 (if (= (length input) 0)
686 (list default)
687 (list input))))
688 (let* ((frame-names-alist (make-frame-names-alist))
689 (frame (cdr (assoc name frame-names-alist))))
690 (or frame
691 (error "There is no frame named `%s'" name))
692 (make-frame-visible frame)
693 (raise-frame frame)
694 (select-frame frame)
695 ;; Ensure, if possible, that frame gets input focus.
696 (if (eq window-system 'w32)
697 (w32-focus-frame frame)
698 (when focus-follows-mouse
699 (set-mouse-position (selected-frame) (1- (frame-width)) 0)))))
701 ;;;; Frame configurations
703 (defun current-frame-configuration ()
704 "Return a list describing the positions and states of all frames.
705 Its car is `frame-configuration'.
706 Each element of the cdr is a list of the form (FRAME ALIST WINDOW-CONFIG),
707 where
708 FRAME is a frame object,
709 ALIST is an association list specifying some of FRAME's parameters, and
710 WINDOW-CONFIG is a window configuration object for FRAME."
711 (cons 'frame-configuration
712 (mapcar (function
713 (lambda (frame)
714 (list frame
715 (frame-parameters frame)
716 (current-window-configuration frame))))
717 (frame-list))))
719 (defun set-frame-configuration (configuration &optional nodelete)
720 "Restore the frames to the state described by CONFIGURATION.
721 Each frame listed in CONFIGURATION has its position, size, window
722 configuration, and other parameters set as specified in CONFIGURATION.
723 Ordinarily, this function deletes all existing frames not
724 listed in CONFIGURATION. But if optional second argument NODELETE
725 is given and non-nil, the unwanted frames are iconified instead."
726 (or (frame-configuration-p configuration)
727 (signal 'wrong-type-argument
728 (list 'frame-configuration-p configuration)))
729 (let ((config-alist (cdr configuration))
730 frames-to-delete)
731 (mapcar (function
732 (lambda (frame)
733 (let ((parameters (assq frame config-alist)))
734 (if parameters
735 (progn
736 (modify-frame-parameters
737 frame
738 ;; Since we can't set a frame's minibuffer status,
739 ;; we might as well omit the parameter altogether.
740 (let* ((parms (nth 1 parameters))
741 (mini (assq 'minibuffer parms)))
742 (if mini (setq parms (delq mini parms)))
743 parms))
744 (set-window-configuration (nth 2 parameters)))
745 (setq frames-to-delete (cons frame frames-to-delete))))))
746 (frame-list))
747 (if nodelete
748 ;; Note: making frames invisible here was tried
749 ;; but led to some strange behavior--each time the frame
750 ;; was made visible again, the window manager asked afresh
751 ;; for where to put it.
752 (mapcar 'iconify-frame frames-to-delete)
753 (mapcar 'delete-frame frames-to-delete))))
755 ;;;; Convenience functions for accessing and interactively changing
756 ;;;; frame parameters.
758 (defun frame-height (&optional frame)
759 "Return number of lines available for display on FRAME.
760 If FRAME is omitted, describe the currently selected frame."
761 (cdr (assq 'height (frame-parameters frame))))
763 (defun frame-width (&optional frame)
764 "Return number of columns available for display on FRAME.
765 If FRAME is omitted, describe the currently selected frame."
766 (cdr (assq 'width (frame-parameters frame))))
768 (defalias 'set-default-font 'set-frame-font)
769 (defun set-frame-font (font-name)
770 "Set the font of the selected frame to FONT-NAME.
771 When called interactively, prompt for the name of the font to use.
772 To get the frame's current default font, use `frame-parameters'."
773 (interactive
774 (list
775 (let ((completion-ignore-case t))
776 (completing-read "Font name: "
777 (mapcar #'list
778 ;; x-list-fonts will fail with an error
779 ;; if this frame doesn't support fonts.
780 (x-list-fonts "*" nil (selected-frame)))))))
781 (modify-frame-parameters (selected-frame)
782 (list (cons 'font font-name)))
783 (run-hooks 'after-setting-font-hook 'after-setting-font-hooks))
785 (defun set-background-color (color-name)
786 "Set the background color of the selected frame to COLOR-NAME.
787 When called interactively, prompt for the name of the color to use.
788 To get the frame's current background color, use `frame-parameters'."
789 (interactive (list (facemenu-read-color)))
790 (modify-frame-parameters (selected-frame)
791 (list (cons 'background-color color-name))))
793 (defun set-foreground-color (color-name)
794 "Set the foreground color of the selected frame to COLOR-NAME.
795 When called interactively, prompt for the name of the color to use.
796 To get the frame's current foreground color, use `frame-parameters'."
797 (interactive (list (facemenu-read-color)))
798 (modify-frame-parameters (selected-frame)
799 (list (cons 'foreground-color color-name))))
801 (defun set-cursor-color (color-name)
802 "Set the text cursor color of the selected frame to COLOR-NAME.
803 When called interactively, prompt for the name of the color to use.
804 To get the frame's current cursor color, use `frame-parameters'."
805 (interactive (list (facemenu-read-color)))
806 (modify-frame-parameters (selected-frame)
807 (list (cons 'cursor-color color-name))))
809 (defun set-mouse-color (color-name)
810 "Set the color of the mouse pointer of the selected frame to COLOR-NAME.
811 When called interactively, prompt for the name of the color to use.
812 To get the frame's current mouse color, use `frame-parameters'."
813 (interactive (list (facemenu-read-color)))
814 (modify-frame-parameters (selected-frame)
815 (list (cons 'mouse-color
816 (or color-name
817 (cdr (assq 'mouse-color
818 (frame-parameters))))))))
820 (defun set-border-color (color-name)
821 "Set the color of the border of the selected frame to COLOR-NAME.
822 When called interactively, prompt for the name of the color to use.
823 To get the frame's current border color, use `frame-parameters'."
824 (interactive (list (facemenu-read-color)))
825 (modify-frame-parameters (selected-frame)
826 (list (cons 'border-color color-name))))
828 (defun auto-raise-mode (arg)
829 "Toggle whether or not the selected frame should auto-raise.
830 With arg, turn auto-raise mode on if and only if arg is positive.
831 Note that this controls Emacs's own auto-raise feature.
832 Some window managers allow you to enable auto-raise for certain windows.
833 You can use that for Emacs windows if you wish, but if you do,
834 that is beyond the control of Emacs and this command has no effect on it."
835 (interactive "P")
836 (if (null arg)
837 (setq arg
838 (if (cdr (assq 'auto-raise (frame-parameters (selected-frame))))
839 -1 1)))
840 (if (> arg 0)
841 (raise-frame (selected-frame)))
842 (modify-frame-parameters (selected-frame)
843 (list (cons 'auto-raise (> arg 0)))))
845 (defun auto-lower-mode (arg)
846 "Toggle whether or not the selected frame should auto-lower.
847 With arg, turn auto-lower mode on if and only if arg is positive.
848 Note that this controls Emacs's own auto-lower feature.
849 Some window managers allow you to enable auto-lower for certain windows.
850 You can use that for Emacs windows if you wish, but if you do,
851 that is beyond the control of Emacs and this command has no effect on it."
852 (interactive "P")
853 (if (null arg)
854 (setq arg
855 (if (cdr (assq 'auto-lower (frame-parameters (selected-frame))))
856 -1 1)))
857 (modify-frame-parameters (selected-frame)
858 (list (cons 'auto-lower (> arg 0)))))
859 (defun set-frame-name (name)
860 "Set the name of the selected frame to NAME.
861 When called interactively, prompt for the name of the frame.
862 The frame name is displayed on the modeline if the terminal displays only
863 one frame, otherwise the name is displayed on the frame's caption bar."
864 (interactive "sFrame name: ")
865 (modify-frame-parameters (selected-frame)
866 (list (cons 'name name))))
868 ;;;; Frame/display capabilities.
869 (defun display-mouse-p (&optional display)
870 "Return non-nil if DISPLAY has a mouse available.
871 DISPLAY can be a display name, a frame, or nil (meaning the selected
872 frame's display)."
873 (let ((frame-type (framep-on-display display)))
874 (cond
875 ((eq frame-type 'pc)
876 (msdos-mouse-p))
877 ((eq system-type 'windows-nt)
878 (> w32-num-mouse-buttons 0))
879 ((memq frame-type '(x mac))
880 t) ;; We assume X and Mac *always* have a pointing device
882 (or (and (featurep 'xt-mouse)
883 xterm-mouse-mode)
884 ;; t-mouse is distributed with the GPM package. It doesn't have
885 ;; a toggle.
886 (featurep 't-mouse))))))
888 (defun display-popup-menus-p (&optional display)
889 "Return non-nil if popup menus are supported on DISPLAY.
890 DISPLAY can be a display name, a frame, or nil (meaning the selected
891 frame's display).
892 Support for popup menus requires that the mouse be available."
893 (and
894 (let ((frame-type (framep-on-display display)))
895 (memq frame-type '(x w32 pc mac)))
896 (display-mouse-p display)))
898 (defun display-graphic-p (&optional display)
899 "Return non-nil if DISPLAY is a graphic display.
900 Graphical displays are those which are capable of displaying several
901 frames and several different fonts at once. This is true for displays
902 that use a window system such as X, and false for text-only terminals.
903 DISPLAY can be a display name, a frame, or nil (meaning the selected
904 frame's display)."
905 (not (null (memq (framep-on-display display) '(x w32 mac)))))
907 (defalias 'display-multi-frame-p 'display-graphic-p)
908 (defalias 'display-multi-font-p 'display-graphic-p)
910 (defun display-selections-p (&optional display)
911 "Return non-nil if DISPLAY supports selections.
912 A selection is a way to transfer text or other data between programs
913 via special system buffers called `selection' or `cut buffer' or
914 `clipboard'.
915 DISPLAY can be a display name, a frame, or nil (meaning the selected
916 frame's display)."
917 (let ((frame-type (framep-on-display display)))
918 (cond
919 ((eq frame-type 'pc)
920 ;; MS-DOG frames support selections when Emacs runs inside
921 ;; the Windows' DOS Box.
922 (not (null dos-windows-version)))
923 ((memq frame-type '(x w32 mac))
924 t) ;; FIXME?
926 nil))))
928 (defun display-screens (&optional display)
929 "Return the number of screens associated with DISPLAY."
930 (let ((frame-type (framep-on-display display)))
931 (cond
932 ((memq frame-type '(x w32))
933 (x-display-screens display))
934 (t ;; FIXME: is this correct for the Mac?
935 1))))
937 (defun display-pixel-height (&optional display)
938 "Return the height of DISPLAY's screen in pixels.
939 For character terminals, each character counts as a single pixel."
940 (let ((frame-type (framep-on-display display)))
941 (cond
942 ((memq frame-type '(x w32 mac))
943 (x-display-pixel-height display))
945 (frame-height (if (framep display) display (selected-frame)))))))
947 (defun display-pixel-width (&optional display)
948 "Return the width of DISPLAY's screen in pixels.
949 For character terminals, each character counts as a single pixel."
950 (let ((frame-type (framep-on-display display)))
951 (cond
952 ((memq frame-type '(x w32 mac))
953 (x-display-pixel-width display))
955 (frame-width (if (framep display) display (selected-frame)))))))
957 (defun display-mm-height (&optional display)
958 "Return the height of DISPLAY's screen in millimeters.
959 If the information is unavailable, value is nil."
960 (and (memq (framep-on-display display) '(x w32 mac))
961 (x-display-mm-height display)))
963 (defun display-mm-width (&optional display)
964 "Return the width of DISPLAY's screen in millimeters.
965 If the information is unavailable, value is nil."
966 (and (memq (framep-on-display display) '(x w32 mac))
967 (x-display-mm-width display)))
969 (defun display-backing-store (&optional display)
970 "Return the backing store capability of DISPLAY's screen.
971 The value may be `always', `when-mapped', `not-useful', or nil if
972 the question is inapplicable to a certain kind of display."
973 (let ((frame-type (framep-on-display display)))
974 (cond
975 ((memq frame-type '(x w32 mac))
976 (x-display-backing-store display))
978 'not-useful))))
980 (defun display-save-under (&optional display)
981 "Return non-nil if DISPLAY's screen supports the SaveUnder feature."
982 (let ((frame-type (framep-on-display display)))
983 (cond
984 ((memq frame-type '(x w32 mac))
985 (x-display-save-under display))
987 'not-useful))))
989 (defun display-planes (&optional display)
990 "Return the number of planes supported by DISPLAY."
991 (let ((frame-type (framep-on-display display)))
992 (cond
993 ((memq frame-type '(x w32 mac))
994 (x-display-planes display))
995 ((eq frame-type 'pc)
998 (truncate (log (length (tty-color-alist)) 2))))))
1000 (defun display-color-cells (&optional display)
1001 "Return the number of color cells supported by DISPLAY."
1002 (let ((frame-type (framep-on-display display)))
1003 (cond
1004 ((memq frame-type '(x w32 mac))
1005 (x-display-color-cells display))
1006 ((eq frame-type 'pc)
1009 (length (tty-color-alist))))))
1011 (defun display-visual-class (&optional display)
1012 "Returns the visual class of DISPLAY.
1013 The value is one of the symbols `static-gray', `gray-scale',
1014 `static-color', `pseudo-color', `true-color', or `direct-color'."
1015 (let ((frame-type (framep-on-display display)))
1016 (cond
1017 ((memq frame-type '(x w32 mac))
1018 (x-display-visual-class display))
1019 ((and (memq frame-type '(pc t))
1020 (tty-display-color-p display))
1021 'static-color)
1023 'static-gray))))
1026 ;;;; Aliases for backward compatibility with Emacs 18.
1027 (defalias 'screen-height 'frame-height)
1028 (defalias 'screen-width 'frame-width)
1030 (defun set-screen-width (cols &optional pretend)
1031 "Obsolete function to change the size of the screen to COLS columns.
1032 Optional second arg non-nil means that redisplay should use COLS columns
1033 but that the idea of the actual width of the frame should not be changed.
1034 This function is provided only for compatibility with Emacs 18; new code
1035 should use `set-frame-width instead'."
1036 (set-frame-width (selected-frame) cols pretend))
1038 (defun set-screen-height (lines &optional pretend)
1039 "Obsolete function to change the height of the screen to LINES lines.
1040 Optional second arg non-nil means that redisplay should use LINES lines
1041 but that the idea of the actual height of the screen should not be changed.
1042 This function is provided only for compatibility with Emacs 18; new code
1043 should use `set-frame-height' instead."
1044 (set-frame-height (selected-frame) lines pretend))
1046 (defun delete-other-frames (&optional frame)
1047 "Delete all frames except FRAME.
1048 If FRAME uses another frame's minibuffer, the minibuffer frame is
1049 left untouched. FRAME nil or omitted means use the selected frame."
1050 (interactive)
1051 (unless frame
1052 (setq frame (selected-frame)))
1053 (let* ((mini-frame (window-frame (minibuffer-window frame)))
1054 (frames (delq mini-frame (delq frame (frame-list)))))
1055 ;; Delete mon-minibuffer-only frames first, because `delete-frame'
1056 ;; signals an error when trying to delete a mini-frame that's
1057 ;; still in use by another frame.
1058 (dolist (frame frames)
1059 (unless (eq (frame-parameter frame 'minibuffer) 'only)
1060 (delete-frame frame)))
1061 ;; Delete minibuffer-only frames.
1062 (dolist (frame frames)
1063 (when (eq (frame-parameter frame 'minibuffer) 'only)
1064 (delete-frame frame)))))
1067 (make-obsolete 'screen-height 'frame-height) ;before 19.15
1068 (make-obsolete 'screen-width 'frame-width) ;before 19.15
1069 (make-obsolete 'set-screen-width 'set-frame-width) ;before 19.15
1070 (make-obsolete 'set-screen-height 'set-frame-height) ;before 19.15
1073 ;;; Highlighting trailing whitespace.
1075 (make-variable-buffer-local 'show-trailing-whitespace)
1077 (defcustom show-trailing-whitespace nil
1078 "*Non-nil means highlight trailing whitespace in face `trailing-whitespace'."
1079 :tag "Highlight trailing whitespace."
1080 :set #'(lambda (symbol value) (set-default symbol value))
1081 :type 'boolean
1082 :group 'font-lock)
1086 ;;; Scrolling
1088 (defgroup scrolling nil
1089 "Scrolling windows."
1090 :version "21.1"
1091 :group 'frames)
1093 (defcustom automatic-hscrolling t
1094 "*Allow or disallow automatic scrolling windows horizontally.
1095 If non-nil, windows are automatically scrolled horizontally to make
1096 point visible."
1097 :version "21.1"
1098 :type 'boolean
1099 :group 'scrolling)
1102 ;;; Blinking cursor
1104 (defgroup cursor nil
1105 "Displaying text cursors."
1106 :version "21.1"
1107 :group 'frames)
1109 (defcustom blink-cursor-delay 0.5
1110 "*Seconds of idle time after which cursor starts to blink."
1111 :tag "Delay in seconds."
1112 :type 'number
1113 :group 'cursor)
1115 (defcustom blink-cursor-interval 0.5
1116 "*Length of cursor blink interval in seconds."
1117 :tag "Blink interval in seconds."
1118 :type 'number
1119 :group 'cursor)
1121 (defvar blink-cursor-idle-timer nil
1122 "Timer started after `blink-cursor-delay' seconds of Emacs idle time.
1123 The function `blink-cursor-start' is called when the timer fires.")
1125 (defvar blink-cursor-timer nil
1126 "Timer started from `blink-cursor-start'.
1127 This timer calls `blink-cursor' every `blink-cursor-interval' seconds.")
1129 (defvar blink-cursor-mode nil
1130 "Non-nil means blinking cursor is active.")
1132 (defun blink-cursor-mode (arg)
1133 "Toggle blinking cursor mode.
1134 With a numeric argument, turn blinking cursor mode on iff ARG is positive.
1135 When blinking cursor mode is enabled, the cursor of the selected
1136 window blinks."
1137 (interactive "P")
1138 (let ((on-p (if (null arg)
1139 (not blink-cursor-mode)
1140 (> (prefix-numeric-value arg) 0))))
1141 (if blink-cursor-idle-timer
1142 (cancel-timer blink-cursor-idle-timer))
1143 (if blink-cursor-timer
1144 (cancel-timer blink-cursor-timer))
1145 (setq blink-cursor-idle-timer nil
1146 blink-cursor-timer nil
1147 blink-cursor-mode nil)
1148 (if on-p
1149 (progn
1150 ;; Hide the cursor.
1151 ;(internal-show-cursor nil nil)
1152 (setq blink-cursor-idle-timer
1153 (run-with-idle-timer blink-cursor-delay
1154 blink-cursor-delay
1155 'blink-cursor-start))
1156 (setq blink-cursor-mode t))
1157 (internal-show-cursor nil t))))
1159 ;; Note that this is really initialized from startup.el before
1160 ;; the init-file is read.
1162 (defcustom blink-cursor nil
1163 "*Non-nil means blinking cursor mode is active."
1164 :group 'cursor
1165 :tag "Blinking cursor"
1166 :type 'boolean
1167 :set #'(lambda (symbol value)
1168 (set-default symbol value)
1169 (blink-cursor-mode (or value 0))))
1171 (defun blink-cursor-start ()
1172 "Timer function called from the timer `blink-cursor-idle-timer'.
1173 This starts the timer `blink-cursor-timer', which makes the cursor blink
1174 if appropriate. It also arranges to cancel that timer when the next
1175 command starts, by installing a pre-command hook."
1176 (when (null blink-cursor-timer)
1177 (add-hook 'pre-command-hook 'blink-cursor-end)
1178 (setq blink-cursor-timer
1179 (run-with-timer blink-cursor-interval blink-cursor-interval
1180 'blink-cursor-timer-function))))
1182 (defun blink-cursor-timer-function ()
1183 "Timer function of timer `blink-cursor-timer'."
1184 (internal-show-cursor nil (not (internal-show-cursor-p))))
1186 (defun blink-cursor-end ()
1187 "Stop cursor blinking.
1188 This is installed as a pre-command hook by `blink-cursor-start'.
1189 When run, it cancels the timer `blink-cursor-timer' and removes
1190 itself as a pre-command hook."
1191 (remove-hook 'pre-command-hook 'blink-cursor-end)
1192 (internal-show-cursor nil t)
1193 (cancel-timer blink-cursor-timer)
1194 (setq blink-cursor-timer nil))
1198 ;;; Hourglass pointer
1200 (defcustom display-hourglass t
1201 "*Non-nil means show an hourglass pointer when running under a window system."
1202 :tag "Hourglass pointer"
1203 :type 'boolean
1204 :group 'cursor)
1206 (defcustom hourglass-delay 1
1207 "*Seconds to wait before displaying an hourglass pointer."
1208 :tag "Hourglass delay"
1209 :type 'number
1210 :group 'cursor)
1213 (defcustom cursor-in-non-selected-windows t
1214 "*Non-nil means show a hollow box cursor in non-selected-windows.
1215 If nil, don't show a cursor except in the selected window.
1216 Use Custom to set this variable to get the display updated."
1217 :tag "Cursor in non-selected windows"
1218 :type 'boolean
1219 :group 'cursor
1220 :set #'(lambda (symbol value)
1221 (set-default symbol value)
1222 (force-mode-line-update t)))
1225 ;;;; Key bindings
1227 (define-key ctl-x-5-map "2" 'make-frame-command)
1228 (define-key ctl-x-5-map "1" 'delete-other-frames)
1229 (define-key ctl-x-5-map "0" 'delete-frame)
1230 (define-key ctl-x-5-map "o" 'other-frame)
1232 (provide 'frame)
1234 ;;; frame.el ends here