diff options
| author | Paul Eggert | 2012-01-16 19:43:00 -0800 |
|---|---|---|
| committer | Paul Eggert | 2012-01-16 19:43:00 -0800 |
| commit | 78df1fb1d46d556bfc2698ca1802972b13613ba8 (patch) | |
| tree | 114803047bb77b06e149d9218cd4540b9f287e65 | |
| parent | 807f82fcebc7d946baa23f1d29ff5b0cf336f08e (diff) | |
| parent | 1b0880d5f1b478fe097aef8b702a5c7c70bd9f18 (diff) | |
| download | emacs-78df1fb1d46d556bfc2698ca1802972b13613ba8.tar.gz emacs-78df1fb1d46d556bfc2698ca1802972b13613ba8.zip | |
Merge from trunk.
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | admin/FOR-RELEASE | 4 | ||||
| -rw-r--r-- | doc/emacs/ChangeLog | 30 | ||||
| -rw-r--r-- | doc/emacs/anti.texi | 124 | ||||
| -rw-r--r-- | doc/emacs/display.texi | 18 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 8 | ||||
| -rw-r--r-- | doc/emacs/programs.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/xresources.texi | 926 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 9 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 93 | ||||
| -rw-r--r-- | lisp/ChangeLog | 82 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 4 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 1 | ||||
| -rw-r--r-- | lisp/window.el | 64 | ||||
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/window.c | 111 |
16 files changed, 619 insertions, 869 deletions
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-01-16 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * .bzrignore: Ignore etc/__pycache__. | ||
| 4 | |||
| 1 | 2011-12-17 Paul Eggert <eggert@cs.ucla.edu> | 5 | 2011-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 | |||
| 144 | emerge-xtra.texi | 144 | emerge-xtra.texi |
| 145 | entering.texi cyd | 145 | entering.texi cyd |
| 146 | files.texi cyd | 146 | files.texi cyd |
| 147 | fixit.texi | 147 | fixit.texi cyd |
| 148 | fortran-xtra.texi | 148 | fortran-xtra.texi |
| 149 | frames.texi cyd | 149 | frames.texi cyd |
| 150 | glossary.texi | 150 | glossary.texi |
| @@ -175,7 +175,7 @@ trouble.texi cyd | |||
| 175 | vc-xtra.texi cyd | 175 | vc-xtra.texi cyd |
| 176 | vc1-xtra.texi cyd | 176 | vc1-xtra.texi cyd |
| 177 | windows.texi cyd | 177 | windows.texi cyd |
| 178 | xresources.texi | 178 | xresources.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 @@ | |||
| 1 | 2012-01-16 Volker Sobek <reklov@live.com> (tiny change) | ||
| 2 | |||
| 3 | * programs.texi (Comment Commands): Typo (bug#10514). | ||
| 4 | |||
| 5 | 2012-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 | |||
| 1 | 2012-01-14 Chong Yidong <cyd@gnu.org> | 26 | 2012-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 |
| 10 | about downgrading to Emacs version 22.3. We hope you will enjoy the | 10 | about downgrading to Emacs version 23.4. We hope you will enjoy the |
| 11 | greater simplicity that results from the absence of many Emacs | 11 | greater 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 | ||
| 17 | We have switched to a character representation specially designed for | ||
| 18 | Emacs. Rather than forcing all the widely used scripts into artificial | ||
| 19 | alignment, as Unicode does, Emacs treats them all equally, giving | ||
| 20 | each one a place in the space of character codes. We have eliminated | ||
| 21 | the confusing practice, in Emacs 23, whereby one character can belong | ||
| 22 | to multiple character sets. Now each script has its own variant, and | ||
| 23 | they all are different as far as Emacs is concerned. For example, | ||
| 24 | there's a Latin-1 c-cedilla character, and there's a Latin-2 | ||
| 25 | c-cedilla; searching a buffer for the Latin-1 variant only finds that | ||
| 26 | variant, but not the others. | ||
| 27 | |||
| 28 | @item | ||
| 29 | Emacs now uses its own special internal encoding for non-@acronym{ASCII} | ||
| 30 | characters, known as @samp{emacs-mule}. This was imperative to | ||
| 31 | support several different variants of the same character, each one | ||
| 32 | belonging to its own script: @samp{emacs-mule} marks each character | ||
| 33 | with its script, to better discern them from one another. | ||
| 34 | |||
| 35 | @item | ||
| 36 | For simplicity, the functions @code{encode-coding-region} and | ||
| 37 | @code{decode-coding-region} no longer accept an argument saying where | ||
| 38 | to store the result of their conversions. The result always replaces | ||
| 39 | the original, so there's no need to look for it elsewhere. | ||
| 40 | |||
| 41 | @item | ||
| 42 | Emacs no longer performs font anti-aliasing. If your fonts look ugly, | ||
| 43 | try choosing a larger font and increasing the screen resolution. | ||
| 44 | Admittedly, this becomes difficult as you go further back in time, | ||
| 45 | since available screen resolutions will decrease. | ||
| 46 | |||
| 47 | @item | ||
| 48 | The Fontconfig font library is no longer supported. To specify a | ||
| 49 | font, you must use an XLFD (X Logical Font Descriptor). The other | ||
| 50 | ways of specifying fonts---so-called ``Fontconfig'' and ``GTK'' font | ||
| 51 | names---are redundant, so they have been removed. | ||
| 52 | |||
| 53 | @item | ||
| 54 | Transient Mark mode is now disabled by default. Furthermore, some | ||
| 55 | commands that operate specifically on the region when it is active and | ||
| 56 | Transient Mark mode is enabled (such as @code{fill-paragraph} | ||
| 57 | @code{ispell-word}, and @code{indent-for-tab-command}), no longer do | ||
| 58 | so. | ||
| 59 | |||
| 60 | @item | ||
| 61 | Holding @key{shift} while typing a motion command no longer creates a | ||
| 62 | temporarily active region, since that's inconsistent with how Emacs | ||
| 63 | normally handles keybindings. The variable @code{shift-select-mode} | ||
| 64 | has been deleted. You can, however, still create temporarily active | ||
| 65 | regions by dragging the mouse. | ||
| 66 | |||
| 67 | @item | ||
| 68 | The line motion commands, @kbd{C-n} and @kbd{C-p}, now move by logical | ||
| 69 | text lines, not screen lines. Even if a long text line is continued | ||
| 70 | over multiple screen lines, @kbd{C-n} and @kbd{C-p} treat it as a | ||
| 71 | single line, because that's ultimately what it is. | ||
| 72 | |||
| 73 | @item | ||
| 74 | Visual Line mode, which provides ``word wrap'' functionality, has been | ||
| 75 | removed. You can still use Long Lines mode to gain an approximation | ||
| 76 | of word wrapping, though this has some drawbacks---for instance, | ||
| 77 | syntax 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 | ||
| 82 | center of the window, instead of cycling through the center, top, and | ||
| 83 | bottom 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 | ||
| 85 | recentered the line. | ||
| 86 | |||
| 87 | @item | ||
| 88 | The way Emacs generates possible minibuffer completions is now much | ||
| 89 | simpler to understand. It matches alternatives to the text before | ||
| 90 | point, ignoring the text after point; it also does not attempt to | ||
| 91 | perform partial completion if the first completion attempt fails. | ||
| 92 | |||
| 93 | @item | ||
| 94 | Typing @kbd{M-n} at the start of the minibuffer history list no longer | ||
| 95 | attempts to generate guesses of possible minibuffer input. It instead | ||
| 96 | does the straightforward thing, by issuing the message @samp{End of | ||
| 97 | history; no default available}. | ||
| 98 | |||
| 99 | @item | ||
| 100 | Individual buffers can no longer display faces specially. The text | ||
| 101 | scaling commands @kbd{C-x C-+}, @kbd{C-x C--}, and @kbd{C-x C-0} have | ||
| 102 | been removed, and so has the buffer face menu bound to | ||
| 103 | @kbd{S-down-mouse-1}. | ||
| 104 | |||
| 105 | @item | ||
| 106 | VC no longer supports fileset-based operations on distributed version | ||
| 107 | control systems (DVCSs) such as Arch, Bazaar, Subversion, Mercurial, | ||
| 108 | and Git. For instance, multi-file commits will be performed by | ||
| 109 | committing one file at a time. As you go further back in time, we | ||
| 110 | will remove DVCS support entirely, so you should migrate your projects | ||
| 111 | to CVS. | ||
| 112 | |||
| 113 | @item | ||
| 114 | Rmail now uses a special file format, Babyl format, specifically designed | ||
| 115 | for storing and editing mail. When you visit a file in Rmail, or get new | ||
| 116 | mail, Rmail converts it automatically to Babyl format. | ||
| 117 | |||
| 118 | @item | ||
| 119 | Emacs can no longer display frames on X windows and text terminals | ||
| 120 | (ttys) simultaneously. If you start Emacs as an X application, it | ||
| 121 | can only create X frames; if you start Emacs on a tty, it can only use | ||
| 122 | that tty. No more confusion about which type of frame | ||
| 123 | @command{emacsclient} will use in any given Emacs session! | ||
| 124 | |||
| 125 | @item | ||
| 126 | Emacs can no longer be started as a daemon. You can be sure that if | ||
| 127 | you don't see Emacs, then it's not running. | ||
| 128 | |||
| 129 | @item | 15 | @item |
| 130 | Emacs has added support for many soon-to-be-non-obsolete platforms, | 16 | FIXME |
| 131 | including VMS, DECstation, SCO Unix, and systems lacking alloca. | ||
| 132 | Support for Sun windows has been added. | ||
| 133 | 17 | ||
| 134 | @item | 18 | @item |
| 135 | To keep up with decreasing computer memory capacity and disk space, many | 19 | To keep up with decreasing computer memory capacity and disk space, many |
| 136 | other functions and files have been eliminated in Emacs 22.3. | 20 | other 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. | |||
| 489 | changes for future Emacs sessions. @xref{Face Customization}. A face | 489 | changes for future Emacs sessions. @xref{Face Customization}. A face |
| 490 | does not have to specify every single attribute; often it inherits | 490 | does not have to specify every single attribute; often it inherits |
| 491 | most attributes from another face. Any ultimately unspecified | 491 | most attributes from another face. Any ultimately unspecified |
| 492 | attribute is taken from a face named @code{default}, whose attributes | 492 | attribute is taken from the face named @code{default}. |
| 493 | are all specified. The @code{default} face is the default for | 493 | |
| 494 | displaying 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 |
| 495 | background color. | 495 | of its attributes are specified. Its background color is also used as |
| 496 | the frame's background color. | ||
| 497 | |||
| 498 | @cindex cursor face | ||
| 499 | Another special face is the @code{cursor} face. On graphical | ||
| 500 | displays, the background color of this face is used to draw the text | ||
| 501 | cursor. None of the other attributes of this face have any effect; | ||
| 502 | the foreground color for text under the cursor is taken from the | ||
| 503 | background color of the underlying text. On text terminals, the | ||
| 504 | appearance of the text cursor is determined by the terminal, not by | ||
| 505 | the @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 |
| 498 | face. @xref{Resources}. | 508 | face. @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 | ||
| 1132 | GTK resources | 1131 | GTK 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 | ||
| 1138 | Emacs and Mac OS / GNUstep | 1138 | Emacs 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. | |||
| 952 | comment on the current line, along with the whitespace before it. | 952 | comment on the current line, along with the whitespace before it. |
| 953 | Since the comment is saved to the kill ring, you can reinsert it on | 953 | Since the comment is saved to the kill ring, you can reinsert it on |
| 954 | another line by moving to the end of that line, doing @kbd{C-y}, and | 954 | another line by moving to the end of that line, doing @kbd{C-y}, and |
| 955 | then @kbd{M-;} to realign the command. You can achieve the same | 955 | then @kbd{M-;} to realign the comment. You can achieve the same |
| 956 | effect as @kbd{C-u M-;} by typing @kbd{M-x comment-kill} | 956 | effect 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 |
| 958 | subroutine when it is given a prefix argument). | 958 | subroutine 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 |
| 9 | resources, as is usual for programs that use X. On MS-Windows, you | 9 | resources, as is usual for programs that use X. |
| 10 | can 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 | 12 | graphical widgets, such as the menu-bar, scroll-bar, and dialog boxes, | |
| 13 | When Emacs is built using an ``X toolkit'', such as Lucid or | 13 | is determined by |
| 14 | LessTif, you need to use X resources to customize the appearance of | ||
| 15 | the widgets, including the menu-bar, scroll-bar, and dialog boxes. | ||
| 16 | This is because the libraries that implement these don't provide for | ||
| 17 | customization 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''. |
| 23 | resource specifications. For full documentation, see the online | ||
| 24 | manual. | ||
| 25 | |||
| 26 | @c Add xref for LessTif/Motif menu resources. | ||
| 27 | @end iftex | 19 | @end iftex |
| 20 | When Emacs is built without GTK+ support, the appearance of these | ||
| 21 | widgets is determined by additional X resources. | ||
| 28 | 22 | ||
| 23 | On MS-Windows, you can customize some of the same aspects using the | ||
| 24 | system 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 | |||
| 63 | using the @samp{-xrm} command line option, as explained below.) | 58 | using 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 |
| 66 | for a collection of related options. Each resource specification | 61 | for a collection of related options. The order in which the lines |
| 62 | appear in the file does not matter. Each resource specification | ||
| 67 | consists of a @dfn{program name} and a @dfn{resource name}. Case | 63 | consists of a @dfn{program name} and a @dfn{resource name}. Case |
| 68 | distinctions are significant in each of these names. Here is an | 64 | distinctions are significant in each of these names. Here is an |
| 69 | example: | 65 | example: |
| 70 | 66 | ||
| 71 | @example | 67 | @example |
| 72 | emacs.borderWidth: 2 | 68 | emacs.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 |
| 77 | resource applies. For Emacs, this is normally @samp{emacs}. To | 72 | resource applies. For Emacs, this is normally @samp{emacs}. To |
| 78 | specify a definition that applies to all instances of Emacs, | 73 | specify a definition that applies to all instances of Emacs, |
| 79 | regardless of the name of the Emacs executable, use @samp{Emacs}. | 74 | regardless 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, |
| 82 | Emacs recognizes a @samp{borderWidth} resource that controls the width | 77 | Emacs recognizes a @samp{cursorColor} resource that controls the color |
| 83 | of the external border for graphical frames. | 78 | of 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 |
| 88 | resource, which controls the width of the internal border for | 83 | Resources}). Instead of using a resource name, you can use a class |
| 89 | graphical frames. Instead of using a resource name, you can use a | 84 | name to specify the default value for all resources in that class, |
| 90 | class name to specify the same value for all resources in that class. | 85 | like this: |
| 91 | Here's an example: | ||
| 92 | |||
| 93 | @example | ||
| 94 | emacs.BorderWidth: 2 | ||
| 95 | @end example | ||
| 96 | |||
| 97 | If you specify a value for a class, it becomes the default for all | ||
| 98 | resources in that class. You can specify values for individual | ||
| 99 | resources as well; these override the class value, for those | ||
| 100 | particular resources. The following example specifies 2 as the | ||
| 101 | default width for all borders, but overrides this value with 4 for the | ||
| 102 | external border: | ||
| 103 | 86 | ||
| 104 | @example | 87 | @example |
| 105 | emacs.BorderWidth: 2 | 88 | emacs.Foreground: dark green |
| 106 | emacs.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. | ||
| 111 | One way to experiment with the effect of different resource settings | ||
| 112 | is to use the @code{editres} program. See the @code{editres} man page | ||
| 113 | for 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 |
| 117 | specify the @samp{-Q} (or @samp{--quick}) command-line argument | 93 | Emacs 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, |
| 166 | Emacs, not counting those for the appearance of the menu bar, each | 142 | excluding those that control the appearance of graphical widgets like |
| 167 | with the class that it belongs to: | 143 | the menu bar: |
| 168 | 144 | ||
| 169 | @table @asis | 145 | @table @asis |
| 170 | @item @code{background} (class @code{Background}) | 146 | @item @code{background} (class @code{Background}) |
| 171 | Background color name. | 147 | Background color (@pxref{Colors}). |
| 172 | 148 | ||
| 173 | @item @code{bitmapIcon} (class @code{BitmapIcon}) | 149 | @item @code{bitmapIcon} (class @code{BitmapIcon}) |
| 174 | Tell the window manager to display the Emacs icon if @samp{on}; don't | 150 | Tell the window manager to display the Emacs icon if @samp{on}; don't |
| 175 | do so if @samp{off}. (The icon is usually shown in the ``taskbar'' on | 151 | do so if @samp{off}. @xref{Icons X}, for a description of the icon. |
| 176 | a graphical desktop.) | ||
| 177 | 152 | ||
| 153 | @ifnottex | ||
| 178 | @item @code{borderColor} (class @code{BorderColor}) | 154 | @item @code{borderColor} (class @code{BorderColor}) |
| 179 | Color name for the external border. | 155 | Color of the frame's external border. This has no effect if Emacs is |
| 156 | compiled with GTK+ support. | ||
| 180 | 157 | ||
| 181 | @ifnottex | ||
| 182 | @item @code{borderWidth} (class @code{BorderWidth}) | 158 | @item @code{borderWidth} (class @code{BorderWidth}) |
| 183 | Width in pixels of the external border. | 159 | Width of the frame's external border, in pixels. This has no effect |
| 160 | if 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}) |
| 187 | Color name for text cursor (point). | 164 | Text cursor color. If this resource is specified when Emacs starts |
| 165 | up, Emacs sets its value as the background color of the @code{cursor} | ||
| 166 | face (@pxref{Faces}). | ||
| 188 | 167 | ||
| 189 | @ifnottex | ||
| 190 | @item @code{cursorBlink} (class @code{CursorBlink}) | 168 | @item @code{cursorBlink} (class @code{CursorBlink}) |
| 191 | Specifies whether to make the cursor blink. The default is @samp{on}. Use | 169 | If 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 | 171 | Display}). |
| 194 | 172 | ||
| 195 | @item @code{font} (class @code{Font}) | 173 | @item @code{font} (class @code{Font}) |
| 196 | Font name for the @code{default} font. @xref{Fonts}. You can also | 174 | Font name for the @code{default} face (@pxref{Fonts}). You can also |
| 197 | specify a fontset name (@pxref{Fontsets}). | 175 | specify a fontset name (@pxref{Fontsets}). |
| 198 | 176 | ||
| 199 | @item @code{fontBackend} (class @code{FontBackend}) | 177 | @item @code{fontBackend} (class @code{FontBackend}) |
| 200 | The backend(s) to use for drawing fonts; if multiple backends are | 178 | Comma-delimited list of backend(s) to use for drawing fonts, in order |
| 201 | specified, they must be comma-delimited and given in order of | 179 | of precedence. For instance, the value @samp{x,xft} tells Emacs to |
| 202 | precedence. On X, for instance, the value @samp{x,xft} tells Emacs to | ||
| 203 | draw fonts using the X core font driver, falling back on the Xft font | 180 | draw fonts using the X core font driver, falling back on the Xft font |
| 204 | driver if that fails. Normally, you can leave this resource unset, in | 181 | driver if that fails. Normally, you should leave this resource unset, |
| 205 | which case Emacs tries using all font backends available on your | 182 | in which case Emacs tries using all available font backends. |
| 206 | graphical device. | ||
| 207 | 183 | ||
| 208 | @item @code{foreground} (class @code{Foreground}) | 184 | @item @code{foreground} (class @code{Foreground}) |
| 209 | Color name for text. | 185 | Default foreground color for text. |
| 210 | 186 | ||
| 211 | @item @code{geometry} (class @code{Geometry}) | 187 | @item @code{geometry} (class @code{Geometry}) |
| 212 | Window size and position. Be careful not to specify this resource as | 188 | Window size and position. The value should be a size and position |
| 213 | @samp{emacs*geometry}, because that may affect individual menus as well | 189 | specification, of the same form as in the @samp{-g} or |
| 214 | as the Emacs frame itself. | 190 | @samp{--geometry} command-line option (@pxref{Window Size X}). |
| 215 | 191 | ||
| 216 | If this resource specifies a position, that position applies only to the | 192 | The size applies to all frames in the Emacs session, but the position |
| 217 | initial Emacs frame (or, in the case of a resource for a specific frame | 193 | applies only to the initial Emacs frame (or, in the case of a resource |
| 218 | name, only that frame). However, the size, if specified here, applies to | 194 | for a specific frame name, only that frame). |
| 219 | all frames. | 195 | |
| 196 | |||
| 197 | Be careful not to specify this resource as @samp{emacs*geometry}, as | ||
| 198 | that 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}) |
| 223 | The desired fullscreen size. The value can be one of @code{fullboth}, | 201 | The 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 |
| 225 | the command-line options @samp{-fs}, @samp{-mm}, @samp{-fw}, and @samp{-fh} | 203 | correspond 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 | 205 | applies to the initial frame only. | |
| 228 | Note 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}) |
| 232 | Name to display in the icon. | 209 | Name to display in the icon. |
| 233 | 210 | ||
| 234 | @item @code{internalBorder} (class @code{BorderWidth}) | 211 | @item @code{internalBorder} (class @code{BorderWidth}) |
| 235 | Width in pixels of the internal border. | 212 | Width 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 | 217 | Additional space between lines, in pixels. |
| 240 | Additional 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 |
| 244 | Give frames menu bars if @samp{on}; don't have menu bars if @samp{off}. | 221 | If 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 | ||
| 251 | for 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}) |
| 255 | If @samp{none}, don't make a minibuffer in this frame. | 226 | If @samp{none}, Emacs will not make a minibuffer in this frame; it |
| 256 | It will use a separate minibuffer frame instead. | 227 | will 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}) |
| 264 | Color of the mouse cursor. | 235 | Color of the mouse cursor. This has no effect in many graphical |
| 236 | desktop environments, as they do not let Emacs change the mouse cursor | ||
| 237 | this 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}) |
| 272 | Switch foreground and background default colors if @samp{on}, use colors as | 245 | Switch foreground and background default colors if @samp{on}, use colors as |
| 273 | specified if @samp{off}. | 246 | specified 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 |
| 283 | The scroll bar width in pixels, equivalent to the frame parameter | 255 | The 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 |
| 257 | compiled 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 |
| 309 | Number of lines to reserve for the tool bar. A zero value suppresses | 283 | If the value of this resource is @samp{off} or @samp{false} or |
| 310 | the 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}). |
| 311 | is non-zero and @code{auto-resize-tool-bars} is non-@code{nil}, the | ||
| 312 | tool bar's size will be changed automatically so that all tool bar | ||
| 313 | items are visible. If the value of @code{auto-resize-tool-bars} is | ||
| 314 | @code{grow-only}, the tool bar expands automatically, but does not | ||
| 315 | contract automatically. To contract the tool bar, you must redraw the | ||
| 316 | frame by entering @kbd{C-l}. For the Gtk+ tool bar, any non-zero | ||
| 317 | value 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 |
| 323 | Turn off use of X input methods (XIM) if @samp{false} or @samp{off}. | 290 | Disable use of X input methods (XIM) if @samp{false} or @samp{off}. |
| 324 | This is only relevant if your Emacs is actually built with XIM | 291 | This is only relevant if your Emacs is built with XIM support. It |
| 325 | support. It is potentially useful to turn off XIM for efficiency, | 292 | might be useful to turn off XIM on slow X client/server links. |
| 326 | especially slow X client/server links. | ||
| 327 | 293 | ||
| 328 | @item @code{verticalScrollBars} (class @code{ScrollBars}) | 294 | @item @code{verticalScrollBars} (class @code{ScrollBars}) |
| 329 | Give frames scroll bars if @samp{on}; don't have scroll bars if | 295 | Give 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}) |
| 334 | Specify the ``visual'' that X should use. This tells X how to handle | 300 | The @dfn{visual class} for X color display. If specified, the value |
| 335 | colors. | 301 | should start with one of @samp{TrueColor}, @samp{PseudoColor}, |
| 336 | 302 | @samp{DirectColor}, @samp{StaticColor}, @samp{GrayScale}, and | |
| 337 | The 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}, | 304 | is 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. | ||
| 341 | Most terminals only allow a few ``visuals,'' and the @samp{dpyinfo} | ||
| 342 | program 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 |
| 350 | faces (@pxref{Faces}): | 312 | recommend customizing faces from within Emacs, instead of using X |
| 351 | 313 | resources. @xref{Face Customization}. | |
| 352 | @table @code | ||
| 353 | @item @var{face}.attributeForeground | ||
| 354 | Foreground color for face @var{face}. | ||
| 355 | @item @var{face}.attributeBackground | ||
| 356 | Background color for face @var{face}. | ||
| 357 | @item @var{face}.attributeUnderline | ||
| 358 | Underline flag for face @var{face}. Use @samp{on} or @samp{true} for | ||
| 359 | yes. | ||
| 360 | @item @var{face}.attributeStrikeThrough | ||
| 361 | @itemx @var{face}.attributeOverline | ||
| 362 | @itemx @var{face}.attributeBox | ||
| 363 | @itemx @var{face}.attributeInverse | ||
| 364 | Likewise, for other boolean font attributes. | ||
| 365 | @item @var{face}.attributeStipple | ||
| 366 | The 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 | ||
| 369 | The background pixmap for the face @var{face}. Should be a name of a | ||
| 370 | pixmap file or @code{false}. | ||
| 371 | @item @var{face}.attributeFont | ||
| 372 | Font name (full XFD name or valid X abbreviation) for face @var{face}. | ||
| 373 | Instead 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 | ||
| 377 | select a font through these separate attributes: | ||
| 378 | |||
| 379 | @table @code | ||
| 380 | @item @var{face}.attributeFamily | ||
| 381 | Font family for face @var{face}. | ||
| 382 | @item @var{face}.attributeHeight | ||
| 383 | Height of the font to use for face @var{face}: either an integer | ||
| 384 | specifying the height in units of 1/10@dmn{pt}, or a floating point | ||
| 385 | number that specifies a scale factor to scale the underlying face's | ||
| 386 | default font, or a function to be called with the default height which | ||
| 387 | will return a new height. | ||
| 388 | @item @var{face}.attributeWidth | ||
| 389 | @itemx @var{face}.attributeWeight | ||
| 390 | @itemx @var{face}.attributeSlant | ||
| 391 | Each of these resources corresponds to a like-named font attribute, | ||
| 392 | and you write the resource value the same as the symbol you would use | ||
| 393 | for the font attribute value. | ||
| 394 | @item @var{face}.attributeBold | ||
| 395 | Bold flag for face @var{face}---instead of @code{attributeWeight}. Use @samp{on} or @samp{true} for | ||
| 396 | yes. | ||
| 397 | @item @var{face}.attributeItalic | ||
| 398 | Italic 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 | 323 | you can use X resources to customize the appearance of the menu bar, |
| 409 | with the Lucid menu widgets, then the menu bar is a separate widget and | 324 | pop-up menus, and dialog boxes. The resources for the menu bar fall |
| 410 | has its own resources. The resource names contain @samp{pane.menubar} | 325 | in the @samp{pane.menubar} class (following, as always, either the |
| 411 | (following, as always, the name of the Emacs invocation, or @samp{Emacs}, | 326 | name of the Emacs executable or @samp{Emacs} for all Emacs |
| 412 | which stands for all Emacs invocations). Specify them like this: | 327 | invocations). 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. |
| 415 | Emacs.pane.menubar.@var{resource}: @var{value} | ||
| 416 | @end example | ||
| 417 | |||
| 418 | @noindent | ||
| 419 | For example, to specify the font @samp{Courier-12} for the menu-bar items, | ||
| 420 | write this: | ||
| 421 | @end ifnottex | ||
| 422 | @iftex | ||
| 423 | If the Emacs installed at your site was built to use the X toolkit | ||
| 424 | with the Lucid menu widgets, then the menu bar is a separate widget | ||
| 425 | and 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} |
| 431 | Emacs.pane.menubar.font: Courier-12 | 332 | font (@pxref{Fonts}), write this: |
| 432 | @end example | ||
| 433 | |||
| 434 | @noindent | ||
| 435 | To specify a font, use fontconfig font names as values to the @code{font} | ||
| 436 | resource, or old style names: | ||
| 437 | 333 | ||
| 438 | @example | 334 | @example |
| 439 | Emacs.pane.menubar.font: lucidasanstypewriter-10 | 335 | Emacs.pane.menubar.font: Courier-12 |
| 440 | @end example | 336 | @end example |
| 441 | 337 | ||
| 442 | @noindent | 338 | @noindent |
| 443 | Emacs first tries to open the font as an old style font, and if that fails | 339 | Lucid widgets can display multilingual text in your locale. To enable |
| 444 | as an fontconfig font. In rare cases, Emacs might do the wrong thing. | 340 | this, specify a @code{fontSet} resource instead of a @code{font} |
| 445 | 341 | resource. @xref{Fontsets}. If both @code{font} and @code{fontSet} | |
| 446 | @noindent | 342 | resources are specified, the @code{fontSet} resource is used. |
| 447 | The Lucid menus can display multilingual text in your locale with old style | ||
| 448 | fonts. 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 | 344 | Here is a list of resources for menu bars, pop-up menus, and dialogs: |
| 455 | Resources for @emph{non-menubar} toolkit pop-up menus have | ||
| 456 | @samp{menu*} instead of @samp{pane.menubar}. For example, to specify | ||
| 457 | the font @samp{8x16} for the pop-up menu items, write this: | ||
| 458 | |||
| 459 | @example | ||
| 460 | Emacs.menu*.font: 8x16 | ||
| 461 | @end example | ||
| 462 | |||
| 463 | @noindent | ||
| 464 | For dialog boxes, use @samp{dialog*}: | ||
| 465 | |||
| 466 | @example | ||
| 467 | Emacs.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 |
| 476 | Fontset for menu item text. | 350 | Fontset for menu item text. |
| 477 | @item foreground | 351 | @item foreground |
| 478 | Color of the foreground. | 352 | Foreground color. |
| 479 | @item background | 353 | @item background |
| 480 | Color of the background. | 354 | Background color. |
| 481 | @item buttonForeground | 355 | @item buttonForeground |
| 482 | In the menu bar, the color of the foreground for a selected item. | 356 | Foreground color for a selected item. |
| 483 | @ifnottex | 357 | @ifnottex |
| 484 | @item horizontalSpacing | 358 | @item horizontalSpacing |
| 485 | Horizontal spacing in pixels between items. Default is 3. | 359 | Horizontal spacing in pixels between items. Default is 3. |
| @@ -489,59 +363,51 @@ Vertical spacing in pixels between items. Default is 2. | |||
| 489 | Horizontal spacing between the arrow (which indicates a submenu) and | 363 | Horizontal spacing between the arrow (which indicates a submenu) and |
| 490 | the associated text. Default is 10. | 364 | the associated text. Default is 10. |
| 491 | @item shadowThickness | 365 | @item shadowThickness |
| 492 | Thickness of shadow line around the widget. Default is 1. | 366 | Thickness of shadow lines for 3D buttons, arrows, and other graphical |
| 493 | 367 | elements. Default is 1. | |
| 494 | Also determines the thickness of shadow lines around other objects, | ||
| 495 | for instance 3D buttons and arrows. If you have the impression that | ||
| 496 | the arrows in the menus do not stand out clearly enough or that the | ||
| 497 | difference between ``in'' and ``out'' buttons is difficult to see, set | ||
| 498 | this to 2. If you have no problems with visibility, the default | ||
| 499 | probably looks better. The background color may also have some effect | ||
| 500 | on the contrast. | ||
| 501 | @end ifnottex | 368 | @end ifnottex |
| 502 | @item margin | 369 | @item margin |
| 503 | The margin of the menu bar, in characters. Default is 1. | 370 | Margin 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 |
| 513 | with the LessTif or Motif widgets, then the menu bar, the dialog | 379 | Motif widgets, you can use X resources to customize the appearance of |
| 514 | boxes, the pop-up menus, and the file-selection box are separate | 380 | the menu bar, pop-up menus, and dialog boxes. However, the resources |
| 515 | widgets and have their own resources. | 381 | are 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 | 384 | class, and they must be specified in this form: |
| 519 | @samp{Emacs}, which stands for all Emacs invocations). Specify them | ||
| 520 | like this: | ||
| 521 | 385 | ||
| 522 | @smallexample | 386 | @smallexample |
| 523 | Emacs.pane.menubar.@var{subwidget}.@var{resource}: @var{value} | 387 | Emacs.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 |
| 527 | name is the same as the menu item string. For example, the word | 391 | For 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 | 392 | of @samp{pane.menubar}. For dialog boxes, they are in @samp{dialog}. |
| 529 | @samp{emacs.pane.menubar.File}. Most likely, you want to specify the | 393 | In each case, each individual menu string is a subwidget; the |
| 530 | same resources for the whole menu bar. To do this, use @samp{*} instead | 394 | subwidget's name is the same as the menu item string. For example, |
| 531 | of a specific subwidget name. For example, to specify the font | 395 | the @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 | ||
| 399 | bar. To do this, use @samp{*} instead of a specific subwidget name. | ||
| 400 | For example, to specify the font @samp{8x16} for all menu bar items, | ||
| 401 | including submenus, write this: | ||
| 533 | 402 | ||
| 534 | @smallexample | 403 | @smallexample |
| 535 | Emacs.pane.menubar.*.fontList: 8x16 | 404 | Emacs.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 |
| 539 | This also specifies the resource value for submenus. | 408 | example, the @samp{File} submenu has an item named @samp{Save (current |
| 540 | 409 | buffer)}. 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 | 410 | this: |
| 542 | resources; for example, the @samp{File} submenu has an item named | ||
| 543 | @samp{Save (current buffer)}. A resource specification for a submenu | ||
| 544 | item looks like this: | ||
| 545 | 411 | ||
| 546 | @smallexample | 412 | @smallexample |
| 547 | Emacs.pane.menubar.popup_*.@var{menu}.@var{item}.@var{resource}: @var{value} | 413 | Emacs.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 |
| 578 | without also specifying it for the submenus as well. So if you want the | 444 | itself, you must first specify the resource for all of them, then |
| 579 | submenu items to look different from the menu bar itself, you must ask | 445 | override the value for submenus alone. Here is an example: |
| 580 | for that in two steps. First, specify the resource for all of them; | ||
| 581 | then, override the value for submenus alone. Here is an example: | ||
| 582 | 446 | ||
| 583 | @smallexample | 447 | @smallexample |
| 584 | Emacs.pane.menubar.*.fontList: 8x16 | 448 | Emacs.pane.menubar.*.fontList: 8x16 |
| 585 | Emacs.pane.menubar.popup_*.fontList: 8x16 | 449 | Emacs.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 |
| 589 | For LessTif pop-up menus, use @samp{menu*} instead of | ||
| 590 | @samp{pane.menubar}. For example, to specify the font @samp{8x16} for | ||
| 591 | the pop-up menu items, write this: | ||
| 592 | |||
| 593 | @smallexample | ||
| 594 | Emacs.menu*.fontList: 8x16 | ||
| 595 | @end smallexample | ||
| 596 | |||
| 597 | @noindent | ||
| 598 | For LessTif dialog boxes, use @samp{dialog} instead of @samp{menu}: | ||
| 599 | |||
| 600 | @example | ||
| 601 | Emacs.dialog*.fontList: 8x16 | ||
| 602 | Emacs.dialog*.foreground: hotpink | ||
| 603 | @end example | ||
| 604 | |||
| 605 | To 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 |
| 609 | Emacs.fsb*.fontList: 8x16 | 456 | Emacs.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 | ||
| 616 | pop-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 |
| 646 | dialogs tool bars and scroll bars) is by choosing an appropriate | 488 | @cindex @file{~/.gtkrc-2.0} file |
| 647 | theme, for example with the GNOME theme selector. | 489 | @cindex @file{~/.emacs.d/gtkrc} file |
| 648 | |||
| 649 | You can also do Emacs specific customization by inserting GTK style | ||
| 650 | directives in the file @file{~/.emacs.d/gtkrc}, but only if you have a | ||
| 651 | Gtk+ version earlier than 3 (i.e.@: 2). Some GTK themes ignore | ||
| 652 | customizations in @file{~/.emacs.d/gtkrc} so not everything works with | ||
| 653 | all themes. To customize Emacs font, background, faces, etc., use the | ||
| 654 | normal X resources (@pxref{Resources}). We will present some examples | ||
| 655 | of customizations here, but for a more detailed description, see the | ||
| 656 | online manual | ||
| 657 | |||
| 658 | The first example is just one line. It changes the font on all GTK widgets | ||
| 659 | to courier with size 12: | ||
| 660 | |||
| 661 | @smallexample | ||
| 662 | gtk-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 | ||
| 666 | Pango font name. A Pango font name is basically of the format "family | ||
| 667 | style size", where the style is optional as in the case above. A name | ||
| 668 | with a style could be for example: | ||
| 669 | 490 | ||
| 670 | @smallexample | 491 | If Emacs is compiled with GTK+ toolkit support, the simplest way to |
| 671 | gtk-font-name = "helvetica bold 10" | 492 | customize its GTK+ widgets (e.g.@: menus, dialogs, tool bars and |
| 672 | @end smallexample | 493 | scroll bars) is to choose an appropriate GTK+ theme, for example with |
| 494 | the GNOME theme selector. | ||
| 495 | |||
| 496 | In GTK+ version 2, you can also use @dfn{GTK+ resources} to | ||
| 497 | customize the appearance of GTK+ widgets used by Emacs. These | ||
| 498 | resources are specified in either the file @file{~/.emacs.d/gtkrc} | ||
| 499 | (for Emacs-specific GTK+ resources), or @file{~/.gtkrc-2.0} (for | ||
| 500 | general GTK+ resources). We recommend using @file{~/.emacs.d/gtkrc}, | ||
| 501 | since GTK+ seems to ignore @file{~/.gtkrc-2.0} when running GConf with | ||
| 502 | GNOME. Note, however, that some GTK themes may override | ||
| 503 | customizations in @file{~/.emacs.d/gtkrc}; there is nothing we can do | ||
| 504 | about this. GTK+ resources do not affect aspects of Emacs unrelated | ||
| 505 | to GTK+ widgets, such as fonts and colors in the main Emacs window; | ||
| 506 | those are governed by normal X resources (@pxref{Resources}). | ||
| 507 | |||
| 508 | The following sections describe how to customize GTK+ resources for | ||
| 509 | Emacs. 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 |
| 675 | the widgets. Here is an example that sets the font for menus, but not | 513 | different system. The appearance of GTK+ widgets is now determined by |
| 676 | for other widgets: | 514 | CSS-like style files: @file{gtk-3.0/gtk.css} in the GTK+ installation |
| 515 | directory, and @file{~/.themes/@var{theme}/gtk-3.0/gtk.css} for local | ||
| 516 | style settings (where @var{theme} is the name of the current GTK+ | ||
| 517 | theme). Therefore, the description of GTK+ resources in this section | ||
| 518 | does not apply to GTK+ 3. For details about the GTK+ 3 styling | ||
| 519 | system, 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. |
| 680 | style "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 |
| 686 | widget "*emacs-menuitem*" style "menufont" | 530 | @appendixsubsec GTK Resource Basics |
| 687 | @end smallexample | ||
| 688 | 531 | ||
| 689 | The 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 |
| 690 | applied to all widgets that match "*emacs-menuitem*". The widgets are | 533 | simplest kinds of resource settings simply assign a value to a |
| 691 | named by the way they are contained, from the outer widget to the inner widget. | 534 | variable. For example, putting the following line in the resource |
| 692 | So to apply the style "my_style" (not shown) with the full, absolute name, for | 535 | file changes the font on all GTK+ widgets to @samp{courier-12}: |
| 693 | the menubar and the scroll bar in Emacs we use: | ||
| 694 | 536 | ||
| 695 | @smallexample | 537 | @smallexample |
| 696 | widget "Emacs.pane.menubar" style "my_style" | 538 | gtk-font-name = "courier 12" |
| 697 | widget "Emacs.pane.emacs.verticalScrollBar" style "my_style" | ||
| 698 | @end smallexample | 539 | @end smallexample |
| 699 | 540 | ||
| 700 | But to avoid having to type it all, wildcards are often used. @samp{*} | 541 | @noindent |
| 701 | matches zero or more characters and @samp{?} matches one character. So "*" | 542 | Note that in this case the font name must be supplied as a GTK font |
| 702 | matches all widgets. | 543 | pattern (also called a @dfn{Pango font name}), not as a |
| 544 | Fontconfig-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 |
| 705 | You can assign styles by name or by class. In this example we have used the | 547 | the style to the widgets. Here is an example that sets the font for |
| 706 | class: | 548 | menus (@samp{#} characters indicate comments): |
| 707 | 549 | ||
| 708 | @smallexample | 550 | @smallexample |
| 709 | style "menufont" | 551 | # @r{Define the style @samp{my_style}.} |
| 552 | style "my_style" | ||
| 710 | @{ | 553 | @{ |
| 711 | font_name = "helvetica bold 14" | 554 | font_name = "helvetica bold 14" |
| 712 | @} | 555 | @} |
| 713 | 556 | ||
| 714 | widget_class "*GtkMenuBar" style "menufont" | 557 | # @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{my_style}.} |
| 558 | widget "*emacs-menuitem*" style "my_style" | ||
| 715 | @end smallexample | 559 | @end smallexample |
| 716 | 560 | ||
| 717 | @noindent | 561 | @noindent |
| 718 | The names and classes for the GTK widgets Emacs uses are: | 562 | The widget name in this example contains wildcards, so the style is |
| 719 | 563 | applied to all widgets matching @samp{*emacs-menuitem*}. The widgets | |
| 720 | @multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some} | 564 | are named by the way they are contained, from the outer widget to the |
| 721 | @item @code{emacs-filedialog} | 565 | inner widget. Here is another example that applies @samp{my_style} |
| 722 | @tab @code{GtkFileSelection} | 566 | specifically 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 | ||
| 742 | and dialogs. The names do not start with @samp{Emacs}, as they are | ||
| 743 | free-standing windows and not contained (in the GTK sense) by the | ||
| 744 | Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this: | ||
| 745 | |||
| 746 | @smallexample | ||
| 747 | widget "*emacs-dialog*" style "my_dialog_style" | ||
| 748 | widget "*emacs-filedialog* style "my_file_style" | ||
| 749 | widget "*emacs-menuitem* style "my_menu_style" | ||
| 750 | @end smallexample | ||
| 751 | |||
| 752 | If you specify a customization in @file{~/.emacs.d/gtkrc}, then it | ||
| 753 | automatically applies only to Emacs, since other programs don't read | ||
| 754 | that file. For example, the drop down menu in the file dialog can not | ||
| 755 | be customized by any absolute widget name, only by an absolute class | ||
| 756 | name. This is because the widgets in the drop down menu do not | ||
| 757 | have names and the menu is not contained in the Emacs GtkWindow. To | ||
| 758 | have all menus in Emacs look the same, use this in | ||
| 759 | @file{~/.emacs.d/gtkrc}: | ||
| 760 | 567 | ||
| 761 | @smallexample | 568 | @smallexample |
| 762 | widget_class "*Menu*" style "my_menu_style" | 569 | widget "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 |
| 769 | style "scroll" | 576 | style "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 | ||
| 777 | widget "*verticalScrollBar*" style "scroll" | 584 | widget "*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, | ||
| 788 | scroll bar and the dialogs are customized with the standard GTK | ||
| 789 | customization file, @file{~/.gtkrc-2.0}, or with the Emacs specific | ||
| 790 | file @file{~/.emacs.d/gtkrc}. We recommend that you use | ||
| 791 | @file{~/.emacs.d/gtkrc} for customizations, since @file{~/.gtkrc-2.0} | ||
| 792 | seems to be ignored when running GConf with GNOME. These files apply | ||
| 793 | only to GTK widget features. To customize Emacs font, background, | ||
| 794 | faces, etc., use the normal X resources (@pxref{Resources}). | ||
| 795 | |||
| 796 | Some GTK themes override these mechanisms, which means that using | ||
| 797 | these mechanisms will not work to customize them. | ||
| 798 | |||
| 799 | In these files you first define a style and say what it means; then | ||
| 800 | you specify to apply the style to various widget types (@pxref{GTK | ||
| 801 | widget names}). Here is an example of how to change the font for | ||
| 802 | Emacs menus: | ||
| 803 | |||
| 804 | @smallexample | ||
| 805 | # @r{Define the style @samp{menufont}.} | ||
| 806 | style "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}.} | ||
| 812 | widget "*emacs-menuitem*" style "menufont" | ||
| 813 | @end smallexample | ||
| 814 | |||
| 815 | Here is a more elaborate example, showing how to change the parts of | ||
| 816 | the scroll bar: | ||
| 817 | |||
| 818 | @smallexample | ||
| 819 | style "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 | ||
| 827 | widget "*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, | ||
| 831 | the property @code{gtk-font-name} sets the default font for GTK. You | ||
| 832 | must use Pango font names (@pxref{GTK styles}). A GTK resources file | ||
| 833 | that just sets a default font looks like this: | ||
| 834 | |||
| 835 | @smallexample | ||
| 836 | gtk-font-name = "courier 12" | ||
| 837 | @end smallexample | ||
| 838 | |||
| 839 | The GTK resources file is fully described in the GTK API document. | ||
| 840 | This can be found in | ||
| 841 | @file{@var{prefix}/share/gtk-doc/html/gtk/gtk-resource-files.html}, | ||
| 842 | where @file{prefix} is the directory in which the GTK libraries were | ||
| 843 | installed (usually @file{/usr} or @file{/usr/local}). You can also | ||
| 844 | find 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 | 592 | class}. The widget name refers to a specific widget |
| 859 | example, @code{GtkMenuBar}. The widget name is the name given to a | 593 | (e.g.@: @samp{emacs-menuitem}), while the widget class refers to a |
| 860 | specific widget. A widget always has a class, but need not have a | 594 | collection of similar widgets (e.g.@: @samp{GtkMenuItem}). A widget |
| 861 | name. | 595 | always 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 |
| 864 | classes, corresponding to hierarchies of widgets embedded within | 598 | classes, corresponding to hierarchies of widgets embedded within |
| @@ -868,55 +602,31 @@ a @code{GtkMenuBar} called @code{menubar}, the absolute class name | |||
| 868 | of the menu-bar widget is @code{GtkWindow.GtkVBox.GtkMenuBar}, and | 602 | of the menu-bar widget is @code{GtkWindow.GtkVBox.GtkMenuBar}, and |
| 869 | its absolute widget name is @code{top.box.menubar}. | 603 | its 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 |
| 872 | name or the absolute widget name. | 606 | widget 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 |
| 878 | specifies a style for widgets based on the absolute class name. | 610 | specifies a style for widgets based on the class name, or just the |
| 611 | class. | ||
| 879 | 612 | ||
| 880 | @item @code{widget} | 613 | @item widget_class |
| 881 | specifies a style for widgets based on the absolute class name, | 614 | specifies a style for widgets based on the class name. |
| 882 | or just the class. | ||
| 883 | @end table | 615 | @end table |
| 884 | 616 | ||
| 885 | @noindent | 617 | @noindent |
| 886 | You must specify the class and the style in double-quotes, and put | 618 | See the previous subsection for examples of using the @code{widget} |
| 887 | these commands at the top level in the GTK customization file, like | 619 | command; the @code{widget_class} command is used similarly. Note that |
| 888 | this: | 620 | the widget name/class and the style must be enclosed in double-quotes, |
| 621 | and 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 |
| 891 | style "menufont" | 624 | shell 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" | 626 | widgets: |
| 894 | @} | ||
| 895 | |||
| 896 | widget "top.box.menubar" style "menufont" | ||
| 897 | widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "menufont" | ||
| 898 | @end smallexample | ||
| 899 | |||
| 900 | Matching of absolute names uses shell wildcard syntax: @samp{*} | ||
| 901 | matches zero or more characters and @samp{?} matches one character. | ||
| 902 | This example assigns @code{base_style} to all widgets: | ||
| 903 | 627 | ||
| 904 | @smallexample | 628 | @smallexample |
| 905 | widget "*" style "base_style" | 629 | widget "*" style "my_style" |
| 906 | @end smallexample | ||
| 907 | |||
| 908 | Given the absolute class name @code{GtkWindow.GtkVBox.GtkMenuBar} | ||
| 909 | and the corresponding absolute widget name @code{top.box.menubar}, all | ||
| 910 | these examples specify @code{my_style} for the menu bar: | ||
| 911 | |||
| 912 | @smallexample | ||
| 913 | widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style" | ||
| 914 | widget_class "GtkWindow.*.GtkMenuBar" style "my_style" | ||
| 915 | widget_class "*GtkMenuBar" style "my_style" | ||
| 916 | widget "top.box.menubar" style "my_style" | ||
| 917 | widget "*box*menubar" style "my_style" | ||
| 918 | widget "*menubar" style "my_style" | ||
| 919 | widget "*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: |
| 928 | that contains a @code{GtkVBox}. The @code{GtkVBox} contains the | ||
| 929 | @code{GtkMenuBar} and a @code{GtkFixed} widget. The vertical scroll | ||
| 930 | bars, @code{GtkVScrollbar}, are contained in the @code{GtkFixed} | ||
| 931 | widget. The text you write in Emacs is drawn in the @code{GtkFixed} | ||
| 932 | widget. | ||
| 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 |
| 938 | To set a style for the menu bar using the absolute class name, use: | 664 | The contents of Emacs windows are drawn in the @code{emacs} widget. |
| 665 | Note that even if there are multiple Emacs windows, each scroll bar | ||
| 666 | widget is named @code{verticalScrollBar}. | ||
| 939 | 667 | ||
| 940 | @smallexample | 668 | For example, here are two different ways to set the menu bar style: |
| 941 | widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style" | ||
| 942 | @end smallexample | ||
| 943 | |||
| 944 | @noindent | ||
| 945 | For the scroll bar, the absolute class name is: | ||
| 946 | 669 | ||
| 947 | @smallexample | 670 | @smallexample |
| 948 | widget_class | 671 | widget "Emacs.pane.menubar.*" style "my_style" |
| 949 | "GtkWindow.GtkVBox.GtkFixed.GtkVScrollbar" | 672 | widget_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 |
| 954 | The names for the emacs widgets, and their classes, are: | 676 | class @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 | ||
| 978 | Thus, for Emacs you can write the two examples above as: | ||
| 979 | |||
| 980 | @smallexample | ||
| 981 | widget "Emacs.pane.menubar" style "my_style" | ||
| 982 | widget "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 |
| 986 | and dialogs. The names do not start with @samp{Emacs}, as they are | 680 | windows and not ``contained'' in the @code{Emacs} widget, their GTK+ |
| 987 | free-standing windows and not contained (in the GTK sense) by the | 681 | absolute names do not start with @samp{Emacs}. To customize these |
| 988 | Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this: | 682 | widgets, use wildcards like this: |
| 989 | 683 | ||
| 990 | @smallexample | 684 | @smallexample |
| 991 | widget "*emacs-dialog*" style "my_dialog_style" | 685 | widget "*emacs-dialog*" style "my_dialog_style" |
| @@ -993,14 +687,7 @@ widget "*emacs-filedialog* style "my_file_style" | |||
| 993 | widget "*emacs-menuitem* style "my_menu_style" | 687 | widget "*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: |
| 997 | automatically applies only to Emacs, since other programs don't read | ||
| 998 | that file. For example, the drop down menu in the file dialog can not | ||
| 999 | be customized by any absolute widget name, only by an absolute class | ||
| 1000 | name. This is because the widgets in the drop down menu do not | ||
| 1001 | have names and the menu is not contained in the Emacs GtkWindow. To | ||
| 1002 | have all menus in Emacs look the same, use this in | ||
| 1003 | @file{~/.emacs.d/gtkrc}: | ||
| 1004 | 691 | ||
| 1005 | @smallexample | 692 | @smallexample |
| 1006 | widget_class "*Menu*" style "my_menu_style" | 693 | widget_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: |
| 1014 | can specify foreground and background color, background pixmap and | ||
| 1015 | font. The edit widget (where you edit the text) in Emacs is a GTK | ||
| 1016 | widget, but trying to specify a style for the edit widget will have no | ||
| 1017 | effect. This is so that Emacs compiled for GTK is compatible with | ||
| 1018 | Emacs compiled for other X toolkits. The settings for foreground, | ||
| 1019 | background 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 |
| 1024 | pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" | 703 | pixmap_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}" |
| 1130 | This specifies the font for text in the widget. @var{font} is a | 809 | This specifies the font for text in the widget. @var{font} is a |
| 1131 | Pango font name, for example @samp{Sans Italic 10}, @samp{Helvetica | 810 | GTK-style (or Pango) font name, like @samp{Sans Italic 10}. |
| 1132 | Bold 12}, @samp{Courier 14}, @samp{Times 18}. See below for exact | 811 | @xref{Fonts}. The names are case insensitive. |
| 1133 | syntax. 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 | |||
| 1138 | of color names and RGB triplets. Color names should be enclosed with | 816 | of color names and RGB triplets. Color names should be enclosed with |
| 1139 | double quotes, e.g.@: @samp{"red"}. RGB triplets should be written | 817 | double quotes, e.g.@: @samp{"red"}. RGB triplets should be written |
| 1140 | without double quotes, e.g.@: @samp{#ff0000}. GTK-style RGB triplets | 818 | without double quotes, e.g.@: @samp{#ff0000}. GTK-style RGB triplets |
| 1141 | have the form | 819 | have 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 | 821 | or floats in the range 0.0-1.0. |
| 1144 | @code{@{ @var{r}, @var{g}, @var{b} @}} | ||
| 1145 | @end smallexample | ||
| 1146 | |||
| 1147 | @noindent | ||
| 1148 | where @var{r}, @var{g} and @var{b} are either integers in the range | ||
| 1149 | 0-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 | ||
| 1156 | terminated by a comma. This way you can specify several families and the | ||
| 1157 | first one found will be used. @var{family} corresponds to the second part in | ||
| 1158 | an 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 | ||
| 1165 | the family name is @samp{times}. | ||
| 1166 | |||
| 1167 | @noindent | ||
| 1168 | @var{style-options} is a whitespace separated list of words where each word | ||
| 1169 | is a style, variant, weight, or stretch. The default value for all of | ||
| 1170 | these is @code{normal}. | ||
| 1171 | |||
| 1172 | @noindent | ||
| 1173 | A `style' corresponds to the fourth part of an X font name. In X font | ||
| 1174 | names it is the character @samp{r}, @samp{i} or @samp{o}; in Pango | ||
| 1175 | font names the corresponding values are @code{normal}, @code{italic}, | ||
| 1176 | or @code{oblique}. | ||
| 1177 | |||
| 1178 | @noindent | ||
| 1179 | A `variant' is either @code{normal} or @code{small-caps}. | ||
| 1180 | Small caps is a font with the lower case characters replaced by | ||
| 1181 | smaller variants of the capital characters. | ||
| 1182 | |||
| 1183 | @noindent | ||
| 1184 | Weight describes the ``boldness'' of a font. It corresponds to the third | ||
| 1185 | part 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 | ||
| 1189 | Stretch gives the width of the font relative to other designs within a | ||
| 1190 | family. 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 @@ | |||
| 1 | 2012-01-16 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * windows.texi (Window Parameters): Use @pxref. | ||
| 4 | |||
| 5 | 2012-01-16 Martin Rudalics <rudalics@gmx.at> | ||
| 6 | |||
| 7 | * windows.texi (Window Configurations, Window Parameters): | ||
| 8 | Describe persistent window parameters. | ||
| 9 | |||
| 1 | 2011-12-27 Stefan Monnier <monnier@iro.umontreal.ca> | 10 | 2011-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 |
| 3105 | This function returns a new object representing @var{frame}'s current | 3105 | This function returns a new object representing @var{frame}'s current |
| 3106 | window configuration. The default for @var{frame} is the selected | 3106 | window configuration. The default for @var{frame} is the selected |
| 3107 | frame. | 3107 | frame. This function saves copies of window parameters listed by the |
| 3108 | variable @code{window-persistent-parameters}, see @ref{Window | ||
| 3109 | Parameters} 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 |
| 3208 | together with the Emacs process. In order to store a window | 3210 | together with the Emacs process. In order to store a window |
| 3209 | configuration on disk and read it back in another Emacs session the | 3211 | configuration on disk and read it back in another Emacs session, the |
| 3210 | following two functions can be used. | 3212 | functions described next can be used. These functions are also useful |
| 3213 | to clone the state of a frame into an arbitrary live window | ||
| 3214 | (@code{set-window-configuration} effectively clones the windows of a | ||
| 3215 | frame 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 |
| 3213 | This function returns the state of @var{window} as a Lisp object. The | 3218 | This function returns the state of @var{window} as a Lisp object. The |
| 3214 | argument @var{window} can be any window and defaults to the root window | 3219 | argument @var{window} can be any window and defaults to the root window |
| 3215 | of the selected frame. | 3220 | of the selected frame. |
| 3216 | 3221 | ||
| 3217 | The optional argument @var{markers} non-@code{nil} means to use markers | 3222 | If the optional argument @var{ignore} is non-@code{nil}, this means to |
| 3218 | for sampling positions like @code{window-point} or @code{window-start}. | 3223 | not use markers for sampling positions like @code{window-point} or |
| 3219 | This 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 |
| 3220 | putting the state back in the same session since markers slow down | 3225 | state shall be written on disk and read back in another session. |
| 3221 | processing. | 3226 | |
| 3227 | The variable @code{window-persistent-parameters} specifies whether and | ||
| 3228 | which window parameters are saved by this function, see @ref{Window | ||
| 3229 | Parameters} for details. | ||
| 3222 | @end defun | 3230 | @end defun |
| 3223 | 3231 | ||
| 3224 | The value returned by @code{window-state-get} can be converted by using | 3232 | The value returned by @code{window-state-get} can be converted, using |
| 3225 | one of the functions defined by Desktop Save Mode (@pxref{Desktop Save | 3233 | one of the functions defined by Desktop Save Mode (@pxref{Desktop Save |
| 3226 | Mode}) to an object that can be written to a file. Such objects can be | 3234 | Mode}), to an object that can be written to a file. Such objects can be |
| 3227 | read back and converted to a Lisp object representing the state of the | 3235 | read back and converted to a Lisp object representing the state of the |
| 3228 | window. That Lisp object can be used as argument for the following | 3236 | window. That Lisp object can be used as argument for the following |
| 3229 | function in order to restore the state window in another window. | 3237 | function 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 | |||
| 3268 | is the selected window. | 3276 | is the selected window. |
| 3269 | @end defun | 3277 | @end defun |
| 3270 | 3278 | ||
| 3279 | By default, functions saving and restoring window configurations or the | ||
| 3280 | states of windows (@pxref{Window Configurations}) do not care about | ||
| 3281 | window parameters. This means, that when you change the value of a | ||
| 3282 | parameter within the body of a @code{save-window-excursion}, the | ||
| 3283 | previous value is not restored upon exit of that macro. It also means | ||
| 3284 | that when you clone via @code{window-state-put} a window state saved | ||
| 3285 | earlier by @code{window-state-get}, the cloned windows come up with no | ||
| 3286 | parameters at all. The following variable allows to override the | ||
| 3287 | standard behavior. | ||
| 3288 | |||
| 3289 | @defvar window-persistent-parameters | ||
| 3290 | This variable is an alist specifying which parameters get saved by | ||
| 3291 | @code{current-window-configuration} and @code{window-state-get} and | ||
| 3292 | subsequently restored by @code{set-window-configuration} and | ||
| 3293 | @code{window-state-put}, see @ref{Window Configurations}. | ||
| 3294 | |||
| 3295 | The @sc{car} of each entry of this alist is the symbol specifying the | ||
| 3296 | parameter. The @sc{cdr} must be one of the following: | ||
| 3297 | |||
| 3298 | @table @asis | ||
| 3299 | @item @code{state} | ||
| 3300 | This value means the parameter is saved by @code{window-state-get} | ||
| 3301 | provided its @var{ignore} argument is @code{nil}. The function | ||
| 3302 | @code{current-window-configuration} does not save this parameter. | ||
| 3303 | |||
| 3304 | @item @code{nil} | ||
| 3305 | This value specifies that the parameter is saved by | ||
| 3306 | @code{current-window-configuration} and, provided its @var{ignore} | ||
| 3307 | argument is @code{nil}, by @code{window-state-get}. | ||
| 3308 | |||
| 3309 | @item @code{t} | ||
| 3310 | This means that the parameter is saved unconditionally by both | ||
| 3311 | @code{current-window-configuration} and @code{window-state-get}. This | ||
| 3312 | value should not be used for parameters whose values do not have a read | ||
| 3313 | syntax. Otherwise, invoking @code{window-state-put} in another session | ||
| 3314 | may fail with an @code{invalid-read-syntax} error. | ||
| 3315 | @end table | ||
| 3316 | |||
| 3317 | Parameters 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 | ||
| 3320 | alone by @code{set-window-configuration} respectively are not installed | ||
| 3321 | by @code{window-state-put}. | ||
| 3322 | @end defvar | ||
| 3323 | |||
| 3271 | Some functions, notably @code{delete-window}, | 3324 | Some 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 |
| 3273 | when their @var{window} argument has a parameter set. You can override | 3326 | when 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 | ||
| 3289 | The following parameters are currently used by the window management | 3342 | The following parameters are currently used by the window management |
| 3290 | code. | 3343 | code: |
| 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} |
| 3310 | This parameter marks the window as not selectable by @code{other-window} | 3363 | This 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} | ||
| 3367 | This parameter specifies the window this one has been cloned from and is | ||
| 3368 | installed by @code{window-state-get}, see @ref{Window Configurations}. | ||
| 3369 | |||
| 3370 | @item @code{quit-restore} | ||
| 3371 | This parameter tells how to proceed with a window when the buffer it | ||
| 3372 | shows is no more needed. It is installed by the buffer display | ||
| 3373 | functions (@pxref{Choosing Window}) and consulted by the function | ||
| 3374 | @code{quit-window} (@pxref{Quitting Windows}). | ||
| 3312 | @end table | 3375 | @end table |
| 3313 | 3376 | ||
| 3314 | In addition, the parameters @code{window-atom} and @code{window-side} | 3377 | In addition, the parameters @code{window-atom} and @code{window-side} |
| 3315 | are reserved and should not be used by applications. The | 3378 | are reserved and should not be used by applications. |
| 3316 | @code{quit-restore} parameter tells how to proceed with a window when | ||
| 3317 | the buffer it shows is no more needed. This parameter is installed by | ||
| 3318 | the buffer display functions (@pxref{Choosing Window}) and consulted by | ||
| 3319 | the 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 @@ | |||
| 1 | 2012-01-16 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * minibuffer.el (completion--replace): Strip properties (bug#10062). | ||
| 4 | |||
| 5 | 2012-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 | |||
| 14 | 2012-01-15 Michael Albinus <michael.albinus@gmx.de> | ||
| 15 | |||
| 16 | * net/tramp-sh.el (tramp-remote-path): Set tramp-autoload cookie. | ||
| 17 | |||
| 1 | 2012-01-14 Eli Zaretskii <eliz@gnu.org> | 18 | 2012-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 | ||
| 46 | 2012-01-10 Chong Yidong <cyd@gnu.org> | 63 | 2012-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 | ||
| 52 | 2012-01-10 Glenn Morris <rgm@gnu.org> | 69 | 2012-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 | ||
| 145 | 2012-01-05 Michael R. Mauger <mmaug@yahoo.com> | 162 | 2012-01-05 Michael R. Mauger <mmaug@yahoo.com> |
| 146 | 163 | ||
| @@ -163,8 +180,8 @@ | |||
| 163 | 180 | ||
| 164 | 2012-01-03 Chong Yidong <cyd@gnu.org> | 181 | 2012-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 | ||
| 170 | 2012-01-02 Richard Stallman <rms@gnu.org> | 187 | 2012-01-02 Richard Stallman <rms@gnu.org> |
| @@ -189,8 +206,8 @@ | |||
| 189 | 206 | ||
| 190 | 2012-01-01 Eli Zaretskii <eliz@gnu.org> | 207 | 2012-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 | ||
| 196 | 2011-12-31 Andreas Schwab <schwab@linux-m68k.org> | 213 | 2011-12-31 Andreas Schwab <schwab@linux-m68k.org> |
| @@ -242,11 +259,10 @@ | |||
| 242 | 2011-12-24 Alan Mackenzie <acm@muc.de> | 259 | 2011-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 @@ | |||
| 487 | 2011-12-10 Eli Zaretskii <eliz@gnu.org> | 500 | 2011-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 | ||
| 1053 | 2011-11-19 Andreas Schwab <schwab@linux-m68k.org> | 1066 | 2011-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 | ||
| 1058 | 2011-11-19 Juri Linkov <juri@jurta.org> | 1070 | 2011-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 | ||
| 1184 | 2011-11-17 Glenn Morris <rgm@gnu.org> | 1195 | 2011-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 | ||
| 1250 | 2011-11-16 Chong Yidong <cyd@gnu.org> | 1260 | 2011-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. |
| 573 | Moves point to the end of the new text." | 573 | Moves 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. |
| 3636 | WINDOW can be any window and defaults to the root window of the | 3648 | WINDOW can be any window and defaults to the root window of the |
| 3637 | selected frame. | 3649 | selected frame. |
| 3638 | 3650 | ||
| 3639 | Optional argument MARKERS non-nil means use markers for sampling | 3651 | Optional argument IGNORE non-nil means do not use markers for |
| 3640 | positions like `window-point' or `window-start'. MARKERS should | 3652 | sampling positions like `window-point' or `window-start' and do |
| 3641 | be non-nil only if the value is used for putting the state back | 3653 | not record parameters unless `window-persistent-parameters' |
| 3642 | in the same session (note that markers slow down processing). | 3654 | requests it. IGNORE should be non-nil when the return value |
| 3655 | shall be written to a file and read back in another session. | ||
| 3643 | 3656 | ||
| 3644 | The return value can be used as argument for `window-state-put' | 3657 | The return value can be used as argument for `window-state-put' |
| 3645 | to put the state recorded here into an arbitrary window. The | 3658 | to 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 @@ | |||
| 1 | 2012-01-15 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2012-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 | ||
| 791 | 2012-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 | |||
| 791 | 2012-01-14 Eli Zaretskii <eliz@gnu.org> | 797 | 2012-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; | |||
| 57 | static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; | 57 | static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; |
| 58 | static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; | 58 | static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; |
| 59 | static Lisp_Object Qsafe, Qabove, Qbelow; | 59 | static Lisp_Object Qsafe, Qabove, Qbelow; |
| 60 | static Lisp_Object Qauto_buffer_name; | 60 | static Lisp_Object Qauto_buffer_name, Qclone_of, Qstate; |
| 61 | 61 | ||
| 62 | static int displayed_window_lines (struct window *); | 62 | static int displayed_window_lines (struct window *); |
| 63 | static struct window *decode_window (Lisp_Object); | 63 | static 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 | |||
| 6544 | function `set-window-combination-limit'. */); | 6616 | function `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. | ||
| 6621 | Parameters 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 | |||
| 6625 | The car of each entry of this alist is the symbol specifying the | ||
| 6626 | parameter. The cdr is one of the following: | ||
| 6627 | |||
| 6628 | The symbol `state' means the parameter is saved by `window-state-get' | ||
| 6629 | provided its IGNORE argument is nil. `current-window-configuration' | ||
| 6630 | does not save this parameter. | ||
| 6631 | |||
| 6632 | nil means the parameter is saved by `current-window-configuration' and, | ||
| 6633 | provided its IGNORE argument is nil, by `window-state-get'. | ||
| 6634 | |||
| 6635 | t means the parameter is saved unconditionally by both | ||
| 6636 | `current-window-configuration' and `window-state-get'. Parameters | ||
| 6637 | without read syntax (like windows or frames) should not use that. | ||
| 6638 | |||
| 6639 | Parameters not saved by `current-window-configuration' or | ||
| 6640 | `window-state-get' are left alone by `set-window-configuration' | ||
| 6641 | respectively 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); |