aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-01-16 19:43:00 -0800
committerPaul Eggert2012-01-16 19:43:00 -0800
commit78df1fb1d46d556bfc2698ca1802972b13613ba8 (patch)
tree114803047bb77b06e149d9218cd4540b9f287e65
parent807f82fcebc7d946baa23f1d29ff5b0cf336f08e (diff)
parent1b0880d5f1b478fe097aef8b702a5c7c70bd9f18 (diff)
downloademacs-78df1fb1d46d556bfc2698ca1802972b13613ba8.tar.gz
emacs-78df1fb1d46d556bfc2698ca1802972b13613ba8.zip
Merge from trunk.
-rw-r--r--ChangeLog4
-rw-r--r--admin/FOR-RELEASE4
-rw-r--r--doc/emacs/ChangeLog30
-rw-r--r--doc/emacs/anti.texi124
-rw-r--r--doc/emacs/display.texi18
-rw-r--r--doc/emacs/emacs.texi8
-rw-r--r--doc/emacs/programs.texi2
-rw-r--r--doc/emacs/xresources.texi926
-rw-r--r--doc/lispref/ChangeLog9
-rw-r--r--doc/lispref/windows.texi93
-rw-r--r--lisp/ChangeLog82
-rw-r--r--lisp/minibuffer.el4
-rw-r--r--lisp/net/tramp-sh.el1
-rw-r--r--lisp/window.el64
-rw-r--r--src/ChangeLog8
-rw-r--r--src/window.c111
16 files changed, 619 insertions, 869 deletions
diff --git a/ChangeLog b/ChangeLog
index fb342cffec9..e33acde4239 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12012-01-16 Juanma Barranquero <lekktu@gmail.com>
2
3 * .bzrignore: Ignore etc/__pycache__.
4
12011-12-17 Paul Eggert <eggert@cs.ucla.edu> 52011-12-17 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 Port HAVE_PTHREAD configuration to MirBSD 10 (Bug#10201). 7 Port HAVE_PTHREAD configuration to MirBSD 10 (Bug#10201).
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 0c75181aa03..daf8e33d041 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -144,7 +144,7 @@ emacs-xtra.texi
144emerge-xtra.texi 144emerge-xtra.texi
145entering.texi cyd 145entering.texi cyd
146files.texi cyd 146files.texi cyd
147fixit.texi 147fixit.texi cyd
148fortran-xtra.texi 148fortran-xtra.texi
149frames.texi cyd 149frames.texi cyd
150glossary.texi 150glossary.texi
@@ -175,7 +175,7 @@ trouble.texi cyd
175vc-xtra.texi cyd 175vc-xtra.texi cyd
176vc1-xtra.texi cyd 176vc1-xtra.texi cyd
177windows.texi cyd 177windows.texi cyd
178xresources.texi 178xresources.texi cyd
179 179
180** Check the Lisp manual. 180** Check the Lisp manual.
181 181
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index ab8c822ffcf..90a7f69ea72 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,7 +1,31 @@
12012-01-16 Volker Sobek <reklov@live.com> (tiny change)
2
3 * programs.texi (Comment Commands): Typo (bug#10514).
4
52012-01-15 Chong Yidong <cyd@gnu.org>
6
7 * xresources.texi (X Resources): Describe GTK+ case first.
8 (Resources): Don't use borderWidth as an example, since it doesn't
9 work with GTK+.
10 (Table of Resources): Clarify role of several resources, including
11 the Emacs 24 behavior of cursorBlink etc.
12 (Face Resources): Node deleted. Recommend using Customize
13 instead. Add paragraph to `Table of Resources' node summarizing
14 how to use X resources for changing faces.
15 (Lucid Resources): Rewrite, omitting description of font names,
16 referring to the Fonts node instead.
17 (LessTif Resources): Copyedits.
18 (GTK resources): Rewrite, describing the difference between gtk2
19 and gtk3.
20 (GTK Resource Basics): New node.
21 (GTK Widget Names, GTK Names in Emacs): Rewrite.
22 (GTK styles): Just refer to Fonts node for GTK font format.
23
24 * display.texi (Faces): Document the cursor face.
25
12012-01-14 Chong Yidong <cyd@gnu.org> 262012-01-14 Chong Yidong <cyd@gnu.org>
2 27
3 * cmdargs.texi (Action Arguments): No need to mention 28 * cmdargs.texi (Action Arguments): No need to mention EMACSLOADPATH.
4 EMACSLOADPATH.
5 (General Variables): Add xref to Lisp Libraries. 29 (General Variables): Add xref to Lisp Libraries.
6 (Initial Options): Copyedits. 30 (Initial Options): Copyedits.
7 (Resume Arguments): Node deleted; emacs.bash/csh are obsolete. 31 (Resume Arguments): Node deleted; emacs.bash/csh are obsolete.
@@ -8826,7 +8850,7 @@
8826;; coding: utf-8 8850;; coding: utf-8
8827;; End: 8851;; End:
8828 8852
8829 Copyright (C) 1993-1999, 2001-2011 Free Software Foundation, Inc. 8853 Copyright (C) 1993-1999, 2001-2012 Free Software Foundation, Inc.
8830 8854
8831 This file is part of GNU Emacs. 8855 This file is part of GNU Emacs.
8832 8856
diff --git a/doc/emacs/anti.texi b/doc/emacs/anti.texi
index 68f617d2cfd..d9f17c91f5e 100644
--- a/doc/emacs/anti.texi
+++ b/doc/emacs/anti.texi
@@ -3,135 +3,19 @@
3@c See file emacs.texi for copying conditions. 3@c See file emacs.texi for copying conditions.
4 4
5@node Antinews, Mac OS / GNUstep, X Resources, Top 5@node Antinews, Mac OS / GNUstep, X Resources, Top
6@appendix Emacs 22 Antinews 6@appendix Emacs 23 Antinews
7@c Update the emacs.texi Antinews menu entry with the above version number. 7@c Update the emacs.texi Antinews menu entry with the above version number.
8 8
9 For those users who live backwards in time, here is information 9 For those users who live backwards in time, here is information
10about downgrading to Emacs version 22.3. We hope you will enjoy the 10about downgrading to Emacs version 23.4. We hope you will enjoy the
11greater simplicity that results from the absence of many Emacs 11greater simplicity that results from the absence of many Emacs
12@value{EMACSVER} features. 12@value{EMACSVER} features.
13 13
14@itemize @bullet 14@itemize @bullet
15
16@item
17We have switched to a character representation specially designed for
18Emacs. Rather than forcing all the widely used scripts into artificial
19alignment, as Unicode does, Emacs treats them all equally, giving
20each one a place in the space of character codes. We have eliminated
21the confusing practice, in Emacs 23, whereby one character can belong
22to multiple character sets. Now each script has its own variant, and
23they all are different as far as Emacs is concerned. For example,
24there's a Latin-1 c-cedilla character, and there's a Latin-2
25c-cedilla; searching a buffer for the Latin-1 variant only finds that
26variant, but not the others.
27
28@item
29Emacs now uses its own special internal encoding for non-@acronym{ASCII}
30characters, known as @samp{emacs-mule}. This was imperative to
31support several different variants of the same character, each one
32belonging to its own script: @samp{emacs-mule} marks each character
33with its script, to better discern them from one another.
34
35@item
36For simplicity, the functions @code{encode-coding-region} and
37@code{decode-coding-region} no longer accept an argument saying where
38to store the result of their conversions. The result always replaces
39the original, so there's no need to look for it elsewhere.
40
41@item
42Emacs no longer performs font anti-aliasing. If your fonts look ugly,
43try choosing a larger font and increasing the screen resolution.
44Admittedly, this becomes difficult as you go further back in time,
45since available screen resolutions will decrease.
46
47@item
48The Fontconfig font library is no longer supported. To specify a
49font, you must use an XLFD (X Logical Font Descriptor). The other
50ways of specifying fonts---so-called ``Fontconfig'' and ``GTK'' font
51names---are redundant, so they have been removed.
52
53@item
54Transient Mark mode is now disabled by default. Furthermore, some
55commands that operate specifically on the region when it is active and
56Transient Mark mode is enabled (such as @code{fill-paragraph}
57@code{ispell-word}, and @code{indent-for-tab-command}), no longer do
58so.
59
60@item
61Holding @key{shift} while typing a motion command no longer creates a
62temporarily active region, since that's inconsistent with how Emacs
63normally handles keybindings. The variable @code{shift-select-mode}
64has been deleted. You can, however, still create temporarily active
65regions by dragging the mouse.
66
67@item
68The line motion commands, @kbd{C-n} and @kbd{C-p}, now move by logical
69text lines, not screen lines. Even if a long text line is continued
70over multiple screen lines, @kbd{C-n} and @kbd{C-p} treat it as a
71single line, because that's ultimately what it is.
72
73@item
74Visual Line mode, which provides ``word wrap'' functionality, has been
75removed. You can still use Long Lines mode to gain an approximation
76of word wrapping, though this has some drawbacks---for instance,
77syntax highlighting often doesn't work well on wrapped lines.
78
79@item
80@kbd{C-l} now runs @code{recenter} instead of
81@code{recenter-top-bottom}. This always sets the current line at the
82center of the window, instead of cycling through the center, top, and
83bottom of the window on successive invocations. This lets you type
84@kbd{C-l C-l C-l C-l} to be @emph{absolutely sure} that you have
85recentered the line.
86
87@item
88The way Emacs generates possible minibuffer completions is now much
89simpler to understand. It matches alternatives to the text before
90point, ignoring the text after point; it also does not attempt to
91perform partial completion if the first completion attempt fails.
92
93@item
94Typing @kbd{M-n} at the start of the minibuffer history list no longer
95attempts to generate guesses of possible minibuffer input. It instead
96does the straightforward thing, by issuing the message @samp{End of
97history; no default available}.
98
99@item
100Individual buffers can no longer display faces specially. The text
101scaling commands @kbd{C-x C-+}, @kbd{C-x C--}, and @kbd{C-x C-0} have
102been removed, and so has the buffer face menu bound to
103@kbd{S-down-mouse-1}.
104
105@item
106VC no longer supports fileset-based operations on distributed version
107control systems (DVCSs) such as Arch, Bazaar, Subversion, Mercurial,
108and Git. For instance, multi-file commits will be performed by
109committing one file at a time. As you go further back in time, we
110will remove DVCS support entirely, so you should migrate your projects
111to CVS.
112
113@item
114Rmail now uses a special file format, Babyl format, specifically designed
115for storing and editing mail. When you visit a file in Rmail, or get new
116mail, Rmail converts it automatically to Babyl format.
117
118@item
119Emacs can no longer display frames on X windows and text terminals
120(ttys) simultaneously. If you start Emacs as an X application, it
121can only create X frames; if you start Emacs on a tty, it can only use
122that tty. No more confusion about which type of frame
123@command{emacsclient} will use in any given Emacs session!
124
125@item
126Emacs can no longer be started as a daemon. You can be sure that if
127you don't see Emacs, then it's not running.
128
129@item 15@item
130Emacs has added support for many soon-to-be-non-obsolete platforms, 16FIXME
131including VMS, DECstation, SCO Unix, and systems lacking alloca.
132Support for Sun windows has been added.
133 17
134@item 18@item
135To keep up with decreasing computer memory capacity and disk space, many 19To keep up with decreasing computer memory capacity and disk space, many
136other functions and files have been eliminated in Emacs 22.3. 20other functions and files have been eliminated in Emacs 23.4.
137@end itemize 21@end itemize
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index e7d58c32290..67feb791fe1 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -489,10 +489,20 @@ support a limited range of colors.
489changes for future Emacs sessions. @xref{Face Customization}. A face 489changes for future Emacs sessions. @xref{Face Customization}. A face
490does not have to specify every single attribute; often it inherits 490does not have to specify every single attribute; often it inherits
491most attributes from another face. Any ultimately unspecified 491most attributes from another face. Any ultimately unspecified
492attribute is taken from a face named @code{default}, whose attributes 492attribute is taken from the face named @code{default}.
493are all specified. The @code{default} face is the default for 493
494displaying text, and its background color is also used as the frame's 494 The @code{default} face is the default for displaying text, and all
495background color. 495of its attributes are specified. Its background color is also used as
496the frame's background color.
497
498@cindex cursor face
499 Another special face is the @code{cursor} face. On graphical
500displays, the background color of this face is used to draw the text
501cursor. None of the other attributes of this face have any effect;
502the foreground color for text under the cursor is taken from the
503background color of the underlying text. On text terminals, the
504appearance of the text cursor is determined by the terminal, not by
505the @code{cursor} face.
496 506
497 You can also use X resources to specify attributes of any particular 507 You can also use X resources to specify attributes of any particular
498face. @xref{Resources}. 508face. @xref{Resources}.
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index b00625facbf..1f7fecb8b6a 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -210,7 +210,7 @@ Appendices
210* GNU Free Documentation License:: The license for this documentation. 210* GNU Free Documentation License:: The license for this documentation.
211* Emacs Invocation:: Hairy startup options. 211* Emacs Invocation:: Hairy startup options.
212* X Resources:: X resources for customizing Emacs. 212* X Resources:: X resources for customizing Emacs.
213* Antinews:: Information about Emacs version 22. 213* Antinews:: Information about Emacs version 23.
214* Mac OS / GNUstep:: Using Emacs under Mac OS and GNUstep. 214* Mac OS / GNUstep:: Using Emacs under Mac OS and GNUstep.
215* Microsoft Windows:: Using Emacs on Microsoft Windows and MS-DOS. 215* Microsoft Windows:: Using Emacs on Microsoft Windows and MS-DOS.
216* Manifesto:: What's GNU? Gnu's Not Unix! 216* Manifesto:: What's GNU? Gnu's Not Unix!
@@ -1124,15 +1124,15 @@ X Options and Resources
1124 1124
1125* Resources:: Using X resources with Emacs (in general). 1125* Resources:: Using X resources with Emacs (in general).
1126* Table of Resources:: Table of specific X resources that affect Emacs. 1126* Table of Resources:: Table of specific X resources that affect Emacs.
1127* Face Resources:: X resources for customizing faces.
1128* Lucid Resources:: X resources for Lucid menus. 1127* Lucid Resources:: X resources for Lucid menus.
1129* LessTif Resources:: X resources for LessTif and Motif menus. 1128* LessTif Resources:: X resources for LessTif and Motif menus.
1130* GTK resources:: Resources for GTK widgets. 1129* GTK resources:: Resources for GTK widgets.
1131 1130
1132GTK resources 1131GTK resources
1133 1132
1134* GTK widget names:: How widgets in GTK are named in general. 1133* GTK Resource Basics:: Basic usage of GTK+ resources.
1135* GTK Names in Emacs:: GTK widget names in Emacs. 1134* GTK Widget Names:: How GTK+ widgets are named.
1135* GTK Names in Emacs:: GTK+ widgets used by Emacs.
1136* GTK styles:: What can be customized in a GTK widget. 1136* GTK styles:: What can be customized in a GTK widget.
1137 1137
1138Emacs and Mac OS / GNUstep 1138Emacs and Mac OS / GNUstep
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 7fef7fb1e22..8ba9b78603a 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -952,7 +952,7 @@ comment text.
952comment on the current line, along with the whitespace before it. 952comment on the current line, along with the whitespace before it.
953Since the comment is saved to the kill ring, you can reinsert it on 953Since the comment is saved to the kill ring, you can reinsert it on
954another line by moving to the end of that line, doing @kbd{C-y}, and 954another line by moving to the end of that line, doing @kbd{C-y}, and
955then @kbd{M-;} to realign the command. You can achieve the same 955then @kbd{M-;} to realign the comment. You can achieve the same
956effect as @kbd{C-u M-;} by typing @kbd{M-x comment-kill} 956effect as @kbd{C-u M-;} by typing @kbd{M-x comment-kill}
957(@code{comment-dwim} actually calls @code{comment-kill} as a 957(@code{comment-dwim} actually calls @code{comment-kill} as a
958subroutine when it is given a prefix argument). 958subroutine when it is given a prefix argument).
diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi
index 7a4e4798061..66281d6dbbb 100644
--- a/doc/emacs/xresources.texi
+++ b/doc/emacs/xresources.texi
@@ -6,31 +6,26 @@
6@appendix X Options and Resources 6@appendix X Options and Resources
7 7
8 You can customize some X-related aspects of Emacs behavior using X 8 You can customize some X-related aspects of Emacs behavior using X
9resources, as is usual for programs that use X. On MS-Windows, you 9resources, as is usual for programs that use X.
10can customize some of the same aspects using the system registry. 10
11@xref{MS-Windows Registry}. 11 When Emacs is compiled with GTK+ support, the appearance of various
12 12graphical widgets, such as the menu-bar, scroll-bar, and dialog boxes,
13 When Emacs is built using an ``X toolkit'', such as Lucid or 13is determined by
14LessTif, you need to use X resources to customize the appearance of
15the widgets, including the menu-bar, scroll-bar, and dialog boxes.
16This is because the libraries that implement these don't provide for
17customization through Emacs. GTK+ widgets use a separate system of
18@ifnottex 14@ifnottex
19``GTK resources'', which we will also describe. 15``GTK resources'', which we will also describe.
20@end ifnottex 16@end ifnottex
21@iftex 17@iftex
22``GTK resources.'' In this chapter we describe the most commonly used 18``GTK resources''.
23resource specifications. For full documentation, see the online
24manual.
25
26@c Add xref for LessTif/Motif menu resources.
27@end iftex 19@end iftex
20When Emacs is built without GTK+ support, the appearance of these
21widgets is determined by additional X resources.
28 22
23 On MS-Windows, you can customize some of the same aspects using the
24system registry (@pxref{MS-Windows Registry}).
29 25
30@menu 26@menu
31* Resources:: Using X resources with Emacs (in general). 27* Resources:: Using X resources with Emacs (in general).
32* Table of Resources:: Table of specific X resources that affect Emacs. 28* Table of Resources:: Table of specific X resources that affect Emacs.
33* Face Resources:: X resources for customizing faces.
34* Lucid Resources:: X resources for Lucid menus. 29* Lucid Resources:: X resources for Lucid menus.
35* LessTif Resources:: X resources for LessTif and Motif menus. 30* LessTif Resources:: X resources for LessTif and Motif menus.
36* GTK resources:: Resources for GTK widgets. 31* GTK resources:: Resources for GTK widgets.
@@ -63,60 +58,41 @@ settings in the Display Control Panel. You can also set resources
63using the @samp{-xrm} command line option, as explained below.) 58using the @samp{-xrm} command line option, as explained below.)
64 59
65 Each line in the X resource file specifies a value for one option or 60 Each line in the X resource file specifies a value for one option or
66for a collection of related options. Each resource specification 61for a collection of related options. The order in which the lines
62appear in the file does not matter. Each resource specification
67consists of a @dfn{program name} and a @dfn{resource name}. Case 63consists of a @dfn{program name} and a @dfn{resource name}. Case
68distinctions are significant in each of these names. Here is an 64distinctions are significant in each of these names. Here is an
69example: 65example:
70 66
71@example 67@example
72emacs.borderWidth: 2 68emacs.cursorColor: dark green
73@end example 69@end example
74 70
75@ifnottex
76 The program name is the name of the executable file to which the 71 The program name is the name of the executable file to which the
77resource applies. For Emacs, this is normally @samp{emacs}. To 72resource applies. For Emacs, this is normally @samp{emacs}. To
78specify a definition that applies to all instances of Emacs, 73specify a definition that applies to all instances of Emacs,
79regardless of the name of the Emacs executable, use @samp{Emacs}. 74regardless of the name of the Emacs executable, use @samp{Emacs}.
80 75
81 The resource name is the name of a program setting. For instance, 76 The resource name is the name of a program setting. For instance,
82Emacs recognizes a @samp{borderWidth} resource that controls the width 77Emacs recognizes a @samp{cursorColor} resource that controls the color
83of the external border for graphical frames. 78of the text cursor.
84 79
85 Resources are grouped into named classes. For instance, the 80 Resources are grouped into named classes. For instance, the
86@samp{BorderWidth} class contains both the @samp{borderWidth} resource 81@samp{Foreground} class contains the @samp{cursorColor},
87(which we just described), as well as the @samp{internalBorder} 82@samp{foreground} and @samp{pointerColor} resources (@pxref{Table of
88resource, which controls the width of the internal border for 83Resources}). Instead of using a resource name, you can use a class
89graphical frames. Instead of using a resource name, you can use a 84name to specify the default value for all resources in that class,
90class name to specify the same value for all resources in that class. 85like this:
91Here's an example:
92
93@example
94emacs.BorderWidth: 2
95@end example
96
97 If you specify a value for a class, it becomes the default for all
98resources in that class. You can specify values for individual
99resources as well; these override the class value, for those
100particular resources. The following example specifies 2 as the
101default width for all borders, but overrides this value with 4 for the
102external border:
103 86
104@example 87@example
105emacs.BorderWidth: 2 88emacs.Foreground: dark green
106emacs.borderWidth: 4
107@end example 89@end example
108@end ifnottex
109
110 The order in which the lines appear in the file does not matter.
111One way to experiment with the effect of different resource settings
112is to use the @code{editres} program. See the @code{editres} man page
113for more details.
114 90
115 Emacs does not process X resources at all if you set the variable 91 Emacs does not process X resources at all if you set the variable
116@code{inhibit-x-resources} to a non-@code{nil} value, or if you 92@code{inhibit-x-resources} to a non-@code{nil} value. If you invoke
117specify the @samp{-Q} (or @samp{--quick}) command-line argument 93Emacs with the @samp{-Q} (or @samp{--quick}) command-line option,
118(@pxref{Initial Options}). (The @samp{-Q} argument automatically sets 94@code{inhibit-x-resources} is automatically set to @code{t}
119@code{inhibit-x-resources} to @code{t}.) 95(@pxref{Initial Options}).
120 96
121@ifnottex 97@ifnottex
122 In addition, you can use the following command-line options to 98 In addition, you can use the following command-line options to
@@ -162,98 +138,93 @@ other resource specifications.
162@node Table of Resources 138@node Table of Resources
163@appendixsec Table of X Resources for Emacs 139@appendixsec Table of X Resources for Emacs
164 140
165 This table lists the resource names that designate options for 141 This table lists the X resource names that Emacs recognizes,
166Emacs, not counting those for the appearance of the menu bar, each 142excluding those that control the appearance of graphical widgets like
167with the class that it belongs to: 143the menu bar:
168 144
169@table @asis 145@table @asis
170@item @code{background} (class @code{Background}) 146@item @code{background} (class @code{Background})
171Background color name. 147Background color (@pxref{Colors}).
172 148
173@item @code{bitmapIcon} (class @code{BitmapIcon}) 149@item @code{bitmapIcon} (class @code{BitmapIcon})
174Tell the window manager to display the Emacs icon if @samp{on}; don't 150Tell the window manager to display the Emacs icon if @samp{on}; don't
175do so if @samp{off}. (The icon is usually shown in the ``taskbar'' on 151do so if @samp{off}. @xref{Icons X}, for a description of the icon.
176a graphical desktop.)
177 152
153@ifnottex
178@item @code{borderColor} (class @code{BorderColor}) 154@item @code{borderColor} (class @code{BorderColor})
179Color name for the external border. 155Color of the frame's external border. This has no effect if Emacs is
156compiled with GTK+ support.
180 157
181@ifnottex
182@item @code{borderWidth} (class @code{BorderWidth}) 158@item @code{borderWidth} (class @code{BorderWidth})
183Width in pixels of the external border. 159Width of the frame's external border, in pixels. This has no effect
160if Emacs is compiled with GTK+ support.
184@end ifnottex 161@end ifnottex
185 162
186@item @code{cursorColor} (class @code{Foreground}) 163@item @code{cursorColor} (class @code{Foreground})
187Color name for text cursor (point). 164Text cursor color. If this resource is specified when Emacs starts
165up, Emacs sets its value as the background color of the @code{cursor}
166face (@pxref{Faces}).
188 167
189@ifnottex
190@item @code{cursorBlink} (class @code{CursorBlink}) 168@item @code{cursorBlink} (class @code{CursorBlink})
191Specifies whether to make the cursor blink. The default is @samp{on}. Use 169If the value of this resource is @samp{off} or @samp{false} or
192@samp{off} or @samp{false} to turn cursor blinking off. 170@samp{0} at startup, Emacs disables Blink Cursor mode (@pxref{Cursor
193@end ifnottex 171Display}).
194 172
195@item @code{font} (class @code{Font}) 173@item @code{font} (class @code{Font})
196Font name for the @code{default} font. @xref{Fonts}. You can also 174Font name for the @code{default} face (@pxref{Fonts}). You can also
197specify a fontset name (@pxref{Fontsets}). 175specify a fontset name (@pxref{Fontsets}).
198 176
199@item @code{fontBackend} (class @code{FontBackend}) 177@item @code{fontBackend} (class @code{FontBackend})
200The backend(s) to use for drawing fonts; if multiple backends are 178Comma-delimited list of backend(s) to use for drawing fonts, in order
201specified, they must be comma-delimited and given in order of 179of precedence. For instance, the value @samp{x,xft} tells Emacs to
202precedence. On X, for instance, the value @samp{x,xft} tells Emacs to
203draw fonts using the X core font driver, falling back on the Xft font 180draw fonts using the X core font driver, falling back on the Xft font
204driver if that fails. Normally, you can leave this resource unset, in 181driver if that fails. Normally, you should leave this resource unset,
205which case Emacs tries using all font backends available on your 182in which case Emacs tries using all available font backends.
206graphical device.
207 183
208@item @code{foreground} (class @code{Foreground}) 184@item @code{foreground} (class @code{Foreground})
209Color name for text. 185Default foreground color for text.
210 186
211@item @code{geometry} (class @code{Geometry}) 187@item @code{geometry} (class @code{Geometry})
212Window size and position. Be careful not to specify this resource as 188Window size and position. The value should be a size and position
213@samp{emacs*geometry}, because that may affect individual menus as well 189specification, of the same form as in the @samp{-g} or
214as the Emacs frame itself. 190@samp{--geometry} command-line option (@pxref{Window Size X}).
215 191
216If this resource specifies a position, that position applies only to the 192The size applies to all frames in the Emacs session, but the position
217initial Emacs frame (or, in the case of a resource for a specific frame 193applies only to the initial Emacs frame (or, in the case of a resource
218name, only that frame). However, the size, if specified here, applies to 194for a specific frame name, only that frame).
219all frames. 195
196
197Be careful not to specify this resource as @samp{emacs*geometry}, as
198that may affect individual menus as well as the main Emacs frame.
220 199
221@ifnottex
222@item @code{fullscreen} (class @code{Fullscreen}) 200@item @code{fullscreen} (class @code{Fullscreen})
223The desired fullscreen size. The value can be one of @code{fullboth}, 201The desired fullscreen size. The value can be one of @code{fullboth},
224@code{maximized}, @code{fullwidth} or @code{fullheight}, which correspond to 202@code{maximized}, @code{fullwidth} or @code{fullheight}, which
225the command-line options @samp{-fs}, @samp{-mm}, @samp{-fw}, and @samp{-fh} 203correspond to the command-line options @samp{-fs}, @samp{-mm},
226(@pxref{Window Size X}). 204@samp{-fw}, and @samp{-fh} (@pxref{Window Size X}). Note that this
227 205applies to the initial frame only.
228Note that this applies to the initial frame only.
229@end ifnottex
230 206
207@ifnottex
231@item @code{iconName} (class @code{Title}) 208@item @code{iconName} (class @code{Title})
232Name to display in the icon. 209Name to display in the icon.
233 210
234@item @code{internalBorder} (class @code{BorderWidth}) 211@item @code{internalBorder} (class @code{BorderWidth})
235Width in pixels of the internal border. 212Width of the internal frame border, in pixels.
213@end ifnottex
236 214
237@item @code{lineSpacing} (class @code{LineSpacing}) 215@item @code{lineSpacing} (class @code{LineSpacing})
238@cindex line spacing 216@cindex line spacing
239@cindex leading 217Additional space between lines, in pixels.
240Additional space (@dfn{leading}) between lines, in pixels.
241 218
242@item @code{menuBar} (class @code{MenuBar}) 219@item @code{menuBar} (class @code{MenuBar})
243@cindex menu bar 220@cindex menu bar
244Give frames menu bars if @samp{on}; don't have menu bars if @samp{off}. 221If the value of this resource is @samp{off} or @samp{false} or
245@ifnottex 222@samp{0}, Emacs disables Menu Bar mode at startup (@pxref{Menu Bars}).
246@xref{Lucid Resources}, and @ref{LessTif Resources},
247@end ifnottex
248@iftex
249@xref{Lucid Resources},
250@end iftex
251for how to control the appearance of the menu bar if you have one.
252 223
253@ifnottex 224@ifnottex
254@item @code{minibuffer} (class @code{Minibuffer}) 225@item @code{minibuffer} (class @code{Minibuffer})
255If @samp{none}, don't make a minibuffer in this frame. 226If @samp{none}, Emacs will not make a minibuffer in this frame; it
256It will use a separate minibuffer frame instead. 227will use a separate minibuffer frame instead.
257 228
258@item @code{paneFont} (class @code{Font}) 229@item @code{paneFont} (class @code{Font})
259@cindex font for menus 230@cindex font for menus
@@ -261,7 +232,9 @@ Font name for menu pane titles, in non-toolkit versions of Emacs.
261@end ifnottex 232@end ifnottex
262 233
263@item @code{pointerColor} (class @code{Foreground}) 234@item @code{pointerColor} (class @code{Foreground})
264Color of the mouse cursor. 235Color of the mouse cursor. This has no effect in many graphical
236desktop environments, as they do not let Emacs change the mouse cursor
237this way.
265 238
266@ifnottex 239@ifnottex
267@item @code{privateColormap} (class @code{PrivateColormap}) 240@item @code{privateColormap} (class @code{PrivateColormap})
@@ -271,7 +244,6 @@ visual'' of class PseudoColor and Emacs is using it.
271@item @code{reverseVideo} (class @code{ReverseVideo}) 244@item @code{reverseVideo} (class @code{ReverseVideo})
272Switch foreground and background default colors if @samp{on}, use colors as 245Switch foreground and background default colors if @samp{on}, use colors as
273specified if @samp{off}. 246specified if @samp{off}.
274@end ifnottex
275 247
276@item @code{screenGamma} (class @code{ScreenGamma}) 248@item @code{screenGamma} (class @code{ScreenGamma})
277@cindex gamma correction 249@cindex gamma correction
@@ -281,7 +253,9 @@ Gamma correction for colors, equivalent to the frame parameter
281@item @code{scrollBarWidth} (class @code{ScrollBarWidth}) 253@item @code{scrollBarWidth} (class @code{ScrollBarWidth})
282@cindex scrollbar width 254@cindex scrollbar width
283The scroll bar width in pixels, equivalent to the frame parameter 255The scroll bar width in pixels, equivalent to the frame parameter
284@code{scroll-bar-width}. 256@code{scroll-bar-width}. Do not set this resource if Emacs is
257compiled with GTK+ support.
258@end ifnottex
285 259
286@ifnottex 260@ifnottex
287@item @code{selectionFont} (class @code{SelectionFont}) 261@item @code{selectionFont} (class @code{SelectionFont})
@@ -306,24 +280,16 @@ Name to display in the title bar of the initial Emacs frame.
306 280
307@item @code{toolBar} (class @code{ToolBar}) 281@item @code{toolBar} (class @code{ToolBar})
308@cindex tool bar 282@cindex tool bar
309Number of lines to reserve for the tool bar. A zero value suppresses 283If the value of this resource is @samp{off} or @samp{false} or
310the tool bar. For the Emacs tool bar (i.e.@: not Gtk+), if the value 284@samp{0}, Emacs disables Tool Bar mode at startup (@pxref{Tool Bars}).
311is non-zero and @code{auto-resize-tool-bars} is non-@code{nil}, the
312tool bar's size will be changed automatically so that all tool bar
313items are visible. If the value of @code{auto-resize-tool-bars} is
314@code{grow-only}, the tool bar expands automatically, but does not
315contract automatically. To contract the tool bar, you must redraw the
316frame by entering @kbd{C-l}. For the Gtk+ tool bar, any non-zero
317value means on and @code{auto-resize-tool-bars} has no effect.
318 285
319@item @code{useXIM} (class @code{UseXIM}) 286@item @code{useXIM} (class @code{UseXIM})
320@cindex XIM 287@cindex XIM
321@cindex X input methods 288@cindex X input methods
322@cindex input methods, X 289@cindex input methods, X
323Turn off use of X input methods (XIM) if @samp{false} or @samp{off}. 290Disable use of X input methods (XIM) if @samp{false} or @samp{off}.
324This is only relevant if your Emacs is actually built with XIM 291This is only relevant if your Emacs is built with XIM support. It
325support. It is potentially useful to turn off XIM for efficiency, 292might be useful to turn off XIM on slow X client/server links.
326especially slow X client/server links.
327 293
328@item @code{verticalScrollBars} (class @code{ScrollBars}) 294@item @code{verticalScrollBars} (class @code{ScrollBars})
329Give frames scroll bars if @samp{on}; don't have scroll bars if 295Give frames scroll bars if @samp{on}; don't have scroll bars if
@@ -331,143 +297,51 @@ Give frames scroll bars if @samp{on}; don't have scroll bars if
331 297
332@ifnottex 298@ifnottex
333@item @code{visualClass} (class @code{VisualClass}) 299@item @code{visualClass} (class @code{VisualClass})
334Specify the ``visual'' that X should use. This tells X how to handle 300The @dfn{visual class} for X color display. If specified, the value
335colors. 301should start with one of @samp{TrueColor}, @samp{PseudoColor},
336 302@samp{DirectColor}, @samp{StaticColor}, @samp{GrayScale}, and
337The value should start with one of @samp{TrueColor}, 303@samp{StaticGray}, followed by @samp{-@var{depth}}, where @var{depth}
338@samp{PseudoColor}, @samp{DirectColor}, @samp{StaticColor}, 304is the number of color planes.
339@samp{GrayScale}, and @samp{StaticGray}, followed by
340@samp{-@var{depth}}, where @var{depth} is the number of color planes.
341Most terminals only allow a few ``visuals,'' and the @samp{dpyinfo}
342program outputs information saying which ones.
343@end ifnottex 305@end ifnottex
344@end table 306@end table
345 307
346@node Face Resources 308 You can also use X resources to customize individual Emacs faces
347@appendixsec X Resources for Faces 309(@pxref{Faces}). For example, setting the resource
348 310@samp{@var{face}.attributeForeground} is equivalent to customizing the
349 You can use resources to customize the appearance of particular 311@samp{foreground} attribute of the face @var{face}. However, we
350faces (@pxref{Faces}): 312recommend customizing faces from within Emacs, instead of using X
351 313resources. @xref{Face Customization}.
352@table @code
353@item @var{face}.attributeForeground
354Foreground color for face @var{face}.
355@item @var{face}.attributeBackground
356Background color for face @var{face}.
357@item @var{face}.attributeUnderline
358Underline flag for face @var{face}. Use @samp{on} or @samp{true} for
359yes.
360@item @var{face}.attributeStrikeThrough
361@itemx @var{face}.attributeOverline
362@itemx @var{face}.attributeBox
363@itemx @var{face}.attributeInverse
364Likewise, for other boolean font attributes.
365@item @var{face}.attributeStipple
366The name of a pixmap data file to use for the stipple pattern, or
367@code{false} to not use stipple for the face @var{face}.
368@item @var{face}.attributeBackgroundPixmap
369The background pixmap for the face @var{face}. Should be a name of a
370pixmap file or @code{false}.
371@item @var{face}.attributeFont
372Font name (full XFD name or valid X abbreviation) for face @var{face}.
373Instead of this, you can specify the font through separate attributes.
374@end table
375
376 Instead of using @code{attributeFont} to specify a font name, you can
377select a font through these separate attributes:
378
379@table @code
380@item @var{face}.attributeFamily
381Font family for face @var{face}.
382@item @var{face}.attributeHeight
383Height of the font to use for face @var{face}: either an integer
384specifying the height in units of 1/10@dmn{pt}, or a floating point
385number that specifies a scale factor to scale the underlying face's
386default font, or a function to be called with the default height which
387will return a new height.
388@item @var{face}.attributeWidth
389@itemx @var{face}.attributeWeight
390@itemx @var{face}.attributeSlant
391Each of these resources corresponds to a like-named font attribute,
392and you write the resource value the same as the symbol you would use
393for the font attribute value.
394@item @var{face}.attributeBold
395Bold flag for face @var{face}---instead of @code{attributeWeight}. Use @samp{on} or @samp{true} for
396yes.
397@item @var{face}.attributeItalic
398Italic flag for face @var{face}---instead of @code{attributeSlant}.
399@end table
400 314
315@ifnottex
401@node Lucid Resources 316@node Lucid Resources
402@appendixsec Lucid Menu And Dialog X Resources 317@appendixsec Lucid Menu And Dialog X Resources
403@cindex Menu X Resources (Lucid widgets) 318@cindex Menu X Resources (Lucid widgets)
404@cindex Dialog X Resources (Lucid widgets) 319@cindex Dialog X Resources (Lucid widgets)
405@cindex Lucid Widget X Resources 320@cindex Lucid Widget X Resources
406 321
407@ifnottex 322 If Emacs is compiled with the X toolkit support using Lucid widgets,
408 If the Emacs installed at your site was built to use the X toolkit 323you can use X resources to customize the appearance of the menu bar,
409with the Lucid menu widgets, then the menu bar is a separate widget and 324pop-up menus, and dialog boxes. The resources for the menu bar fall
410has its own resources. The resource names contain @samp{pane.menubar} 325in the @samp{pane.menubar} class (following, as always, either the
411(following, as always, the name of the Emacs invocation, or @samp{Emacs}, 326name of the Emacs executable or @samp{Emacs} for all Emacs
412which stands for all Emacs invocations). Specify them like this: 327invocations). The resources for the pop-up menu are in the
413 328@samp{menu*} class. The resources for dialog boxes are in the
414@example 329@samp{dialog*} class.
415Emacs.pane.menubar.@var{resource}: @var{value}
416@end example
417
418@noindent
419For example, to specify the font @samp{Courier-12} for the menu-bar items,
420write this:
421@end ifnottex
422@iftex
423 If the Emacs installed at your site was built to use the X toolkit
424with the Lucid menu widgets, then the menu bar is a separate widget
425and has its own resources. The resource specifications start with
426@samp{Emacs.pane.menubar}---for instance, to specify the font
427@samp{Courier-12} for the menu-bar items, write this:
428@end iftex
429 330
430@example 331 For example, to display menu bar entries with the @samp{Courier-12}
431Emacs.pane.menubar.font: Courier-12 332font (@pxref{Fonts}), write this:
432@end example
433
434@noindent
435To specify a font, use fontconfig font names as values to the @code{font}
436resource, or old style names:
437 333
438@example 334@example
439Emacs.pane.menubar.font: lucidasanstypewriter-10 335Emacs.pane.menubar.font: Courier-12
440@end example 336@end example
441 337
442@noindent 338@noindent
443Emacs first tries to open the font as an old style font, and if that fails 339Lucid widgets can display multilingual text in your locale. To enable
444as an fontconfig font. In rare cases, Emacs might do the wrong thing. 340this, specify a @code{fontSet} resource instead of a @code{font}
445 341resource. @xref{Fontsets}. If both @code{font} and @code{fontSet}
446@noindent 342resources are specified, the @code{fontSet} resource is used.
447The Lucid menus can display multilingual text in your locale with old style
448fonts. For more information about fontsets see the man page for
449@code{XCreateFontSet}. To enable multilingual menu text you specify a
450@code{fontSet} resource instead of the font resource. If both
451@code{font} and @code{fontSet} resources are specified, the
452@code{fontSet} resource is used.
453 343
454@noindent 344Here is a list of resources for menu bars, pop-up menus, and dialogs:
455Resources for @emph{non-menubar} toolkit pop-up menus have
456@samp{menu*} instead of @samp{pane.menubar}. For example, to specify
457the font @samp{8x16} for the pop-up menu items, write this:
458
459@example
460Emacs.menu*.font: 8x16
461@end example
462
463@noindent
464For dialog boxes, use @samp{dialog*}:
465
466@example
467Emacs.dialog*.font: Sans-12
468@end example
469
470 Here is a list of the specific resources for menu bars and pop-up menus:
471 345
472@table @code 346@table @code
473@item font 347@item font
@@ -475,11 +349,11 @@ Font for menu item text.
475@item fontSet 349@item fontSet
476Fontset for menu item text. 350Fontset for menu item text.
477@item foreground 351@item foreground
478Color of the foreground. 352Foreground color.
479@item background 353@item background
480Color of the background. 354Background color.
481@item buttonForeground 355@item buttonForeground
482In the menu bar, the color of the foreground for a selected item. 356Foreground color for a selected item.
483@ifnottex 357@ifnottex
484@item horizontalSpacing 358@item horizontalSpacing
485Horizontal spacing in pixels between items. Default is 3. 359Horizontal spacing in pixels between items. Default is 3.
@@ -489,59 +363,51 @@ Vertical spacing in pixels between items. Default is 2.
489Horizontal spacing between the arrow (which indicates a submenu) and 363Horizontal spacing between the arrow (which indicates a submenu) and
490the associated text. Default is 10. 364the associated text. Default is 10.
491@item shadowThickness 365@item shadowThickness
492Thickness of shadow line around the widget. Default is 1. 366Thickness of shadow lines for 3D buttons, arrows, and other graphical
493 367elements. Default is 1.
494Also determines the thickness of shadow lines around other objects,
495for instance 3D buttons and arrows. If you have the impression that
496the arrows in the menus do not stand out clearly enough or that the
497difference between ``in'' and ``out'' buttons is difficult to see, set
498this to 2. If you have no problems with visibility, the default
499probably looks better. The background color may also have some effect
500on the contrast.
501@end ifnottex 368@end ifnottex
502@item margin 369@item margin
503The margin of the menu bar, in characters. Default is 1. 370Margin of the menu bar, in characters. Default is 1.
504@end table 371@end table
505 372
506@ifnottex
507@node LessTif Resources 373@node LessTif Resources
508@appendixsec LessTif Menu X Resources 374@appendixsec LessTif Menu X Resources
509@cindex Menu X Resources (LessTif widgets) 375@cindex Menu X Resources (LessTif widgets)
510@cindex LessTif Widget X Resources 376@cindex LessTif Widget X Resources
511 377
512 If the Emacs installed at your site was built to use the X toolkit 378 If Emacs is compiled with the X toolkit support using LessTif or
513with the LessTif or Motif widgets, then the menu bar, the dialog 379Motif widgets, you can use X resources to customize the appearance of
514boxes, the pop-up menus, and the file-selection box are separate 380the menu bar, pop-up menus, and dialog boxes. However, the resources
515widgets and have their own resources. 381are organized differently from Lucid widgets.
516 382
517 The resource names for the menu bar contain @samp{pane.menubar} 383 The resource names for the menu bar are in the @samp{pane.menubar}
518(following, as always, the name of the Emacs invocation, or 384class, and they must be specified in this form:
519@samp{Emacs}, which stands for all Emacs invocations). Specify them
520like this:
521 385
522@smallexample 386@smallexample
523Emacs.pane.menubar.@var{subwidget}.@var{resource}: @var{value} 387Emacs.pane.menubar.@var{subwidget}.@var{resource}: @var{value}
524@end smallexample 388@end smallexample
525 389
526 Each individual string in the menu bar is a subwidget; the subwidget's 390@noindent
527name is the same as the menu item string. For example, the word 391For pop-up menus, the resources are in the @samp{menu*} class, instead
528@samp{File} in the menu bar is part of a subwidget named 392of @samp{pane.menubar}. For dialog boxes, they are in @samp{dialog}.
529@samp{emacs.pane.menubar.File}. Most likely, you want to specify the 393In each case, each individual menu string is a subwidget; the
530same resources for the whole menu bar. To do this, use @samp{*} instead 394subwidget's name is the same as the menu item string. For example,
531of a specific subwidget name. For example, to specify the font 395the @samp{File} menu in the menu bar is a subwidget named
532@samp{8x16} for the menu-bar items, write this: 396@samp{emacs.pane.menubar.File}.
397
398 Typically, you want to specify the same resources for the whole menu
399bar. To do this, use @samp{*} instead of a specific subwidget name.
400For example, to specify the font @samp{8x16} for all menu bar items,
401including submenus, write this:
533 402
534@smallexample 403@smallexample
535Emacs.pane.menubar.*.fontList: 8x16 404Emacs.pane.menubar.*.fontList: 8x16
536@end smallexample 405@end smallexample
537 406
538@noindent 407 Each item in a submenu also has its own name for X resources; for
539This also specifies the resource value for submenus. 408example, the @samp{File} submenu has an item named @samp{Save (current
540 409buffer)}. A resource specification for a submenu item looks like
541 Each item in a submenu in the menu bar also has its own name for X 410this:
542resources; for example, the @samp{File} submenu has an item named
543@samp{Save (current buffer)}. A resource specification for a submenu
544item looks like this:
545 411
546@smallexample 412@smallexample
547Emacs.pane.menubar.popup_*.@var{menu}.@var{item}.@var{resource}: @var{value} 413Emacs.pane.menubar.popup_*.@var{menu}.@var{item}.@var{resource}: @var{value}
@@ -574,46 +440,23 @@ Emacs.pane.menubar.popup_*.popup_*.Spell Checking.Complete Word: @var{value}
574@noindent 440@noindent
575(This should be one long line.) 441(This should be one long line.)
576 442
577 It's impossible to specify a resource for all the menu-bar items 443 If you want the submenu items to look different from the menu bar
578without also specifying it for the submenus as well. So if you want the 444itself, you must first specify the resource for all of them, then
579submenu items to look different from the menu bar itself, you must ask 445override the value for submenus alone. Here is an example:
580for that in two steps. First, specify the resource for all of them;
581then, override the value for submenus alone. Here is an example:
582 446
583@smallexample 447@smallexample
584Emacs.pane.menubar.*.fontList: 8x16 448Emacs.pane.menubar.*.fontList: 8x16
585Emacs.pane.menubar.popup_*.fontList: 8x16 449Emacs.pane.menubar.popup_*.fontList: 8x16
586@end smallexample 450@end smallexample
587 451
588@noindent 452 To specify resources for the LessTif file-selection box, use
589For LessTif pop-up menus, use @samp{menu*} instead of
590@samp{pane.menubar}. For example, to specify the font @samp{8x16} for
591the pop-up menu items, write this:
592
593@smallexample
594Emacs.menu*.fontList: 8x16
595@end smallexample
596
597@noindent
598For LessTif dialog boxes, use @samp{dialog} instead of @samp{menu}:
599
600@example
601Emacs.dialog*.fontList: 8x16
602Emacs.dialog*.foreground: hotpink
603@end example
604
605To specify resources for the LessTif file-selection box, use
606@samp{fsb*}, like this: 453@samp{fsb*}, like this:
607 454
608@example 455@example
609Emacs.fsb*.fontList: 8x16 456Emacs.fsb*.fontList: 8x16
610@end example 457@end example
611 458
612@iftex 459 Here is a list of resources for LessTif menu bars and pop-up menus:
613@medbreak
614@end iftex
615 Here is a list of the specific resources for LessTif menu bars and
616pop-up menus:
617 460
618@table @code 461@table @code
619@item armColor 462@item armColor
@@ -638,128 +481,92 @@ The color for the border shadow, on the top and the left.
638@end table 481@end table
639@end ifnottex 482@end ifnottex
640 483
641
642@node GTK resources 484@node GTK resources
643@appendixsec GTK resources 485@appendixsec GTK resources
644@iftex 486@cindex GTK+ resources
645 The most common way to customize the GTK widgets Emacs uses (menus, 487@cindex resource files for GTK
646dialogs tool bars and scroll bars) is by choosing an appropriate 488@cindex @file{~/.gtkrc-2.0} file
647theme, for example with the GNOME theme selector. 489@cindex @file{~/.emacs.d/gtkrc} file
648
649You can also do Emacs specific customization by inserting GTK style
650directives in the file @file{~/.emacs.d/gtkrc}, but only if you have a
651Gtk+ version earlier than 3 (i.e.@: 2). Some GTK themes ignore
652customizations in @file{~/.emacs.d/gtkrc} so not everything works with
653all themes. To customize Emacs font, background, faces, etc., use the
654normal X resources (@pxref{Resources}). We will present some examples
655of customizations here, but for a more detailed description, see the
656online manual
657
658 The first example is just one line. It changes the font on all GTK widgets
659to courier with size 12:
660
661@smallexample
662gtk-font-name = "courier 12"
663@end smallexample
664
665 The thing to note is that the font name is not an X font name, but a
666Pango font name. A Pango font name is basically of the format "family
667style size", where the style is optional as in the case above. A name
668with a style could be for example:
669 490
670@smallexample 491 If Emacs is compiled with GTK+ toolkit support, the simplest way to
671gtk-font-name = "helvetica bold 10" 492customize its GTK+ widgets (e.g.@: menus, dialogs, tool bars and
672@end smallexample 493scroll bars) is to choose an appropriate GTK+ theme, for example with
494the GNOME theme selector.
495
496 In GTK+ version 2, you can also use @dfn{GTK+ resources} to
497customize the appearance of GTK+ widgets used by Emacs. These
498resources are specified in either the file @file{~/.emacs.d/gtkrc}
499(for Emacs-specific GTK+ resources), or @file{~/.gtkrc-2.0} (for
500general GTK+ resources). We recommend using @file{~/.emacs.d/gtkrc},
501since GTK+ seems to ignore @file{~/.gtkrc-2.0} when running GConf with
502GNOME. Note, however, that some GTK themes may override
503customizations in @file{~/.emacs.d/gtkrc}; there is nothing we can do
504about this. GTK+ resources do not affect aspects of Emacs unrelated
505to GTK+ widgets, such as fonts and colors in the main Emacs window;
506those are governed by normal X resources (@pxref{Resources}).
507
508 The following sections describe how to customize GTK+ resources for
509Emacs. For details about GTK+ resources, see the GTK+ API document at
510@uref{http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html}.
673 511
674 To customize widgets you first define a style and then apply the style to 512 In GTK+ version 3, GTK+ resources have been replaced by a completely
675the widgets. Here is an example that sets the font for menus, but not 513different system. The appearance of GTK+ widgets is now determined by
676for other widgets: 514CSS-like style files: @file{gtk-3.0/gtk.css} in the GTK+ installation
515directory, and @file{~/.themes/@var{theme}/gtk-3.0/gtk.css} for local
516style settings (where @var{theme} is the name of the current GTK+
517theme). Therefore, the description of GTK+ resources in this section
518does not apply to GTK+ 3. For details about the GTK+ 3 styling
519system, see
520@uref{http://developer.gnome.org/gtk3/3.0/GtkCssProvider.html}.
677 521
678@smallexample 522@menu
679# @r{Define the style @samp{menufont}.} 523* GTK Resource Basics:: Basic usage of GTK+ resources.
680style "menufont" 524* GTK Widget Names:: How GTK+ widgets are named.
681@{ 525* GTK Names in Emacs:: GTK widgets used by Emacs.
682 font_name = "helvetica bold 14" # This is a Pango font name 526* GTK styles:: What can be customized in a GTK widget.
683@} 527@end menu
684 528
685# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.} 529@node GTK Resource Basics
686widget "*emacs-menuitem*" style "menufont" 530@appendixsubsec GTK Resource Basics
687@end smallexample
688 531
689The widget name in this example contains wildcards, so the style will be 532 In a GTK+ 2 resource file (usually @file{~/.emacs.d/gtkrc}), the
690applied to all widgets that match "*emacs-menuitem*". The widgets are 533simplest kinds of resource settings simply assign a value to a
691named by the way they are contained, from the outer widget to the inner widget. 534variable. For example, putting the following line in the resource
692So to apply the style "my_style" (not shown) with the full, absolute name, for 535file changes the font on all GTK+ widgets to @samp{courier-12}:
693the menubar and the scroll bar in Emacs we use:
694 536
695@smallexample 537@smallexample
696widget "Emacs.pane.menubar" style "my_style" 538gtk-font-name = "courier 12"
697widget "Emacs.pane.emacs.verticalScrollBar" style "my_style"
698@end smallexample 539@end smallexample
699 540
700But to avoid having to type it all, wildcards are often used. @samp{*} 541@noindent
701matches zero or more characters and @samp{?} matches one character. So "*" 542Note that in this case the font name must be supplied as a GTK font
702matches all widgets. 543pattern (also called a @dfn{Pango font name}), not as a
544Fontconfig-style font name or XLFD. @xref{Fonts}.
703 545
704 Each widget has a class (for example GtkMenuItem) and a name (emacs-menuitem). 546 To customize widgets you first define a @dfn{style}, and then apply
705You can assign styles by name or by class. In this example we have used the 547the style to the widgets. Here is an example that sets the font for
706class: 548menus (@samp{#} characters indicate comments):
707 549
708@smallexample 550@smallexample
709style "menufont" 551# @r{Define the style @samp{my_style}.}
552style "my_style"
710@{ 553@{
711 font_name = "helvetica bold 14" 554 font_name = "helvetica bold 14"
712@} 555@}
713 556
714widget_class "*GtkMenuBar" style "menufont" 557# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{my_style}.}
558widget "*emacs-menuitem*" style "my_style"
715@end smallexample 559@end smallexample
716 560
717@noindent 561@noindent
718The names and classes for the GTK widgets Emacs uses are: 562The widget name in this example contains wildcards, so the style is
719 563applied to all widgets matching @samp{*emacs-menuitem*}. The widgets
720@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some} 564are named by the way they are contained, from the outer widget to the
721@item @code{emacs-filedialog} 565inner widget. Here is another example that applies @samp{my_style}
722@tab @code{GtkFileSelection} 566specifically to the Emacs menu bar:
723@item @code{emacs-dialog}
724@tab @code{GtkDialog}
725@item @code{Emacs}
726@tab @code{GtkWindow}
727@item @code{pane}
728@tab @code{GtkVHbox}
729@item @code{emacs}
730@tab @code{GtkFixed}
731@item @code{verticalScrollBar}
732@tab @code{GtkVScrollbar}
733@item @code{emacs-toolbar}
734@tab @code{GtkToolbar}
735@item @code{menubar}
736@tab @code{GtkMenuBar}
737@item @code{emacs-menuitem}
738@tab anything in menus
739@end multitable
740
741 GTK absolute names are quite strange when it comes to menus
742and dialogs. The names do not start with @samp{Emacs}, as they are
743free-standing windows and not contained (in the GTK sense) by the
744Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this:
745
746@smallexample
747widget "*emacs-dialog*" style "my_dialog_style"
748widget "*emacs-filedialog* style "my_file_style"
749widget "*emacs-menuitem* style "my_menu_style"
750@end smallexample
751
752 If you specify a customization in @file{~/.emacs.d/gtkrc}, then it
753automatically applies only to Emacs, since other programs don't read
754that file. For example, the drop down menu in the file dialog can not
755be customized by any absolute widget name, only by an absolute class
756name. This is because the widgets in the drop down menu do not
757have names and the menu is not contained in the Emacs GtkWindow. To
758have all menus in Emacs look the same, use this in
759@file{~/.emacs.d/gtkrc}:
760 567
761@smallexample 568@smallexample
762widget_class "*Menu*" style "my_menu_style" 569widget "Emacs.pane.menubar.*" style "my_style"
763@end smallexample 570@end smallexample
764 571
765 Here is a more elaborate example, showing how to change the parts of 572 Here is a more elaborate example, showing how to change the parts of
@@ -768,97 +575,24 @@ the scroll bar:
768@smallexample 575@smallexample
769style "scroll" 576style "scroll"
770@{ 577@{
771 fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.} 578 fg[NORMAL] = "red"@ @ @ @ @ # @r{Arrow color.}
772 bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.} 579 bg[NORMAL] = "yellow"@ @ # @r{Thumb and background around arrow.}
773 bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.} 580 bg[ACTIVE] = "blue"@ @ @ @ # @r{Trough color.}
774 bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.} 581 bg[PRELIGHT] = "white"@ # @r{Thumb color when the mouse is over it.}
775@} 582@}
776 583
777widget "*verticalScrollBar*" style "scroll" 584widget "*verticalScrollBar*" style "scroll"
778@end smallexample 585@end smallexample
779@end iftex
780
781@ifnottex
782@cindex GTK resources and customization
783@cindex resource files for GTK
784@cindex @file{~/.gtkrc-2.0} file
785@cindex @file{~/.emacs.d/gtkrc} file
786
787 If Emacs was built to use the GTK widget set, then the menu bar, tool bar,
788scroll bar and the dialogs are customized with the standard GTK
789customization file, @file{~/.gtkrc-2.0}, or with the Emacs specific
790file @file{~/.emacs.d/gtkrc}. We recommend that you use
791@file{~/.emacs.d/gtkrc} for customizations, since @file{~/.gtkrc-2.0}
792seems to be ignored when running GConf with GNOME. These files apply
793only to GTK widget features. To customize Emacs font, background,
794faces, etc., use the normal X resources (@pxref{Resources}).
795
796 Some GTK themes override these mechanisms, which means that using
797these mechanisms will not work to customize them.
798
799 In these files you first define a style and say what it means; then
800you specify to apply the style to various widget types (@pxref{GTK
801widget names}). Here is an example of how to change the font for
802Emacs menus:
803
804@smallexample
805# @r{Define the style @samp{menufont}.}
806style "menufont"
807@{
808 font_name = "helvetica bold 14" # This is a Pango font name
809@}
810
811# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.}
812widget "*emacs-menuitem*" style "menufont"
813@end smallexample
814
815 Here is a more elaborate example, showing how to change the parts of
816the scroll bar:
817
818@smallexample
819style "scroll"
820@{
821 fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.}
822 bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.}
823 bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.}
824 bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.}
825@}
826 586
827widget "*verticalScrollBar*" style "scroll" 587@node GTK Widget Names
828@end smallexample
829
830 There are also parameters that affect GTK as a whole. For example,
831the property @code{gtk-font-name} sets the default font for GTK. You
832must use Pango font names (@pxref{GTK styles}). A GTK resources file
833that just sets a default font looks like this:
834
835@smallexample
836gtk-font-name = "courier 12"
837@end smallexample
838
839 The GTK resources file is fully described in the GTK API document.
840This can be found in
841@file{@var{prefix}/share/gtk-doc/html/gtk/gtk-resource-files.html},
842where @file{prefix} is the directory in which the GTK libraries were
843installed (usually @file{/usr} or @file{/usr/local}). You can also
844find the document online, at
845@uref{http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html}.
846
847@menu
848* GTK widget names:: How widgets in GTK are named in general.
849* GTK Names in Emacs:: GTK widget names in Emacs.
850* GTK styles:: What can be customized in a GTK widget.
851@end menu
852
853@node GTK widget names
854@appendixsubsec GTK widget names 588@appendixsubsec GTK widget names
855@cindex GTK widget names 589@cindex GTK widget names
856 590
857 A GTK widget is specified by its @dfn{widget class} and 591 A GTK+ widget is specified by a @dfn{widget name} and a @dfn{widget
858@dfn{widget name}. The widget class is the type of the widget: for 592class}. The widget name refers to a specific widget
859example, @code{GtkMenuBar}. The widget name is the name given to a 593(e.g.@: @samp{emacs-menuitem}), while the widget class refers to a
860specific widget. A widget always has a class, but need not have a 594collection of similar widgets (e.g.@: @samp{GtkMenuItem}). A widget
861name. 595always has a class, but need not have a name.
862 596
863 @dfn{Absolute names} are sequences of widget names or widget 597 @dfn{Absolute names} are sequences of widget names or widget
864classes, corresponding to hierarchies of widgets embedded within 598classes, corresponding to hierarchies of widgets embedded within
@@ -868,55 +602,31 @@ a @code{GtkMenuBar} called @code{menubar}, the absolute class name
868of the menu-bar widget is @code{GtkWindow.GtkVBox.GtkMenuBar}, and 602of the menu-bar widget is @code{GtkWindow.GtkVBox.GtkMenuBar}, and
869its absolute widget name is @code{top.box.menubar}. 603its absolute widget name is @code{top.box.menubar}.
870 604
871 When assigning a style to a widget, you can use the absolute class 605 GTK+ resource files can contain two types of commands for specifying
872name or the absolute widget name. 606widget appearances:
873
874 There are two commands to specify changes for widgets:
875 607
876@table @asis 608@table @code
877@item @code{widget_class} 609@item widget
878specifies a style for widgets based on the absolute class name. 610specifies a style for widgets based on the class name, or just the
611class.
879 612
880@item @code{widget} 613@item widget_class
881specifies a style for widgets based on the absolute class name, 614specifies a style for widgets based on the class name.
882or just the class.
883@end table 615@end table
884 616
885@noindent 617@noindent
886You must specify the class and the style in double-quotes, and put 618See the previous subsection for examples of using the @code{widget}
887these commands at the top level in the GTK customization file, like 619command; the @code{widget_class} command is used similarly. Note that
888this: 620the widget name/class and the style must be enclosed in double-quotes,
621and these commands must be at the top level in the GTK+ resource file.
889 622
890@smallexample 623 As previously noted, you may specify a widget name or class with
891style "menufont" 624shell wildcard syntax: @samp{*} matches zero or more characters and
892@{ 625@samp{?} matches one character. This example assigns a style to all
893 font_name = "helvetica bold 14" 626widgets:
894@}
895
896widget "top.box.menubar" style "menufont"
897widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "menufont"
898@end smallexample
899
900 Matching of absolute names uses shell wildcard syntax: @samp{*}
901matches zero or more characters and @samp{?} matches one character.
902This example assigns @code{base_style} to all widgets:
903 627
904@smallexample 628@smallexample
905widget "*" style "base_style" 629widget "*" style "my_style"
906@end smallexample
907
908 Given the absolute class name @code{GtkWindow.GtkVBox.GtkMenuBar}
909and the corresponding absolute widget name @code{top.box.menubar}, all
910these examples specify @code{my_style} for the menu bar:
911
912@smallexample
913widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style"
914widget_class "GtkWindow.*.GtkMenuBar" style "my_style"
915widget_class "*GtkMenuBar" style "my_style"
916widget "top.box.menubar" style "my_style"
917widget "*box*menubar" style "my_style"
918widget "*menubar" style "my_style"
919widget "*menu*" style "my_style"
920@end smallexample 630@end smallexample
921 631
922@node GTK Names in Emacs 632@node GTK Names in Emacs
@@ -924,68 +634,52 @@ widget "*menu*" style "my_style"
924@cindex GTK widget names 634@cindex GTK widget names
925@cindex GTK widget classes 635@cindex GTK widget classes
926 636
927 In Emacs, the top level widget for a frame is a @code{GtkWindow} 637 The GTK+ widgets used by an Emacs frame are listed below:
928that contains a @code{GtkVBox}. The @code{GtkVBox} contains the
929@code{GtkMenuBar} and a @code{GtkFixed} widget. The vertical scroll
930bars, @code{GtkVScrollbar}, are contained in the @code{GtkFixed}
931widget. The text you write in Emacs is drawn in the @code{GtkFixed}
932widget.
933 638
934 Dialogs in Emacs are @code{GtkDialog} widgets. The file dialog is a 639@table @asis
935@code{GtkFileSelection} widget. 640@item @code{Emacs} (class @code{GtkWindow})
641@table @asis
642@item @code{pane} (class @code{GtkVBox})
643@table @asis
644@item @code{menubar} (class @code{GtkMenuBar})
645@table @asis
646@item [menu item widgets]
647@end table
648@item [unnamed widget] (class @code{GtkHandleBox})
649@table @asis
650@item @code{emacs-toolbar} (class @code{GtkToolbar})
651@table @asis
652@item [tool bar item widgets]
653@end table
654@end table
655@item @code{emacs} (class @code{GtkFixed})
656@table @asis
657@item @code{verticalScrollBar} (class @code{GtkVScrollbar})
658@end table
659@end table
660@end table
661@end table
936 662
937@noindent 663@noindent
938To set a style for the menu bar using the absolute class name, use: 664The contents of Emacs windows are drawn in the @code{emacs} widget.
665Note that even if there are multiple Emacs windows, each scroll bar
666widget is named @code{verticalScrollBar}.
939 667
940@smallexample 668 For example, here are two different ways to set the menu bar style:
941widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style"
942@end smallexample
943
944@noindent
945For the scroll bar, the absolute class name is:
946 669
947@smallexample 670@smallexample
948widget_class 671widget "Emacs.pane.menubar.*" style "my_style"
949 "GtkWindow.GtkVBox.GtkFixed.GtkVScrollbar" 672widget_class "GtkWindow.GtkVBox.GtkMenuBar.*" style "my_style"
950 style "my_style"
951@end smallexample 673@end smallexample
952 674
953@noindent 675 For GTK+ dialogs, Emacs uses a widget named @code{emacs-dialog}, of
954The names for the emacs widgets, and their classes, are: 676class @code{GtkDialog}. For file selection, Emacs uses a widget named
955 677@code{emacs-filedialog}, of class @code{GtkFileSelection}.
956@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some}
957@item @code{emacs-filedialog}
958@tab @code{GtkFileSelection}
959@item @code{emacs-dialog}
960@tab @code{GtkDialog}
961@item @code{Emacs}
962@tab @code{GtkWindow}
963@item @code{pane}
964@tab @code{GtkVHbox}
965@item @code{emacs}
966@tab @code{GtkFixed}
967@item @code{verticalScrollBar}
968@tab @code{GtkVScrollbar}
969@item @code{emacs-toolbar}
970@tab @code{GtkToolbar}
971@item @code{menubar}
972@tab @code{GtkMenuBar}
973@item @code{emacs-menuitem}
974@tab anything in menus
975@end multitable
976
977@noindent
978Thus, for Emacs you can write the two examples above as:
979
980@smallexample
981widget "Emacs.pane.menubar" style "my_style"
982widget "Emacs.pane.emacs.verticalScrollBar" style "my_style"
983@end smallexample
984 678
985 GTK absolute names are quite strange when it comes to menus 679 Because the widgets for pop-up menus and dialogs are free-standing
986and dialogs. The names do not start with @samp{Emacs}, as they are 680windows and not ``contained'' in the @code{Emacs} widget, their GTK+
987free-standing windows and not contained (in the GTK sense) by the 681absolute names do not start with @samp{Emacs}. To customize these
988Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this: 682widgets, use wildcards like this:
989 683
990@smallexample 684@smallexample
991widget "*emacs-dialog*" style "my_dialog_style" 685widget "*emacs-dialog*" style "my_dialog_style"
@@ -993,14 +687,7 @@ widget "*emacs-filedialog* style "my_file_style"
993widget "*emacs-menuitem* style "my_menu_style" 687widget "*emacs-menuitem* style "my_menu_style"
994@end smallexample 688@end smallexample
995 689
996 If you specify a customization in @file{~/.emacs.d/gtkrc}, then it 690 If you want to apply a style to all menus in Emacs, use this:
997automatically applies only to Emacs, since other programs don't read
998that file. For example, the drop down menu in the file dialog can not
999be customized by any absolute widget name, only by an absolute class
1000name. This is because the widgets in the drop down menu do not
1001have names and the menu is not contained in the Emacs GtkWindow. To
1002have all menus in Emacs look the same, use this in
1003@file{~/.emacs.d/gtkrc}:
1004 691
1005@smallexample 692@smallexample
1006widget_class "*Menu*" style "my_menu_style" 693widget_class "*Menu*" style "my_menu_style"
@@ -1010,15 +697,7 @@ widget_class "*Menu*" style "my_menu_style"
1010@appendixsubsec GTK styles 697@appendixsubsec GTK styles
1011@cindex GTK styles 698@cindex GTK styles
1012 699
1013 In a GTK style you specify the appearance widgets shall have. You 700 Here is an example of two GTK+ style declarations:
1014can specify foreground and background color, background pixmap and
1015font. The edit widget (where you edit the text) in Emacs is a GTK
1016widget, but trying to specify a style for the edit widget will have no
1017effect. This is so that Emacs compiled for GTK is compatible with
1018Emacs compiled for other X toolkits. The settings for foreground,
1019background and font for the edit widget is taken from the X resources;
1020@pxref{Resources}. Here is an example of two style declarations,
1021@samp{default} and @samp{ruler}:
1022 701
1023@smallexample 702@smallexample
1024pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" 703pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps"
@@ -1128,9 +807,8 @@ text fields in the file dialog.
1128 807
1129@item font_name = "@var{font}" 808@item font_name = "@var{font}"
1130This specifies the font for text in the widget. @var{font} is a 809This specifies the font for text in the widget. @var{font} is a
1131Pango font name, for example @samp{Sans Italic 10}, @samp{Helvetica 810GTK-style (or Pango) font name, like @samp{Sans Italic 10}.
1132Bold 12}, @samp{Courier 14}, @samp{Times 18}. See below for exact 811@xref{Fonts}. The names are case insensitive.
1133syntax. The names are case insensitive.
1134@end table 812@end table
1135 813
1136 There are three ways to specify a color: a color name, an RGB 814 There are three ways to specify a color: a color name, an RGB
@@ -1138,60 +816,6 @@ triplet, or a GTK-style RGB triplet. @xref{Colors}, for a description
1138of color names and RGB triplets. Color names should be enclosed with 816of color names and RGB triplets. Color names should be enclosed with
1139double quotes, e.g.@: @samp{"red"}. RGB triplets should be written 817double quotes, e.g.@: @samp{"red"}. RGB triplets should be written
1140without double quotes, e.g.@: @samp{#ff0000}. GTK-style RGB triplets 818without double quotes, e.g.@: @samp{#ff0000}. GTK-style RGB triplets
1141have the form 819have the form @w{@code{@{ @var{r}, @var{g}, @var{b} @}}}, where
1142 820@var{r}, @var{g} and @var{b} are either integers in the range 0-65535
1143@smallexample 821or floats in the range 0.0-1.0.
1144@code{@{ @var{r}, @var{g}, @var{b} @}}
1145@end smallexample
1146
1147@noindent
1148where @var{r}, @var{g} and @var{b} are either integers in the range
11490-65535 or floats in the range 0.0-1.0.
1150
1151 Pango font names have the form ``@var{family-list} @var{style-options}
1152@var{size}.''
1153@cindex Pango font name
1154@noindent
1155@var{family-list} is a comma separated list of font families optionally
1156terminated by a comma. This way you can specify several families and the
1157first one found will be used. @var{family} corresponds to the second part in
1158an X font name, for example in
1159
1160@smallexample
1161-adobe-times-medium-r-normal--12-120-75-75-p-64-iso10646-1
1162@end smallexample
1163
1164@noindent
1165the family name is @samp{times}.
1166
1167@noindent
1168@var{style-options} is a whitespace separated list of words where each word
1169is a style, variant, weight, or stretch. The default value for all of
1170these is @code{normal}.
1171
1172@noindent
1173A `style' corresponds to the fourth part of an X font name. In X font
1174names it is the character @samp{r}, @samp{i} or @samp{o}; in Pango
1175font names the corresponding values are @code{normal}, @code{italic},
1176or @code{oblique}.
1177
1178@noindent
1179A `variant' is either @code{normal} or @code{small-caps}.
1180Small caps is a font with the lower case characters replaced by
1181smaller variants of the capital characters.
1182
1183@noindent
1184Weight describes the ``boldness'' of a font. It corresponds to the third
1185part of an X font name. It is one of @code{ultra-light}, @code{light},
1186@code{normal}, @code{bold}, @code{ultra-bold}, or @code{heavy}.
1187
1188@noindent
1189Stretch gives the width of the font relative to other designs within a
1190family. It corresponds to the fifth part of an X font name. It is one of
1191@code{ultra-condensed}, @code{extra-condensed}, @code{condensed},
1192@code{semi-condensed}, @code{normal}, @code{semi-expanded},
1193@code{expanded}, @code{extra-expanded}, or @code{ultra-expanded}.
1194
1195@noindent
1196@var{size} is a decimal number that describes the font size in points.
1197@end ifnottex
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index f69eeeaadd4..4b9531c0e6c 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,12 @@
12012-01-16 Juanma Barranquero <lekktu@gmail.com>
2
3 * windows.texi (Window Parameters): Use @pxref.
4
52012-01-16 Martin Rudalics <rudalics@gmx.at>
6
7 * windows.texi (Window Configurations, Window Parameters):
8 Describe persistent window parameters.
9
12011-12-27 Stefan Monnier <monnier@iro.umontreal.ca> 102011-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
2 11
3 * variables.texi (Creating Buffer-Local): Warn against misuses of 12 * variables.texi (Creating Buffer-Local): Warn against misuses of
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 85e1b9340fc..1bff30e45e1 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -3104,7 +3104,9 @@ window configuration; see @ref{Frame Configurations}.
3104@defun current-window-configuration &optional frame 3104@defun current-window-configuration &optional frame
3105This function returns a new object representing @var{frame}'s current 3105This function returns a new object representing @var{frame}'s current
3106window configuration. The default for @var{frame} is the selected 3106window configuration. The default for @var{frame} is the selected
3107frame. 3107frame. This function saves copies of window parameters listed by the
3108variable @code{window-persistent-parameters}, see @ref{Window
3109Parameters} for details.
3108@end defun 3110@end defun
3109 3111
3110@defun set-window-configuration configuration 3112@defun set-window-configuration configuration
@@ -3206,24 +3208,30 @@ configurations.
3206 3208
3207 The objects returned by @code{current-window-configuration} die 3209 The objects returned by @code{current-window-configuration} die
3208together with the Emacs process. In order to store a window 3210together with the Emacs process. In order to store a window
3209configuration on disk and read it back in another Emacs session the 3211configuration on disk and read it back in another Emacs session, the
3210following two functions can be used. 3212functions described next can be used. These functions are also useful
3213to clone the state of a frame into an arbitrary live window
3214(@code{set-window-configuration} effectively clones the windows of a
3215frame into the root window of that very frame only).
3211 3216
3212@defun window-state-get &optional window markers 3217@defun window-state-get &optional window ignore
3213This function returns the state of @var{window} as a Lisp object. The 3218This function returns the state of @var{window} as a Lisp object. The
3214argument @var{window} can be any window and defaults to the root window 3219argument @var{window} can be any window and defaults to the root window
3215of the selected frame. 3220of the selected frame.
3216 3221
3217The optional argument @var{markers} non-@code{nil} means to use markers 3222If the optional argument @var{ignore} is non-@code{nil}, this means to
3218for sampling positions like @code{window-point} or @code{window-start}. 3223not use markers for sampling positions like @code{window-point} or
3219This argument should be non-@code{nil} only if the value is used for 3224@code{window-start}. This argument should be non-@code{nil} when the
3220putting the state back in the same session since markers slow down 3225state shall be written on disk and read back in another session.
3221processing. 3226
3227The variable @code{window-persistent-parameters} specifies whether and
3228which window parameters are saved by this function, see @ref{Window
3229Parameters} for details.
3222@end defun 3230@end defun
3223 3231
3224The value returned by @code{window-state-get} can be converted by using 3232The value returned by @code{window-state-get} can be converted, using
3225one of the functions defined by Desktop Save Mode (@pxref{Desktop Save 3233one of the functions defined by Desktop Save Mode (@pxref{Desktop Save
3226Mode}) to an object that can be written to a file. Such objects can be 3234Mode}), to an object that can be written to a file. Such objects can be
3227read back and converted to a Lisp object representing the state of the 3235read back and converted to a Lisp object representing the state of the
3228window. That Lisp object can be used as argument for the following 3236window. That Lisp object can be used as argument for the following
3229function in order to restore the state window in another window. 3237function in order to restore the state window in another window.
@@ -3268,6 +3276,51 @@ This function sets @var{window}'s value of @var{parameter} to
3268is the selected window. 3276is the selected window.
3269@end defun 3277@end defun
3270 3278
3279By default, functions saving and restoring window configurations or the
3280states of windows (@pxref{Window Configurations}) do not care about
3281window parameters. This means, that when you change the value of a
3282parameter within the body of a @code{save-window-excursion}, the
3283previous value is not restored upon exit of that macro. It also means
3284that when you clone via @code{window-state-put} a window state saved
3285earlier by @code{window-state-get}, the cloned windows come up with no
3286parameters at all. The following variable allows to override the
3287standard behavior.
3288
3289@defvar window-persistent-parameters
3290This variable is an alist specifying which parameters get saved by
3291@code{current-window-configuration} and @code{window-state-get} and
3292subsequently restored by @code{set-window-configuration} and
3293@code{window-state-put}, see @ref{Window Configurations}.
3294
3295The @sc{car} of each entry of this alist is the symbol specifying the
3296parameter. The @sc{cdr} must be one of the following:
3297
3298@table @asis
3299@item @code{state}
3300This value means the parameter is saved by @code{window-state-get}
3301provided its @var{ignore} argument is @code{nil}. The function
3302@code{current-window-configuration} does not save this parameter.
3303
3304@item @code{nil}
3305This value specifies that the parameter is saved by
3306@code{current-window-configuration} and, provided its @var{ignore}
3307argument is @code{nil}, by @code{window-state-get}.
3308
3309@item @code{t}
3310This means that the parameter is saved unconditionally by both
3311@code{current-window-configuration} and @code{window-state-get}. This
3312value should not be used for parameters whose values do not have a read
3313syntax. Otherwise, invoking @code{window-state-put} in another session
3314may fail with an @code{invalid-read-syntax} error.
3315@end table
3316
3317Parameters that have been saved are restored to their previous values by
3318@code{set-window-configuration} respectively are installed by
3319@code{window-state-put}. Parameters that have not been saved are left
3320alone by @code{set-window-configuration} respectively are not installed
3321by @code{window-state-put}.
3322@end defvar
3323
3271Some functions, notably @code{delete-window}, 3324Some functions, notably @code{delete-window},
3272@code{delete-other-windows} and @code{split-window} may behave specially 3325@code{delete-other-windows} and @code{split-window} may behave specially
3273when their @var{window} argument has a parameter set. You can override 3326when their @var{window} argument has a parameter set. You can override
@@ -3287,7 +3340,7 @@ windows when exiting that function.
3287@end defvar 3340@end defvar
3288 3341
3289The following parameters are currently used by the window management 3342The following parameters are currently used by the window management
3290code. 3343code:
3291 3344
3292@table @asis 3345@table @asis
3293@item @code{delete-window} 3346@item @code{delete-window}
@@ -3309,14 +3362,20 @@ This parameter affects the execution of @code{other-window}
3309@item @code{no-other-window} 3362@item @code{no-other-window}
3310This parameter marks the window as not selectable by @code{other-window} 3363This parameter marks the window as not selectable by @code{other-window}
3311(@pxref{Cyclic Window Ordering}). 3364(@pxref{Cyclic Window Ordering}).
3365
3366@item @code{clone-of}
3367This parameter specifies the window this one has been cloned from and is
3368installed by @code{window-state-get}, see @ref{Window Configurations}.
3369
3370@item @code{quit-restore}
3371This parameter tells how to proceed with a window when the buffer it
3372shows is no more needed. It is installed by the buffer display
3373functions (@pxref{Choosing Window}) and consulted by the function
3374@code{quit-window} (@pxref{Quitting Windows}).
3312@end table 3375@end table
3313 3376
3314In addition, the parameters @code{window-atom} and @code{window-side} 3377In addition, the parameters @code{window-atom} and @code{window-side}
3315are reserved and should not be used by applications. The 3378are reserved and should not be used by applications.
3316@code{quit-restore} parameter tells how to proceed with a window when
3317the buffer it shows is no more needed. This parameter is installed by
3318the buffer display functions (@pxref{Choosing Window}) and consulted by
3319the function @code{quit-window} (@pxref{Quitting Windows}).
3320 3379
3321 3380
3322@node Window Hooks 3381@node Window Hooks
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 76728fdbc5b..2813d80d9ff 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,20 @@
12012-01-16 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * minibuffer.el (completion--replace): Strip properties (bug#10062).
4
52012-01-16 Martin Rudalics <rudalics@gmx.at>
6
7 * window.el (window-state-ignored-parameters): Remove variable.
8 (window--state-get-1): Rename argument MARKERS to IGNORE.
9 Handle persistent window parameters. Make copy of clone-of
10 parameter only if requested. (Bug#10348)
11 (window--state-put-2): Install a window parameter only if it has
12 a non-nil value or an existing parameter shall be overwritten.
13
142012-01-15 Michael Albinus <michael.albinus@gmx.de>
15
16 * net/tramp-sh.el (tramp-remote-path): Set tramp-autoload cookie.
17
12012-01-14 Eli Zaretskii <eliz@gnu.org> 182012-01-14 Eli Zaretskii <eliz@gnu.org>
2 19
3 * info.el (Info-toc-build): If the Info file has no "Up" pointer, 20 * info.el (Info-toc-build): If the Info file has no "Up" pointer,
@@ -34,7 +51,7 @@
34 51
35 Fix Emacs bug #10463 - put `widen's around the critical spots. 52 Fix Emacs bug #10463 - put `widen's around the critical spots.
36 53
37 * progmodes/cc-engine.el (c-in-literal, c-literal-limits): put a 54 * progmodes/cc-engine.el (c-in-literal, c-literal-limits): Put a
38 widen around each invocation of c-state-pp-to-literal. Remove an 55 widen around each invocation of c-state-pp-to-literal. Remove an
39 unused let variable. 56 unused let variable.
40 57
@@ -45,8 +62,8 @@
45 62
462012-01-10 Chong Yidong <cyd@gnu.org> 632012-01-10 Chong Yidong <cyd@gnu.org>
47 64
48 * net/network-stream.el (network-stream-open-starttls): Avoid 65 * net/network-stream.el (network-stream-open-starttls):
49 emitting a confusing error message when the server gives a bad 66 Avoid emitting a confusing error message when the server gives a bad
50 response to the capability command. 67 response to the capability command.
51 68
522012-01-10 Glenn Morris <rgm@gnu.org> 692012-01-10 Glenn Morris <rgm@gnu.org>
@@ -139,8 +156,8 @@
139 156
140 * custom.el (enable-theme): Don't set custom-safe-themes. 157 * custom.el (enable-theme): Don't set custom-safe-themes.
141 158
142 * cus-theme.el (custom-theme-merge-theme): Ignore 159 * cus-theme.el (custom-theme-merge-theme):
143 custom-enabled-themes and custom-safe-themes. 160 Ignore custom-enabled-themes and custom-safe-themes.
144 161
1452012-01-05 Michael R. Mauger <mmaug@yahoo.com> 1622012-01-05 Michael R. Mauger <mmaug@yahoo.com>
146 163
@@ -163,8 +180,8 @@
163 180
1642012-01-03 Chong Yidong <cyd@gnu.org> 1812012-01-03 Chong Yidong <cyd@gnu.org>
165 182
166 * shell.el (shell-dynamic-complete-functions): Put 183 * shell.el (shell-dynamic-complete-functions):
167 pcomplete-completions-at-point, so as to try 184 Put pcomplete-completions-at-point, so as to try
168 comint-filename-completion first (Bug#10417). 185 comint-filename-completion first (Bug#10417).
169 186
1702012-01-02 Richard Stallman <rms@gnu.org> 1872012-01-02 Richard Stallman <rms@gnu.org>
@@ -189,8 +206,8 @@
189 206
1902012-01-01 Eli Zaretskii <eliz@gnu.org> 2072012-01-01 Eli Zaretskii <eliz@gnu.org>
191 208
192 * term/w32-win.el (dynamic-library-alist) <gnutls>: Load 209 * term/w32-win.el (dynamic-library-alist) <gnutls>:
193 libgnutls-28.dll, from GnuTLS version 3.x, in preference to 210 Load libgnutls-28.dll, from GnuTLS version 3.x, in preference to
194 libgnutls-26.dll. 211 libgnutls-26.dll.
195 212
1962011-12-31 Andreas Schwab <schwab@linux-m68k.org> 2132011-12-31 Andreas Schwab <schwab@linux-m68k.org>
@@ -242,11 +259,10 @@
2422011-12-24 Alan Mackenzie <acm@muc.de> 2592011-12-24 Alan Mackenzie <acm@muc.de>
243 260
244 Introduce a mechanism to widen the region used in context font 261 Introduce a mechanism to widen the region used in context font
245 locking. Use this to protect declarations from losing their 262 locking. Use this to protect declarations from losing their contexts.
246 contexts.
247 263
248 * progmodes/cc-langs.el (c-before-font-lock-functions): Replace 264 * progmodes/cc-langs.el (c-before-font-lock-functions):
249 c-set-fl-decl-start with c-change-set-fl-decl-start (Renaming). 265 Replace c-set-fl-decl-start with c-change-set-fl-decl-start (Renaming).
250 (c-before-context-fontification-functions): New defvar, a list of 266 (c-before-context-fontification-functions): New defvar, a list of
251 functions to be run just before context (etc.) font locking. 267 functions to be run just before context (etc.) font locking.
252 268
@@ -398,22 +414,19 @@
398 414
399 * progmodes/cc-langs (c-label-kwds): Let AWK take the same 415 * progmodes/cc-langs (c-label-kwds): Let AWK take the same
400 expression as the rest. 416 expression as the rest.
401 (c-nonlabel-token-key): Allow string literals for AWK. Refactor 417 (c-nonlabel-token-key): Allow string literals for AWK.
402 for the other modes. 418 Refactor for the other modes.
403 419
404 Large brace-block initialisation makes CC Mode slow: Fix. 420 Large brace-block initialisation makes CC Mode slow: Fix.
405 Tidy up and accelerate c-in-literal, etc. by using the 421 Tidy up and accelerate c-in-literal, etc. by using the c-parse-state
406 c-parse-state
407 routines. Limit backward searching in c-font-lock-enclosing.decl. 422 routines. Limit backward searching in c-font-lock-enclosing.decl.
408 423
409 * progmodes/cc-engine.el (c-state-pp-to-literal): Return the 424 * progmodes/cc-engine.el (c-state-pp-to-literal): Return the
410 pp-state and literal type in addition to the limits. 425 pp-state and literal type in addition to the limits.
411 (c-state-safe-place): New defun, extracted from 426 (c-state-safe-place): New defun, extracted from c-state-literal-at.
412 c-state-literal-at.
413 (c-state-literal-at): Use the above new defun. 427 (c-state-literal-at): Use the above new defun.
414 (c-slow-in-literal, c-fast-in-literal): Removed. 428 (c-slow-in-literal, c-fast-in-literal): Remove.
415 (c-in-literal, c-literal-limits): Amended to use 429 (c-in-literal, c-literal-limits): Amend to use c-state-pp-to-literal.
416 c-state-pp-to-literal.
417 430
418 * progmodes/cc-fonts.el (c-font-lock-enclosing-decls): Check for 431 * progmodes/cc-fonts.el (c-font-lock-enclosing-decls): Check for
419 being in a literal. Add a limit for backward searching. 432 being in a literal. Add a limit for backward searching.
@@ -487,8 +500,8 @@
4872011-12-10 Eli Zaretskii <eliz@gnu.org> 5002011-12-10 Eli Zaretskii <eliz@gnu.org>
488 501
489 * mail/rmailsum.el (rmail-header-summary): RFC2047 decode the 502 * mail/rmailsum.el (rmail-header-summary): RFC2047 decode the
490 `from' or `to' address before taking its substring. Fixes 503 `from' or `to' address before taking its substring.
491 incorrect display in Rmail summary buffer whereby an RFC2047 504 Fixes incorrect display in Rmail summary buffer whereby an RFC2047
492 encoded name is chopped in the middle of the encoded string, and 505 encoded name is chopped in the middle of the encoded string, and
493 thus displayed encoded. 506 thus displayed encoded.
494 507
@@ -707,8 +720,8 @@
707 (verilog-uvm-statement-re): Support UVM indentation and 720 (verilog-uvm-statement-re): Support UVM indentation and
708 highlighting, with old OVM keywords only. 721 highlighting, with old OVM keywords only.
709 (verilog-auto-tieoff, verilog-auto-tieoff-declaration): 722 (verilog-auto-tieoff, verilog-auto-tieoff-declaration):
710 Support AUTOTIEOFF creating non-wire data types. Suggested by Jonathan 723 Support AUTOTIEOFF creating non-wire data types.
711 Greenlaw. 724 Suggested by Jonathan Greenlaw.
712 (verilog-auto-insert-lisp, verilog-delete-to-paren) 725 (verilog-auto-insert-lisp, verilog-delete-to-paren)
713 (verilog-forward-sexp-cmt, verilog-forward-sexp-ign-cmt) 726 (verilog-forward-sexp-cmt, verilog-forward-sexp-ign-cmt)
714 (verilog-inject-sense, verilog-read-inst-pins) 727 (verilog-inject-sense, verilog-read-inst-pins)
@@ -794,11 +807,11 @@
794 Andrew Drake. 807 Andrew Drake.
795 (verilog-auto-star-safe, verilog-delete-auto-star-implicit) 808 (verilog-auto-star-safe, verilog-delete-auto-star-implicit)
796 (verilog-inst-comment-re): Fix not deleting Interfaced comment 809 (verilog-inst-comment-re): Fix not deleting Interfaced comment
797 when expanding .* in interfaces, bug320. Reported by Pierre-David 810 when expanding .* in interfaces, bug320.
798 Pfister. 811 Reported by Pierre-David Pfister.
799 (verilog-read-module-name): Fix import statements between module 812 (verilog-read-module-name): Fix import statements between module
800 name and open parenthesis, bug317. Reported by Pierre-David 813 name and open parenthesis, bug317.
801 Pfister. 814 Reported by Pierre-David Pfister.
802 (verilog-simplify-range-expression): Fix simplification of 815 (verilog-simplify-range-expression): Fix simplification of
803 multiplications inside AUTOWIRE connections, bug303. 816 multiplications inside AUTOWIRE connections, bug303.
804 (verilog-auto-inst-port): Support parameter expansion in 817 (verilog-auto-inst-port): Support parameter expansion in
@@ -1052,8 +1065,7 @@
1052 1065
10532011-11-19 Andreas Schwab <schwab@linux-m68k.org> 10662011-11-19 Andreas Schwab <schwab@linux-m68k.org>
1054 1067
1055 * progmodes/sh-script.el (sh-assignment-regexp): Add entry for 1068 * progmodes/sh-script.el (sh-assignment-regexp): Add entry for bash.
1056 bash.
1057 1069
10582011-11-19 Juri Linkov <juri@jurta.org> 10702011-11-19 Juri Linkov <juri@jurta.org>
1059 1071
@@ -1178,8 +1190,7 @@
1178 1190
1179 * window.el (window-resize, delete-window, split-window): 1191 * window.el (window-resize, delete-window, split-window):
1180 Replace window-splits by window-combination-resize. 1192 Replace window-splits by window-combination-resize.
1181 * cus-start.el (window-splits): Replace by 1193 * cus-start.el (window-splits): Replace by window-combination-resize.
1182 window-combination-resize.
1183 1194
11842011-11-17 Glenn Morris <rgm@gnu.org> 11952011-11-17 Glenn Morris <rgm@gnu.org>
1185 1196
@@ -1244,8 +1255,7 @@
1244 * window.el (split-window, window-state-get-1) 1255 * window.el (split-window, window-state-get-1)
1245 (window-state-put-1, window-state-put-2): Rename occurrences of 1256 (window-state-put-1, window-state-put-2): Rename occurrences of
1246 window-nest to window-combination-limit. 1257 window-nest to window-combination-limit.
1247 * cus-start.el (window-nest): Rename to 1258 * cus-start.el (window-nest): Rename to window-combination-limit.
1248 window-combination-limit.
1249 1259
12502011-11-16 Chong Yidong <cyd@gnu.org> 12602011-11-16 Chong Yidong <cyd@gnu.org>
1251 1261
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 756010160d2..3d9b30bcbb3 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -571,6 +571,10 @@ in the last `cdr'."
571(defun completion--replace (beg end newtext) 571(defun completion--replace (beg end newtext)
572 "Replace the buffer text between BEG and END with NEWTEXT. 572 "Replace the buffer text between BEG and END with NEWTEXT.
573Moves point to the end of the new text." 573Moves point to the end of the new text."
574 ;; The properties on `newtext' include things like
575 ;; completions-first-difference, which we don't want to include
576 ;; upon insertion.
577 (set-text-properties 0 (length newtext) nil newtext)
574 ;; Maybe this should be in subr.el. 578 ;; Maybe this should be in subr.el.
575 ;; You'd think this is trivial to do, but details matter if you want 579 ;; You'd think this is trivial to do, but details matter if you want
576 ;; to keep markers "at the right place" and be robust in the face of 580 ;; to keep markers "at the right place" and be robust in the face of
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 02f933be367..2478253841f 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -512,6 +512,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
512;; GNU/Linux (Debian, Suse): /bin:/usr/bin 512;; GNU/Linux (Debian, Suse): /bin:/usr/bin
513;; FreeBSD: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"! 513;; FreeBSD: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"!
514;; IRIX64: /usr/bin 514;; IRIX64: /usr/bin
515;;;###tramp-autoload
515(defcustom tramp-remote-path 516(defcustom tramp-remote-path
516 '(tramp-default-remote-path "/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin" 517 '(tramp-default-remote-path "/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin"
517 "/local/bin" "/local/freeware/bin" "/local/gnu/bin" 518 "/local/bin" "/local/freeware/bin" "/local/gnu/bin"
diff --git a/lisp/window.el b/lisp/window.el
index 8eb0ac3575b..54e5ec9c74c 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -3568,10 +3568,7 @@ specific buffers."
3568 )) 3568 ))
3569 3569
3570;;; Window states, how to get them and how to put them in a window. 3570;;; Window states, how to get them and how to put them in a window.
3571(defvar window-state-ignored-parameters '(quit-restore) 3571(defun window--state-get-1 (window &optional ignore)
3572 "List of window parameters ignored by `window-state-get'.")
3573
3574(defun window--state-get-1 (window &optional markers)
3575 "Helper function for `window-state-get'." 3572 "Helper function for `window-state-get'."
3576 (let* ((type 3573 (let* ((type
3577 (cond 3574 (cond
@@ -3589,12 +3586,27 @@ specific buffers."
3589 (normal-width . ,(window-normal-size window t)) 3586 (normal-width . ,(window-normal-size window t))
3590 (combination-limit . ,(window-combination-limit window)) 3587 (combination-limit . ,(window-combination-limit window))
3591 ,@(let (list) 3588 ,@(let (list)
3592 (dolist (parameter (window-parameters window)) 3589 ;; Make copies of persistent window parameters whose cdr
3593 (unless (memq (car parameter) 3590 ;; is either t or, when IGNORE is non-nil, is either nil
3594 window-state-ignored-parameters) 3591 ;; or `state'.
3595 (setq list (cons parameter list)))) 3592 (dolist (pers window-persistent-parameters)
3596 (unless (window-parameter window 'clone-of) 3593 (when (and (consp pers)
3597 ;; Make a clone-of parameter. 3594 (or (eq (cdr pers) t)
3595 (and (memq (cdr pers) '(state nil))
3596 (not ignore))))
3597 (let ((par (assq (car pers) (window-parameters window))))
3598 (setq list (cons (cons (car pers) (when par (cdr par)))
3599 list)))))
3600 ;; Save `clone-of' parameter unless IGNORE or
3601 ;; `window-persistent-parameters' prevail.
3602 (when (and (not (assq 'clone-of (window-parameters window)))
3603 (let ((clone-of
3604 (assq 'clone-of
3605 window-persistent-parameters)))
3606 (when clone-of
3607 (if ignore
3608 (eq (cdr clone-of) t)
3609 (memq (cdr clone-of) '(state nil))))))
3598 (setq list (cons (cons 'clone-of window) list))) 3610 (setq list (cons (cons 'clone-of window) list)))
3599 (when list 3611 (when list
3600 `((parameters . ,list)))) 3612 `((parameters . ,list))))
@@ -3616,30 +3628,31 @@ specific buffers."
3616 (scroll-bars . ,(window-scroll-bars window)) 3628 (scroll-bars . ,(window-scroll-bars window))
3617 (vscroll . ,(window-vscroll window)) 3629 (vscroll . ,(window-vscroll window))
3618 (dedicated . ,(window-dedicated-p window)) 3630 (dedicated . ,(window-dedicated-p window))
3619 (point . ,(if markers (copy-marker point) point)) 3631 (point . ,(if ignore point (copy-marker point)))
3620 (start . ,(if markers (copy-marker start) start)) 3632 (start . ,(if ignore start (copy-marker start)))
3621 ,@(when mark 3633 ,@(when mark
3622 `((mark . ,(if markers 3634 `((mark . ,(if ignore
3623 (copy-marker mark) mark))))))))))) 3635 mark (copy-marker mark))))))))))))
3624 (tail 3636 (tail
3625 (when (memq type '(vc hc)) 3637 (when (memq type '(vc hc))
3626 (let (list) 3638 (let (list)
3627 (setq window (window-child window)) 3639 (setq window (window-child window))
3628 (while window 3640 (while window
3629 (setq list (cons (window--state-get-1 window markers) list)) 3641 (setq list (cons (window--state-get-1 window ignore) list))
3630 (setq window (window-right window))) 3642 (setq window (window-right window)))
3631 (nreverse list))))) 3643 (nreverse list)))))
3632 (append head tail))) 3644 (append head tail)))
3633 3645
3634(defun window-state-get (&optional window markers) 3646(defun window-state-get (&optional window ignore)
3635 "Return state of WINDOW as a Lisp object. 3647 "Return state of WINDOW as a Lisp object.
3636WINDOW can be any window and defaults to the root window of the 3648WINDOW can be any window and defaults to the root window of the
3637selected frame. 3649selected frame.
3638 3650
3639Optional argument MARKERS non-nil means use markers for sampling 3651Optional argument IGNORE non-nil means do not use markers for
3640positions like `window-point' or `window-start'. MARKERS should 3652sampling positions like `window-point' or `window-start' and do
3641be non-nil only if the value is used for putting the state back 3653not record parameters unless `window-persistent-parameters'
3642in the same session (note that markers slow down processing). 3654requests it. IGNORE should be non-nil when the return value
3655shall be written to a file and read back in another session.
3643 3656
3644The return value can be used as argument for `window-state-put' 3657The return value can be used as argument for `window-state-put'
3645to put the state recorded here into an arbitrary window. The 3658to put the state recorded here into an arbitrary window. The
@@ -3665,7 +3678,7 @@ value can be also stored on disk and read back in a new session."
3665 ;; These are probably not needed. 3678 ;; These are probably not needed.
3666 ,@(when (window-size-fixed-p window) `((fixed-height . t))) 3679 ,@(when (window-size-fixed-p window) `((fixed-height . t)))
3667 ,@(when (window-size-fixed-p window t) `((fixed-width . t)))) 3680 ,@(when (window-size-fixed-p window t) `((fixed-width . t))))
3668 (window--state-get-1 window markers))) 3681 (window--state-get-1 window ignore)))
3669 3682
3670(defvar window-state-put-list nil 3683(defvar window-state-put-list nil
3671 "Helper variable for `window-state-put'.") 3684 "Helper variable for `window-state-put'.")
@@ -3744,10 +3757,15 @@ value can be also stored on disk and read back in a new session."
3744 (state (cdr (assq 'buffer item)))) 3757 (state (cdr (assq 'buffer item))))
3745 (when combination-limit 3758 (when combination-limit
3746 (set-window-combination-limit window combination-limit)) 3759 (set-window-combination-limit window combination-limit))
3747 ;; Process parameters. 3760 ;; Assign saved window parameters. If a parameter's value is nil,
3761 ;; don't assign it unless the new window has it set already (which
3762 ;; shouldn't happen unless some `window-configuration-change-hook'
3763 ;; function installed it).
3748 (when parameters 3764 (when parameters
3749 (dolist (parameter parameters) 3765 (dolist (parameter parameters)
3750 (set-window-parameter window (car parameter) (cdr parameter)))) 3766 (when (or (cdr parameter)
3767 (window-parameter window (car parameter)))
3768 (set-window-parameter window (car parameter) (cdr parameter)))))
3751 ;; Process buffer related state. 3769 ;; Process buffer related state.
3752 (when state 3770 (when state
3753 ;; We don't want to raise an error here so we create a buffer if 3771 ;; We don't want to raise an error here so we create a buffer if
diff --git a/src/ChangeLog b/src/ChangeLog
index a989246335d..c27b4c69bb5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,4 @@
12012-01-15 Paul Eggert <eggert@cs.ucla.edu> 12012-01-17 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Fix integer width and related bugs (Bug#9874). 3 Fix integer width and related bugs (Bug#9874).
4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): 4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
@@ -788,6 +788,12 @@
788 rather than rolling our own approximation. 788 rather than rolling our own approximation.
789 (SCROLL_BAR_VEC_SIZE): Remove; not used. 789 (SCROLL_BAR_VEC_SIZE): Remove; not used.
790 790
7912012-01-16 Martin Rudalics <rudalics@gmx.at>
792
793 * window.c (Vwindow_persistent_parameters): New variable.
794 (Fset_window_configuration, save_window_save): Handle persistent
795 window parameters.
796
7912012-01-14 Eli Zaretskii <eliz@gnu.org> 7972012-01-14 Eli Zaretskii <eliz@gnu.org>
792 798
793 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid 799 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
diff --git a/src/window.c b/src/window.c
index 27e4914ad1a..edf60cd8ff3 100644
--- a/src/window.c
+++ b/src/window.c
@@ -57,7 +57,7 @@ static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window;
57static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; 57static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically;
58static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; 58static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command;
59static Lisp_Object Qsafe, Qabove, Qbelow; 59static Lisp_Object Qsafe, Qabove, Qbelow;
60static Lisp_Object Qauto_buffer_name; 60static Lisp_Object Qauto_buffer_name, Qclone_of, Qstate;
61 61
62static int displayed_window_lines (struct window *); 62static int displayed_window_lines (struct window *);
63static struct window *decode_window (Lisp_Object); 63static struct window *decode_window (Lisp_Object);
@@ -5412,6 +5412,7 @@ the return value is nil. Otherwise the value is t. */)
5412 { 5412 {
5413 Lisp_Object window; 5413 Lisp_Object window;
5414 Lisp_Object dead_windows = Qnil; 5414 Lisp_Object dead_windows = Qnil;
5415 register Lisp_Object tem, par, pers;
5415 register struct window *w; 5416 register struct window *w;
5416 register struct saved_window *p; 5417 register struct saved_window *p;
5417 struct window *root_window; 5418 struct window *root_window;
@@ -5545,7 +5546,28 @@ the return value is nil. Otherwise the value is t. */)
5545 w->vertical_scroll_bar_type = p->vertical_scroll_bar_type; 5546 w->vertical_scroll_bar_type = p->vertical_scroll_bar_type;
5546 w->dedicated = p->dedicated; 5547 w->dedicated = p->dedicated;
5547 w->combination_limit = p->combination_limit; 5548 w->combination_limit = p->combination_limit;
5548 w->window_parameters = p->window_parameters; 5549 /* Restore any window parameters that have been saved.
5550 Parameters that have not been saved are left alone. */
5551 for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem))
5552 {
5553 pers = XCAR (tem);
5554 if (CONSP (pers))
5555 {
5556 if (NILP (XCDR (pers)))
5557 {
5558 par = Fassq (XCAR (pers), w->window_parameters);
5559 if (CONSP (par) && !NILP (XCDR (par)))
5560 /* Reset a parameter to nil if and only if it
5561 has a non-nil association. Don't make new
5562 associations. */
5563 Fsetcdr (par, Qnil);
5564 }
5565 else
5566 /* Always restore a non-nil value. */
5567 Fset_window_parameter (window, XCAR (pers), XCDR (pers));
5568 }
5569 }
5570
5549 XSETFASTINT (w->last_modified, 0); 5571 XSETFASTINT (w->last_modified, 0);
5550 XSETFASTINT (w->last_overlay_modified, 0); 5572 XSETFASTINT (w->last_overlay_modified, 0);
5551 5573
@@ -5812,7 +5834,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5812{ 5834{
5813 register struct saved_window *p; 5835 register struct saved_window *p;
5814 register struct window *w; 5836 register struct window *w;
5815 register Lisp_Object tem; 5837 register Lisp_Object tem, pers, par;
5816 5838
5817 for (;!NILP (window); window = w->next) 5839 for (;!NILP (window); window = w->next)
5818 { 5840 {
@@ -5840,12 +5862,60 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5840 p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; 5862 p->vertical_scroll_bar_type = w->vertical_scroll_bar_type;
5841 p->dedicated = w->dedicated; 5863 p->dedicated = w->dedicated;
5842 p->combination_limit = w->combination_limit; 5864 p->combination_limit = w->combination_limit;
5843 p->window_parameters = w->window_parameters; 5865 p->window_parameters = Qnil;
5866
5867 if (!NILP (Vwindow_persistent_parameters))
5868 {
5869 /* Run cycle detection on Vwindow_persistent_parameters. */
5870 Lisp_Object tortoise, hare;
5871
5872 hare = tortoise = Vwindow_persistent_parameters;
5873 while (CONSP (hare))
5874 {
5875 hare = XCDR (hare);
5876 if (!CONSP (hare))
5877 break;
5878
5879 hare = XCDR (hare);
5880 tortoise = XCDR (tortoise);
5881
5882 if (EQ (hare, tortoise))
5883 /* Reset Vwindow_persistent_parameters to Qnil. */
5884 {
5885 Vwindow_persistent_parameters = Qnil;
5886 break;
5887 }
5888 }
5889
5890 for (tem = Vwindow_persistent_parameters; CONSP (tem);
5891 tem = XCDR (tem))
5892 {
5893 pers = XCAR (tem);
5894 /* Save values for persistent window parameters whose cdr
5895 is either nil or t. */
5896 if (CONSP (pers) && (NILP (XCDR (pers)) || EQ (XCDR (pers), Qt)))
5897 {
5898 par = Fassq (XCAR (pers), w->window_parameters);
5899 if (NILP (par))
5900 /* If the window has no value for the parameter,
5901 make one. */
5902 p->window_parameters = Fcons (Fcons (XCAR (pers), Qnil),
5903 p->window_parameters);
5904 else
5905 /* If the window has a value for the parameter,
5906 save it. */
5907 p->window_parameters = Fcons (Fcons (XCAR (par),
5908 XCDR (par)),
5909 p->window_parameters);
5910 }
5911 }
5912 }
5913
5844 if (!NILP (w->buffer)) 5914 if (!NILP (w->buffer))
5845 { 5915 {
5846 /* Save w's value of point in the window configuration. 5916 /* Save w's value of point in the window configuration. If w
5847 If w is the selected window, then get the value of point 5917 is the selected window, then get the value of point from
5848 from the buffer; pointm is garbage in the selected window. */ 5918 the buffer; pointm is garbage in the selected window. */
5849 if (EQ (window, selected_window)) 5919 if (EQ (window, selected_window))
5850 { 5920 {
5851 p->pointm = Fmake_marker (); 5921 p->pointm = Fmake_marker ();
@@ -6435,6 +6505,8 @@ syms_of_window (void)
6435 DEFSYM (Qabove, "above"); 6505 DEFSYM (Qabove, "above");
6436 DEFSYM (Qbelow, "below"); 6506 DEFSYM (Qbelow, "below");
6437 DEFSYM (Qauto_buffer_name, "auto-buffer-name"); 6507 DEFSYM (Qauto_buffer_name, "auto-buffer-name");
6508 DEFSYM (Qclone_of, "clone-of");
6509 DEFSYM (Qstate, "state");
6438 6510
6439 staticpro (&Vwindow_list); 6511 staticpro (&Vwindow_list);
6440 6512
@@ -6544,6 +6616,31 @@ retrieved via the function `window-combination-limit' and altered by the
6544function `set-window-combination-limit'. */); 6616function `set-window-combination-limit'. */);
6545 Vwindow_combination_limit = Qnil; 6617 Vwindow_combination_limit = Qnil;
6546 6618
6619 DEFVAR_LISP ("window-persistent-parameters", Vwindow_persistent_parameters,
6620 doc: /* Alist of persistent window parameters.
6621Parameters in this list are saved by `current-window-configuration' and
6622`window-state-get' and subsequently restored to their previous values by
6623`set-window-configuration' and `window-state-put'.
6624
6625The car of each entry of this alist is the symbol specifying the
6626parameter. The cdr is one of the following:
6627
6628The symbol `state' means the parameter is saved by `window-state-get'
6629provided its IGNORE argument is nil. `current-window-configuration'
6630does not save this parameter.
6631
6632nil means the parameter is saved by `current-window-configuration' and,
6633provided its IGNORE argument is nil, by `window-state-get'.
6634
6635t means the parameter is saved unconditionally by both
6636`current-window-configuration' and `window-state-get'. Parameters
6637without read syntax (like windows or frames) should not use that.
6638
6639Parameters not saved by `current-window-configuration' or
6640`window-state-get' are left alone by `set-window-configuration'
6641respectively are not installed by `window-state-put'. */);
6642 Vwindow_persistent_parameters = list1 (Fcons (Qclone_of, Qstate));
6643
6547 defsubr (&Sselected_window); 6644 defsubr (&Sselected_window);
6548 defsubr (&Sminibuffer_window); 6645 defsubr (&Sminibuffer_window);
6549 defsubr (&Swindow_minibuffer_p); 6646 defsubr (&Swindow_minibuffer_p);