comparison man/lispref/frames.texi @ 444:576fb035e263 r21-2-37

Import from CVS: tag r21-2-37
author cvs
date Mon, 13 Aug 2007 11:36:19 +0200
parents abe6d1db359e
children 755ae5b97edb
comparison
equal deleted inserted replaced
443:a8296e22da4e 444:576fb035e263
1 @c -*-texinfo-*- 1 @c -*-texinfo-*-
2 @c This is part of the XEmacs Lisp Reference Manual. 2 @c This is part of the XEmacs Lisp Reference Manual.
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. 3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
4 @c Copyright (C) 1995, 1996 Ben Wing. 4 @c Copyright (C) 1995, 1996 Ben Wing.
5 @c See the file lispref.texi for copying conditions. 5 @c See the file lispref.texi for copying conditions.
6 @setfilename ../../info/frames.info 6 @setfilename ../../info/frames.info
7 @node Frames, Consoles and Devices, Windows, Top 7 @node Frames, Consoles and Devices, Windows, Top
8 @chapter Frames 8 @chapter Frames
61 @node Creating Frames 61 @node Creating Frames
62 @section Creating Frames 62 @section Creating Frames
63 63
64 To create a new frame, call the function @code{make-frame}. 64 To create a new frame, call the function @code{make-frame}.
65 65
66 @defun make-frame &optional props device 66 @deffn Command make-frame &optional props device
67 This function creates a new frame on @var{device}, if @var{device} 67 This function creates a new frame on @var{device}, if @var{device}
68 permits creation of frames. (An X server does; an ordinary terminal 68 permits creation of frames. (An X server does; an ordinary terminal
69 does not (yet).) @var{device} defaults to the selected device if omitted. 69 does not (yet).) @var{device} defaults to the selected device if omitted.
70 @xref{Consoles and Devices}. 70 @xref{Consoles and Devices}.
71 71
81 81
82 The set of possible properties depends in principle on what kind of 82 The set of possible properties depends in principle on what kind of
83 window system XEmacs uses to display its frames. @xref{X Frame 83 window system XEmacs uses to display its frames. @xref{X Frame
84 Properties}, for documentation of individual properties you can specify 84 Properties}, for documentation of individual properties you can specify
85 when creating an X window frame. 85 when creating an X window frame.
86 @end defun 86 @end deffn
87 87
88 @node Frame Properties 88 @node Frame Properties
89 @section Frame Properties 89 @section Frame Properties
90 90
91 A frame has many properties that control its appearance and behavior. 91 A frame has many properties that control its appearance and behavior.
114 and their values. 114 and their values.
115 @end defun 115 @end defun
116 116
117 @defun frame-property frame property &optional default 117 @defun frame-property frame property &optional default
118 This function returns @var{frame}'s value for the property 118 This function returns @var{frame}'s value for the property
119 @var{property}. 119 @var{property}, or @var{default} if there is no such property.
120 @end defun 120 @end defun
121 121
122 @defun set-frame-properties frame plist 122 @defun set-frame-properties frame plist
123 This function alters the properties of frame @var{frame} based on the 123 This function alters the properties of frame @var{frame} based on the
124 elements of property list @var{plist}. If you don't mention a property 124 elements of property list @var{plist}. If you don't mention a property
125 in @var{plist}, its value doesn't change. 125 in @var{plist}, its value doesn't change.
126 @end defun 126 @end defun
127 127
128 @defun set-frame-property frame prop val 128 @defun set-frame-property frame property value
129 This function sets the property @var{prop} of frame @var{frame} to the 129 This function sets the property @var{property} of frame @var{frame} to the
130 value @var{val}. 130 value @var{value}.
131 @end defun 131 @end defun
132 132
133 @node Initial Properties 133 @node Initial Properties
134 @subsection Initial Frame Properties 134 @subsection Initial Frame Properties
135 135
360 @end defun 360 @end defun
361 361
362 @defun set-frame-size frame cols rows &optional pretend 362 @defun set-frame-size frame cols rows &optional pretend
363 This function sets the size of @var{frame}, measured in characters; 363 This function sets the size of @var{frame}, measured in characters;
364 @var{cols} and @var{rows} specify the new width and height. (If 364 @var{cols} and @var{rows} specify the new width and height. (If
365 @var{pretend} is non-nil, it means that redisplay should act as if 365 @var{pretend} is non-@code{nil}, it means that redisplay should act as if
366 the frame's size is @var{cols} by @var{rows}, but the actual size 366 the frame's size is @var{cols} by @var{rows}, but the actual size
367 of the frame should not be changed. You should not normally use 367 of the frame should not be changed. You should not normally use
368 this option.) 368 this option.)
369 @end defun 369 @end defun
370 370
496 496
497 Frames remain potentially visible until you explicitly @dfn{delete} 497 Frames remain potentially visible until you explicitly @dfn{delete}
498 them. A deleted frame cannot appear on the screen, but continues to 498 them. A deleted frame cannot appear on the screen, but continues to
499 exist as a Lisp object until there are no references to it. 499 exist as a Lisp object until there are no references to it.
500 500
501 @deffn Command delete-frame &optional frame 501 @deffn Command delete-frame &optional frame force
502 This function deletes the frame @var{frame}. By default, @var{frame} is 502 This function deletes the frame @var{frame}. By default, @var{frame} is
503 the selected frame. 503 the selected frame.
504
505 A frame may not be deleted if its minibuffer is used by other frames.
506 Normally, you cannot delete the last non-minibuffer-only frame (you must
507 use @code{save-buffers-kill-emacs} or @code{kill-emacs}). However, if
508 optional second argument @var{force} is non-@code{nil}, you can delete
509 the last frame. (This will automatically call
510 @code{save-buffers-kill-emacs}.)
504 @end deffn 511 @end deffn
505 512
506 @defun frame-live-p frame 513 @defun frame-live-p frame
507 The function @code{frame-live-p} returns non-@code{nil} if the frame 514 The function @code{frame-live-p} returns non-@code{nil} if the frame
508 @var{frame} has not been deleted. 515 @var{frame} has not been deleted.
536 If @var{device} is specified only frames on that device will be returned. 543 If @var{device} is specified only frames on that device will be returned.
537 @xref{Visibility of Frames}. (TTY frames always count as 544 @xref{Visibility of Frames}. (TTY frames always count as
538 ``visible'', even though only the selected one is actually displayed.) 545 ``visible'', even though only the selected one is actually displayed.)
539 @end defun 546 @end defun
540 547
541 @defun next-frame &optional frame minibuf 548 @defun next-frame &optional frame which-frames which-devices
542 The function @code{next-frame} lets you cycle conveniently through all 549 The function @code{next-frame} lets you cycle conveniently through all
543 the frames from an arbitrary starting point. It returns the ``next'' 550 the frames from an arbitrary starting point. It returns the ``next''
544 frame after @var{frame} in the cycle. If @var{frame} is omitted or 551 frame after @var{frame} in the cycle. If @var{frame} defaults to the
545 @code{nil}, it defaults to the selected frame. 552 selected frame.
546 553
547 The second argument, @var{minibuf}, says which frames to consider: 554 The second argument, @var{which-frames}, says which frames to consider:
555
556 @table @asis
557 @item @code{visible}
558 Consider only frames that are visible.
559
560 @item @code{iconic}
561 Consider only frames that are iconic.
562
563 @item @code{invisible}
564 Consider only frames that are invisible (this is different from iconic).
565
566 @item @code{visible-iconic}
567 Consider frames that are visible or iconic.
568
569 @item @code{invisible-iconic}
570 Consider frames that are invisible or iconic.
571
572 @item @code{nomini}
573 Consider all frames except minibuffer-only ones.
574
575 @item @code{visible-nomini}
576 Like @code{visible} but omits minibuffer-only frames.
577
578 @item @code{iconic-nomini}
579 Like @code{iconic} but omits minibuffer-only frames.
580
581 @item @code{invisible-nomini}
582 Like @code{invisible} but omits minibuffer-only frames.
583
584 @item @code{visible-iconic-nomini}
585 Like @code{visible-iconic} but omits minibuffer-only frames.
586
587 @item @code{invisible-iconic-nomini}
588 Like @code{invisible-iconic} but omits minibuffer-only frames.
589
590 @item @code{nil}
591 Identical to @code{nomini}.
592
593 @item @var{window}
594 Consider only the window @var{window}'s frame and any frame now using
595 @var{window} as the minibuffer.
596
597 @item any other value
598 Consider all frames.
599 @end table
600
601 The optional argument @var{which-devices} further clarifies on which
602 devices to search for frames as specified by @var{which-frames}.
548 603
549 @table @asis 604 @table @asis
550 @item @code{nil} 605 @item @code{nil}
551 Exclude minibuffer-only frames. 606 Consider all devices on the selected console.
552 @item @code{visible} 607
553 Consider all visible frames. 608 @item @var{device}
554 @item 0 609 Consider only the one device @var{device}.
555 Consider all visible or iconified frames. 610
556 @item a window 611 @item @var{console}
557 Consider only the frames using that particular window as their 612 Consider all devices on @var{console}.
558 minibuffer. 613
559 @item the symbol @code{visible} 614 @item @var{device-type}
560 Include all visible frames. 615 Consider all devices with device type @var{device-type}.
561 @item @code{0} 616
562 Include all visible and iconified frames. 617 @item @code{window-system}
618 Consider all devices on window system consoles.
619
563 @item anything else 620 @item anything else
564 Consider all frames. 621 Consider all devices without restriction.
565 @end table 622 @end table
566 @end defun 623 @end defun
567 624
568 @defun previous-frame &optional frame minibuf 625 @defun previous-frame &optional frame which-frames which-devices
569 Like @code{next-frame}, but cycles through all frames in the opposite 626 Like @code{next-frame}, but cycles through all frames in the opposite
570 direction. 627 direction.
571 @end defun 628 @end defun
572 629
573 See also @code{next-window} and @code{previous-window}, in @ref{Cyclic 630 See also @code{next-window} and @code{previous-window}, in @ref{Cyclic
593 order. The order runs from the frame's top window, which is at the 650 order. The order runs from the frame's top window, which is at the
594 upper left corner, down and to the right, until it reaches the window at 651 upper left corner, down and to the right, until it reaches the window at
595 the lower right corner (always the minibuffer window, if the frame has 652 the lower right corner (always the minibuffer window, if the frame has
596 one), and then it moves back to the top. 653 one), and then it moves back to the top.
597 654
598 @defun frame-top-window frame 655 @defun frame-highest-window &optional frame position
599 This returns the topmost, leftmost window of frame @var{frame}. 656 This function returns the topmost, leftmost window of frame @var{frame}
600 @end defun 657 at position @var{position}.
658
659 If omitted, @var{frame} defaults to the currently selected frame.
660
661 @var{position} is used to distinguish between multiple windows that abut
662 the top of the frame: 0 means the leftmost window abutting the top of
663 the frame, 1 the next-leftmost, etc. @var{position} can also be less
664 than zero: -1 means the rightmost window abutting the top of the frame,
665 -2 the next-rightmost, etc. If omitted, @var{position} defaults to 0,
666 i.e. the leftmost highest window. If there is no window at the given
667 @var{position}, @code{nil} is returned.
668 @end defun
669
670 The following three functions work similarly.
671
672 @defun frame-lowest-window &optional frame position
673 This function returns the lowest window on @var{frame} which is at
674 @var{position}.
675 @end defun
676
677 @defun frame-leftmost-window &optional frame position
678 This function returns the leftmost window on @var{frame} which is at
679 @var{position}.
680 @end defun
681
682 @defun frame-rightmost-window &optional frame position
683 This function returns the rightmost window on @var{frame} which is at
684 @var{position}.
685 @end defun
686
601 687
602 At any time, exactly one window on any frame is @dfn{selected within the 688 At any time, exactly one window on any frame is @dfn{selected within the
603 frame}. The significance of this designation is that selecting the 689 frame}. The significance of this designation is that selecting the
604 frame also selects this window. You can get the frame's current 690 frame also selects this window. You can get the frame's current
605 selected window with @code{frame-selected-window}. 691 selected window with @code{frame-selected-window}.
697 This function selects @var{frame} and gives it the window system focus. 783 This function selects @var{frame} and gives it the window system focus.
698 The operation of @code{focus-frame} is not affected by the value of 784 The operation of @code{focus-frame} is not affected by the value of
699 @code{focus-follows-mouse}. 785 @code{focus-follows-mouse}.
700 @end defun 786 @end defun
701 787
702 @defmac save-selected-frame forms@dots{} 788 @defspec save-selected-frame forms@dots{}
703 This macro records the selected frame, executes @var{forms} in sequence, 789 This special form records the selected frame, executes @var{forms} in
704 then restores the earlier selected frame. The value returned is the 790 sequence, then restores the earlier selected frame. The value returned
705 value of the last form. 791 is the value of the last form.
706 @end defmac 792 @end defspec
707 793
708 @defmac with-selected-frame frame forms@dots{} 794 @defspec with-selected-frame frame forms@dots{}
709 This macro records the selected frame, then selects @var{frame} and 795 This special form records the selected frame, then selects @var{frame}
710 executes @var{forms} in sequence. After the last form is finished, the 796 and executes @var{forms} in sequence. After the last form is finished,
711 earlier selected frame is restored. The value returned is the value of 797 the earlier selected frame is restored. The value returned is the value
712 the last form. 798 of the last form.
713 @end defmac 799 @end defspec
714 800
715 @ignore (FSF Emacs, continued from defun select-frame) 801 @ignore (FSF Emacs, continued from defun select-frame)
716 XEmacs cooperates with the X server and the window managers by arranging 802 XEmacs cooperates with the X server and the window managers by arranging
717 to select frames according to what the server and window manager ask 803 to select frames according to what the server and window manager ask
718 for. It does so by generating a special kind of input event, called a 804 for. It does so by generating a special kind of input event, called a
763 @cindex visible frame 849 @cindex visible frame
764 @cindex invisible frame 850 @cindex invisible frame
765 @cindex iconified frame 851 @cindex iconified frame
766 @cindex frame visibility 852 @cindex frame visibility
767 853
768 An X window frame may be @dfn{visible}, @dfn{invisible}, or 854 An frame on a window system may be @dfn{visible}, @dfn{invisible}, or
769 @dfn{iconified}. If it is visible, you can see its contents. If it is 855 @dfn{iconified}. If it is visible, you can see its contents. If it is
770 iconified, the frame's contents do not appear on the screen, but an icon 856 iconified, the frame's contents do not appear on the screen, but an icon
771 does. If the frame is invisible, it doesn't show on the screen, not 857 does. If the frame is invisible, it doesn't show on the screen, not
772 even as an icon. 858 even as an icon.
773 859
774 Visibility is meaningless for TTY frames, since only the selected 860 Visibility is meaningless for TTY frames, since only the selected
775 one is actually displayed in any case. 861 one is actually displayed in any case.
776 862
777 @deffn Command make-frame-visible &optional frame 863 @defun make-frame-visible &optional frame
778 This function makes frame @var{frame} visible. If you omit @var{frame}, 864 This function makes frame @var{frame} visible. If you omit @var{frame},
779 it makes the selected frame visible. 865 it makes the selected frame visible.
780 @end deffn 866 @end defun
781 867
782 @deffn Command make-frame-invisible &optional frame 868 @defun make-frame-invisible &optional frame force
783 This function makes frame @var{frame} invisible. 869 This function makes frame @var{frame} invisible.
784 @end deffn 870 @end defun
785 871
786 @deffn Command iconify-frame &optional frame 872 @deffn Command iconify-frame &optional frame
787 This function iconifies frame @var{frame}. 873 This function iconifies frame @var{frame}.
788 @end deffn 874 @end deffn
789 875
790 @deffn Command deiconify-frame &optional frame 876 @defun Command deiconify-frame &optional frame
791 This function de-iconifies frame @var{frame}. Under X, this is 877 This function de-iconifies frame @var{frame}. Under a window system,
792 equivalent to @code{make-frame-visible}. 878 this is equivalent to @code{make-frame-visible}.
793 @end deffn 879 @end defun
794 880
795 @defun frame-visible-p frame 881 @defun frame-visible-p &optional frame
796 This returns whether @var{frame} is currently ``visible'' (actually in 882 This returns whether @var{frame} is currently ``visible'' (actually in
797 use for display). A frame that is not visible is not updated, and, if 883 use for display). A frame that is not visible is not updated, and, if
798 it works through a window system, may not show at all. 884 it works through a window system, may not show at all.
799 @end defun 885 @end defun
800 886
801 @defun frame-iconified-p frame 887 @defun frame-iconified-p &optional frame
802 This returns whether @var{frame} is iconified. Not all window managers 888 This returns whether @var{frame} is iconified. Not all window managers
803 use icons; some merely unmap the window, so this function is not the 889 use icons; some merely unmap the window, so this function is not the
804 inverse of @code{frame-visible-p}. It is possible for a frame to not 890 inverse of @code{frame-visible-p}. It is possible for a frame to not
805 be visible and not be iconified either. However, if the frame is 891 be visible and not be iconified either. However, if the frame is
806 iconified, it will not be visible. (Under FSF Emacs, the functionality 892 iconified, it will not be visible. (Under FSF Emacs, the functionality
807 of this function is obtained through @code{frame-visible-p}.) 893 of this function is obtained through @code{frame-visible-p}.)
808 @end defun 894 @end defun
809 895
810 @defun frame-totally-visible-p frame 896 @defun frame-totally-visible-p &optional frame
811 This returns whether @var{frame} is not obscured by any other X 897 This returns whether @var{frame} is not obscured by any other X
812 windows. On TTY frames, this is the same as @code{frame-visible-p}. 898 windows. On TTY frames, this is the same as @code{frame-visible-p}.
813 @end defun 899 @end defun
814 900
815 @ignore @c Not in XEmacs. 901 @ignore @c Not in XEmacs.
902 @defun current-frame-configuration 988 @defun current-frame-configuration
903 This function returns a frame configuration list that describes 989 This function returns a frame configuration list that describes
904 the current arrangement of frames and their contents. 990 the current arrangement of frames and their contents.
905 @end defun 991 @end defun
906 992
907 @defun set-frame-configuration configuration 993 @defun set-frame-configuration configuration &optional nodelete
908 This function restores the state of frames described in 994 This function restores the state of frames described by
995 @var{configuration}, which should be the return value from a previous
996 call to @code{current-frame-configuration}.
997
998 Each frame listed in @var{configuration} has its position, size, window
999 configuration, and other properties set as specified in
909 @var{configuration}. 1000 @var{configuration}.
1001
1002 Ordinarily, this function deletes all existing frames not listed in
1003 @var{configuration}. But if optional second argument @var{nodelete} is
1004 non-@code{nil}, the unwanted frames are iconified instead.
910 @end defun 1005 @end defun
911 1006
912 @node Frame Hooks 1007 @node Frame Hooks
913 @section Hooks for Customizing Frame Behavior 1008 @section Hooks for Customizing Frame Behavior
914 @cindex frame hooks 1009 @cindex frame hooks