Mercurial > hg > xemacs-beta
comparison lisp/prim/frame.el @ 163:0132846995bd r20-3b8
Import from CVS: tag r20-3b8
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:43:35 +0200 |
parents | 59463afc5666 |
children | 9ad43877534d |
comparison
equal
deleted
inserted
replaced
162:4de2936b4e77 | 163:0132846995bd |
---|---|
25 | 25 |
26 ;;; Synched up with: FSF 19.30. | 26 ;;; Synched up with: FSF 19.30. |
27 | 27 |
28 ;;; Code: | 28 ;;; Code: |
29 | 29 |
30 (defgroup frames nil | |
31 "Support for Emacs frames and window systems." | |
32 :group 'environment) | |
33 | |
30 ; No need for `frame-creation-function'. | 34 ; No need for `frame-creation-function'. |
31 | 35 |
32 ;;; The initial value given here for this must ask for a minibuffer. | 36 ;;; The initial value given here for this must ask for a minibuffer. |
33 ;;; There must always exist a frame with a minibuffer, and after we | 37 ;;; There must always exist a frame with a minibuffer, and after we |
34 ;;; delete the terminal frame, this will be the only frame. | 38 ;;; delete the terminal frame, this will be the only frame. |
35 (defvar initial-frame-plist '(minibuffer t) | 39 (defcustom initial-frame-plist '(minibuffer t) |
36 "Plist of frame properties for creating the initial X window frame. | 40 "Plist of frame properties for creating the initial X window frame. |
37 You can set this in your `.emacs' file; for example, | 41 You can set this in your `.emacs' file; for example, |
38 (setq initial-frame-plist '(top 1 left 1 width 80 height 55)) | 42 (setq initial-frame-plist '(top 1 left 1 width 80 height 55)) |
39 Properties specified here supersede the values given in `default-frame-plist'. | 43 Properties specified here supersede the values given in `default-frame-plist'. |
40 The format of this can also be an alist for backward compatibility. | 44 The format of this can also be an alist for backward compatibility. |
50 as it appears, you need to use this three-step process: | 54 as it appears, you need to use this three-step process: |
51 * Specify X resources to give the geometry you want. | 55 * Specify X resources to give the geometry you want. |
52 * Set `default-frame-plist' to override these options so that they | 56 * Set `default-frame-plist' to override these options so that they |
53 don't affect subsequent frames. | 57 don't affect subsequent frames. |
54 * Set `initial-frame-plist' in a way that matches the X resources, | 58 * Set `initial-frame-plist' in a way that matches the X resources, |
55 to override what you put in `default-frame-plist'.") | 59 to override what you put in `default-frame-plist'." |
56 | 60 :type '(repeat (group :inline t |
57 (defvar minibuffer-frame-plist '(width 80 height 2 menubar-visible-p nil | 61 (symbol :tag "Property") |
62 (sexp :tag "Value"))) | |
63 :group 'frames) | |
64 | |
65 (defcustom minibuffer-frame-plist '(width 80 height 2 menubar-visible-p nil | |
58 default-toolbar-visible-p nil) | 66 default-toolbar-visible-p nil) |
59 "Plist of frame properties for initially creating a minibuffer frame. | 67 "Plist of frame properties for initially creating a minibuffer frame. |
60 You can set this in your `.emacs' file; for example, | 68 You can set this in your `.emacs' file; for example, |
61 (setq minibuffer-frame-plist '(top 1 left 1 width 80 height 2)) | 69 (setq minibuffer-frame-plist '(top 1 left 1 width 80 height 2)) |
62 Properties specified here supersede the values given in | 70 Properties specified here supersede the values given in |
63 `default-frame-plist'. | 71 `default-frame-plist'. |
64 The format of this can also be an alist for backward compatibility.") | 72 The format of this can also be an alist for backward compatibility." |
65 | 73 :type '(repeat (group :inline t |
66 (defvar pop-up-frame-plist nil | 74 (symbol :tag "Property") |
75 (sexp :tag "Value"))) | |
76 :group 'frames) | |
77 | |
78 (defcustom pop-up-frame-plist nil | |
67 "Plist of frame properties used when creating pop-up frames. | 79 "Plist of frame properties used when creating pop-up frames. |
68 Pop-up frames are used for completions, help, and the like. | 80 Pop-up frames are used for completions, help, and the like. |
69 This variable can be set in your init file, like this: | 81 This variable can be set in your init file, like this: |
70 (setq pop-up-frame-plist '(width 80 height 20)) | 82 (setq pop-up-frame-plist '(width 80 height 20)) |
71 These supersede the values given in `default-frame-plist'. | 83 These supersede the values given in `default-frame-plist'. |
72 The format of this can also be an alist for backward compatibility.") | 84 The format of this can also be an alist for backward compatibility." |
85 :type '(repeat (group :inline t | |
86 (symbol :tag "Property") | |
87 (sexp :tag "Value"))) | |
88 :group 'frames) | |
73 | 89 |
74 (setq pop-up-frame-function | 90 (setq pop-up-frame-function |
75 (function (lambda () | 91 (function (lambda () |
76 (make-frame pop-up-frame-plist)))) | 92 (make-frame pop-up-frame-plist)))) |
77 | 93 |
78 (defvar special-display-frame-plist '(height 14 width 80 unsplittable t) | 94 (defcustom special-display-frame-plist '(height 14 width 80 unsplittable t) |
79 "*Plist of frame properties used when creating special frames. | 95 "*Plist of frame properties used when creating special frames. |
80 Special frames are used for buffers whose names are in | 96 Special frames are used for buffers whose names are in |
81 `special-display-buffer-names' and for buffers whose names match | 97 `special-display-buffer-names' and for buffers whose names match |
82 one of the regular expressions in `special-display-regexps'. | 98 one of the regular expressions in `special-display-regexps'. |
83 This variable can be set in your init file, like this: | 99 This variable can be set in your init file, like this: |
84 (setq special-display-frame-plist '(width 80 height 20)) | 100 (setq special-display-frame-plist '(width 80 height 20)) |
85 These supersede the values given in `default-frame-plist'. | 101 These supersede the values given in `default-frame-plist'. |
86 The format of this can also be an alist for backward compatibility.") | 102 The format of this can also be an alist for backward compatibility." |
103 :type '(repeat (group :inline t | |
104 (symbol :tag "Property") | |
105 (sexp :tag "Value"))) | |
106 :group 'frames) | |
87 | 107 |
88 (defun safe-alist-to-plist (cruftiness) | 108 (defun safe-alist-to-plist (cruftiness) |
89 (if (consp (car cruftiness)) | 109 (if (consp (car cruftiness)) |
90 (alist-to-plist cruftiness) | 110 (alist-to-plist cruftiness) |
91 cruftiness)) | 111 cruftiness)) |
765 (suspend-emacs)))) | 785 (suspend-emacs)))) |
766 | 786 |
767 | 787 |
768 ;;; auto-raise and auto-lower | 788 ;;; auto-raise and auto-lower |
769 | 789 |
770 (defvar auto-raise-frame nil | 790 (defcustom auto-raise-frame nil |
771 "*If true, frames will be raised to the top when selected. | 791 "*If true, frames will be raised to the top when selected. |
772 Under X, most ICCCM-compliant window managers will have an option to do this | 792 Under X, most ICCCM-compliant window managers will have an option to do this |
773 for you, but this variable is provided in case you're using a broken WM.") | 793 for you, but this variable is provided in case you're using a broken WM." |
774 | 794 :type 'boolean |
775 (defvar auto-lower-frame nil | 795 :group 'frames) |
796 | |
797 (defcustom auto-lower-frame nil | |
776 "*If true, frames will be lowered to the bottom when no longer selected. | 798 "*If true, frames will be lowered to the bottom when no longer selected. |
777 Under X, most ICCCM-compliant window managers will have an option to do this | 799 Under X, most ICCCM-compliant window managers will have an option to do this |
778 for you, but this variable is provided in case you're using a broken WM.") | 800 for you, but this variable is provided in case you're using a broken WM." |
801 :type 'boolean | |
802 :group 'frames) | |
779 | 803 |
780 (defun default-select-frame-hook () | 804 (defun default-select-frame-hook () |
781 "Implements the `auto-raise-frame' variable. | 805 "Implements the `auto-raise-frame' variable. |
782 For use as the value of `select-frame-hook'." | 806 For use as the value of `select-frame-hook'." |
783 (if auto-raise-frame (raise-frame (selected-frame)))) | 807 (if auto-raise-frame (raise-frame (selected-frame)))) |
1048 | 1072 |
1049 (if save-frame | 1073 (if save-frame |
1050 (append (list save-frame) frames) | 1074 (append (list save-frame) frames) |
1051 frames))) | 1075 frames))) |
1052 | 1076 |
1053 (defvar temp-buffer-shrink-to-fit nil | 1077 (defcustom temp-buffer-shrink-to-fit nil |
1054 "*When non-nil resize temporary output buffers to minimize blank lines.") | 1078 "*When non-nil resize temporary output buffers to minimize blank lines." |
1055 | 1079 :type 'boolean |
1056 (defvar temp-buffer-max-height .5 | 1080 :group 'frames) |
1057 "*Proportion of frame to use for temp windows.") | 1081 |
1082 (defcustom temp-buffer-max-height .5 | |
1083 "*Proportion of frame to use for temp windows." | |
1084 :type 'number | |
1085 :group 'frames) | |
1058 | 1086 |
1059 (defun show-temp-buffer-in-current-frame (buffer) | 1087 (defun show-temp-buffer-in-current-frame (buffer) |
1060 "For use as the value of temp-buffer-show-function: | 1088 "For use as the value of temp-buffer-show-function: |
1061 always displays the buffer in the current frame, regardless of the behavior | 1089 always displays the buffer in the current frame, regardless of the behavior |
1062 that would otherwise be introduced by the `pre-display-buffer-function', which | 1090 that would otherwise be introduced by the `pre-display-buffer-function', which |