diff --git a/admin/ChangeLog b/admin/ChangeLog index 3bfbab881aa..597beb60ce2 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,8 @@ +2012-01-14 Eli Zaretskii + + * FOR-RELEASE (Check the Emacs Tutorial): Mark TUTORIAL.he as + updated and checked. + 2011-11-26 Andreas Schwab * grammars/bovine-grammar.el (bovine--grammar-newstyle-unquote): diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index c82dbf36f0d..daf8e33d041 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -107,7 +107,7 @@ TUTORIAL.de TUTORIAL.eo TUTORIAL.es TUTORIAL.fr -TUTORIAL.he +TUTORIAL.he eliz TUTORIAL.it TUTORIAL.ja TUTORIAL.ko @@ -133,7 +133,7 @@ buffers.texi cyd building.texi cyd calendar.texi cal-xtra.texi -cmdargs.texi +cmdargs.texi cyd commands.texi cyd custom.texi cyd dired.texi cyd @@ -144,7 +144,7 @@ emacs-xtra.texi emerge-xtra.texi entering.texi cyd files.texi cyd -fixit.texi +fixit.texi cyd fortran-xtra.texi frames.texi cyd glossary.texi @@ -175,7 +175,7 @@ trouble.texi cyd vc-xtra.texi cyd vc1-xtra.texi cyd windows.texi cyd -xresources.texi +xresources.texi cyd ** Check the Lisp manual. diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 8f7f8ebb220..4f3e5f77fd5 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,43 @@ +2012-01-15 Chong Yidong + + * xresources.texi (X Resources): Describe GTK+ case first. + (Resources): Don't use borderWidth as an example, since it doesn't + work with GTK+. + (Table of Resources): Clarify role of several resources, including + the Emacs 24 behavior of cursorBlink etc. + (Face Resources): Node deleted. Recommend using Customize + instead. Add paragraph to `Table of Resources' node summarizing + how to use X resources for changing faces. + (Lucid Resources): Rewrite, omitting description of font names, + referring to the Fonts node instead. + (LessTif Resources): Copyedits. + (GTK resources): Rewrite, describing the difference between gtk2 + and gtk3. + (GTK Resource Basics): New node. + (GTK Widget Names, GTK Names in Emacs): Rewrite. + (GTK styles): Just refer to Fonts node for GTK font format. + + * display.texi (Faces): Document the cursor face. + +2012-01-14 Chong Yidong + + * cmdargs.texi (Action Arguments): No need to mention + EMACSLOADPATH. + (General Variables): Add xref to Lisp Libraries. + (Initial Options): Copyedits. + (Resume Arguments): Node deleted; emacs.bash/csh are obsolete. + (Environment): Clarify what getenv does. + (General Variables): Clarify EMACSPATH etc. Emacs does not assume + light backgrounds on xterms. + (Misc Variables): TEMP and TMP are not Windows-specific. + (Display X): Copyedits. + (Colors X): -bd does nothing for GTK. + (Icons X): Gnome 3 doesn't use taskbars. + + * misc.texi (Shell): Document exec-path here. + + * rmail.texi (Movemail): Add xref for exec-path. + 2012-01-13 Glenn Morris * dired.texi (Dired and Find): Clarify find-ls-options. 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 @@ @c See file emacs.texi for copying conditions. @node Antinews, Mac OS / GNUstep, X Resources, Top -@appendix Emacs 22 Antinews +@appendix Emacs 23 Antinews @c Update the emacs.texi Antinews menu entry with the above version number. For those users who live backwards in time, here is information -about downgrading to Emacs version 22.3. We hope you will enjoy the +about downgrading to Emacs version 23.4. We hope you will enjoy the greater simplicity that results from the absence of many Emacs @value{EMACSVER} features. @itemize @bullet - @item -We have switched to a character representation specially designed for -Emacs. Rather than forcing all the widely used scripts into artificial -alignment, as Unicode does, Emacs treats them all equally, giving -each one a place in the space of character codes. We have eliminated -the confusing practice, in Emacs 23, whereby one character can belong -to multiple character sets. Now each script has its own variant, and -they all are different as far as Emacs is concerned. For example, -there's a Latin-1 c-cedilla character, and there's a Latin-2 -c-cedilla; searching a buffer for the Latin-1 variant only finds that -variant, but not the others. - -@item -Emacs now uses its own special internal encoding for non-@acronym{ASCII} -characters, known as @samp{emacs-mule}. This was imperative to -support several different variants of the same character, each one -belonging to its own script: @samp{emacs-mule} marks each character -with its script, to better discern them from one another. - -@item -For simplicity, the functions @code{encode-coding-region} and -@code{decode-coding-region} no longer accept an argument saying where -to store the result of their conversions. The result always replaces -the original, so there's no need to look for it elsewhere. - -@item -Emacs no longer performs font anti-aliasing. If your fonts look ugly, -try choosing a larger font and increasing the screen resolution. -Admittedly, this becomes difficult as you go further back in time, -since available screen resolutions will decrease. - -@item -The Fontconfig font library is no longer supported. To specify a -font, you must use an XLFD (X Logical Font Descriptor). The other -ways of specifying fonts---so-called ``Fontconfig'' and ``GTK'' font -names---are redundant, so they have been removed. - -@item -Transient Mark mode is now disabled by default. Furthermore, some -commands that operate specifically on the region when it is active and -Transient Mark mode is enabled (such as @code{fill-paragraph} -@code{ispell-word}, and @code{indent-for-tab-command}), no longer do -so. - -@item -Holding @key{shift} while typing a motion command no longer creates a -temporarily active region, since that's inconsistent with how Emacs -normally handles keybindings. The variable @code{shift-select-mode} -has been deleted. You can, however, still create temporarily active -regions by dragging the mouse. - -@item -The line motion commands, @kbd{C-n} and @kbd{C-p}, now move by logical -text lines, not screen lines. Even if a long text line is continued -over multiple screen lines, @kbd{C-n} and @kbd{C-p} treat it as a -single line, because that's ultimately what it is. - -@item -Visual Line mode, which provides ``word wrap'' functionality, has been -removed. You can still use Long Lines mode to gain an approximation -of word wrapping, though this has some drawbacks---for instance, -syntax highlighting often doesn't work well on wrapped lines. - -@item -@kbd{C-l} now runs @code{recenter} instead of -@code{recenter-top-bottom}. This always sets the current line at the -center of the window, instead of cycling through the center, top, and -bottom of the window on successive invocations. This lets you type -@kbd{C-l C-l C-l C-l} to be @emph{absolutely sure} that you have -recentered the line. - -@item -The way Emacs generates possible minibuffer completions is now much -simpler to understand. It matches alternatives to the text before -point, ignoring the text after point; it also does not attempt to -perform partial completion if the first completion attempt fails. - -@item -Typing @kbd{M-n} at the start of the minibuffer history list no longer -attempts to generate guesses of possible minibuffer input. It instead -does the straightforward thing, by issuing the message @samp{End of -history; no default available}. - -@item -Individual buffers can no longer display faces specially. The text -scaling commands @kbd{C-x C-+}, @kbd{C-x C--}, and @kbd{C-x C-0} have -been removed, and so has the buffer face menu bound to -@kbd{S-down-mouse-1}. - -@item -VC no longer supports fileset-based operations on distributed version -control systems (DVCSs) such as Arch, Bazaar, Subversion, Mercurial, -and Git. For instance, multi-file commits will be performed by -committing one file at a time. As you go further back in time, we -will remove DVCS support entirely, so you should migrate your projects -to CVS. - -@item -Rmail now uses a special file format, Babyl format, specifically designed -for storing and editing mail. When you visit a file in Rmail, or get new -mail, Rmail converts it automatically to Babyl format. - -@item -Emacs can no longer display frames on X windows and text terminals -(ttys) simultaneously. If you start Emacs as an X application, it -can only create X frames; if you start Emacs on a tty, it can only use -that tty. No more confusion about which type of frame -@command{emacsclient} will use in any given Emacs session! - -@item -Emacs can no longer be started as a daemon. You can be sure that if -you don't see Emacs, then it's not running. - -@item -Emacs has added support for many soon-to-be-non-obsolete platforms, -including VMS, DECstation, SCO Unix, and systems lacking alloca. -Support for Sun windows has been added. +FIXME @item To keep up with decreasing computer memory capacity and disk space, many -other functions and files have been eliminated in Emacs 22.3. +other functions and files have been eliminated in Emacs 23.4. @end itemize diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 11cc4df8ce9..00730cc6510 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -65,7 +65,6 @@ arguments.) and call functions. * Initial Options:: Arguments that take effect while starting Emacs. * Command Example:: Examples of using command line arguments. -* Resume Arguments:: Specifying arguments when you resume a running Emacs. * Environment:: Environment variables that Emacs uses. * Display X:: Changing the default display and using remote login. * Font X:: Choosing a font for text, under X. @@ -124,10 +123,9 @@ Visit @var{file} using @code{find-file}, then go to line number @opindex --load @cindex loading Lisp libraries, command-line argument Load a Lisp library named @var{file} with the function @code{load}. -@xref{Lisp Libraries}. If @var{file} is not an absolute file name, -the library can be found either in the current directory, or in the -Emacs library search path as specified with @env{EMACSLOADPATH} -(@pxref{General Variables}). +If @var{file} is not an absolute file name, Emacs first looks for it +in the current directory, then in the directories listed in +@code{load-path} (@pxref{Lisp Libraries}). @strong{Warning:} If previous command-line arguments have visited files, the current directory is the directory of the last file @@ -186,11 +184,11 @@ specifically related to the X Window System appear in the following sections. Some initial options affect the loading of the initialization file. -The normal actions of Emacs are to first load @file{site-start.el} if -it exists, then your own initialization file @file{~/.emacs} if it -exists, and finally @file{default.el} if it exists. @xref{Init File}. -Certain options prevent loading of some of these files or substitute -other files for them. +Normally, Emacs first loads @file{site-start.el} if it exists, then +your own initialization file if it exists, and finally the default +initialization file @file{default.el} if it exists (@pxref{Init +File}). Certain options prevent loading of some of these files or +substitute other files for them. @table @samp @item -chdir @var{directory} @@ -207,8 +205,8 @@ stopped. This makes desktop saving and restoring easier. @itemx --terminal=@var{device} @opindex --terminal @cindex device for Emacs terminal I/O -Use @var{device} as the device for terminal input and output. -@samp{--terminal} implies @samp{--no-window-system}. +Use @var{device} as the device for terminal input and output. This +option implies @samp{--no-window-system}. @item -d @var{display} @opindex -d @@ -252,7 +250,7 @@ terminal's standard input stream (@code{stdin}) instead. @samp{--batch} implies @samp{-q} (do not load an initialization file), but @file{site-start.el} is loaded nonetheless. It also causes Emacs to exit after processing all the command options. In addition, it -disables auto-saving except in buffers for which it has been +disables auto-saving except in buffers for which auto-saving is explicitly requested. @item --script @var{file} @@ -270,8 +268,8 @@ Emacs. They can start with this text on the first line @noindent which will invoke Emacs with @samp{--script} and supply the name of -the script file as @var{file}. Emacs Lisp then treats @samp{#!} as a -comment delimiter. +the script file as @var{file}. Emacs Lisp then treats the @samp{#!} +on this first line as a comment delimiter. @item -q @opindex -q @@ -280,11 +278,10 @@ comment delimiter. @cindex bypassing init and @file{default.el} file @cindex init file, not loading @cindex @file{default.el} file, not loading -Do not load your Emacs initialization file, and do not load the file -@file{default.el} either (@pxref{Init File}). Regardless of this -switch, @file{site-start.el} is still loaded. When Emacs is invoked -like this, the Customize facility does not allow options to be saved -(@pxref{Easy Customization}). +Do not load any initialization file (@pxref{Init File}). When Emacs +is invoked with this option, the Customize facility does not allow +options to be saved (@pxref{Easy Customization}). This option does +not disable loading @file{site-start.el}. @item --no-site-file @opindex --no-site-file @@ -371,45 +368,6 @@ also guarantees there will be no problem redirecting output to @file{log}, because Emacs will not assume that it has a display terminal to work with. -@node Resume Arguments -@appendixsec Resuming Emacs with Arguments - - You can specify action arguments for Emacs when you resume it after -a suspension. To prepare for this, put the following code in your -@file{.emacs} file (@pxref{Hooks}): - -@c `resume-suspend-hook' is correct. It is the name of a function. -@example -(add-hook 'suspend-hook 'resume-suspend-hook) -(add-hook 'suspend-resume-hook 'resume-process-args) -@end example - - As further preparation, you must execute the shell script -@file{emacs.csh} (if you use csh as your shell) or @file{emacs.bash} -(if you use bash as your shell). These scripts define an alias named -@code{edit}, which will resume Emacs giving it new command line -arguments such as files to visit. The scripts are found in the -@file{etc} subdirectory of the Emacs distribution. - - Only action arguments work properly when you resume Emacs. Initial -arguments are not recognized---it's too late to execute them anyway. - - Note that resuming Emacs (with or without arguments) must be done from -within the shell that is the parent of the Emacs job. This is why -@code{edit} is an alias rather than a program or a shell script. It is -not possible to implement a resumption command that could be run from -other subjobs of the shell; there is no way to define a command that could -be made the value of @env{EDITOR}, for example. Therefore, this feature -does not take the place of the Emacs Server feature (@pxref{Emacs -Server}). - - The aliases use the Emacs Server feature if you appear to have a -server Emacs running. However, they cannot determine this with complete -accuracy. They may think that a server is still running when in -actuality you have killed that Emacs, because the file -@file{/tmp/esrv@dots{}} still exists. If this happens, find that -file and delete it. - @node Environment @appendixsec Environment Variables @cindex environment variables @@ -424,19 +382,19 @@ letters only. The values are all text strings. environment automatically from their parent process. This means you can set up an environment variable in your login shell, and all the programs you run (including Emacs) will automatically see it. -Subprocesses of Emacs (such as shells, compilers, and version-control -software) inherit the environment from Emacs, too. +Subprocesses of Emacs (such as shells, compilers, and version control +programs) inherit the environment from Emacs, too. @findex setenv @findex getenv @vindex initial-environment - Inside Emacs, the command @kbd{M-x getenv} gets the value of an -environment variable. @kbd{M-x setenv} sets a variable in the Emacs -environment, and @kbd{C-u M-x setenv} removes a variable. -(Environment variable substitutions with @samp{$} work in the value -just as in file names; see @ref{File Names with $}.) The variable -@code{initial-environment} stores the initial environment inherited by -Emacs. + Inside Emacs, the command @kbd{M-x getenv} reads the name of an +environment variable, and prints its value in the echo area. @kbd{M-x +setenv} sets a variable in the Emacs environment, and @kbd{C-u M-x +setenv} removes a variable. (Environment variable substitutions with +@samp{$} work in the value just as in file names; see @ref{File Names +with $}.) The variable @code{initial-environment} stores the initial +environment inherited by Emacs. The way to set environment variables outside of Emacs depends on the operating system, and especially the shell that you are using. For @@ -483,22 +441,25 @@ This is used to initialize the Lisp variable @code{data-directory}. Directory for the documentation string file, which is used to initialize the Lisp variable @code{doc-directory}. @item EMACSLOADPATH -A colon-separated list of directories@footnote{ -Here and below, whenever we say ``colon-separated list of directories,'' -it pertains to Unix and GNU/Linux systems. On MS-DOS and MS-Windows, -the directories are separated by semi-colons instead, since DOS/Windows -file names might include a colon after a drive letter.} -to search for Emacs Lisp files---used to initialize @code{load-path}. +A colon-separated list of directories@footnote{ Here and below, +whenever we say ``colon-separated list of directories,'' it pertains +to Unix and GNU/Linux systems. On MS-DOS and MS-Windows, the +directories are separated by semi-colons instead, since DOS/Windows +file names might include a colon after a drive letter.} to search for +Emacs Lisp files. If set, it overrides the usual initial value of the +@code{load-path} variable (@pxref{Lisp Libraries}). @item EMACSPATH -A colon-separated list of directories to search for executable -files---used to initialize @code{exec-path}. +A colon-separated list of directories to search for executable files. +If set, Emacs uses this in addition to @env{PATH} (see below) when +initializing the variable @code{exec-path} (@pxref{Shell}). @item EMAIL @vindex user-mail-address@r{, initialization} Your email address; used to initialize the Lisp variable -@code{user-mail-address}, which the Emacs mail interface puts into -the @samp{From} header of outgoing messages (@pxref{Mail Headers}). +@code{user-mail-address}, which the Emacs mail interface puts into the +@samp{From} header of outgoing messages (@pxref{Mail Headers}). @item ESHELL -Used for shell-mode to override the @env{SHELL} environment variable. +Used for shell-mode to override the @env{SHELL} environment variable +(@pxref{Interactive Shell}). @item HISTFILE The name of the file that shell commands are saved in between logins. This variable defaults to @file{~/.bash_history} if you use Bash, to @@ -554,23 +515,28 @@ environment and coding system. @xref{Language Environments}. The user's login name. See also @env{USER}. @item MAIL The name of your system mail inbox. +@ifnottex @item MH -Name of setup file for the mh system. (The default is @file{~/.mh_profile}.) +Name of setup file for the mh system. @xref{Top,,MH-E,mh-e, The Emacs +Interface to MH}. +@end ifnottex @item NAME -Your real-world name. +Your real-world name. This is used to initialize the variable +@code{user-full-name} (@pxref{Mail Headers}). @item NNTPSERVER The name of the news server. Used by the mh and Gnus packages. @item ORGANIZATION The name of the organization to which you belong. Used for setting the `Organization:' header in your posts from the Gnus package. @item PATH -A colon-separated list of directories in which executables reside. This -is used to initialize the Emacs Lisp variable @code{exec-path}. +A colon-separated list of directories containing executable files. +This is used to initialize the variable @code{exec-path} +(@pxref{Shell}). @item PWD If set, this should be the default directory when Emacs was started. @item REPLYTO If set, this specifies an initial value for the variable -@code{mail-default-reply-to}. @xref{Mail Headers}. +@code{mail-default-reply-to} (@pxref{Mail Headers}). @item SAVEDIR The name of a directory in which news articles are saved by default. Used by the Gnus package. @@ -578,23 +544,29 @@ Used by the Gnus package. The name of an interpreter used to parse and execute programs run from inside Emacs. @item SMTPSERVER -The name of the outgoing mail server. Used by the SMTP library -(@pxref{Top,,,smtpmail,Sending mail via SMTP}). +The name of the outgoing mail server. This is used to initialize the +variable @code{smtpmail-smtp-server} (@pxref{Mail Sending}). @cindex background mode, on @command{xterm} @item TERM The type of the terminal that Emacs is using. This variable must be set unless Emacs is run in batch mode. On MS-DOS, it defaults to @samp{internal}, which specifies a built-in terminal emulation that -handles the machine's own display. If the value of @env{TERM} indicates -that Emacs runs in non-windowed mode from @command{xterm} or a similar -terminal emulator, the background mode defaults to @samp{light}, and -Emacs will choose colors that are appropriate for a light background. +handles the machine's own display. @item TERMCAP The name of the termcap library file describing how to program the -terminal specified by the @env{TERM} variable. This defaults to +terminal specified by @env{TERM}. This defaults to @file{/etc/termcap}. @item TMPDIR -Used by the Emerge package as a prefix for temporary files. +@itemx TMP +@itemx TEMP +These environment variables are used to initialize the variable +@code{temporary-file-directory}, which specifies a directory in which +to put temporary files (@pxref{Backup}). Emacs tries to use +@env{TMPDIR} first; if that is unset, it tries @env{TMP}, then +@env{TEMP}, and finally @file{/tmp}. But on MS-Windows and MS-DOS, +Emacs tries @env{TEMP}, then @env{TMPDIR}, then @env{TMP}, and finally +@file{c:/temp}. + @item TZ This specifies the current time zone and possibly also daylight saving time information. On MS-DOS, if @env{TZ} is not set in the @@ -624,11 +596,6 @@ variable. On MS-DOS, this variable defaults to the value of the @env{USER} variable. -@item TEMP -@itemx TMP -On MS-DOS and MS-Windows, these specify the name of the directory for -storing temporary files in. - @item EMACSTEST On MS-DOS, this specifies a file to use to log the operation of the internal terminal emulator. This feature is useful for submitting bug @@ -710,27 +677,21 @@ of the settings which on X belong in the @file{.Xdefaults} file @cindex display name (X Window System) @cindex @env{DISPLAY} environment variable - The environment variable @env{DISPLAY} tells all X clients, including -Emacs, where to display their windows. Its value is set by default -in ordinary circumstances, when you start an X server and run jobs -locally. Occasionally you may need to specify the display yourself; for -example, if you do a remote login and want to run a client program -remotely, displaying on your local screen. - - With Emacs, the main reason people change the default display is to -let them log into another system, run Emacs on that system, but have the -window displayed at their local terminal. You might need to log in -to another system because the files you want to edit are there, or -because the Emacs executable file you want to run is there. + The environment variable @env{DISPLAY} tells all X clients, +including Emacs, where to display their windows. Its value is set by +default in ordinary circumstances, when you start an X server and run +jobs locally. You can specify the display yourself; one reason to do +this is if you want to log into another system and run Emacs there, +and have the window displayed at your local terminal. @env{DISPLAY} has the syntax @samp{@var{host}:@var{display}.@var{screen}}, where @var{host} is the host name of the X Window System server machine, @var{display} is an arbitrarily-assigned number that distinguishes your server (X terminal) from other servers on the same machine, and @var{screen} is -a rarely-used field that allows an X server to control multiple -terminal screens. The period and the @var{screen} field are optional. -If included, @var{screen} is usually zero. +a field that allows an X server to control multiple terminal screens. +The period and the @var{screen} field are optional. If included, +@var{screen} is usually zero. For example, if your host is named @samp{glasperle} and your server is the first (or perhaps the only) server listed in the configuration, your @@ -744,9 +705,9 @@ by changing the @env{DISPLAY} variable, or with the option @samp{-d emacs --display=glasperle:0 & @end smallexample - You can inhibit the direct use of the window system and GUI with the -@samp{-nw} option. It tells Emacs to display using ordinary @acronym{ASCII} on -its controlling terminal. This is also an initial option. + You can inhibit the use of the X window system with the @samp{-nw} +option. Then Emacs uses its controlling text terminal for display. +@xref{Initial Options}. Sometimes, security arrangements prevent a program on a remote system from displaying on your local system. In this case, trying to run Emacs @@ -778,17 +739,17 @@ font: Use @var{font} as the default font. @end table -When passing a font specification to Emacs on the command line, you -may need to ``quote'' it, by enclosing it in quotation marks, if it -contains characters that the shell treats specially (e.g.@: spaces). -For example: +When passing a font name to Emacs on the command line, you may need to +``quote'' it, by enclosing it in quotation marks, if it contains +characters that the shell treats specially (e.g.@: spaces). For +example: @smallexample emacs -fn "DejaVu Sans Mono-12" @end smallexample -@xref{Fonts}, for other ways to specify the default font and font name -formats. +@xref{Fonts}, for details about font names and other ways to specify +the default font. @node Colors X @appendixsec Window Color Options @@ -819,7 +780,8 @@ Specify the background color, overriding the color specified by the @itemx --border-color=@var{color} @opindex --border-color @cindex border color, command-line argument -Specify the color of the border of the X window. +Specify the color of the border of the X window. This has no effect +if Emacs is compiled with GTK+ support. @item -cr @var{color} @opindex -cr @itemx --cursor-color=@var{color} @@ -844,11 +806,10 @@ Reverse video---swap the foreground and background colors. @opindex --color @cindex standard colors on a character terminal @cindex override character terminal color support -For a character terminal only, specify the mode of color support. -This option is intended for overriding the number of supported colors -that the character terminal advertises in its @code{termcap} or -@code{terminfo} database. The parameter @var{mode} can be one of the -following: +Set the @dfn{color support mode} when Emacs is run on a text terminal. +This option overrides the number of supported colors that the +character terminal advertises in its @code{termcap} or @code{terminfo} +database. The parameter @var{mode} can be one of the following: @table @samp @item never @itemx no @@ -1090,7 +1051,7 @@ Start Emacs in an iconified (``minimized'') state. @itemx --no-bitmap-icon @opindex --no-bitmap-icon @cindex Emacs icon, a gnu -Do not display the Emacs icon. +Disable the use of the Emacs icon. @end table Most window managers allow you to ``iconify'' (or ``minimize'') an @@ -1102,10 +1063,11 @@ The text frame doesn't appear until you deiconify (or ``un-minimize'') it. By default, Emacs uses an icon containing the Emacs logo. On -desktop environments such as Gnome, this icon is also displayed on the -``taskbar''. The @samp{-nbi} or @samp{--no-bitmap-icon} option tells -Emacs to let the window manager choose what sort of icon to -use---usually just a small rectangle containing the frame's title. +desktop environments such as Gnome, this icon is also displayed in +other contexts, e.g.@: when switching into an Emacs frame. The +@samp{-nbi} or @samp{--no-bitmap-icon} option tells Emacs to let the +window manager choose what sort of icon to use---usually just a small +rectangle containing the frame's title. @node Misc X @appendixsec Other Display Options 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. changes for future Emacs sessions. @xref{Face Customization}. A face does not have to specify every single attribute; often it inherits most attributes from another face. Any ultimately unspecified -attribute is taken from a face named @code{default}, whose attributes -are all specified. The @code{default} face is the default for -displaying text, and its background color is also used as the frame's -background color. +attribute is taken from the face named @code{default}. + + The @code{default} face is the default for displaying text, and all +of its attributes are specified. Its background color is also used as +the frame's background color. + +@cindex cursor face + Another special face is the @code{cursor} face. On graphical +displays, the background color of this face is used to draw the text +cursor. None of the other attributes of this face have any effect; +the foreground color for text under the cursor is taken from the +background color of the underlying text. On text terminals, the +appearance of the text cursor is determined by the terminal, not by +the @code{cursor} face. You can also use X resources to specify attributes of any particular face. @xref{Resources}. diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index b8722e9f850..1f7fecb8b6a 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -210,7 +210,7 @@ Appendices * GNU Free Documentation License:: The license for this documentation. * Emacs Invocation:: Hairy startup options. * X Resources:: X resources for customizing Emacs. -* Antinews:: Information about Emacs version 22. +* Antinews:: Information about Emacs version 23. * Mac OS / GNUstep:: Using Emacs under Mac OS and GNUstep. * Microsoft Windows:: Using Emacs on Microsoft Windows and MS-DOS. * Manifesto:: What's GNU? Gnu's Not Unix! @@ -1104,7 +1104,6 @@ Command Line Arguments for Emacs Invocation and call functions. * Initial Options:: Arguments that take effect while starting Emacs. * Command Example:: Examples of using command line arguments. -* Resume Arguments:: Specifying arguments when you resume a running Emacs. * Environment:: Environment variables that Emacs uses. * Display X:: Changing the default display and using remote login. * Font X:: Choosing a font for text, under X. @@ -1125,15 +1124,15 @@ X Options and Resources * Resources:: Using X resources with Emacs (in general). * Table of Resources:: Table of specific X resources that affect Emacs. -* Face Resources:: X resources for customizing faces. * Lucid Resources:: X resources for Lucid menus. * LessTif Resources:: X resources for LessTif and Motif menus. * GTK resources:: Resources for GTK widgets. GTK resources -* GTK widget names:: How widgets in GTK are named in general. -* GTK Names in Emacs:: GTK widget names in Emacs. +* GTK Resource Basics:: Basic usage of GTK+ resources. +* GTK Widget Names:: How GTK+ widgets are named. +* GTK Names in Emacs:: GTK+ widgets used by Emacs. * GTK styles:: What can be customized in a GTK widget. Emacs and Mac OS / GNUstep diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index a522e055d2b..77211a3d9ac 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1871,10 +1871,9 @@ Add each file name in @var{directory} and all of its nested subdirectories to the file name cache, using @command{locate} to find them all. @item M-x file-cache-add-directory-list @key{RET} @var{variable} @key{RET} -Add each file name in each directory listed in @var{variable} -to the file name cache. @var{variable} should be a Lisp variable -such as @code{load-path} or @code{exec-path}, whose value is a list -of directory names. +Add each file name in each directory listed in @var{variable} to the +file name cache. @var{variable} should be a Lisp variable whose value +is a list of directory names, like @code{load-path}. @item M-x file-cache-clear-cache @key{RET} Clear the cache; that is, remove all file names from it. @end table diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 69e141efb0f..93dd5e3b8ce 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -465,6 +465,15 @@ then give commands interactively. Full terminal emulation is available. @end table +@vindex exec-path + Whenever you specify a relative file name for an executable program +(either in the @var{cmd} argument to one of the above commands, or in +other contexts), Emacs searches for the program in the directories +specified by the variable @code{exec-path}. The value of this +variable must be a list of directory names; the default value is +initialized from the environment variable @env{PATH} when Emacs is +started (@pxref{General Variables}). + @kbd{M-x eshell} invokes a shell implemented entirely in Emacs. It is documented in its own manual. @ifnottex @@ -551,11 +560,8 @@ to @command{gpg}. This will output the list of keys to the The above commands use the shell specified by the variable @code{shell-file-name}. Its default value is determined by the @env{SHELL} environment variable when Emacs is started. If the file -name is relative, Emacs searches the directories in the list -@code{exec-path}; this list is initialized based on the environment -variable @env{PATH} when Emacs is started. Your init file can -override either or both of these default initializations (@pxref{Init -File}). +name is relative, Emacs searches the directories listed in +@code{exec-path} (@pxref{Shell}). To specify a coding system for @kbd{M-!} or @kbd{M-|}, use the command @kbd{C-x @key{RET} c} immediately beforehand. @xref{Communication Coding}. diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi index 9713b825ee8..be1c1f68c66 100644 --- a/doc/emacs/rmail.texi +++ b/doc/emacs/rmail.texi @@ -1428,8 +1428,8 @@ This is equivalent to specifying the @samp{file} protocol: @code{movemail} to use. If that is a string, it specifies the absolute file name of the @code{movemail} executable. If it is @code{nil}, Rmail searches for @code{movemail} in the directories -listed in @code{rmail-movemail-search-path} and @code{exec-path}, then -in @code{exec-directory}. +listed in @code{rmail-movemail-search-path}, then in @code{exec-path} +(@pxref{Shell}), then in @code{exec-directory}. @node Remote Mailboxes @section Retrieving Mail from Remote Mailboxes 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 @@ @appendix X Options and Resources You can customize some X-related aspects of Emacs behavior using X -resources, as is usual for programs that use X. On MS-Windows, you -can customize some of the same aspects using the system registry. -@xref{MS-Windows Registry}. +resources, as is usual for programs that use X. - When Emacs is built using an ``X toolkit'', such as Lucid or -LessTif, you need to use X resources to customize the appearance of -the widgets, including the menu-bar, scroll-bar, and dialog boxes. -This is because the libraries that implement these don't provide for -customization through Emacs. GTK+ widgets use a separate system of + When Emacs is compiled with GTK+ support, the appearance of various +graphical widgets, such as the menu-bar, scroll-bar, and dialog boxes, +is determined by @ifnottex ``GTK resources'', which we will also describe. @end ifnottex @iftex -``GTK resources.'' In this chapter we describe the most commonly used -resource specifications. For full documentation, see the online -manual. - -@c Add xref for LessTif/Motif menu resources. +``GTK resources''. @end iftex +When Emacs is built without GTK+ support, the appearance of these +widgets is determined by additional X resources. + On MS-Windows, you can customize some of the same aspects using the +system registry (@pxref{MS-Windows Registry}). @menu * Resources:: Using X resources with Emacs (in general). * Table of Resources:: Table of specific X resources that affect Emacs. -* Face Resources:: X resources for customizing faces. * Lucid Resources:: X resources for Lucid menus. * LessTif Resources:: X resources for LessTif and Motif menus. * GTK resources:: Resources for GTK widgets. @@ -63,60 +58,41 @@ settings in the Display Control Panel. You can also set resources using the @samp{-xrm} command line option, as explained below.) Each line in the X resource file specifies a value for one option or -for a collection of related options. Each resource specification +for a collection of related options. The order in which the lines +appear in the file does not matter. Each resource specification consists of a @dfn{program name} and a @dfn{resource name}. Case distinctions are significant in each of these names. Here is an example: @example -emacs.borderWidth: 2 +emacs.cursorColor: dark green @end example -@ifnottex The program name is the name of the executable file to which the resource applies. For Emacs, this is normally @samp{emacs}. To specify a definition that applies to all instances of Emacs, regardless of the name of the Emacs executable, use @samp{Emacs}. The resource name is the name of a program setting. For instance, -Emacs recognizes a @samp{borderWidth} resource that controls the width -of the external border for graphical frames. +Emacs recognizes a @samp{cursorColor} resource that controls the color +of the text cursor. Resources are grouped into named classes. For instance, the -@samp{BorderWidth} class contains both the @samp{borderWidth} resource -(which we just described), as well as the @samp{internalBorder} -resource, which controls the width of the internal border for -graphical frames. Instead of using a resource name, you can use a -class name to specify the same value for all resources in that class. -Here's an example: +@samp{Foreground} class contains the @samp{cursorColor}, +@samp{foreground} and @samp{pointerColor} resources (@pxref{Table of +Resources}). Instead of using a resource name, you can use a class +name to specify the default value for all resources in that class, +like this: @example -emacs.BorderWidth: 2 +emacs.Foreground: dark green @end example - If you specify a value for a class, it becomes the default for all -resources in that class. You can specify values for individual -resources as well; these override the class value, for those -particular resources. The following example specifies 2 as the -default width for all borders, but overrides this value with 4 for the -external border: - -@example -emacs.BorderWidth: 2 -emacs.borderWidth: 4 -@end example -@end ifnottex - - The order in which the lines appear in the file does not matter. -One way to experiment with the effect of different resource settings -is to use the @code{editres} program. See the @code{editres} man page -for more details. - Emacs does not process X resources at all if you set the variable -@code{inhibit-x-resources} to a non-@code{nil} value, or if you -specify the @samp{-Q} (or @samp{--quick}) command-line argument -(@pxref{Initial Options}). (The @samp{-Q} argument automatically sets -@code{inhibit-x-resources} to @code{t}.) +@code{inhibit-x-resources} to a non-@code{nil} value. If you invoke +Emacs with the @samp{-Q} (or @samp{--quick}) command-line option, +@code{inhibit-x-resources} is automatically set to @code{t} +(@pxref{Initial Options}). @ifnottex In addition, you can use the following command-line options to @@ -162,98 +138,93 @@ other resource specifications. @node Table of Resources @appendixsec Table of X Resources for Emacs - This table lists the resource names that designate options for -Emacs, not counting those for the appearance of the menu bar, each -with the class that it belongs to: + This table lists the X resource names that Emacs recognizes, +excluding those that control the appearance of graphical widgets like +the menu bar: @table @asis @item @code{background} (class @code{Background}) -Background color name. +Background color (@pxref{Colors}). @item @code{bitmapIcon} (class @code{BitmapIcon}) Tell the window manager to display the Emacs icon if @samp{on}; don't -do so if @samp{off}. (The icon is usually shown in the ``taskbar'' on -a graphical desktop.) - -@item @code{borderColor} (class @code{BorderColor}) -Color name for the external border. +do so if @samp{off}. @xref{Icons X}, for a description of the icon. @ifnottex +@item @code{borderColor} (class @code{BorderColor}) +Color of the frame's external border. This has no effect if Emacs is +compiled with GTK+ support. + @item @code{borderWidth} (class @code{BorderWidth}) -Width in pixels of the external border. +Width of the frame's external border, in pixels. This has no effect +if Emacs is compiled with GTK+ support. @end ifnottex @item @code{cursorColor} (class @code{Foreground}) -Color name for text cursor (point). +Text cursor color. If this resource is specified when Emacs starts +up, Emacs sets its value as the background color of the @code{cursor} +face (@pxref{Faces}). -@ifnottex @item @code{cursorBlink} (class @code{CursorBlink}) -Specifies whether to make the cursor blink. The default is @samp{on}. Use -@samp{off} or @samp{false} to turn cursor blinking off. -@end ifnottex +If the value of this resource is @samp{off} or @samp{false} or +@samp{0} at startup, Emacs disables Blink Cursor mode (@pxref{Cursor +Display}). @item @code{font} (class @code{Font}) -Font name for the @code{default} font. @xref{Fonts}. You can also +Font name for the @code{default} face (@pxref{Fonts}). You can also specify a fontset name (@pxref{Fontsets}). @item @code{fontBackend} (class @code{FontBackend}) -The backend(s) to use for drawing fonts; if multiple backends are -specified, they must be comma-delimited and given in order of -precedence. On X, for instance, the value @samp{x,xft} tells Emacs to +Comma-delimited list of backend(s) to use for drawing fonts, in order +of precedence. For instance, the value @samp{x,xft} tells Emacs to draw fonts using the X core font driver, falling back on the Xft font -driver if that fails. Normally, you can leave this resource unset, in -which case Emacs tries using all font backends available on your -graphical device. +driver if that fails. Normally, you should leave this resource unset, +in which case Emacs tries using all available font backends. @item @code{foreground} (class @code{Foreground}) -Color name for text. +Default foreground color for text. @item @code{geometry} (class @code{Geometry}) -Window size and position. Be careful not to specify this resource as -@samp{emacs*geometry}, because that may affect individual menus as well -as the Emacs frame itself. +Window size and position. The value should be a size and position +specification, of the same form as in the @samp{-g} or +@samp{--geometry} command-line option (@pxref{Window Size X}). -If this resource specifies a position, that position applies only to the -initial Emacs frame (or, in the case of a resource for a specific frame -name, only that frame). However, the size, if specified here, applies to -all frames. +The size applies to all frames in the Emacs session, but the position +applies only to the initial Emacs frame (or, in the case of a resource +for a specific frame name, only that frame). + + +Be careful not to specify this resource as @samp{emacs*geometry}, as +that may affect individual menus as well as the main Emacs frame. -@ifnottex @item @code{fullscreen} (class @code{Fullscreen}) The desired fullscreen size. The value can be one of @code{fullboth}, -@code{maximized}, @code{fullwidth} or @code{fullheight}, which correspond to -the command-line options @samp{-fs}, @samp{-mm}, @samp{-fw}, and @samp{-fh} -(@pxref{Window Size X}). - -Note that this applies to the initial frame only. -@end ifnottex +@code{maximized}, @code{fullwidth} or @code{fullheight}, which +correspond to the command-line options @samp{-fs}, @samp{-mm}, +@samp{-fw}, and @samp{-fh} (@pxref{Window Size X}). Note that this +applies to the initial frame only. +@ifnottex @item @code{iconName} (class @code{Title}) Name to display in the icon. @item @code{internalBorder} (class @code{BorderWidth}) -Width in pixels of the internal border. +Width of the internal frame border, in pixels. +@end ifnottex @item @code{lineSpacing} (class @code{LineSpacing}) @cindex line spacing -@cindex leading -Additional space (@dfn{leading}) between lines, in pixels. +Additional space between lines, in pixels. @item @code{menuBar} (class @code{MenuBar}) @cindex menu bar -Give frames menu bars if @samp{on}; don't have menu bars if @samp{off}. -@ifnottex -@xref{Lucid Resources}, and @ref{LessTif Resources}, -@end ifnottex -@iftex -@xref{Lucid Resources}, -@end iftex -for how to control the appearance of the menu bar if you have one. +If the value of this resource is @samp{off} or @samp{false} or +@samp{0}, Emacs disables Menu Bar mode at startup (@pxref{Menu Bars}). @ifnottex @item @code{minibuffer} (class @code{Minibuffer}) -If @samp{none}, don't make a minibuffer in this frame. -It will use a separate minibuffer frame instead. +If @samp{none}, Emacs will not make a minibuffer in this frame; it +will use a separate minibuffer frame instead. @item @code{paneFont} (class @code{Font}) @cindex font for menus @@ -261,7 +232,9 @@ Font name for menu pane titles, in non-toolkit versions of Emacs. @end ifnottex @item @code{pointerColor} (class @code{Foreground}) -Color of the mouse cursor. +Color of the mouse cursor. This has no effect in many graphical +desktop environments, as they do not let Emacs change the mouse cursor +this way. @ifnottex @item @code{privateColormap} (class @code{PrivateColormap}) @@ -271,7 +244,6 @@ visual'' of class PseudoColor and Emacs is using it. @item @code{reverseVideo} (class @code{ReverseVideo}) Switch foreground and background default colors if @samp{on}, use colors as specified if @samp{off}. -@end ifnottex @item @code{screenGamma} (class @code{ScreenGamma}) @cindex gamma correction @@ -281,7 +253,9 @@ Gamma correction for colors, equivalent to the frame parameter @item @code{scrollBarWidth} (class @code{ScrollBarWidth}) @cindex scrollbar width The scroll bar width in pixels, equivalent to the frame parameter -@code{scroll-bar-width}. +@code{scroll-bar-width}. Do not set this resource if Emacs is +compiled with GTK+ support. +@end ifnottex @ifnottex @item @code{selectionFont} (class @code{SelectionFont}) @@ -306,24 +280,16 @@ Name to display in the title bar of the initial Emacs frame. @item @code{toolBar} (class @code{ToolBar}) @cindex tool bar -Number of lines to reserve for the tool bar. A zero value suppresses -the tool bar. For the Emacs tool bar (i.e.@: not Gtk+), if the value -is non-zero and @code{auto-resize-tool-bars} is non-@code{nil}, the -tool bar's size will be changed automatically so that all tool bar -items are visible. If the value of @code{auto-resize-tool-bars} is -@code{grow-only}, the tool bar expands automatically, but does not -contract automatically. To contract the tool bar, you must redraw the -frame by entering @kbd{C-l}. For the Gtk+ tool bar, any non-zero -value means on and @code{auto-resize-tool-bars} has no effect. +If the value of this resource is @samp{off} or @samp{false} or +@samp{0}, Emacs disables Tool Bar mode at startup (@pxref{Tool Bars}). @item @code{useXIM} (class @code{UseXIM}) @cindex XIM @cindex X input methods @cindex input methods, X -Turn off use of X input methods (XIM) if @samp{false} or @samp{off}. -This is only relevant if your Emacs is actually built with XIM -support. It is potentially useful to turn off XIM for efficiency, -especially slow X client/server links. +Disable use of X input methods (XIM) if @samp{false} or @samp{off}. +This is only relevant if your Emacs is built with XIM support. It +might be useful to turn off XIM on slow X client/server links. @item @code{verticalScrollBars} (class @code{ScrollBars}) 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 @ifnottex @item @code{visualClass} (class @code{VisualClass}) -Specify the ``visual'' that X should use. This tells X how to handle -colors. - -The value should start with one of @samp{TrueColor}, -@samp{PseudoColor}, @samp{DirectColor}, @samp{StaticColor}, -@samp{GrayScale}, and @samp{StaticGray}, followed by -@samp{-@var{depth}}, where @var{depth} is the number of color planes. -Most terminals only allow a few ``visuals,'' and the @samp{dpyinfo} -program outputs information saying which ones. +The @dfn{visual class} for X color display. If specified, the value +should start with one of @samp{TrueColor}, @samp{PseudoColor}, +@samp{DirectColor}, @samp{StaticColor}, @samp{GrayScale}, and +@samp{StaticGray}, followed by @samp{-@var{depth}}, where @var{depth} +is the number of color planes. @end ifnottex @end table -@node Face Resources -@appendixsec X Resources for Faces - - You can use resources to customize the appearance of particular -faces (@pxref{Faces}): - -@table @code -@item @var{face}.attributeForeground -Foreground color for face @var{face}. -@item @var{face}.attributeBackground -Background color for face @var{face}. -@item @var{face}.attributeUnderline -Underline flag for face @var{face}. Use @samp{on} or @samp{true} for -yes. -@item @var{face}.attributeStrikeThrough -@itemx @var{face}.attributeOverline -@itemx @var{face}.attributeBox -@itemx @var{face}.attributeInverse -Likewise, for other boolean font attributes. -@item @var{face}.attributeStipple -The name of a pixmap data file to use for the stipple pattern, or -@code{false} to not use stipple for the face @var{face}. -@item @var{face}.attributeBackgroundPixmap -The background pixmap for the face @var{face}. Should be a name of a -pixmap file or @code{false}. -@item @var{face}.attributeFont -Font name (full XFD name or valid X abbreviation) for face @var{face}. -Instead of this, you can specify the font through separate attributes. -@end table - - Instead of using @code{attributeFont} to specify a font name, you can -select a font through these separate attributes: - -@table @code -@item @var{face}.attributeFamily -Font family for face @var{face}. -@item @var{face}.attributeHeight -Height of the font to use for face @var{face}: either an integer -specifying the height in units of 1/10@dmn{pt}, or a floating point -number that specifies a scale factor to scale the underlying face's -default font, or a function to be called with the default height which -will return a new height. -@item @var{face}.attributeWidth -@itemx @var{face}.attributeWeight -@itemx @var{face}.attributeSlant -Each of these resources corresponds to a like-named font attribute, -and you write the resource value the same as the symbol you would use -for the font attribute value. -@item @var{face}.attributeBold -Bold flag for face @var{face}---instead of @code{attributeWeight}. Use @samp{on} or @samp{true} for -yes. -@item @var{face}.attributeItalic -Italic flag for face @var{face}---instead of @code{attributeSlant}. -@end table + You can also use X resources to customize individual Emacs faces +(@pxref{Faces}). For example, setting the resource +@samp{@var{face}.attributeForeground} is equivalent to customizing the +@samp{foreground} attribute of the face @var{face}. However, we +recommend customizing faces from within Emacs, instead of using X +resources. @xref{Face Customization}. +@ifnottex @node Lucid Resources @appendixsec Lucid Menu And Dialog X Resources @cindex Menu X Resources (Lucid widgets) @cindex Dialog X Resources (Lucid widgets) @cindex Lucid Widget X Resources -@ifnottex - If the Emacs installed at your site was built to use the X toolkit -with the Lucid menu widgets, then the menu bar is a separate widget and -has its own resources. The resource names contain @samp{pane.menubar} -(following, as always, the name of the Emacs invocation, or @samp{Emacs}, -which stands for all Emacs invocations). Specify them like this: + If Emacs is compiled with the X toolkit support using Lucid widgets, +you can use X resources to customize the appearance of the menu bar, +pop-up menus, and dialog boxes. The resources for the menu bar fall +in the @samp{pane.menubar} class (following, as always, either the +name of the Emacs executable or @samp{Emacs} for all Emacs +invocations). The resources for the pop-up menu are in the +@samp{menu*} class. The resources for dialog boxes are in the +@samp{dialog*} class. + + For example, to display menu bar entries with the @samp{Courier-12} +font (@pxref{Fonts}), write this: @example -Emacs.pane.menubar.@var{resource}: @var{value} +Emacs.pane.menubar.font: Courier-12 @end example @noindent -For example, to specify the font @samp{Courier-12} for the menu-bar items, -write this: -@end ifnottex -@iftex - If the Emacs installed at your site was built to use the X toolkit -with the Lucid menu widgets, then the menu bar is a separate widget -and has its own resources. The resource specifications start with -@samp{Emacs.pane.menubar}---for instance, to specify the font -@samp{Courier-12} for the menu-bar items, write this: -@end iftex +Lucid widgets can display multilingual text in your locale. To enable +this, specify a @code{fontSet} resource instead of a @code{font} +resource. @xref{Fontsets}. If both @code{font} and @code{fontSet} +resources are specified, the @code{fontSet} resource is used. -@example -Emacs.pane.menubar.font: Courier-12 -@end example - -@noindent -To specify a font, use fontconfig font names as values to the @code{font} -resource, or old style names: - -@example -Emacs.pane.menubar.font: lucidasanstypewriter-10 -@end example - -@noindent -Emacs first tries to open the font as an old style font, and if that fails -as an fontconfig font. In rare cases, Emacs might do the wrong thing. - -@noindent -The Lucid menus can display multilingual text in your locale with old style -fonts. For more information about fontsets see the man page for -@code{XCreateFontSet}. To enable multilingual menu text you specify a -@code{fontSet} resource instead of the font resource. If both -@code{font} and @code{fontSet} resources are specified, the -@code{fontSet} resource is used. - -@noindent -Resources for @emph{non-menubar} toolkit pop-up menus have -@samp{menu*} instead of @samp{pane.menubar}. For example, to specify -the font @samp{8x16} for the pop-up menu items, write this: - -@example -Emacs.menu*.font: 8x16 -@end example - -@noindent -For dialog boxes, use @samp{dialog*}: - -@example -Emacs.dialog*.font: Sans-12 -@end example - - Here is a list of the specific resources for menu bars and pop-up menus: +Here is a list of resources for menu bars, pop-up menus, and dialogs: @table @code @item font @@ -475,11 +349,11 @@ Font for menu item text. @item fontSet Fontset for menu item text. @item foreground -Color of the foreground. +Foreground color. @item background -Color of the background. +Background color. @item buttonForeground -In the menu bar, the color of the foreground for a selected item. +Foreground color for a selected item. @ifnottex @item horizontalSpacing Horizontal spacing in pixels between items. Default is 3. @@ -489,59 +363,51 @@ Vertical spacing in pixels between items. Default is 2. Horizontal spacing between the arrow (which indicates a submenu) and the associated text. Default is 10. @item shadowThickness -Thickness of shadow line around the widget. Default is 1. - -Also determines the thickness of shadow lines around other objects, -for instance 3D buttons and arrows. If you have the impression that -the arrows in the menus do not stand out clearly enough or that the -difference between ``in'' and ``out'' buttons is difficult to see, set -this to 2. If you have no problems with visibility, the default -probably looks better. The background color may also have some effect -on the contrast. +Thickness of shadow lines for 3D buttons, arrows, and other graphical +elements. Default is 1. @end ifnottex @item margin -The margin of the menu bar, in characters. Default is 1. +Margin of the menu bar, in characters. Default is 1. @end table -@ifnottex @node LessTif Resources @appendixsec LessTif Menu X Resources @cindex Menu X Resources (LessTif widgets) @cindex LessTif Widget X Resources - If the Emacs installed at your site was built to use the X toolkit -with the LessTif or Motif widgets, then the menu bar, the dialog -boxes, the pop-up menus, and the file-selection box are separate -widgets and have their own resources. + If Emacs is compiled with the X toolkit support using LessTif or +Motif widgets, you can use X resources to customize the appearance of +the menu bar, pop-up menus, and dialog boxes. However, the resources +are organized differently from Lucid widgets. - The resource names for the menu bar contain @samp{pane.menubar} -(following, as always, the name of the Emacs invocation, or -@samp{Emacs}, which stands for all Emacs invocations). Specify them -like this: + The resource names for the menu bar are in the @samp{pane.menubar} +class, and they must be specified in this form: @smallexample Emacs.pane.menubar.@var{subwidget}.@var{resource}: @var{value} @end smallexample - Each individual string in the menu bar is a subwidget; the subwidget's -name is the same as the menu item string. For example, the word -@samp{File} in the menu bar is part of a subwidget named -@samp{emacs.pane.menubar.File}. Most likely, you want to specify the -same resources for the whole menu bar. To do this, use @samp{*} instead -of a specific subwidget name. For example, to specify the font -@samp{8x16} for the menu-bar items, write this: +@noindent +For pop-up menus, the resources are in the @samp{menu*} class, instead +of @samp{pane.menubar}. For dialog boxes, they are in @samp{dialog}. +In each case, each individual menu string is a subwidget; the +subwidget's name is the same as the menu item string. For example, +the @samp{File} menu in the menu bar is a subwidget named +@samp{emacs.pane.menubar.File}. + + Typically, you want to specify the same resources for the whole menu +bar. To do this, use @samp{*} instead of a specific subwidget name. +For example, to specify the font @samp{8x16} for all menu bar items, +including submenus, write this: @smallexample Emacs.pane.menubar.*.fontList: 8x16 @end smallexample -@noindent -This also specifies the resource value for submenus. - - Each item in a submenu in the menu bar also has its own name for X -resources; for example, the @samp{File} submenu has an item named -@samp{Save (current buffer)}. A resource specification for a submenu -item looks like this: + Each item in a submenu also has its own name for X resources; for +example, the @samp{File} submenu has an item named @samp{Save (current +buffer)}. A resource specification for a submenu item looks like +this: @smallexample 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} @noindent (This should be one long line.) - It's impossible to specify a resource for all the menu-bar items -without also specifying it for the submenus as well. So if you want the -submenu items to look different from the menu bar itself, you must ask -for that in two steps. First, specify the resource for all of them; -then, override the value for submenus alone. Here is an example: + If you want the submenu items to look different from the menu bar +itself, you must first specify the resource for all of them, then +override the value for submenus alone. Here is an example: @smallexample Emacs.pane.menubar.*.fontList: 8x16 Emacs.pane.menubar.popup_*.fontList: 8x16 @end smallexample -@noindent -For LessTif pop-up menus, use @samp{menu*} instead of -@samp{pane.menubar}. For example, to specify the font @samp{8x16} for -the pop-up menu items, write this: - -@smallexample -Emacs.menu*.fontList: 8x16 -@end smallexample - -@noindent -For LessTif dialog boxes, use @samp{dialog} instead of @samp{menu}: - -@example -Emacs.dialog*.fontList: 8x16 -Emacs.dialog*.foreground: hotpink -@end example - -To specify resources for the LessTif file-selection box, use + To specify resources for the LessTif file-selection box, use @samp{fsb*}, like this: @example Emacs.fsb*.fontList: 8x16 @end example -@iftex -@medbreak -@end iftex - Here is a list of the specific resources for LessTif menu bars and -pop-up menus: + Here is a list of resources for LessTif menu bars and pop-up menus: @table @code @item armColor @@ -638,178 +481,92 @@ The color for the border shadow, on the top and the left. @end table @end ifnottex - @node GTK resources @appendixsec GTK resources -@iftex - The most common way to customize the GTK widgets Emacs uses (menus, -dialogs tool bars and scroll bars) is by choosing an appropriate -theme, for example with the GNOME theme selector. - -You can also do Emacs specific customization by inserting GTK style -directives in the file @file{~/.emacs.d/gtkrc}, but only if you have a -Gtk+ version earlier than 3 (i.e.@: 2). Some GTK themes ignore -customizations in @file{~/.emacs.d/gtkrc} so not everything works with -all themes. To customize Emacs font, background, faces, etc., use the -normal X resources (@pxref{Resources}). We will present some examples -of customizations here, but for a more detailed description, see the -online manual - - The first example is just one line. It changes the font on all GTK widgets -to courier with size 12: - -@smallexample -gtk-font-name = "courier 12" -@end smallexample - - The thing to note is that the font name is not an X font name, but a -Pango font name. A Pango font name is basically of the format "family -style size", where the style is optional as in the case above. A name -with a style could be for example: - -@smallexample -gtk-font-name = "helvetica bold 10" -@end smallexample - - To customize widgets you first define a style and then apply the style to -the widgets. Here is an example that sets the font for menus, but not -for other widgets: - -@smallexample -# @r{Define the style @samp{menufont}.} -style "menufont" -@{ - font_name = "helvetica bold 14" # This is a Pango font name -@} - -# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.} -widget "*emacs-menuitem*" style "menufont" -@end smallexample - -The widget name in this example contains wildcards, so the style will be -applied to all widgets that match "*emacs-menuitem*". The widgets are -named by the way they are contained, from the outer widget to the inner widget. -So to apply the style "my_style" (not shown) with the full, absolute name, for -the menubar and the scroll bar in Emacs we use: - -@smallexample -widget "Emacs.pane.menubar" style "my_style" -widget "Emacs.pane.emacs.verticalScrollBar" style "my_style" -@end smallexample - -But to avoid having to type it all, wildcards are often used. @samp{*} -matches zero or more characters and @samp{?} matches one character. So "*" -matches all widgets. - - Each widget has a class (for example GtkMenuItem) and a name (emacs-menuitem). -You can assign styles by name or by class. In this example we have used the -class: - -@smallexample -style "menufont" -@{ - font_name = "helvetica bold 14" -@} - -widget_class "*GtkMenuBar" style "menufont" -@end smallexample - -@noindent -The names and classes for the GTK widgets Emacs uses are: - -@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some} -@item @code{emacs-filedialog} -@tab @code{GtkFileSelection} -@item @code{emacs-dialog} -@tab @code{GtkDialog} -@item @code{Emacs} -@tab @code{GtkWindow} -@item @code{pane} -@tab @code{GtkVHbox} -@item @code{emacs} -@tab @code{GtkFixed} -@item @code{verticalScrollBar} -@tab @code{GtkVScrollbar} -@item @code{emacs-toolbar} -@tab @code{GtkToolbar} -@item @code{menubar} -@tab @code{GtkMenuBar} -@item @code{emacs-menuitem} -@tab anything in menus -@end multitable - - GTK absolute names are quite strange when it comes to menus -and dialogs. The names do not start with @samp{Emacs}, as they are -free-standing windows and not contained (in the GTK sense) by the -Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this: - -@smallexample -widget "*emacs-dialog*" style "my_dialog_style" -widget "*emacs-filedialog* style "my_file_style" -widget "*emacs-menuitem* style "my_menu_style" -@end smallexample - - If you specify a customization in @file{~/.emacs.d/gtkrc}, then it -automatically applies only to Emacs, since other programs don't read -that file. For example, the drop down menu in the file dialog can not -be customized by any absolute widget name, only by an absolute class -name. This is because the widgets in the drop down menu do not -have names and the menu is not contained in the Emacs GtkWindow. To -have all menus in Emacs look the same, use this in -@file{~/.emacs.d/gtkrc}: - -@smallexample -widget_class "*Menu*" style "my_menu_style" -@end smallexample - - Here is a more elaborate example, showing how to change the parts of -the scroll bar: - -@smallexample -style "scroll" -@{ - fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.} - bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.} - bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.} - bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.} -@} - -widget "*verticalScrollBar*" style "scroll" -@end smallexample -@end iftex - -@ifnottex -@cindex GTK resources and customization +@cindex GTK+ resources @cindex resource files for GTK @cindex @file{~/.gtkrc-2.0} file @cindex @file{~/.emacs.d/gtkrc} file - If Emacs was built to use the GTK widget set, then the menu bar, tool bar, -scroll bar and the dialogs are customized with the standard GTK -customization file, @file{~/.gtkrc-2.0}, or with the Emacs specific -file @file{~/.emacs.d/gtkrc}. We recommend that you use -@file{~/.emacs.d/gtkrc} for customizations, since @file{~/.gtkrc-2.0} -seems to be ignored when running GConf with GNOME. These files apply -only to GTK widget features. To customize Emacs font, background, -faces, etc., use the normal X resources (@pxref{Resources}). + If Emacs is compiled with GTK+ toolkit support, the simplest way to +customize its GTK+ widgets (e.g.@: menus, dialogs, tool bars and +scroll bars) is to choose an appropriate GTK+ theme, for example with +the GNOME theme selector. - Some GTK themes override these mechanisms, which means that using -these mechanisms will not work to customize them. + In GTK+ version 2, you can also use @dfn{GTK+ resources} to +customize the appearance of GTK+ widgets used by Emacs. These +resources are specified in either the file @file{~/.emacs.d/gtkrc} +(for Emacs-specific GTK+ resources), or @file{~/.gtkrc-2.0} (for +general GTK+ resources). We recommend using @file{~/.emacs.d/gtkrc}, +since GTK+ seems to ignore @file{~/.gtkrc-2.0} when running GConf with +GNOME. Note, however, that some GTK themes may override +customizations in @file{~/.emacs.d/gtkrc}; there is nothing we can do +about this. GTK+ resources do not affect aspects of Emacs unrelated +to GTK+ widgets, such as fonts and colors in the main Emacs window; +those are governed by normal X resources (@pxref{Resources}). - In these files you first define a style and say what it means; then -you specify to apply the style to various widget types (@pxref{GTK -widget names}). Here is an example of how to change the font for -Emacs menus: + The following sections describe how to customize GTK+ resources for +Emacs. For details about GTK+ resources, see the GTK+ API document at +@uref{http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html}. + + In GTK+ version 3, GTK+ resources have been replaced by a completely +different system. The appearance of GTK+ widgets is now determined by +CSS-like style files: @file{gtk-3.0/gtk.css} in the GTK+ installation +directory, and @file{~/.themes/@var{theme}/gtk-3.0/gtk.css} for local +style settings (where @var{theme} is the name of the current GTK+ +theme). Therefore, the description of GTK+ resources in this section +does not apply to GTK+ 3. For details about the GTK+ 3 styling +system, see +@uref{http://developer.gnome.org/gtk3/3.0/GtkCssProvider.html}. + +@menu +* GTK Resource Basics:: Basic usage of GTK+ resources. +* GTK Widget Names:: How GTK+ widgets are named. +* GTK Names in Emacs:: GTK widgets used by Emacs. +* GTK styles:: What can be customized in a GTK widget. +@end menu + +@node GTK Resource Basics +@appendixsubsec GTK Resource Basics + + In a GTK+ 2 resource file (usually @file{~/.emacs.d/gtkrc}), the +simplest kinds of resource settings simply assign a value to a +variable. For example, putting the following line in the resource +file changes the font on all GTK+ widgets to @samp{courier-12}: @smallexample -# @r{Define the style @samp{menufont}.} -style "menufont" +gtk-font-name = "courier 12" +@end smallexample + +@noindent +Note that in this case the font name must be supplied as a GTK font +pattern (also called a @dfn{Pango font name}), not as a +Fontconfig-style font name or XLFD. @xref{Fonts}. + + To customize widgets you first define a @dfn{style}, and then apply +the style to the widgets. Here is an example that sets the font for +menus (@samp{#} characters indicate comments): + +@smallexample +# @r{Define the style @samp{my_style}.} +style "my_style" @{ - font_name = "helvetica bold 14" # This is a Pango font name + font_name = "helvetica bold 14" @} -# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.} -widget "*emacs-menuitem*" style "menufont" +# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{my_style}.} +widget "*emacs-menuitem*" style "my_style" +@end smallexample + +@noindent +The widget name in this example contains wildcards, so the style is +applied to all widgets matching @samp{*emacs-menuitem*}. The widgets +are named by the way they are contained, from the outer widget to the +inner widget. Here is another example that applies @samp{my_style} +specifically to the Emacs menu bar: + +@smallexample +widget "Emacs.pane.menubar.*" style "my_style" @end smallexample Here is a more elaborate example, showing how to change the parts of @@ -818,47 +575,24 @@ the scroll bar: @smallexample style "scroll" @{ - fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.} - bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.} - bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.} - bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.} + fg[NORMAL] = "red"@ @ @ @ @ # @r{Arrow color.} + bg[NORMAL] = "yellow"@ @ # @r{Thumb and background around arrow.} + bg[ACTIVE] = "blue"@ @ @ @ # @r{Trough color.} + bg[PRELIGHT] = "white"@ # @r{Thumb color when the mouse is over it.} @} widget "*verticalScrollBar*" style "scroll" @end smallexample - There are also parameters that affect GTK as a whole. For example, -the property @code{gtk-font-name} sets the default font for GTK. You -must use Pango font names (@pxref{GTK styles}). A GTK resources file -that just sets a default font looks like this: - -@smallexample -gtk-font-name = "courier 12" -@end smallexample - - The GTK resources file is fully described in the GTK API document. -This can be found in -@file{@var{prefix}/share/gtk-doc/html/gtk/gtk-resource-files.html}, -where @file{prefix} is the directory in which the GTK libraries were -installed (usually @file{/usr} or @file{/usr/local}). You can also -find the document online, at -@uref{http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html}. - -@menu -* GTK widget names:: How widgets in GTK are named in general. -* GTK Names in Emacs:: GTK widget names in Emacs. -* GTK styles:: What can be customized in a GTK widget. -@end menu - -@node GTK widget names +@node GTK Widget Names @appendixsubsec GTK widget names @cindex GTK widget names - A GTK widget is specified by its @dfn{widget class} and -@dfn{widget name}. The widget class is the type of the widget: for -example, @code{GtkMenuBar}. The widget name is the name given to a -specific widget. A widget always has a class, but need not have a -name. + A GTK+ widget is specified by a @dfn{widget name} and a @dfn{widget +class}. The widget name refers to a specific widget +(e.g.@: @samp{emacs-menuitem}), while the widget class refers to a +collection of similar widgets (e.g.@: @samp{GtkMenuItem}). A widget +always has a class, but need not have a name. @dfn{Absolute names} are sequences of widget names or widget classes, corresponding to hierarchies of widgets embedded within @@ -868,55 +602,31 @@ a @code{GtkMenuBar} called @code{menubar}, the absolute class name of the menu-bar widget is @code{GtkWindow.GtkVBox.GtkMenuBar}, and its absolute widget name is @code{top.box.menubar}. - When assigning a style to a widget, you can use the absolute class -name or the absolute widget name. + GTK+ resource files can contain two types of commands for specifying +widget appearances: - There are two commands to specify changes for widgets: +@table @code +@item widget +specifies a style for widgets based on the class name, or just the +class. -@table @asis -@item @code{widget_class} -specifies a style for widgets based on the absolute class name. - -@item @code{widget} -specifies a style for widgets based on the absolute class name, -or just the class. +@item widget_class +specifies a style for widgets based on the class name. @end table @noindent -You must specify the class and the style in double-quotes, and put -these commands at the top level in the GTK customization file, like -this: +See the previous subsection for examples of using the @code{widget} +command; the @code{widget_class} command is used similarly. Note that +the widget name/class and the style must be enclosed in double-quotes, +and these commands must be at the top level in the GTK+ resource file. + + As previously noted, you may specify a widget name or class with +shell wildcard syntax: @samp{*} matches zero or more characters and +@samp{?} matches one character. This example assigns a style to all +widgets: @smallexample -style "menufont" -@{ - font_name = "helvetica bold 14" -@} - -widget "top.box.menubar" style "menufont" -widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "menufont" -@end smallexample - - Matching of absolute names uses shell wildcard syntax: @samp{*} -matches zero or more characters and @samp{?} matches one character. -This example assigns @code{base_style} to all widgets: - -@smallexample -widget "*" style "base_style" -@end smallexample - - Given the absolute class name @code{GtkWindow.GtkVBox.GtkMenuBar} -and the corresponding absolute widget name @code{top.box.menubar}, all -these examples specify @code{my_style} for the menu bar: - -@smallexample -widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style" -widget_class "GtkWindow.*.GtkMenuBar" style "my_style" -widget_class "*GtkMenuBar" style "my_style" -widget "top.box.menubar" style "my_style" -widget "*box*menubar" style "my_style" -widget "*menubar" style "my_style" -widget "*menu*" style "my_style" +widget "*" style "my_style" @end smallexample @node GTK Names in Emacs @@ -924,68 +634,52 @@ widget "*menu*" style "my_style" @cindex GTK widget names @cindex GTK widget classes - In Emacs, the top level widget for a frame is a @code{GtkWindow} -that contains a @code{GtkVBox}. The @code{GtkVBox} contains the -@code{GtkMenuBar} and a @code{GtkFixed} widget. The vertical scroll -bars, @code{GtkVScrollbar}, are contained in the @code{GtkFixed} -widget. The text you write in Emacs is drawn in the @code{GtkFixed} -widget. + The GTK+ widgets used by an Emacs frame are listed below: - Dialogs in Emacs are @code{GtkDialog} widgets. The file dialog is a -@code{GtkFileSelection} widget. +@table @asis +@item @code{Emacs} (class @code{GtkWindow}) +@table @asis +@item @code{pane} (class @code{GtkVBox}) +@table @asis +@item @code{menubar} (class @code{GtkMenuBar}) +@table @asis +@item [menu item widgets] +@end table +@item [unnamed widget] (class @code{GtkHandleBox}) +@table @asis +@item @code{emacs-toolbar} (class @code{GtkToolbar}) +@table @asis +@item [tool bar item widgets] +@end table +@end table +@item @code{emacs} (class @code{GtkFixed}) +@table @asis +@item @code{verticalScrollBar} (class @code{GtkVScrollbar}) +@end table +@end table +@end table +@end table @noindent -To set a style for the menu bar using the absolute class name, use: +The contents of Emacs windows are drawn in the @code{emacs} widget. +Note that even if there are multiple Emacs windows, each scroll bar +widget is named @code{verticalScrollBar}. + + For example, here are two different ways to set the menu bar style: @smallexample -widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style" +widget "Emacs.pane.menubar.*" style "my_style" +widget_class "GtkWindow.GtkVBox.GtkMenuBar.*" style "my_style" @end smallexample -@noindent -For the scroll bar, the absolute class name is: + For GTK+ dialogs, Emacs uses a widget named @code{emacs-dialog}, of +class @code{GtkDialog}. For file selection, Emacs uses a widget named +@code{emacs-filedialog}, of class @code{GtkFileSelection}. -@smallexample -widget_class - "GtkWindow.GtkVBox.GtkFixed.GtkVScrollbar" - style "my_style" -@end smallexample - -@noindent -The names for the emacs widgets, and their classes, are: - -@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some} -@item @code{emacs-filedialog} -@tab @code{GtkFileSelection} -@item @code{emacs-dialog} -@tab @code{GtkDialog} -@item @code{Emacs} -@tab @code{GtkWindow} -@item @code{pane} -@tab @code{GtkVHbox} -@item @code{emacs} -@tab @code{GtkFixed} -@item @code{verticalScrollBar} -@tab @code{GtkVScrollbar} -@item @code{emacs-toolbar} -@tab @code{GtkToolbar} -@item @code{menubar} -@tab @code{GtkMenuBar} -@item @code{emacs-menuitem} -@tab anything in menus -@end multitable - -@noindent -Thus, for Emacs you can write the two examples above as: - -@smallexample -widget "Emacs.pane.menubar" style "my_style" -widget "Emacs.pane.emacs.verticalScrollBar" style "my_style" -@end smallexample - - GTK absolute names are quite strange when it comes to menus -and dialogs. The names do not start with @samp{Emacs}, as they are -free-standing windows and not contained (in the GTK sense) by the -Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this: + Because the widgets for pop-up menus and dialogs are free-standing +windows and not ``contained'' in the @code{Emacs} widget, their GTK+ +absolute names do not start with @samp{Emacs}. To customize these +widgets, use wildcards like this: @smallexample widget "*emacs-dialog*" style "my_dialog_style" @@ -993,14 +687,7 @@ widget "*emacs-filedialog* style "my_file_style" widget "*emacs-menuitem* style "my_menu_style" @end smallexample - If you specify a customization in @file{~/.emacs.d/gtkrc}, then it -automatically applies only to Emacs, since other programs don't read -that file. For example, the drop down menu in the file dialog can not -be customized by any absolute widget name, only by an absolute class -name. This is because the widgets in the drop down menu do not -have names and the menu is not contained in the Emacs GtkWindow. To -have all menus in Emacs look the same, use this in -@file{~/.emacs.d/gtkrc}: + If you want to apply a style to all menus in Emacs, use this: @smallexample widget_class "*Menu*" style "my_menu_style" @@ -1010,15 +697,7 @@ widget_class "*Menu*" style "my_menu_style" @appendixsubsec GTK styles @cindex GTK styles - In a GTK style you specify the appearance widgets shall have. You -can specify foreground and background color, background pixmap and -font. The edit widget (where you edit the text) in Emacs is a GTK -widget, but trying to specify a style for the edit widget will have no -effect. This is so that Emacs compiled for GTK is compatible with -Emacs compiled for other X toolkits. The settings for foreground, -background and font for the edit widget is taken from the X resources; -@pxref{Resources}. Here is an example of two style declarations, -@samp{default} and @samp{ruler}: + Here is an example of two GTK+ style declarations: @smallexample pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" @@ -1128,9 +807,8 @@ text fields in the file dialog. @item font_name = "@var{font}" This specifies the font for text in the widget. @var{font} is a -Pango font name, for example @samp{Sans Italic 10}, @samp{Helvetica -Bold 12}, @samp{Courier 14}, @samp{Times 18}. See below for exact -syntax. The names are case insensitive. +GTK-style (or Pango) font name, like @samp{Sans Italic 10}. +@xref{Fonts}. The names are case insensitive. @end table 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 of color names and RGB triplets. Color names should be enclosed with double quotes, e.g.@: @samp{"red"}. RGB triplets should be written without double quotes, e.g.@: @samp{#ff0000}. GTK-style RGB triplets -have the form - -@smallexample -@code{@{ @var{r}, @var{g}, @var{b} @}} -@end smallexample - -@noindent -where @var{r}, @var{g} and @var{b} are either integers in the range -0-65535 or floats in the range 0.0-1.0. - - Pango font names have the form ``@var{family-list} @var{style-options} -@var{size}.'' -@cindex Pango font name -@noindent -@var{family-list} is a comma separated list of font families optionally -terminated by a comma. This way you can specify several families and the -first one found will be used. @var{family} corresponds to the second part in -an X font name, for example in - -@smallexample --adobe-times-medium-r-normal--12-120-75-75-p-64-iso10646-1 -@end smallexample - -@noindent -the family name is @samp{times}. - -@noindent -@var{style-options} is a whitespace separated list of words where each word -is a style, variant, weight, or stretch. The default value for all of -these is @code{normal}. - -@noindent -A `style' corresponds to the fourth part of an X font name. In X font -names it is the character @samp{r}, @samp{i} or @samp{o}; in Pango -font names the corresponding values are @code{normal}, @code{italic}, -or @code{oblique}. - -@noindent -A `variant' is either @code{normal} or @code{small-caps}. -Small caps is a font with the lower case characters replaced by -smaller variants of the capital characters. - -@noindent -Weight describes the ``boldness'' of a font. It corresponds to the third -part of an X font name. It is one of @code{ultra-light}, @code{light}, -@code{normal}, @code{bold}, @code{ultra-bold}, or @code{heavy}. - -@noindent -Stretch gives the width of the font relative to other designs within a -family. It corresponds to the fifth part of an X font name. It is one of -@code{ultra-condensed}, @code{extra-condensed}, @code{condensed}, -@code{semi-condensed}, @code{normal}, @code{semi-expanded}, -@code{expanded}, @code{extra-expanded}, or @code{ultra-expanded}. - -@noindent -@var{size} is a decimal number that describes the font size in points. -@end ifnottex +have the form @w{@code{@{ @var{r}, @var{g}, @var{b} @}}}, where +@var{r}, @var{g} and @var{b} are either integers in the range 0-65535 +or floats in the range 0.0-1.0. diff --git a/etc/ChangeLog b/etc/ChangeLog index 15257c9fe52..b4e22c506a3 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2012-01-14 Eli Zaretskii + + * tutorials/TUTORIAL.he: Update to follow changes to TUTORIAL in + 2012-01-10T08:27:22Z!cyd@gnu.org. + 2012-01-10 Chong Yidong * tutorials/TUTORIAL: Don't give instructions for old-style X diff --git a/etc/tutorials/TUTORIAL b/etc/tutorials/TUTORIAL index c41b5d1127e..12b22f83245 100644 --- a/etc/tutorials/TUTORIAL +++ b/etc/tutorials/TUTORIAL @@ -296,7 +296,7 @@ like A, 7, *, etc., are inserted as you type them. To insert a Newline character, type (this is the key on the keyboard which is sometimes labeled "Enter"). -To delete the character immediately before the current cursor +To delete the character immediately before the current cursor position, type . This is the key on the keyboard usually labeled "Backspace"--the same one you normally use, outside Emacs, to delete the last character typed. @@ -839,8 +839,8 @@ go to the next occurrence of 'cursor' just type C-s again. If no such occurrence exists, Emacs beeps and tells you the search is currently "failing". C-g would also terminate the search. -If you are in the middle of an incremental search and type , this -the search "retreats" to an earlier location. If you type just +If you are in the middle of an incremental search and type , the +search "retreats" to an earlier location. If you type just after you had typed C-s to advance to the next occurrence of a search string, the moves the cursor back to an earlier occurrence. If there are no earlier occurrences, the erases the last character diff --git a/etc/tutorials/TUTORIAL.he b/etc/tutorials/TUTORIAL.he index 98690501f5f..cb82f87f765 100644 --- a/etc/tutorials/TUTORIAL.he +++ b/etc/tutorials/TUTORIAL.he @@ -198,19 +198,9 @@ argument) משום מקישים אותו לפני הפקודה אליה הוא כתוצאה, התצוגה היתה צריכה לזוז ב־8 שורות. אם ברצונכם לגלול בחזרה, אפשר להשיג זאת ע"י מתן ארגומנט ל־M-v. -אם הפעלתם את Emacs על־גבי מערכת חלונאית כגון X או MS-Windows, אתם +אם הפעלתם את Emacs על־גבי תצוגה גרפית כגון X או MS-Windows, אתם צריכים לראות פס צר וגבוה, ששמו פס גלילה (scroll bar) בצידו של החלון -של Emacs. (שימו לב שבשני צידי החלון קיימים פסים נוספים. אלה נקראים -"השוליים" -- "fringes" -- ומשמשים להצגת סימני המשך שורה וסימונים -אחרים. פס הגלילה, לעומתם, מופיע רק בצד אחד והוא הכי קרוב לקצה החלון -בצד ההוא.) - ->> נסו עתה להקליק בכפתור האמצעי של העכבר בחלק העליון של האזור המודגש - של פס הגלילה. פעולה זו אמורה לגלול את הטקסט בשיעור שתלוי במקום בו - הקלקתם. - ->> נסו לגרור את העכבר מעלה ומטה, תוך כדי לחיצה על הכפתור האמצעי. - כתוצאה, Emacs יגלול את הטקסט מעלה ומטה בהתאם לתנועת העכבר. +של Emacs. ניתן לגלול את הטקסט ע"י הקלקת עכבר בתוך פס הגלילה. אם העכבר שלכם מצויד בגלגל, תוכלו להשתמש גם בו לגלילת הטקסט. @@ -255,9 +245,9 @@ argument) משום מקישים אותו לפני הפקודה אליה הוא מבטלת את שאר החלונות. >> הניעו את הסמן לתוך שורה זו והקישו C-u 0 C-l. ->> עתה הקישו CONTROL-h k CONTROL-f. +>> עתה הקישו C-h k C-f. שימו לב כיצד החלון הנוכחי מצטמצם ומופיע חלון חדש שבו מוצג - התיעוד של הפקודה CONTROL-f. + התיעוד של הפקודה C-f. >> הקישו C-x 1 ושימו לב שהחלון עם ההסבר על C-f נעלם. @@ -271,40 +261,37 @@ argument) משום מקישים אותו לפני הפקודה אליה הוא -------------- אם ברצונכם להכניס טקסט, פשוט הקישו על המקשים המתאימים. תוים רגילים, -כגון A, א, 7, * וכד' מתפרשים ע"י Emacs כטקסט ומיד מתווספים לטקסט -הקיים. הקישו (מקש חזרת גרר) כדי להכניס את תו השורה החדשה +כגון A, א, 7, * וכד' מיד מתווספים לטקסט הקיים. הקישו (מקש +חזרת גרר שלעתים נהוג לקרוא לו "Enter") כדי להכניס את תו השורה החדשה (Newline). -למחיקת התו האחרון שהקשתם הקישו . המקש שאנו קוראים לו -יכול להתקרא בשמות שונים -- "Delete", "DEL" או "Backspace". בדרך כלל -זהו מקש גדול ובולט שנמצא לא הרחק ממקש , והוא משמש אתכם למחיקת -התו אחרון גם בתוכניות אחרות, לא רק ב־Emacs. +למחיקת התו האחרון שהקשתם הקישו . בדרך כלל זהו מקש שמסומן +ב־"Backspace", והוא משמש אתכם למחיקת התו אחרון גם בתוכניות אחרות, לא +רק ב־Emacs. -אם קיים במקלדת שלכם מקש גדול שעליו רשום , אז זהון המקש אשר -ישמש כ־. גם אם יהיה מקש אחר המסומן ב־"Delete" במקום אחרת זה -אינו ה־ שלכם. - -באופן כללי יותר, מוחק את התו שקודם למיקום הסמן. +יתכן שבמקלדת שלכם קיים מקש שעליו רשום , אך זה אינו המקש שאנו +קוראים לו . >> הקישו עתה מספר תוים, ואחר־כך מחקו אותם ע"י הקשות אחדות - על . אל תחששו לשנות את הקובץ הזה -- העותק המקורי + על . אל תחששו לשנות את הקובץ הזה -- העותק המקורי של השיעור יישאר ללא שינוי. אתם עובדים על העותק האישי שלכם. כאשר שורה של טקסט נעשית ארוכה משורה אחת של תצוגה, חלק מהטקסט ממשיך -בשורת תצוגה נוספת, היא "שורת ההמשך". תו לוכסן ("/") בסוף השורה (או -חץ עקלקל קטן באזור השוליים -- "fringe") מסמל שלשורה יש שורת המשך. +בשורת תצוגה נוספת, היא "שורת ההמשך". על תצוגה גרפית יופיע חץ עקלקל קטן +באזור השוליים -- "fringe" שמסמל כי לשורה יש שורת המשך, ואילו על תצוגה +טקסטואלית יופיע תו לוכסן ("/") לאותה תכלית בסוף השורה. >> הקישו טקסט עד שתגיעו לקצה השורה, ואז תמשיכו להקיש עוד טקסט. כתוצאה, תראו שמופיעה שורת המשך. ->> עתה הקישו על־מנת למחוק טקסט עד שהשורה תיעשה קצרה מספיק +>> עתה הקישו על־מנת למחוק טקסט עד שהשורה תיעשה קצרה מספיק ותתאים לשורה בודדת על־גבי התצוגה. שורת ההמשך תיעלם. ניתן למחוק את תו ה־Newline כמו כל תו אחר. מחיקת ה־Newline בין שתי שורות תמזג את השורות לשורה אחת. אם השורה המשולבת תהיה ארוכה מרוחב התצוגה, היא תוצג עם שורת המשך. ->> הניעו את הסמן לתחילת השורה והקישו . כתוצאה, השורה תתמזג +>> הניעו את הסמן לתחילת השורה והקישו . כתוצאה, השורה תתמזג אם קודמתה. >> עתה הקישו כדי להחזיר את ה־Newline שמחקתם. @@ -317,24 +304,24 @@ argument) משום מקישים אותו לפני הפקודה אליה הוא ובכן, למדתם את האופן הבסיסי ביותר להדפיס משהו ב־Emacs ולתקן שגיאות. אפשר למחוק גם מלים ואף שורות שלמות. להלן סיכום פקודות המחיקה: - ‏ מחק תו שלפני הסמן + ‏ מחק תו שלפני הסמן ‏C-d מחק תו מתחת או אחרי הסמן - ‏‪M-‬ גזור מילה שלפני הסמן + ‏‪M-‬ גזור מילה שלפני הסמן ‏M-d גזור מילה שאחרי הסמן ‏C-k גזור טקסט מהסמן ועד סוף השורה ‏M-k גזור טקסט עד סוף המשפט הנוכחי. -שימו לב שהיחס בין ו־C-d לעומת M-‎ ו־M-d ממשיכים את -ההקבלה שבין C-f ו־M-f (אמנם איננו תו בקרה, בוא נזניח את -הנקודה הזו לעת־עתה). C-k ו־M-k דומים ל־C-e ו־M-e, אם נקביל שורות -למשפטים. +שימו לב שהיחס בין ו־C-d לעומת M-‎ ו־M-d ממשיכים את ההקבלה +שבין C-f ו־M-f (אמנם איננו תו בקרה, אבל בוא נזניח את הנקודה הזו +לעת־עתה). C-k ו־M-k דומים ל־C-e ו־M-e, אם נקביל שורות למשפטים. בנוסף, קיימת שיטה אחידה שמאפשרת לגזור קטע כלשהו של טקסט. לשם כך, תגיעו -לקצה האחד של חלק הטקסט והקישו C-@‎ או C-‎ (אחד מבין שני אלו). -( הוא מקש הרווח.) עתה הניעו את הסמן לקצה השני של חלק הטקסט והקישו -C-w. כתוצאה, כל הטקסט בין שני המקומות הללו ייגזר. +לקצה האחד של חלק הטקסט והקישו C-‎. ( הוא מקש הרווח.) עתה +הניעו את הסמן לקצה השני של חלק הטקסט אשר ברצונכם לגזור. תוך כדי תנועת +הסמן Emacs צובע את הטקסט בין הסמן לבין המקום בו הקשתם C-‎. לבסוף, +הקישו C-w. כתוצאה, כל הטקסט בין שני המקומות הללו ייגזר. >> הניעו את הסמן אל האות ב בתחילת הפיסקה הקודמת. >> הקישו C-‎. ‏Emacs צריך להציג הודעה האומרת "Mark set" בתחתית @@ -348,7 +335,7 @@ C-w. כתוצאה, כל הטקסט בין שני המקומות הללו ייג הטקסט הגזור נקרא "הדבקה" ("yanking"). באופן כללי, פקודות אשר עלולות להעלים כמויות גדולות של טקסט תמיד גוזרות את הטקסט (כך שניתן יהיה בקלות לשחזרו) בעוד הפקודות שמורידות תו בודד או שורות ריקות ותוי רווח -- -מוחקות (כך שלא ניתן להדביק את הטקסט שנמחק). כך, ו־C-d מוחקים +מוחקות (כך שלא ניתן להדביק את הטקסט שנמחק). כך, ו־C-d מוחקים כאשר מפעילים אותם ללא ארגומנט, אבל גוזרים כאשר מפעילים אותם עם ארגומנט. >> הניעו את הסמן לתחילת שורה שאינה ריקה. אחר־כך הקישו C-k כדי לגזור @@ -406,23 +393,22 @@ C-w. כתוצאה, כל הטקסט בין שני המקומות הללו ייג -------------- אם שיניתם את הטקסט ואז החלטתם שהשינוי היה טעות, תוכלו לבטל את השינוי -בעזרת פקודת הביטול, C-x u. +בעזרת פקודת הביטול, ‪C-/‬. -בדרך כלל, C-x u מבטל את השינויים שבוצעו ע"י פקודה אחת. הפעלה חוזרת של -C-x u ברצף מבטלת שינויים של פקודות קודמות, אחת אחרי השניה. +בדרך כלל,‪C-/‬ מבטל את השינויים שבוצעו ע"י פקודה אחת. הפעלה חוזרת של +‪C-/‬ ברצף מבטלת שינויים של פקודות קודמות, אחת אחרי השניה. שני יוצאים מהכלל הזה: פקודות שאינן משנות טקסט (למשל פקודות הנעת הסמן ופקודות גלילה) אינן נספרות ותוים שמכניסים את עצמם מקובצים בקבוצות של -עד 20, כדי להקטין את מספר הפעמים שיש להקיש C-x u כדי לבטל הכנסת טקסט. +עד 20, כדי להקטין את מספר הפעמים שיש להקיש ‪C-/‬ כדי לבטל הכנסת טקסט. ->> גזרו שורה זו עם C-k, אחר־כך הקישו C-x u והיא תופיע שוב. +>> גזרו שורה זו עם C-k, אחר־כך הקישו ‪C-/‬ והיא תופיע שוב. -‏C-_‎ הינה דרך חלופית להפעיל את פקודת הביטול. היא פועלת בדיוק כמו C-x u, -אבל קלה יותר להקשה מספר פעמים בזו אחר זו. החסרון של C-_‎ הוא שבכמה -מקלדות לא ברור מאליו כיצד להקיש זאת. זו הסיבה לקיומו של C-x u. במקלדות -אחדות ניתן להקיש C-_‎ ע"י החזקת CONTROL והקשת לוכסן /. +‏C-_‎ הינה דרך חלופית להפעיל את פקודת הביטול. היא פועלת בדיוק כמו ‪C-/‬. +במקלדות אחדות הקשה על ‪C-/‬ שולחת ל־Emacs את התו C-_‎. חלופה נוספת היא +C-x u, אם־כי היא פחות נוחה להקשה מספר פעמים בזו אחר זו. -ארגומנט נומרי ל־C-_‎ או ל־C-x u משמש כמספר החזרות על הפקודה. +ארגומנט נומרי ל־‪C-/‬ או ל־C-_‎ או ל־C-x u משמש כמספר החזרות על הפקודה. ניתן לבטל מחיקה של טקסט בדיוק כמו שניתן לבטל גזירה. ההבדלים בין מחיקה וגזירה משפיעים על יכולתכם להדביק את הטקסט הגזור עם C-y; הם אינם חשובים @@ -442,15 +428,15 @@ C-x u ברצף מבטלת שינויים של פקודות קודמות, אחת שלם במערכת שלא כרצונכם. אפילו אם אתם שומרים את הקובץ, Emacs משאיר את התוכן המקורי בשם שונה למקרה שמאוחר יותר תחליטו שהשינויים נעשו בטעות. -אם תביטו בחלק התחתון של התצוגה, תראו שם שורה בולטת שמתחילה ומסתיימת -במקפים וליד הקצה השמאלי שלה כתוב "TUTORIAL.he". חלק זה של התצוגה בדרך -כלל מציג את שם הקובץ אותו אתם פוקדים. כרגע אתם פוקדים קובץ בשם -"TUTORIAL.he" שהוא עותק הטיוטה האישי שלכם של שיעור השימוש ב־Emacs. -פתיחת קובץ כלשהו ב־Emacs תציג את שמו של הקובץ במקום זה. +אם תביטו בחלק התחתון של התצוגה, תראו שם שורה בולטת שמתחילה במקפים וליד +הקצה השמאלי שלה כתוב "TUTORIAL.he". חלק זה של התצוגה בדרך כלל מציג את +שם הקובץ אותו אתם פוקדים. כרגע אתם פוקדים קובץ בשם "TUTORIAL.he" שהוא +עותק הטיוטה האישי שלכם של שיעור השימוש ב־Emacs. פתיחת קובץ כלשהו +ב־Emacs תציג את שמו של הקובץ במקום זה. היבט אחד מיוחד של פתיחת קובץ הוא שיש לציין את שם הקובץ אשר ברצונכם -לפתוח. אנו אומרים שהפקודה "קוראת ארגומנט מהמסוף" (במקרה זה הארגומנט -הוא שם הקובץ). אחרי שתקישו את הפקודה +לפתוח. אנו אומרים שהפקודה "קוראת ארגומנט" (במקרה זה הארגומנט הוא שם +הקובץ). אחרי שתקישו את הפקודה ‏C-x C-f פתח קובץ @@ -465,12 +451,11 @@ C-x u ברצף מבטלת שינויים של פקודות קודמות, אחת >> הקישו C-x C-f ואחר־כך הקישו C-g. זה מבטל את המיני־חוצץ וגם מבטל את הפקודה C-x C-f שהשתמשה במיני־חוצץ. התוצאה היא שאף קובץ לא נפתח. -משסיימתם להקיש את שם הקובץ, הקישו לסיים את הקלט. או־אז תיגש -C-x C-f לעבודה ותמצא ותפתח את הקובץ שבחרתם. המיני־חוצץ נעלם כאשר -פקודת ה־C-x C-f תסיים את עבודתה. - -זמן קצר אחר־כך תוכן הקובץ יופיע על־גבי התצוגה ותוכלו לבצע בו שינויים. -כשתחליטו לשמור את השינויים, הקישו את הפקודה הבאה: +משסיימתם להקיש את שם הקובץ, הקישו לסיים את הקלט. או־אז +המיני־חוצץ נעלם והפקודה C-x C-f תיגש לעבודה ותמצא ותפתח את הקובץ +שבחרתם. כאשר פקודת ה־C-x C-f תסיים את עבודתה, תוכן הקובץ יופיע על־גבי +התצוגה ותוכלו לבצע בו שינויים. כשתחליטו לשמור את השינויים, הקישו את +הפקודה הבאה: ‏C-x C-s שמור את הקובץ @@ -482,8 +467,9 @@ C-x C-f לעבודה ותמצא ותפתח את הקובץ שבחרתם. המי לשמור לעתים מזומנות על־מנת להימנע מלאבד יותר מדי מהעבודה שלכם אם המחשב ייפול (ראה להלן פיסקה על שמירה אוטומטית). ->> הקישו C-x C-s כדי לשמור את העותק שלכם של השיעור. - כתוצאה, תופיע ההודעה "Wrote ... TUTORIAL.he" בתחתית התצוגה. +>> הקישו C-x C-s TUTORIAL.he ותסיימו בהקשת . כתוצאה, שיעור זה + יישמר בקובץ בשם TUTORIAL.he ובתחתית התצוגה תופיע ההודעה + "Wrote ...TUTORIAL.he". ניתן לפתוח קובץ קיים על־מנת לצפות בו או לערוך אותו. ניתן גם לפתוח קובץ שאינו קיים. זו הדרך ליצור קבצים חדשים בעזרת Emacs: פתחו את הקובץ @@ -498,10 +484,6 @@ Emacs ייצור את הקובץ עם הטקסט שהקשתם. מאותו רגע אם תפתחו קובץ נוסף עם C-x C-f, הקובץ הראשון עדיין נשאר פתוח ב־Emacs. תוכלו לחזור אליו ע"י C-x C-f. כך תוכלו לפתוח מספר רב של קבצים. ->> ניצור עתה קובץ בשם "foo" ע"י הקשת C-x C-f foo ‎. - אחר־כך הכניסו קצת טקסט, ערכו אותו ולבסוף שמרו בקובץ "foo" - ע"י C-x C-s. עתה חזרו לשיעור בעזרת C-x C-f TUTORIAL.he ‎. - ‏Emacs מחזיק כל קובץ בתוך יישות בשם "חוצץ" ("buffer"). פתיחת קובץ יוצרת חוצץ חדש בתוך Emacs. כדי לראות את רשימת החוצצים הקיימים בתוך Emacs, הקישו @@ -522,17 +504,19 @@ Emacs ייצור את הקובץ עם הטקסט שהקשתם. מאותו רגע ע"י C-x C-f שיפקוד את הקובץ בשנית. אבל קיימת דרך פשוטה יותר: שימוש בפקודה C-x b. פקודה זו תחייב אותכם להקיש את שם החוצץ. ->> הקישו C-x b foo ‎ כדי לחזור לחוצץ "foo" אשר מחזיק טקסט של - הקובץ "foo". אחר־כך הקישו C-x b TUTORIAL.he ‎ כדי לשוב - לשיעור זה. +>> ניצור עתה קובץ בשם "foo" ע"י הקשת C-x C-f foo ‎. + עתה חזרו לשיעור זה בעזרת C-x b TUTORIAL.he ‎. ברוב המקרים שם החוצץ זהה לשם הקובץ (ללא שם התיקיה שלו). אבל אין זה -תמיד כך. רשימת החוצצים שנוצרת ע"י C-x C-b תמיד תציג את שמות כל החוצצים -הקיימים ב־Emacs. +תמיד כך. רשימת החוצצים שנוצרת ע"י C-x C-b תציג הן את שם החוצץ והן את +שם הקובץ עבור כל החוצצים הקיימים ב־Emacs. כל טקסט שמוצג בחלון של Emacs הינו תמיד חלק של חוצץ כלשהו. קיימים -חוצצים שאינם קשורים לשום קובץ. לדוגמא, החוצץ בשם "*Buffer List*" אינו -מציג שום קובץ. זהו חוצץ המחזיק את רשימת החוצצים שנוצר ע"י C-x C-b. +חוצצים שאינם קשורים לשום קובץ. לדוגמא, החוצץ בשם "*Buffer List*" +המחזיק את רשימת החוצצים שנוצרה ע"י C-x C-b אינו מציג שום קובץ. גם +לחוצץ הנוכחי ששמו TUTORIAL.he לא היה קובץ עד שהקשתם על C-x C-s כדי +לשמור אותו בקובץ. + חוצץ בשם "*Messages*" אף הוא אינו קשור לשום קובץ; הוא מחזיק את ההודעות שהופיעו בשורה התחתונה במהלך עבודתכם בתוך Emacs. @@ -573,11 +557,11 @@ C-x C-s. לכן קיימת פקודה מ־Emacs -- ‏C-x C-c. (כשאתם מפעילים C-x C-c, אל תדאגו לשינויים שטרם נשמרו; C-x C-c מציע לשמור כל קובץ ששיניתם לפני שהוא מסיים את Emacs.) -אם אתם משתמשים בצג גרפי אשר תומך במספר תוכניות במקביל, אינכם זקוקים -לפקודה מיוחדת כדי לעבור מ־Emacs לתוכנית אחרת. אפשר לעשות זאת בעזרת -העכבר או פקודות של מנהל החלונות. אולם, כאשר אתם משתמשים בתצוגה -טקסטואלית שמסוגלת להציג רק תוכנית אחת בו־זמנית, תצטרכו "להשעות" -("suspend") את Emacs על־מנת לעבור לתוכנית אחרת. +אם אתם משתמשים בצג גרפי, אינכם זקוקים לפקודה מיוחדת כדי לעבור מ־Emacs +לתוכנית אחרת. אפשר לעשות זאת בעזרת העכבר או פקודות של מנהל החלונות. +אולם, כאשר אתם משתמשים בתצוגה טקסטואלית שמסוגלת להציג רק תוכנית אחת +בו־זמנית, תצטרכו "להשעות" ("suspend") את Emacs על־מנת לעבור לתוכנית +אחרת. הפקודה C-z יוצאת מ־Emacs *באופן זמני* -- כך שתוכלו לשוב אליו מאוחר יותר ולהמשיך מאותה נקודה. כאשר Emacs רץ על תצוגת טקסט, C-z "משעה" את @@ -587,8 +571,7 @@ Emacs: הוא מחזיר אתכם לשורת הפקודות הבסיסית של הרגע הנכון להשתמש ב־C-x C-c הוא כאשר אתם עומדים להתנתק (log out). כמו־כן, תצטרכו להשתמש בו כדי לצאת מ־Emacs שהופעל ע"י תוכניות אחרות -כגון קריאת דואר אלקטרוני -- תוכניות אלו לא תמיד יודעות להסתדר עם -השעיית Emacs. +כגון קריאת דואר אלקטרוני. קיימות פקודות C-x רבות מאד. להלן רשימת אלו שכבר למדתם: @@ -607,7 +590,7 @@ replace-string (החלף מחרוזת) אשר מחליפה מחרוזת אחת אחרי שתקישו M-x, ‏Emacs מציג M-x בתחתית התצוגה ומחכה שתקישו את שם הפקודה, במקרה זה "replace-string". מספיק שתקישו "repl s‎" ו־Emacs ישלים את השם המלא. ( הוא מקש Tab, בדרך כלל תמצאו אותו מעל מקש -ה־CapsLock או Shift, ליד הקצה השמאלי של המקלדת.) סיימו את שם הפקודה +ה־CapsLock או Shift, ליד הקצה השמאלי של המקלדת.) סיימו את הזנת הפקודה ע"י הקשת . הפקודה להחלפת מחרוזת זקוקה לשני ארגומנטים -- המחרוזת שתוחלף וזו שתחליף @@ -651,15 +634,15 @@ replace-string (החלף מחרוזת) אשר מחליפה מחרוזת אחת השורה שמעל אזור תצוגת הד נקראת "שורת הסטטוס" (mode line). שורה זו מציגה משהו כמו: - -U:**- TUTORIAL.he 63% L651 (Fundamental)----------------------- + U:**- TUTORIAL.he 63% L651 (Fundamental) שורה זו מציגה מידע חשוב לגבי מצבו של Emacs ולגבי הטקסט שנמצא בעריכה. אתם כבר יודעים מהי משמעותו של שם הקובץ -- זהו הקובץ שפתחתם. NN%‎ מציין -את מיקומכם הנוכחי בתוך הטקסט, לאמור כי NN אחוזים מהטקסט קודמים לטקסט -המוצג כרגע בחלון. אם המוצג בחלון כולל את תחילת הטקסט, תראו שם "Top" -במקום "0% ". אם המוצג בחלון כולל את סוף הטקסט, תראו שם "Bot" ‏(bottom). -אם הטקסט כל־כך קצר שכולו מוצג בחלון, שורת הסטטוס תציג "All". +את מיקומכם הנוכחי בתוך הטקסט, לאמור כי NN אחוזים מתכולת החוצץ קודמים +לטקסט המוצג כרגע בחלון. אם המוצג בחלון כולל את תחילת הטקסט, תראו שם +"Top" במקום "0% ". אם המוצג בחלון כולל את סוף הטקסט, תראו שם "Bot" +‏(bottom). אם הטקסט כל־כך קצר שכולו מוצג בחלון, שורת הסטטוס תציג "All". האות L והמספר שאחריה מציינים את המיקום הנוכחי בדרך אחרת: הם מראים את מספר השורה שבה נמצא הסמן. @@ -698,7 +681,7 @@ replace-string (החלף מחרוזת) אשר מחליפה מחרוזת אחת לצפיה בתיעוד של האופן הראשי הנוכחי יש להקיש C-h m. ->> השתמשו ב־C-u C-v פעם אחת או יותר כדי להביא שורה זו לראשית התצוגה. +>> הקישו C-l C-l כדי להביא שורה זו לראשית התצוגה. >> עתה הקישו C-h m כדי לראות במה Text mode שונה מה־Fundamental mode. >> לבסוף, הקישו C-x 1 כדי לסלק את התיעוד מהתצוגה. @@ -740,9 +723,9 @@ Auto Fill mode. כאשר אופן זה מופעל, Emacs אוטומטית פות * חיפוש ------- -‏Emacs יכול לחפש מחרוזות (רצף של תווים או מילים) קדימה או אחורה בתוך -הטקסט. חיפוש של מחרוזת הוא סוג של פקודה להנעת הסמן: הוא ממקם את הסמן -היכן שנמצאה המחרוזת הבאה. +‏Emacs יכול לחפש מחרוזות (רצף של תווים) קדימה או אחורה בתוך הטקסט. +חיפוש של מחרוזת הוא סוג של פקודה להנעת הסמן: הוא ממקם את הסמן היכן +שנמצאה המחרוזת הבאה. החיפוש של Emacs הינו "מצטבר" ("incremental"). פירוש הדבר הוא שהחיפוש מתבצע במקביל להקשתכם את המחרוזת אותה ברצונכם למצוא. @@ -759,7 +742,7 @@ Auto Fill mode. כאשר אופן זה מופעל, Emacs אוטומטית פות "סמן", עם הפסקה אחרי כל אות, ושימו לב להתנהגות הסמן. זה עתה מצאתם את המילה "סמן" פעם אחת. >> הקישו C-s שוב, כדי למצוא את "סמן" במקומות נוספים בטקסט. ->> הקישו שלוש פעמים ושימו לב לתנועת הסמן בכל הקשה. +>> הקישו שלוש פעמים ושימו לב לתנועת הסמן בכל הקשה. >> הקישו לסיום החיפוש. האם שמתם לב למה שקרה? במהלך "חיפוש מצטבר" Emacs מנסה למצוא את המקום @@ -768,16 +751,13 @@ Auto Fill mode. כאשר אופן זה מופעל, Emacs אוטומטית פות ומודיע שהחיפוש נכנס למצב של "כשלון" ("failing"). הקשה על C-g גם היא מסיימת את החיפוש. -(הערה: במערכות אחדות הקשה על C-s מקפיעה את תצוגת המסך, כך שלא תראו -יותר שום פלט של Emacs. משמעות הדבר שתכונת מערכת ההפעלה ששמה "flow -control" מופעלת ע"י C-s ואינה מעבירה את C-s ל־Emacs. לביטול הקפאת -התצוגה במערכות אלו יש להקיש C-q.) - -אם במהלך החיפוש תקישו על , תראו שהתו האחרון של המחרוזת -המבוקשת נמחק והחיפוש חוזר למקום הקודם בו נמצאה המחרוזת ללא התו האחרון. -למשל, נניח שהקשתם "ס" על־מנת למצוא את המקום הבא בו מופיעה האות "ס". אם -עכשיו תקישו "מ", הסמן יזוז למקום בו נמצא "סמ". עתה הקישו . -ה־"מ" נמחק מהמחרוזת והסמן חוזר למקום בו הוא מצא את "ס" לראשונה. +אם במהלך החיפוש תקישו על , החיפוש "נסוג" למצב קודם. אם הקשתם + מיד אחרי C-s, הקשת מחזירה את הסמן למקום הקודם בו נמצאה +המחרוזת. אם אין מקומות קודמים בהם מופיעה המחרוזת, הקשת מוחקת את +התו האחרון של המחרוזת המבוקשת. למשל, נניח שהקשתם "ס" על־מנת למצוא את +המקום הבא בו מופיעה האות "ס". אם עכשיו תקישו "מ", הסמן יזוז למקום בו +נמצא "סמ". עתה הקישו . ה־"מ" נמחק מהמחרוזת והסמן חוזר למקום בו +הוא מצא את "ס" לראשונה. אם במהלך החיפוש תפעילו פקודה כלשהי ע"י הקשה על מקש תוך לחיצה על CONTROL או META, החיפוש יסתיים. (כמה תווים יוצאים מכלל זה -- אלו תווים @@ -796,10 +776,10 @@ CONTROL או META, החיפוש יסתיים. (כמה תווים יוצאים מ שתוכניות אחרות מכנות "חלון". תבניות מתוארות בפסקה הבאה. תוכלו למצוא את רשימת המונחים של Emacs בפרק "Glossary" של מדריך משתמש.) ->> הביאו סמן לשורה זו והקישו C-u 0 C-l ‏(CONTROL-L ולא CONTROL-1). +>> הביאו סמן לשורה זו והקישו C-l C-l ‏(CONTROL-L ולא CONTROL-1). >> עתה הקישו C-x 2 וכתוצאה מכך החלון יתחלק לשניים. כל אחד משני החלונות - מציג את השיעור הזה. הסמן נשאר בחלון העליוןץ + מציג את השיעור הזה. הסמן נשאר בחלון העליון. >> הקישו C-M-v כדי לגלול את החלון התחתון. (אם במקלדת שלכם אין מקש META אמיתי, הקישו ‎ C-v כתחליף.) @@ -812,19 +792,19 @@ CONTROL או META, החיפוש יסתיים. (כמה תווים יוצאים מ >> הקישו C-x o שוב לחזור לחלון העליון. הסמן בחלון העליון יישאר במקום בו הוא היה לפני־כן. -תוכלו להמשיך להשתמש ב־C-x o כדי לדלג בין שני החלונות. לכל חלון מיקום -סמן משלו, אבל רק חלון אחד מציג את הסמן בכל רגע. כל פקודות העריכה -הרגילות פועלות על החלון שבו מוצג הסמן. אנו קוראים לחלון זה "החלון -הנבחר". +תוכלו להמשיך להשתמש ב־C-x o כדי לדלג בין החלונות. "החלון הנבחר", אותו +חלון בו הנכם עורכים טקסט, מזוהה ע"י סמן בולט שמהבהב בזמן שאינכם +מקלידים. לכל החלונות האחרים מיקום סמן משלהם; אם הפעלתם את Emacs על צג +גרפי, מיקום הסמן בחלונות האחרים מוצג כתיבה ריקה שאינה מהבהבת. הפקודה C-M-v נוחה מאד כאשר הינכם עורכים טקסט בחלון אחד ומשתמשים בחלון -אחר לייחוס. תוכלו בכל עת לשמור על הסמן בחלון בו אתם עורכים טקסט -ולהתקדם בחלון השני בעזרת C-M-v. +אחר לייחוס. תוכלו להתקדם בחלון השני בעזרת C-M-v מבלי לעזוב את החלון +הנבחר. ‏C-M-v היא דוגמא אחת של פקודת CONTROL-META. אם במקלדת שלכם קיים מקש -META אמיתי, תוכלו להקיש את הפקודה ע"י לחיצה והחזקה של מקשי CONTROL -ו־META גם יחד ואז להקיש v. הסדר שבו תלחצו על CONTROL ו־META אינו משנה -כי שני המקשים הללו פועלים ע"י שינוי התו המוקש יחד איתם. +META (או Alt) אמיתי, תוכלו להקיש את הפקודה ע"י לחיצה והחזקה של מקשי +CONTROL ו־META גם יחד ואז להקיש v. הסדר שבו תלחצו על CONTROL ו־META +אינו משנה כי שני המקשים הללו פועלים ע"י שינוי התו המוקש יחד איתם. אם אין במקלדת מקש META אמיתי ואתם משתמשים ב־ כתחליף, הסדר כן משנה: חייבים להקיש ורק לאחר מכן CONTROL-v, וזאת משום @@ -853,9 +833,10 @@ META אמיתי, תוכלו להקיש את הפקודה ע"י לחיצה והח * תבניות מרובות --------------- -‏Emacs מסוגל לפתוח מספר "תבניות" ("frames") בתנאי שאינכם משתמשים בצג -שמסוגל להציג רק טקסט. תבנית כוללת קבוצת חלונות, תפריט, פסי גלילה, אזור -תצוגת הד וכו'. (תוכניות אחרות נוהגות לקרוא לזה "חלון".) +‏Emacs מסוגל לפתוח מספר "תבניות" ("frames"). תבנית כוללת קבוצת חלונות, +תפריט, פסי גלילה, אזור תצוגת הד וכו'. על צג גרפי מה שאנו קוראים +"תבנית" נקרא בדרך־כלל "חלון". ניתן להציג תבניות אחדות על אותו צג גרפי +בו־זמנית על צג טקסטואלי אפשר להציג רק תבנית אחת בכל עת. >> הקישו M-x make-frame ‎. כתוצאה, תבנית חדשה תופיע על המסך. @@ -866,10 +847,10 @@ META אמיתי, תוכלו להקיש את הפקודה ע"י לחיצה והח >> הקישו M-x delete-frame ‎. התבנית שבה הקשתם את הפקודה תיסגר ותיעלם מהמסך. -כמו־כן, ניתן לסגור תבנית בדרך הרגילה הנתמכת ע"י מנהל החלונות של המערכת -שלכם (בדרך־כלל, ע"י הקלקה על הכפתור המסומן ב־"X" בפינה עליונה של -התבנית.) שום מידע אינו הולך לעיבוד כאשר סוגרים תבנית (או חלון). המידע -הזה פשוט יורד מהתצוגה, אבל ניתן לאחזרו מאוחר יותר. +כמו־כן, ניתן לסגור תבנית בדרך הרגילה הנתמכת ע"י התצוגה הגרפית של +המערכת שלכם (בדרך־כלל, ע"י הקלקה על הכפתור המסומן ב־"X" בפינה עליונה +של התבנית.) שום מידע אינו הולך לעיבוד כאשר סוגרים תבנית (או חלון). +המידע הזה פשוט יורד מהתצוגה, אבל ניתן לאחזרו מאוחר יותר. * רמות עריכה רקורסיביות @@ -983,7 +964,7 @@ find-file. ושמות קבצים. תכונת ההשלמה מתוארת במלואה במדריך למשתמש Emacs בצומת (node) בשם "Completion". -‏Dired מאפשר להציג רשימת קבצים בתיקיה (וכאפציה גם בתת-תיקיות שלה), לנוע +‏Dired מאפשר להציג רשימת קבצים בתיקיה (וכאפציה גם בתת־תיקיות שלה), לנוע בתוך הרשימה הזו, לפתוח קבצים, לשנות את שמותיהם, למחוק אותם ולבצע עליהם עוד פעולות רבות. Dired מתואר במלואו במדריך למשתמש בצומת בשם "Dired". diff --git a/etc/tutorials/TUTORIAL.translators b/etc/tutorials/TUTORIAL.translators index a69d23c471d..64780687bb1 100644 --- a/etc/tutorials/TUTORIAL.translators +++ b/etc/tutorials/TUTORIAL.translators @@ -12,8 +12,7 @@ Maintainer: Sun Yijiang * TUTORIAL.cs: Author: Milan Zamazal Pavel Janík -Maintainer: Milan Zamazal - Pavel Janík +Maintainer: Maintainer needed. * TUTORIAL.de: Author: Werner Lemberg @@ -73,7 +72,7 @@ Maintainer: Alex Ott * TUTORIAL.sk: Author: Miroslav Vaško Pavel Janík -Maintainer: Pavel Janík +Maintainer: Maintainer needed. * TUTORIAL.sl: Author: Primož Peterlin diff --git a/lisp/ChangeLog b/lisp/ChangeLog index be7c45339fa..e40d43ee8b9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,32 @@ +2012-01-15 Michael Albinus + + * net/tramp-sh.el (tramp-remote-path): Set tramp-autoload cookie. + +2012-01-14 Eli Zaretskii + + * info.el (Info-toc-build): If the Info file has no "Up" pointer, + don't pass the (nil) value of `upnode' to string-match. + +2012-01-14 Chong Yidong + + * startup.el (command-line): Fix X resource class for cursorColor. + Fix values recognized by the cursorBlink resource. + +2012-01-14 Paul Eggert + + * epg.el (epg--make-temp-file): Avoid permission race condition + when running on old Emacs versions (bug#10403). + +2012-01-14 Glenn Morris + + * dired.el (dired-get-filename): Fix 'verbatim case of previous change. + 2012-01-13 Glenn Morris + * dired.el (dired-switches-escape-p): New function. + (dired-insert-directory): Use dired-switches-escape-p. + (dired-get-filename): Undo "\ " quoting if needed. (Bug#10469) + * find-dired.el (find-ls-option): Doc fix. (Bug#10262) 2012-01-12 Glenn Morris diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index 7d6f9f570ec..f9a546ec894 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog @@ -1,3 +1,20 @@ +2012-01-09 Eric Ludlam + + * ede.el (ede-project-directories): New option. + (ede-directory-safe-p): Check it. + (ede-initialize-state-current-buffer, ede, ede-new) + (ede-check-project-directory, ede-rescan-toplevel) + (ede-load-project-file, ede-parent-project, ede-current-project): + (ede-target-parent): Avoid loading in a project unless it is safe, + since it may involve malicious code. This security flaw was + pointed out by Hiroshi Oota. + + * ede/auto.el (ede-project-autoload): Add safe-p slot. + (ede-project-class-files): Projects using Project.ede are unsafe. + (ede-auto-load-project): New method. + + * ede/simple.el (ede-project-class-files): Mark as unsafe. + 2011-12-19 Sam Steingold * semantic/edit.el (semantic-edits-incremental-parser): Add the diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el index 5f336df5514..cc8b6f53242 100644 --- a/lisp/cedet/ede.el +++ b/lisp/cedet/ede.el @@ -94,6 +94,42 @@ target willing to take the file. 'never means never perform the check." :group 'ede :type 'sexp) ; make this be a list of options some day +(defcustom ede-project-directories nil + "Directories in which EDE may search for project files. +If the value is t, EDE may search in any directory. + +If the value is a function, EDE calls that function with one +argument, the directory name; the function should return t iff +EDE should look for project files in the directory. + +Otherwise, the value should be a list of fully-expanded directory +names. EDE searches for project files only in those directories. +If you invoke the commands \\[ede] or \\[ede-new] on a directory +that is not listed, Emacs will offer to add it to the list. + +Any other value disables searching for EDE project files." + :group 'ede + :type '(choice (const :tag "Any directory" t) + (repeat :tag "List of directories" + (directory)) + (function :tag "Predicate")) + :version "23.4" + :risky t) + +(defun ede-directory-safe-p (dir) + "Return non-nil if DIR is a safe directory to load projects from. +Projects that do not load a project definition as Emacs Lisp code +are safe, and can be loaded automatically. Other project types, +such as those created with Project.ede files, are safe only if +specified by `ede-project-directories'." + (setq dir (directory-file-name (expand-file-name dir))) + ;; Load only if allowed by `ede-project-directories'. + (or (eq ede-project-directories t) + (and (functionp ede-project-directories) + (funcall ede-project-directories dir)) + (and (listp ede-project-directories) + (member dir ede-project-directories)))) + ;;; Management variables @@ -420,24 +456,42 @@ provided `global-ede-mode' is enabled." Sets buffer local variables for EDE." (let* ((ROOT nil) (proj (ede-directory-get-open-project default-directory - 'ROOT))) + 'ROOT)) + (projauto nil)) + (when (or proj ROOT - (ede-directory-project-p default-directory t)) + ;; If there is no open project, look up the project + ;; autoloader to see if we should initialize. + (setq projauto (ede-directory-project-p default-directory t))) - (when (not proj) - ;; @todo - this could be wasteful. - (setq proj (ede-load-project-file default-directory 'ROOT))) + (when (and (not proj) projauto) - (setq ede-object (ede-buffer-object (current-buffer) + ;; No project was loaded, but we have a project description + ;; object. This means that we can check if it is a safe + ;; project to load before requesting it to be loaded. + + (when (or (oref projauto safe-p) + ;; The project style is not safe, so check if it is + ;; in `ede-project-directories'. + (let ((top (ede-toplevel-project default-directory))) + (ede-directory-safe-p top))) + + ;; The project is safe, so load it in. + (setq proj (ede-load-project-file default-directory 'ROOT)))) + + ;; Only initialize EDE state in this buffer if we found a project. + (when proj + + (setq ede-object (ede-buffer-object (current-buffer) 'ede-object-project)) - (setq ede-object-root-project - (or ROOT (ede-project-root ede-object-project))) + (setq ede-object-root-project + (or ROOT (ede-project-root ede-object-project))) - (if (and (not ede-object) ede-object-project) - (ede-auto-add-to-target)) + (if (and (not ede-object) ede-object-project) + (ede-auto-add-to-target)) - (ede-apply-target-options)))) + (ede-apply-target-options))))) (defun ede-reset-all-buffers (onoff) "Reset all the buffers due to change in EDE. @@ -557,13 +611,73 @@ of objects with the `ede-want-file-p' method." ;;; Interactive method invocations ;; -(defun ede (file) - "Start up EDE on something. -Argument FILE is the file or directory to load a project from." - (interactive "fProject File: ") - (if (not (file-exists-p file)) - (ede-new file) - (ede-load-project-file (file-name-directory file)))) +(defun ede (dir) + "Start up EDE for directory DIR. +If DIR has an existing project file, load it. +Otherwise, create a new project for DIR." + (interactive + ;; When choosing a directory to turn on, and we see some directory here, + ;; provide that as the default. + (let* ((top (ede-toplevel-project default-directory)) + (promptdflt (or top default-directory))) + (list (read-directory-name "Project directory: " + promptdflt promptdflt t)))) + (unless (file-directory-p dir) + (error "%s is not a directory" dir)) + (when (ede-directory-get-open-project dir) + (error "%s already has an open project associated with it" dir)) + + ;; Check if the directory has been added to the list of safe + ;; directories. It can also add the directory to the safe list if + ;; the user chooses. + (if (ede-check-project-directory dir) + (progn + ;; If there is a project in DIR, load it, otherwise do + ;; nothing. + (ede-load-project-file dir) + + ;; Check if we loaded anything on the previous line. + (if (ede-current-project dir) + + ;; We successfully opened an existing project. Some open + ;; buffers may also be referring to this project. + ;; Resetting all the buffers will get them to also point + ;; at this new open project. + (ede-reset-all-buffers 1) + + ;; ELSE + ;; There was no project, so switch to `ede-new' which is how + ;; a user can select a new kind of project to create. + (let ((default-directory (expand-file-name dir))) + (call-interactively 'ede-new)))) + + ;; If the proposed directory isn't safe, then say so. + (error "%s is not an allowed project directory in `ede-project-directories'" + dir))) + +(defun ede-check-project-directory (dir) + "Check if DIR should be in `ede-project-directories'. +If it is not, try asking the user if it should be added; if so, +add it and save `ede-project-directories' via Customize. +Return nil iff DIR should not be in `ede-project-directories'." + (setq dir (directory-file-name (expand-file-name dir))) ; strip trailing / + (or (eq ede-project-directories t) + (and (functionp ede-project-directories) + (funcall ede-project-directories dir)) + ;; If `ede-project-directories' is a list, maybe add it. + (when (listp ede-project-directories) + (or (member dir ede-project-directories) + (when (y-or-n-p (format "`%s' is not listed in `ede-project-directories'. +Add it to the list of allowed project directories? " + dir)) + (push dir ede-project-directories) + ;; If possible, save `ede-project-directories'. + (if (or custom-file user-init-file) + (let ((coding-system-for-read nil)) + (customize-save-variable + 'ede-project-directories + ede-project-directories))) + t))))) (defun ede-new (type &optional name) "Create a new project starting from project type TYPE. @@ -598,6 +712,11 @@ Optional argument NAME is the name to give this project." (error "Cannot create project in non-existent directory %s" default-directory)) (when (not (file-writable-p default-directory)) (error "No write permissions for %s" default-directory)) + (unless (ede-check-project-directory default-directory) + (error "%s is not an allowed project directory in `ede-project-directories'" + default-directory)) + ;; Make sure the project directory is loadable in the future. + (ede-check-project-directory default-directory) ;; Create the project (let* ((obj (object-assoc type 'name ede-project-class-files)) (nobj (let ((f (oref obj file)) @@ -631,6 +750,10 @@ Optional argument NAME is the name to give this project." (ede-add-subproject pp nobj) (ede-commit-project pp))) (ede-commit-project nobj)) + ;; Once the project is created, load it again. This used to happen + ;; lazily, but with project loading occurring less often and with + ;; security in mind, this is now the safe time to reload. + (ede-load-project-file default-directory) ;; Have the menu appear (setq ede-minor-mode t) ;; Allert the user @@ -653,11 +776,16 @@ ARGS are additional arguments to pass to method SYM." (defun ede-rescan-toplevel () "Rescan all project files." (interactive) - (let ((toppath (ede-toplevel-project default-directory)) - (ede-deep-rescan t)) - (project-rescan (ede-load-project-file toppath)) - (ede-reset-all-buffers 1) - )) + (if (not (ede-directory-get-open-project default-directory)) + ;; This directory isn't open. Can't rescan. + (error "Attempt to rescan a project that isn't open") + + ;; Continue + (let ((toppath (ede-toplevel-project default-directory)) + (ede-deep-rescan t)) + + (project-rescan (ede-load-project-file toppath)) + (ede-reset-all-buffers 1)))) (defun ede-new-target (&rest args) "Create a new target specific to this type of project file. @@ -893,7 +1021,7 @@ Optional ROOTRETURN will return the root project for DIR." ;; Do the load ;;(message "EDE LOAD : %S" file) (let* ((file dir) - (path (expand-file-name (file-name-directory file))) + (path (file-name-as-directory (expand-file-name dir))) (pfc (ede-directory-project-p path)) (toppath nil) (o nil)) @@ -922,13 +1050,11 @@ Optional ROOTRETURN will return the root project for DIR." ;; See if it's been loaded before (setq o (object-assoc (ede-dir-to-projectfile pfc toppath) 'file ede-projects)) - (if (not o) - ;; If not, get it now. - (let ((ede-constructing pfc)) - (setq o (funcall (oref pfc load-type) toppath)) - (when (not o) - (error "Project type error: :load-type failed to create a project")) - (ede-add-project-to-global-list o))) + + ;; If not open yet, load it. + (unless o + (let ((ede-constructing pfc)) + (setq o (ede-auto-load-project pfc toppath)))) ;; Return the found root project. (when rootreturn (set rootreturn o)) @@ -982,13 +1108,7 @@ Optional argument OBJ is an object to find the parent of." (and root (ede-find-subproject-for-directory root updir)) ;; Try the all structure based search. - (ede-directory-get-open-project updir) - ;; Load up the project file as a last resort. - ;; Last resort since it uses file-truename, and other - ;; slow features. - (and (ede-directory-project-p updir) - (ede-load-project-file - (file-name-as-directory updir)))))))))) + (ede-directory-get-open-project updir)))))))) (defun ede-current-project (&optional dir) "Return the current project file. @@ -1002,11 +1122,7 @@ If optional DIR is provided, get the project for DIR instead." ;; No current project. (when (not ans) (let* ((ldir (or dir default-directory))) - (setq ans (ede-directory-get-open-project ldir)) - (or ans - ;; No open project, if this dir pass project-p, then load. - (when (ede-directory-project-p ldir) - (setq ans (ede-load-project-file ldir)))))) + (setq ans (ede-directory-get-open-project ldir)))) ;; Return what we found. ans)) @@ -1061,12 +1177,13 @@ If TARGET belongs to a subproject, return that project file." "Return the project which is the parent of TARGET. It is recommended you track the project a different way as this function could become slow in time." - ;; @todo - use ede-object-project as a starting point. - (let ((ans nil) (projs ede-projects)) - (while (and (not ans) projs) - (setq ans (ede-target-in-project-p (car projs) target) - projs (cdr projs))) - ans)) + (or ede-object-project + ;; If not cached, derive it from the current directory of the target. + (let ((ans nil) (projs ede-projects)) + (while (and (not ans) projs) + (setq ans (ede-target-in-project-p (car projs) target) + projs (cdr projs))) + ans))) (defmethod ede-find-target ((proj ede-project) buffer) "Fetch the target in PROJ belonging to BUFFER or nil." diff --git a/lisp/cedet/ede/auto.el b/lisp/cedet/ede/auto.el index 7ff291d3675..b458cc246f0 100644 --- a/lisp/cedet/ede/auto.el +++ b/lisp/cedet/ede/auto.el @@ -58,6 +58,13 @@ associated with a single object class, based on the initializers used.") :initform t :documentation "Non-nil if this is an option when a user creates a project.") + (safe-p :initarg :safe-p + :initform t + :documentation + "Non-nil if the project load files are \"safe\". +An unsafe project is one that loads project variables via Emacs +Lisp code. A safe project is one that loads project variables by +scanning files without loading Lisp code from them.") ) "Class representing minimal knowledge set to run preliminary EDE functions. When more advanced functionality is needed from a project type, that projects @@ -69,13 +76,15 @@ type is required and the load function used.") :name "Make" :file 'ede/proj :proj-file "Project.ede" :load-type 'ede-proj-load - :class-sym 'ede-proj-project) + :class-sym 'ede-proj-project + :safe-p nil) (ede-project-autoload "edeproject-automake" :name "Automake" :file 'ede/proj :proj-file "Project.ede" :initializers '(:makefile-type Makefile.am) :load-type 'ede-proj-load - :class-sym 'ede-proj-project) + :class-sym 'ede-proj-project + :safe-p nil) (ede-project-autoload "automake" :name "automake" :file 'ede/project-am :proj-file "Makefile.am" @@ -84,6 +93,8 @@ type is required and the load function used.") :new-p nil)) "List of vectors defining how to determine what type of projects exist.") +(put 'ede-project-class-files 'risky-local-variable t) + ;;; EDE project-autoload methods ;; (defmethod ede-project-root ((this ede-project-autoload)) @@ -122,6 +133,19 @@ Return nil if the project file does not exist." (when (and f (file-exists-p f)) f))) +(defmethod ede-auto-load-project ((this ede-project-autoload) dir) + "Load in the project associated with THIS project autoload description. +THIS project description should be valid for DIR, where the project will +be loaded." + ;; Last line of defense: don't load unsafe projects. + (when (not (or (oref this :safe-p) + (ede-directory-safe-p dir))) + (error "Attempt to load an unsafe project (bug elsewhere in EDE)")) + ;; Things are good - so load the project. + (let ((o (funcall (oref this load-type) dir))) + (when (not o) + (error "Project type error: :load-type failed to create a project")) + (ede-add-project-to-global-list o))) (provide 'ede/auto) diff --git a/lisp/cedet/ede/simple.el b/lisp/cedet/ede/simple.el index 028c126e9e4..5cfa750c63f 100644 --- a/lisp/cedet/ede/simple.el +++ b/lisp/cedet/ede/simple.el @@ -50,7 +50,8 @@ :name "Simple" :file 'ede/simple :proj-file 'ede-simple-projectfile-for-dir :load-type 'ede-simple-load - :class-sym 'ede-simple-project) + :class-sym 'ede-simple-project + :safe-p nil) t) (defcustom ede-simple-save-directory "~/.ede" diff --git a/lisp/dired.el b/lisp/dired.el index 6f2ddbbc73d..f1a778ad05a 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1111,6 +1111,11 @@ BEG..END is the line where the file info is located." (defvar ls-lisp-use-insert-directory-program) +(defun dired-switches-escape-p (switches) + "Return non-nil if the string SWITCHES contains -b or --escape." + ;; Do not match things like "--block-size" that happen to contain "b". + (string-match "\\(\\`\\| \\)-[[:alnum:]]*b\\|--escape\\>" switches)) + (defun dired-insert-directory (dir switches &optional file-list wildcard hdr) "Insert a directory listing of DIR, Dired style. Use SWITCHES to make the listings. @@ -1152,7 +1157,7 @@ see `dired-use-ls-dired' for more details.") (dired-align-file beg (point)))) (insert-directory dir switches wildcard (not wildcard))) ;; Quote certain characters, unless ls quoted them for us. - (if (not (string-match "b" dired-actual-switches)) + (if (not (dired-switches-escape-p dired-actual-switches)) (save-excursion (setq end (point-marker)) (goto-char opoint) @@ -2099,7 +2104,18 @@ Otherwise, an error occurs in these cases." ;; with quotation marks in their names. (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file) (setq file (replace-match "\\\"" nil t file 1))) - + ;; Unescape any spaces escaped by ls -b (bug#10469). + ;; Other -b quotes, eg \t, \n, work transparently. + (if (dired-switches-escape-p dired-actual-switches) + (let ((start 0) + (rep "") + (shift -1)) + (if (eq localp 'verbatim) + (setq rep "\\\\" + shift +1)) + (while (string-match "\\(\\\\\\) " file start) + (setq file (replace-match rep nil t file 1) + start (+ shift (match-end 0)))))) (when (eq system-type 'windows-nt) (save-match-data (let ((start 0)) @@ -2107,6 +2123,7 @@ Otherwise, an error occurs in these cases." (aset file (match-beginning 0) ?/) (setq start (match-end 0)))))) + ;; Hence we don't need to worry about converting `\\' back to `\'. (setq file (read (concat "\"" file "\""))) ;; The above `read' will return a unibyte string if FILE ;; contains eight-bit-control/graphic characters. diff --git a/lisp/epg.el b/lisp/epg.el index 3505e183c1f..6529afb2d3c 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -1951,7 +1951,8 @@ The returned file name (created by appending some random characters at the end of PREFIX, and expanding against `temporary-file-directory' if necessary), is guaranteed to point to a newly created empty file. You can then use `write-region' to write new data into the file." - (let (tempdir tempfile) + (let ((orig-modes (default-file-modes)) + tempdir tempfile) (setq prefix (expand-file-name prefix (if (featurep 'xemacs) (temp-directory) @@ -1959,6 +1960,7 @@ You can then use `write-region' to write new data into the file." (unwind-protect (let (file) ;; First, create a temporary directory. + (set-default-file-modes #o700) (while (condition-case () (progn (setq tempdir (make-temp-name @@ -1969,14 +1971,12 @@ You can then use `write-region' to write new data into the file." (make-directory tempdir)) ;; let's try again. (file-already-exists t))) - (set-file-modes tempdir 448) ;; Second, create a temporary file in the tempdir. ;; There *is* a race condition between `make-temp-name' ;; and `write-region', but we don't care it since we are ;; in a private directory now. (setq tempfile (make-temp-name (concat tempdir "/EMU"))) (write-region "" nil tempfile nil 'silent) - (set-file-modes tempfile 384) ;; Finally, make a hard-link from the tempfile. (while (condition-case () (progn @@ -1986,6 +1986,7 @@ You can then use `write-region' to write new data into the file." ;; let's try again. (file-already-exists t))) file) + (set-default-file-modes orig-modes) ;; Cleanup the tempfile. (and tempfile (file-exists-p tempfile) diff --git a/lisp/info.el b/lisp/info.el index 94d29518995..a8cb141114c 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2251,7 +2251,7 @@ Table of contents is created from the tree structure of menus." (match-string-no-properties 1))) (section "Top") menu-items) - (when (string-match "(" upnode) (setq upnode nil)) + (when (and upnode (string-match "(" upnode)) (setq upnode nil)) (when (and (not (Info-index-node nodename file)) (re-search-forward "^\\* Menu:" bound t)) (forward-line 1) 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.") ;; GNU/Linux (Debian, Suse): /bin:/usr/bin ;; FreeBSD: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"! ;; IRIX64: /usr/bin +;;;###tramp-autoload (defcustom tramp-remote-path '(tramp-default-remote-path "/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin" "/local/bin" "/local/freeware/bin" "/local/gnu/bin" diff --git a/lisp/startup.el b/lisp/startup.el index 1cbf2f74c14..41056f3907e 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -910,7 +910,7 @@ opening the first frame (e.g. open a connection to an X server).") (setq no-blinking-cursor t))) ;; If the cursorColor X resource exists, alter the `cursor' face ;; spec, but mark it as changed outside of Customize. - (let ((color (x-get-resource "cursorColor" "CursorColor"))) + (let ((color (x-get-resource "cursorColor" "Foreground"))) (when color (put 'cursor 'theme-face `((changed ((t :background ,color))))) @@ -929,7 +929,7 @@ opening the first frame (e.g. open a connection to an X server).") emacs-basic-display (and (memq window-system '(x w32 ns)) (not (member (x-get-resource "cursorBlink" "CursorBlink") - '("off" "false"))))) + '("no" "off" "false" "0"))))) (setq no-blinking-cursor t)) ;; Re-evaluate predefined variables whose initial value depends on diff --git a/msdos/ChangeLog b/msdos/ChangeLog index 482934f2029..060970151ef 100644 --- a/msdos/ChangeLog +++ b/msdos/ChangeLog @@ -1,3 +1,8 @@ +2012-01-14 Eli Zaretskii + + * sed4.inp (PATH_DUMPLOADSEARCH): Edit to "../lisp", for when the + default in src/epaths.in will change, maybe. + 2011-10-31 Eli Zaretskii * sed3v2.inp (insrcdir): Comment out definition. diff --git a/msdos/sed4.inp b/msdos/sed4.inp index efbed4d3f1d..73d025463d8 100644 --- a/msdos/sed4.inp +++ b/msdos/sed4.inp @@ -16,6 +16,7 @@ # # ---------------------------------------------------------------------- /^#define *PATH_LOADSEARCH/s/".*"/rootrelativepath ("lisp")/ +/^#define *PATH_DUMPLOADSEARCH/s/".*"/"..\/lisp"/ /^#define *PATH_DATA/s/".*"/rootrelativepath ("etc")/ /^#define *PATH_DOC/s/".*"/rootrelativepath ("etc")/ /^#define *PATH_INFO/s/".*"/rootrelativepath ("info")/ diff --git a/src/ChangeLog b/src/ChangeLog index 28910c5a556..eb03ef1357f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-01-14 Eli Zaretskii + + * w32fns.c (signal_user_input): Don't do a QUIT, to avoid + thrashing the stack of the thread. (Bug#9087) + 2012-01-12 Paul Eggert * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses. diff --git a/src/w32fns.c b/src/w32fns.c index 1fcf29fbcfd..510d1e94f16 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -2479,6 +2479,10 @@ signal_user_input (void) if (!NILP (Vthrow_on_input)) { Vquit_flag = Vthrow_on_input; + /* Doing a QUIT from this thread is a bad idea, since this + unwinds the stack of the Lisp thread, and the Windows runtime + rightfully barfs. Disabled. */ +#if 0 /* If we're inside a function that wants immediate quits, do it now. */ if (immediate_quit && NILP (Vinhibit_quit)) @@ -2486,6 +2490,7 @@ signal_user_input (void) immediate_quit = 0; QUIT; } +#endif } }