diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-10-12 09:48:12 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-10-12 09:48:12 -0700 |
commit | 682432fc544c2bb4e0531c2931d43bce085eb16a (patch) | |
tree | 4bc9e4d78f34e19254382246b89a3462a0186311 | |
parent | d44287d4adc1e268ef9974ea72010f0186f40197 (diff) | |
parent | 79beb1785aac3f8326f58710462e4b6be7f0449a (diff) | |
download | emacs-682432fc544c2bb4e0531c2931d43bce085eb16a.tar.gz |
Merge from trunk.
48 files changed, 1228 insertions, 975 deletions
diff --git a/ChangeLog b/ChangeLog index 52aa133f8e0..a3bbe29e77e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-10-12 Paul Eggert <eggert@cs.ucla.edu> + + * configure.in: Remove check for -lintl (Bug#9713). + The check breaks 'configure' in some CentOS 5.7 x86 configurations. + The check was helpful but not essential in Solaris 2.6 (1997), + and is no longer needed in Solaris 8 (2000). Solaris 2.6 is + obsolete -- Sun dropped support for it in 2006 -- and without + access to that Silurian platform we can't maintain the code anyway. + 2011-10-07 Paul Eggert <eggert@cs.ucla.edu> Merge from gnulib, fixing some 'configure' typos (Bug#9696). diff --git a/autogen/config.in b/autogen/config.in index fd2c4f8eda5..f1f950cc034 100644 --- a/autogen/config.in +++ b/autogen/config.in @@ -420,9 +420,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Define to 1 if you have the hesiod library (-lhesiod). */ #undef HAVE_LIBHESIOD -/* Define to 1 if you have the `intl' library (-lintl). */ -#undef HAVE_LIBINTL - /* Define to 1 if you have the `k5crypto' library (-lk5crypto). */ #undef HAVE_LIBK5CRYPTO diff --git a/autogen/configure b/autogen/configure index a648a000713..e86db7a7362 100755 --- a/autogen/configure +++ b/autogen/configure @@ -6969,6 +6969,8 @@ esac # Code from module stat: # Code from module stdarg: + + # Code from module stdbool: # Code from module stddef: # Code from module stdint: @@ -15290,54 +15292,6 @@ fi -# Solaris requires -lintl if you want strerror (which calls dgettext) -# to return localized messages. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 -$as_echo_n "checking for dgettext in -lintl... " >&6; } -if test "${ac_cv_lib_intl_dgettext+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dgettext (); -int -main () -{ -return dgettext (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_intl_dgettext=yes -else - ac_cv_lib_intl_dgettext=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5 -$as_echo "$ac_cv_lib_intl_dgettext" >&6; } -if test "x$ac_cv_lib_intl_dgettext" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBINTL 1 -_ACEOF - - LIBS="-lintl $LIBS" - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime caches TZ" >&5 $as_echo_n "checking whether localtime caches TZ... " >&6; } if test "${emacs_cv_localtime_cache+set}" = set; then : @@ -21903,12 +21857,6 @@ fi gl_gnulib_enabled_sigprocmask=true - if $condition; then - func_gl_gnulib_m4code_raise - fi - if $condition; then - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi fi } func_gl_gnulib_m4code_stat () @@ -22040,13 +21988,10 @@ fi gl_gnulib_enabled_stat=true - if $condition; then + if test $REPLACE_STAT = 1; then func_gl_gnulib_m4code_dosname fi - if $condition; then - func_gl_gnulib_m4code_pathmax - fi - if $condition; then + if test $REPLACE_STAT = 1; then func_gl_gnulib_m4code_verify fi fi @@ -22161,12 +22106,6 @@ fi gl_gnulib_enabled_verify=true fi } - if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi - if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi if test $REPLACE_GETOPT = 1; then func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 fi diff --git a/configure.in b/configure.in index 57cc4dcded8..4af95b99273 100644 --- a/configure.in +++ b/configure.in @@ -3008,10 +3008,6 @@ AC_SUBST(KRB5LIB) AC_SUBST(DESLIB) AC_SUBST(KRB4LIB) -# Solaris requires -lintl if you want strerror (which calls dgettext) -# to return localized messages. -AC_CHECK_LIB(intl, dgettext) - AC_MSG_CHECKING(whether localtime caches TZ) AC_CACHE_VAL(emacs_cv_localtime_cache, [if test x$ac_cv_func_tzset = xyes; then diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index dc331eeb612..6adbe95cc97 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,46 @@ +2011-10-09 Chong Yidong <cyd@stupidchicken.com> + + * help.texi (Help, Help Summary): Eliminate the unnecessary "help + option" terminology. + (Key Help): Add command names. Define "documentation string". + (Name Help): Remove an over-long joke. + (Apropos): Document prefix args. Remove duplicated descriptions. + (Help Mode): Add C-c C-b to table. Update TAB binding. + (Package Keywords): Rename from "Library by Keyword". Describe + new package menu interface. + (Help Files, Help Echo): Tweak description. + + * mini.texi (Completion Options): Add completion-cycle-threshold. + (Minibuffer History): Document numeric args to history commands. + +2011-10-08 Eli Zaretskii <eliz@gnu.org> + + * mule.texi (Bidirectional Editing): Correct some inaccuracies. + +2011-10-08 Chong Yidong <cyd@stupidchicken.com> + + * basic.texi (Position Info): Omit page commands. Document + count-words-region and count-words. + + * text.texi (Pages): Move what-page documentation here. + +2011-10-08 Chong Yidong <cyd@stupidchicken.com> + + * mini.texi (Minibuffer File): Minor copyedits. Use xref to + Remote Files node instead of linking directly to the Tramp manual. + (Minibuffer Edit): Add xref to Blank Lines. + (Completion): Add xref to Symbol Completion. Remove redundant + example, which is repeated in the next node. + (Completion Commands): Minor clarifications. + (Completion Styles): New node, split from Completion Commands. + Document substring and initials styles. + (Strict Completion): Remove information duplicated in other nodes. + (Completion Options): Consolidate case difference discussion here. + + * help.texi (Help Mode): Fix kindex entries. + + * files.texi (File Names): Add index entries. + 2011-10-07 Chong Yidong <cyd@stupidchicken.com> * basic.texi (Inserting Text): Add xref to Completion. Add diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index 52f9395cedc..e4e7dadd548 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi @@ -23,7 +23,7 @@ suggest you first run the Emacs learn-by-doing tutorial, by typing * Help: Basic Help. Asking what a character does. * Blank Lines:: Making and deleting blank lines. * Continuation Lines:: How Emacs displays lines too wide for the screen. -* Position Info:: What page, line, row, or column is point on? +* Position Info:: What line, row, or column is point on? * Arguments:: Numeric arguments for repeating a command N times. * Repeating:: Repeating the previous command quickly. @end menu @@ -569,28 +569,26 @@ logical lines. @xref{Visual Line Mode}. @section Cursor Position Information Here are commands to get information about the size and position of -parts of the buffer, and to count lines. +parts of the buffer, and to count words and lines. @table @kbd -@item M-x what-page -Display the page number of point, and the line number within that page. @item M-x what-line -Display the line number of point in the whole buffer. +Display the line number of point. @item M-x line-number-mode @itemx M-x column-number-mode Toggle automatic display of the current line number or column number. @xref{Optional Mode Line}. @item M-= -Display the number of lines in the region (@code{count-lines-region}). -@xref{Mark}, for information about the region. +Display the number of lines, words, and characters that are present in +the region (@code{count-words-region}). @xref{Mark}, for information +about the region. -@item C-x l -Display the number of lines in the current page -(@code{count-lines-page}). @xref{Pages}. +@item M-x count-words +Display the number of lines, words, and characters that are present in +the buffer. If the region is active (@pxref{Mark}), display the +numbers for the region instead. -@item M-x count-words-region -Display the number of words in the region. @item C-x = Display the character code of character after point, character position of point, and column of point (@code{what-cursor-position}). @@ -602,7 +600,6 @@ Toggle automatic display of the size of the buffer. @xref{Optional Mode Line}. @end table -@findex what-page @findex what-line @cindex line number commands @cindex location of point @@ -616,16 +613,14 @@ the accessible portion (@pxref{Narrowing}). By contrast, @code{what-line} displays both the line number relative to the narrowed region and the line number relative to the whole buffer. - @kbd{M-x what-page} counts pages from the beginning of the file, and -counts lines within the page, showing both numbers in the echo area. -@xref{Pages}. - @kindex M-= -@findex count-lines-region - @kbd{M-=} (@code{count-lines-region}) displays the number of lines -in the region (@pxref{Mark}), while @kbd{C-x l} -(@code{count-lines-page}) counts the lines in the current page -(@pxref{Pages}). +@findex count-words-region +@findex count-words + @kbd{M-=} (@code{count-words-region}) displays a message reporting +the number of lines, words, and characters in the region. @kbd{M-x +count-words} displays a similar message for the entire buffer, or for +the region if the region is @dfn{active}. @xref{Mark}, for an +explanation of the region. @kindex C-x = @findex what-cursor-position diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index bb675b61cff..286595c2b45 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -264,7 +264,7 @@ Basic Editing Commands * Basic Help:: Asking what a character does. * Blank Lines:: Making and deleting blank lines. * Continuation Lines:: How Emacs displays lines too wide for the screen. -* Position Info:: What page, line, row, or column is point on? +* Position Info:: What line, row, or column is point on? * Arguments:: Numeric arguments for repeating a command N times. * Repeating:: Repeating the previous command quickly. @@ -282,6 +282,7 @@ Completion * Completion Example:: Examples of using completion. * Completion Commands:: A list of completion commands. * Strict Completion:: Different types of completion. +* Completion Styles:: How completion matches are chosen. * Completion Options:: Options for completion. Help @@ -291,10 +292,10 @@ Help * Name Help:: Asking about a command, variable or function name. * Apropos:: Asking what pertains to a given topic. * Help Mode:: Special features of Help mode and Help buffers. -* Library Keywords:: Finding Lisp libraries by keywords (topics). +* Package Keywords:: Finding Lisp libraries by keywords (topics). * Language Help:: Help relating to international language support. * Misc Help:: Other help commands. -* Help Files:: Commands to display pre-written help files. +* Help Files:: Commands to display auxilliary help files. * Help Echo:: Help on active text and tooltips (`balloon help'). The Mark and the Region diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 2672c30363b..433bf617598 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -54,11 +54,13 @@ Note that file name completion ignores file names whose extensions appear in the variable @code{completion-ignored-extensions} (@pxref{Completion Options}). +@cindex default file name For most operations, there is a @dfn{default file name} which is used if you type just @key{RET} to enter an empty argument. Normally, the default file name is the name of the file visited in the current buffer. +@cindex default directory @vindex default-directory @vindex insert-default-directory Each buffer has a @dfn{default directory} which is normally the same @@ -1863,7 +1865,7 @@ then specifying @file{/tmp/foo*bar} will visit only @cindex file name caching @cindex cache of file names @pindex find -@kindex C-@key{TAB} +@kindex C-TAB @findex file-cache-minibuffer-complete You can use the @dfn{file name cache} to make it easy to locate a file by name, without having to remember exactly where it is located. diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index 9ff995138f5..a85edf101e5 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -11,31 +11,19 @@ @kindex C-h @kindex F1 - Emacs provides extensive help features, all accessible through the -@dfn{help character}, @kbd{C-h}. This is a prefix key that is used -for commands that display documentation; the next character you type -should be a @dfn{help option}, to ask for a particular kind of help. -You can cancel the @kbd{C-h} command with @kbd{C-g}. The function key -@key{F1} is equivalent to @kbd{C-h}. - @kindex C-h C-h @findex help-for-help - @kbd{C-h} itself is one of the help options; @kbd{C-h C-h} displays -a list of help options, with a brief description of each one -(@code{help-for-help}). You can scroll the list with @key{SPC} and -@key{DEL}, then type the help option you want. To cancel, type -@kbd{C-g}. - - @kbd{C-h} or @key{F1} means ``help'' in various other contexts as -well. For instance, you can type them after a prefix key to display -a list of the keys that can follow the prefix key. (A few prefix keys -don't support @kbd{C-h} in this way, because they define other -meanings for it, but they all support @key{F1} for help.) - - Most help buffers use a special major mode, Help mode, which lets -you scroll conveniently with @key{SPC} and @key{DEL}. You can also -follow hyperlinks to URLs, and to other facilities including Info -nodes and customization buffers. @xref{Help Mode}. + Emacs provides a wide variety of help commands, all accessible +through the prefix key @kbd{C-h} (or, equivalently, the function key +@key{F1}). These help commands are described in the following +sections. You can also type @kbd{C-h C-h} to view a list of help +commands (@code{help-for-help}). You can scroll the list with +@key{SPC} and @key{DEL}, then type the help command you want. To +cancel, type @kbd{C-g}. + + Many help commands display their information in a special @dfn{help +buffer}. In this buffer, you can type @key{SPC} and @key{DEL} to +scroll and type @key{RET} to follow hyperlinks. @xref{Help Mode}. @cindex searching documentation efficiently @cindex looking for a subject in documentation @@ -51,33 +39,38 @@ This searches for commands whose names match the argument regular expression (@pxref{Regexps}). @xref{Apropos}. @item C-h i d m emacs @key{RET} i @var{topic} @key{RET} -This searches for @var{topic} in the indices of the on-line Emacs -manual, and displays the first match found. Press @kbd{,} to see -subsequent matches. You can use a regular expression as @var{topic}. +This searches for @var{topic} in the indices of the Emacs Info manual, +displaying the first match found. Press @kbd{,} to see subsequent +matches. You can use a regular expression as @var{topic}. @item C-h i d m emacs @key{RET} s @var{topic} @key{RET} Similar, but searches the @emph{text} of the manual rather than the indices. @item C-h C-f -This displays the Emacs FAQ. You can use the Info commands -to browse it. +This displays the Emacs FAQ, using Info. @item C-h p This displays the available Emacs packages based on keywords. -@xref{Library Keywords}. +@xref{Package Keywords}. @end table + @kbd{C-h} or @key{F1} means ``help'' in various other contexts as +well. For instance, you can type them after a prefix key to view a +list of the keys that can follow the prefix key. (A few prefix keys +don't support @kbd{C-h} in this way, because they define other +meanings for it, but they all support @key{F1} for help.) + @menu * Help Summary:: Brief list of all Help commands. * Key Help:: Asking what a key does in Emacs. * Name Help:: Asking about a command, variable or function name. * Apropos:: Asking what pertains to a given topic. * Help Mode:: Special features of Help mode and Help buffers. -* Library Keywords:: Finding Lisp libraries by keywords (topics). +* Package Keywords:: Finding Lisp libraries by keywords (topics). * Language Help:: Help relating to international language support. * Misc Help:: Other help commands. -* Help Files:: Commands to display pre-written help files. +* Help Files:: Commands to display auxilliary help files. * Help Echo:: Help on active text and tooltips (`balloon help'). @end menu @@ -89,21 +82,20 @@ This displays the available Emacs packages based on keywords. @section Help Summary @end ifnottex - Here is a summary of the Emacs interactive help commands. (The -character that follows @kbd{C-h} is the ``help option.'') See -@ref{Help Files}, for other help commands that display fixed files -of information. + Here is a summary of help commands for accessing the built-in +documentation. Most of these are described in more detail in the +following sections. @table @kbd @item C-h a @var{topics} @key{RET} Display a list of commands whose names match @var{topics} -(@code{apropos-command}; @pxref{Apropos}). +(@code{apropos-command}). @item C-h b Display all active key bindings; minor mode bindings first, then those of the major mode, then global bindings (@code{describe-bindings}). @item C-h c @var{key} -Given a key sequence @var{key}, show the name of the command that it -runs (@code{describe-key-briefly}). Here @kbd{c} stands for +Show the name of the command that the key sequence @var{key} is bound +to (@code{describe-key-briefly}). Here @kbd{c} stands for ``character.'' For more extensive information on @var{key}, use @kbd{C-h k}. @item C-h d @var{topics} @key{RET} @@ -120,8 +112,8 @@ this works for commands too. Display the @file{HELLO} file, which shows examples of various character sets. @item C-h i -Run Info, the GNU documentation browser (@code{info}). -The complete Emacs manual is available on-line in Info. +Run Info, the GNU documentation browser (@code{info}). The Emacs +manual is available in Info. @item C-h k @var{key} Display the name and documentation of the command that @var{key} runs (@code{describe-key}). @@ -134,20 +126,18 @@ Display documentation of the current major mode (@code{describe-mode}). Display news of recent Emacs changes (@code{view-emacs-news}). @item C-h p Find packages by topic keyword (@code{finder-by-keyword}). This lists -packages using a package menu buffer (@pxref{Package Menu}); for an -alternative interface to the same information, try the -@code{info-finder} command. +packages using a package menu buffer. @xref{Packages}. @item C-h P @var{package} @key{RET} Display documentation about the package named @var{package} -(@code{describe-package}; @pxref{Packages}). +(@code{describe-package}). @item C-h r Display the Emacs manual in Info (@code{info-emacs-manual}). @item C-h s -Display the current contents of the @dfn{syntax table}, with an -explanation of what they mean (@code{describe-syntax}). The syntax -table says which characters are opening delimiters, which are parts of -words, which are string quotes, and so on. @xref{Syntax Tables,, -Syntax Tables, elisp, The Emacs Lisp Reference Manual}, for details. +Display the contents of the current @dfn{syntax table} +(@code{describe-syntax}). The syntax table says which characters are +opening delimiters, which are parts of words, and so on. @xref{Syntax +Tables,, Syntax Tables, elisp, The Emacs Lisp Reference Manual}, for +details. @item C-h t Enter the Emacs interactive tutorial (@code{help-with-tutorial}). @item C-h v @var{var} @key{RET} @@ -184,27 +174,27 @@ Display the help message for a special text area, if point is in one @node Key Help @section Documentation for a Key -@kindex C-h c @findex describe-key-briefly +@findex describe-key The help commands to get information about a key sequence are -@kbd{C-h c} and @w{@kbd{C-h k}}. @kbd{C-h c @var{key}} displays in -the echo area the name of the command that @var{key} is bound to. For -example, @kbd{C-h c C-f} displays @samp{forward-char}. Since command -names are chosen to describe what the commands do, this gives you a -very brief description of what @var{key} does. +@kbd{C-h c} (@code{describe-key-briefly}) and @kbd{C-h k} +(@code{describe-key}). + +@kindex C-h c + @kbd{C-h c @var{key}} displays in the echo area the name of the +command that @var{key} is bound to. For example, @kbd{C-h c C-f} +displays @samp{forward-char}. +@cindex documentation string @kindex C-h k -@findex describe-key @kbd{C-h k @var{key}} is similar but gives more information: it -displays the documentation string of the command as well as its name. -It displays this information in a window, since it may not fit in the -echo area. +displays a help buffer containing the command's @dfn{documentation +string}, which describes exactly what the command does. @kindex C-h K @findex Info-goto-emacs-key-command-node - To find the documentation of a key sequence @var{key}, type @kbd{C-h -K @var{key}}. This displays the appropriate manual section which -contains the documentation of @var{key}. + @kbd{C-h K @var{key}} displays the section of the Emacs manual that +describes the command corresponding to @var{key}. @kbd{C-h c}, @kbd{C-h k} and @kbd{C-h K} work for any sort of key sequences, including function keys, menus, and mouse events. For @@ -271,14 +261,8 @@ the Lisp symbol around or before point, if that is the name of a defined Lisp variable. @xref{Variables}. Help buffers that describe Emacs variables and functions normally -have hyperlinks to the corresponding source definition, if you have -the source files installed. (@xref{Hyperlinking}.) If you know Lisp -(or C), this provides the ultimate documentation. If you don't know -Lisp, you should learn it. (The Introduction to Emacs Lisp -Programming, available from the FSF through fsf.org, is a good way to -get started.) If Emacs feels you are just @emph{using} it, treating -it as an object program, its feelings may be hurt. For real intimacy, -read the Emacs source code. +have hyperlinks to the corresponding source code, if you have the +source files installed (@pxref{Hyperlinking}). @kindex C-h F @findex Info-goto-emacs-command-node @@ -288,53 +272,58 @@ manuals, not just the Emacs manual, and finds the right one. @node Apropos @section Apropos +@cindex apropos The @dfn{apropos} commands answer questions like, ``What are the commands for working with files?'' More precisely, you specify an @dfn{apropos pattern}, which means either a word, a list of words, or -a regular expression. Each apropos command displays a list of items -that match the pattern, in a separate buffer. +a regular expression. + + Each of the following apropos commands reads an apropos pattern in +the minibuffer, searches for items that match the pattern, and +displays the results in a different window. @table @kbd -@item C-h a @var{pattern} @key{RET} -Search for commands whose names match @var{pattern}. +@item C-h a +@kindex C-h a +@findex apropos-command +Search for commands (@code{apropos-command}). With a prefix argument, +search for noninteractive functions too. -@item M-x apropos @key{RET} @var{pattern} @key{RET} -Search for functions and variables whose names match @var{pattern}. -Both interactive functions (commands) and noninteractive functions can -be found by this command. +@item M-x apropos +@findex apropos +Search for functions and variables. Both interactive functions +(commands) and noninteractive functions can be found by this. -@item M-x apropos-variable @key{RET} @var{pattern} @key{RET} -Search for user-option variables whose names match @var{pattern}. +@item M-x apropos-variable +@findex apropos-variable +Search for user-customizable variables. With a prefix argument, +search for non-customizable variables too. -@item M-x apropos-value @key{RET} @var{pattern} @key{RET} -Search for functions whose definitions match @var{pattern}, and -variables whose values match @var{pattern}. +@item M-x apropos-value +@findex apropos-value +Search for variables whose values match the specified pattern. With a +prefix argument, search also for functions with definitions matching +the pattern, and Lisp symbols with properties matching the pattern. -@item C-h d @var{pattern} @key{RET} -Search for functions and variables whose @strong{documentation -strings} match @var{pattern}. +@item C-h d +@kindex C-h d +@findex apropos-documentation +Search for functions and variables whose documentation strings match +the specified pattern (@code{apropos-documentation}). @end table -@kindex C-h a -@findex apropos-command -@cindex apropos - The simplest kind of apropos pattern is one word. Anything which -contains that word matches the pattern. Thus, to find the commands -that work on files, type @kbd{C-h a file @key{RET}}. This displays a -list of all command names that contain @samp{file}, including + The simplest kind of apropos pattern is one word. Anything +containing that word matches the pattern. Thus, to find commands that +work on files, type @kbd{C-h a file @key{RET}}. This displays a list +of all command names that contain @samp{file}, including @code{copy-file}, @code{find-file}, and so on. Each command name comes with a brief description and a list of keys you can currently invoke it with. In our example, it would say that you can invoke @code{find-file} by typing @kbd{C-x C-f}. - The @kbd{a} in @kbd{C-h a} stands for ``Apropos''; @kbd{C-h a} -runs the command @code{apropos-command}. This command normally checks -only commands (interactive functions); if you specify a prefix -argument, it checks noninteractive functions as well. - For more information about a function definition, variable or symbol -property listed in the apropos buffer, you can click on it with +property listed in an apropos buffer, you can click on it with @kbd{Mouse-1} or @kbd{Mouse-2}, or move there and type @key{RET}. When you specify more than one word in the apropos pattern, a name @@ -362,160 +351,117 @@ mark, insert, yank, fill, indent, case, change, set, what, list, find, view, describe, default. @end quotation -@findex apropos - Use @kbd{M-x apropos} instead of @kbd{C-h a} to list all the Lisp -symbols that match an apropos pattern, not just the symbols that are -commands. This command does not list key bindings by default; specify -a numeric argument if you want it to list them. - -@findex apropos-variable - Use @kbd{M-x apropos-variable} to list user-customizable variables -that match an apropos pattern. If you specify a prefix argument, it -lists all matching variables. - -@kindex C-h d -@findex apropos-documentation - The @code{apropos-documentation} command is like @code{apropos} -except that it searches documentation strings instead of symbol names -for matches. - -@findex apropos-value - The @code{apropos-value} command is like @code{apropos} except that -it searches variables' values for matches for the apropos pattern. -With a prefix argument, it also checks symbols' function definitions -and property lists. - @vindex apropos-do-all If the variable @code{apropos-do-all} is non-@code{nil}, the apropos commands always behave as if they had been given a prefix argument. @vindex apropos-sort-by-scores @cindex apropos search results, order by score - By default, apropos lists the search results in alphabetical order. -If the variable @code{apropos-sort-by-scores} is non-@code{nil}, the -apropos commands try to guess the relevance of each result, and -display the most relevant ones first. - @vindex apropos-documentation-sort-by-scores - By default, apropos lists the search results for -@code{apropos-documentation} in order of relevance of the match. If -the variable @code{apropos-documentation-sort-by-scores} is -@code{nil}, apropos lists the symbols found in alphabetical order. + By default, all apropos commands except @code{apropos-documentation} +list their results in alphabetical order. If the variable +@code{apropos-sort-by-scores} is non-@code{nil}, these commands +instead try to guess the relevance of each result, and display the +most relevant ones first. The @code{apropos-documentation} command +lists its results in order of relevance by default; to list them in +alphabetical order, change the variable +@code{apropos-documentation-sort-by-scores} to @code{nil}. @node Help Mode @section Help Mode Commands Help buffers provide the same commands as View mode (@pxref{View -Mode}), plus a few special commands of their own. +Mode}); for instance, @key{SPC} scrolls forward, and @key{DEL} scrolls +backward. A few special commands are also provided: @table @kbd -@item @key{SPC} -Scroll forward. -@item @key{DEL} -Scroll backward. @item @key{RET} -Follow a cross reference at point. +Follow a cross reference at point (@code{help-follow}). @item @key{TAB} -Move point forward to the next cross reference. +Move point forward to the next hyperlink (@code{forward-button}). @item S-@key{TAB} -Move point back to the previous cross reference. +Move point back to the previous hyperlink (@code{backward-button}). @item Mouse-1 @itemx Mouse-2 -Follow a cross reference that you click on. +Follow a hyperlink that you click on. @item C-c C-c -Show all documentation about the symbol at point. +Show all documentation about the symbol at point +(@code{help-follow-symbol}). +@item C-c C-b +Go back to the previous help topic (@code{help-go-back}). @end table - When a function name (@pxref{M-x,, Running Commands by Name}), -variable name (@pxref{Variables}), or face name (@pxref{Faces}) -appears in the documentation, it normally appears inside paired -single-quotes. To view the documentation of that command, variable or -face, you can click on the name with @kbd{Mouse-1} or @kbd{Mouse-2}, -or move point there and type @key{RET}. Use @kbd{C-c C-b} to retrace -your steps. +@cindex hyperlink +@findex help-follow +@findex help-go-back +@kindex RET @r{(Help mode)} +@kindex C-c C-b @r{(Help mode)} + When a function name, variable name, or face name (@pxref{Faces}) +appears in the documentation in the help buffer, it is normally an +underlined @dfn{hyperlink}. To view the associated documentation, +move point there and type @key{RET} (@code{help-follow}), or click on +the hyperlink with @kbd{Mouse-1} or @kbd{Mouse-2}. Doing so replaces +the contents of the help buffer; to retrace your steps, type @kbd{C-c +C-b} (@code{help-go-back}). @cindex URL, viewing in help @cindex help, viewing web pages @cindex viewing web pages in help @cindex web pages, viewing in help @findex browse-url - You can follow cross references to URLs (web pages) also. This uses -the @code{browse-url} command to view the page in the browser you -choose. @xref{Browse-URL}. - -@kindex @key{TAB} @r{(Help mode)} -@findex help-next-ref -@kindex S-@key{TAB} @r{(Help mode)} -@findex help-previous-ref - There are convenient commands to move point to cross references in -the help text. @key{TAB} (@code{help-next-ref}) moves point down to -the next cross reference. @kbd{S-@key{TAB}} moves up to the previous -cross reference (@code{help-previous-ref}). - - To view all documentation about any symbol name that appears in the -text, move point to the symbol name and type @kbd{C-c C-c} -(@code{help-follow-symbol}). This shows all available documentation -about the symbol as a variable, function and/or face. As above, use -@kbd{C-c C-b} to retrace your steps. - -@node Library Keywords -@section Keyword Search for Lisp Libraries + A help buffer can also contain hyperlinks to Info manuals, source +code definitions, and URLs (web pages). The first two are opened in +Emacs, and the third using a web browser via the @code{browse-url} +command (@pxref{Browse-URL}). + +@kindex TAB @r{(Help mode)} +@findex forward-button +@kindex S-TAB @r{(Help mode)} +@findex backward-button + In a help buffer, @key{TAB} (@code{forward-button}) moves point +forward to the next hyperlink, while @kbd{S-@key{TAB}} +(@code{backward-button}) point back to the previous hyperlink. These +commands act cyclically; for instance, typing @key{TAB} at the last +hyperlink moves back to the first hyperlink. + + To view all documentation about any symbol in the text, move point +to there and type @kbd{C-c C-c} (@code{help-follow-symbol}). This +shows all available documentation about the symbol---as a variable, +function and/or face. + +@node Package Keywords +@section Keyword Search for Packages +@cindex finder + +Most optional features in Emacs are grouped into @dfn{packages}. +Emacs contains several hundred built-in packages, and more can be +installed over the network (@pxref{Packages}). @kindex C-h p @findex finder-by-keyword -The @kbd{C-h p} command lets you search the standard Emacs Lisp -libraries by topic keywords. Here is a partial list of keywords you can -use: - -@multitable {convenience} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} -@item abbrev@tab abbreviation handling, typing shortcuts, macros. -@item bib@tab code related to the @code{bib} bibliography processor. -@item c@tab support for the C language and related languages. -@item calendar@tab calendar and time management support. -@item comm@tab communications, networking, remote access to files. -@item convenience@tab convenience features for faster editing. -@item data@tab support for editing files of data. -@item docs@tab support for Emacs documentation. -@item emulations@tab emulations of other editors. -@item extensions@tab Emacs Lisp language extensions. -@item faces@tab support for multiple fonts. -@item files@tab support for editing and manipulating files. -@item frames@tab support for Emacs frames and window systems. -@item games@tab games, jokes and amusements. -@item hardware@tab support for interfacing with exotic hardware. -@item help@tab support for on-line help systems. -@item hypermedia@tab support for links between text or other media types. -@item i18n@tab internationalization and alternate character-set support. -@item internal@tab code for Emacs internals, build process, defaults. -@item languages@tab specialized modes for editing programming languages. -@item lisp@tab Lisp support, including Emacs Lisp. -@item local@tab code local to your site. -@item maint@tab maintenance aids for the Emacs development group. -@item mail@tab modes for electronic-mail handling. -@item matching@tab various sorts of searching and matching. -@item mouse@tab mouse support. -@item multimedia@tab images and sound support. -@item news@tab support for netnews reading and posting. -@item oop@tab support for object-oriented programming. -@item outlines@tab support for hierarchical outlining. -@item processes@tab process, subshell, compilation, and job control support. -@item terminals@tab support for terminal types. -@item tex@tab supporting code for the @TeX{} formatter. -@item tools@tab programming tools. -@item unix@tab front-ends/assistants for, or emulators of, UNIX-like features. -@item wp@tab word processing. -@end multitable + To make it easier to find packages related to a topic, most packages +are associated with one or more @dfn{keywords} based on what they do. +Type @kbd{C-h p} (@code{finder-by-keyword}) to bring up a list of +package keywords, together with a description of what the keywords +mean. To view a list of packages for a given keyword, type @key{RET} +on that line; this displays the list of packages in a Package Menu +buffer (@pxref{Package Menu}). + +@findex describe-package +@kindex C-h P + @kbd{C-h P} (@code{describe-package}) prompts for the name of a +package, and displays a help buffer describing the attributes of the +package and the features that it implements. @node Language Help @section Help for International Language Support - You can use the command @kbd{C-h L} -(@code{describe-language-environment}) to get information about a -specific language environment. @xref{Language Environments}. This -tells you which languages this language environment supports. It also -lists the character sets, coding systems, and input methods that work -with this language environment, and finally shows some sample text to -illustrate scripts. + For information on a specific language environment (@pxref{Language +Environments}), type @kbd{C-h L} +(@code{describe-language-environment}). This displays a help buffer +describing the languages supported by the language environment, and +listing the associated character sets, coding systems, and input +methods, as well as some sample text for that language environment. The command @kbd{C-h h} (@code{view-hello-file}) displays the file @file{etc/HELLO}, which shows how to say ``hello'' in many languages. @@ -604,12 +550,11 @@ these is @key{ESC}, because @kbd{@key{ESC} C-h} is actually @node Help Files @section Help Files - The Emacs help commands described above display dynamic help based -on the current state within Emacs, or refer to manuals. Other help -commands display pre-written, static help files. - - Except for @kbd{C-h g}, these commands all have the form @kbd{C-h -C-@var{char}}; that is, @kbd{C-h} followed by a control character. + Apart from the built-in documentation and manuals, Emacs contains +several other files describing topics like copying conditions, release +notes, instructions for debugging and reporting bugs, and so forth. +You can use the following commands to view these files. Apart from +@kbd{C-h g}, they all have the form @kbd{C-h C-@var{char}}. @kindex C-h C-c @findex describe-copying @@ -636,24 +581,23 @@ C-@var{char}}; that is, @kbd{C-h} followed by a control character. @table @kbd @item C-h C-c -Display the Emacs copying conditions (@code{describe-copying}). -These are the rules under which you can copy and redistribute Emacs. +Display the rules under which you can copy and redistribute Emacs +(@code{describe-copying}). @item C-h C-d Display help for debugging Emacs (@code{view-emacs-debugging}). @item C-h C-e -Display external packages and information about Emacs +Display information about where to get external packages (@code{view-external-packages}). @item C-h C-f Display the Emacs frequently-answered-questions list (@code{view-emacs-FAQ}). @item C-h g -Display general information about the GNU Project -(@code{describe-gnu-project}). +Display information about the GNU Project (@code{describe-gnu-project}). @item C-h C-m -Display how to order printed copies of Emacs manuals +Display information about ordering printed copies of Emacs manuals (@code{view-order-manuals}). @item C-h C-n -Display the Emacs ``news'' file, which lists new features in the most -recent version of Emacs (@code{view-emacs-news}). +Display the ``news'' file, which lists the new features in this +version of Emacs (@code{view-emacs-news}). @item C-h C-o Display how to order or download the latest version of Emacs and other GNU software (@code{describe-distribution}). @@ -672,20 +616,20 @@ Emacs (@code{describe-no-warranty}). @cindex tooltips @cindex balloon help - When text on the screen is ``active'', so that it does something -special in response to mouse clicks or @kbd{RET}, it often has associated -help text. For instance, most parts of the mode line have help text. On -terminals that support mouse tracking, Emacs displays the help text as a -``tooltip'' (sometimes known as ``balloon help'') or in the echo area, -whenever you leave the mouse stationary over the active text. + In Emacs, stretches of ``active text'' (text that does something +special in response to mouse clicks or @key{RET}) often have +associated help text. This includes hyperlinks in Emacs buffers, as +well as parts of the mode line. On graphical displays, as well as +some text terminals which support mouse tracking, moving the mouse +over the active text displays the help text as a @dfn{tooltip}. @xref{Tooltips}. @kindex C-h . @findex display-local-help @vindex help-at-pt-display-when-idle - If your terminal doesn't support mouse-tracking, you can display the -help text for active buffer text using the keyboard. @kbd{C-h .} -(@code{display-local-help}) displays any help text associated with the -character after point, using the echo area. To display help text -automatically whenever it is available on the character after point, set -the variable @code{help-at-pt-display-when-idle} to @code{t}. + On terminals that don't support mouse-tracking, you can display the +help text for active buffer text at point by typing @kbd{C-h .} +(@code{display-local-help}). This shows the help text in the echo +area. To display help text automatically whenever it is available at +point, set the variable @code{help-at-pt-display-when-idle} to +@code{t}. diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index da1e88ab331..e84b4c9f080 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi @@ -15,9 +15,9 @@ argument text. @cindex prompt When the minibuffer is in use, it appears in the echo area, with a -cursor. The minibuffer display starts with a @dfn{prompt} in a -distinct color, usually ending with a colon. The prompt states what -kind of input is expected, and how it will be used. +cursor. The minibuffer starts with a @dfn{prompt} in a distinct +color, usually ending with a colon. The prompt states what kind of +input is expected, and how it will be used. The simplest way to enter a minibuffer argument is to type the text, then @key{RET} to submit the argument and exit the minibuffer. You @@ -26,19 +26,17 @@ typing @kbd{C-g}. @cindex default argument Sometimes, a @dfn{default argument} appears in the prompt, inside -parentheses before the colon. The default will be used as the -argument value if you just type @key{RET}. For example, commands that -read buffer names usually show a buffer name as the default; you can -type @key{RET} to operate on that default buffer. +parentheses before the colon. This default will be used as the +argument if you just type @key{RET}. For example, commands that read +buffer names usually show a buffer name as the default; you can type +@key{RET} to operate on that default buffer. Since the minibuffer appears in the echo area, it can conflict with -other uses of the echo area. If an error occurs while the minibuffer -is active, the error message hides the minibuffer for a few seconds, -or until you type something; then the minibuffer comes back. If a -command such as @kbd{C-x =} needs to display a message in the echo -area, the message hides the minibuffer for a few seconds, or until you -type something; then the minibuffer comes back. While the minibuffer -is in use, keystrokes do not echo. +other uses of the echo area. If an error message or an informative +message is emitted while the minibuffer is active, the message hides +the minibuffer for a few seconds, or until you type something; then +the minibuffer comes back. While the minibuffer is in use, keystrokes +do not echo. @menu * Minibuffer File:: Entering file names with the minibuffer. @@ -52,6 +50,7 @@ is in use, keystrokes do not echo. @node Minibuffer File @section Minibuffers for File Names +@cindex default directory Commands such as @kbd{C-x C-f} (@code{find-file}) use the minibuffer to read a file name argument (@pxref{Basic Files}). When the minibuffer is used to read a file name, it typically starts out with @@ -92,7 +91,7 @@ Emacs interprets a double slash as ``ignore everything before the second slash in the pair.'' In the example above, @file{/u2/emacs/src/} is ignored, so the argument you supplied is @file{/etc/termcap}. The ignored part of the file name is dimmed if -the terminal allows it (to disable this dimming, turn off File Name +the terminal allows it. (To disable this dimming, turn off File Name Shadow mode with the command @kbd{M-x file-name-shadow-mode}.) @cindex home directory shorthand @@ -108,11 +107,11 @@ directory name in front of the @file{~} is ignored: thus, home directory, Emacs uses several alternatives. For MS-Windows, see @ref{Windows HOME}; for MS-DOS, see @ifnottex -@ref{MS-DOS File Names, HOME on MS-DOS}. +@ref{MS-DOS File Names}. @end ifnottex @iftex -@ref{MS-DOS File Names, HOME on MS-DOS,, emacs, the Emacs Manual}, in -the main Emacs manual. +@ref{MS-DOS File Names, HOME on MS-DOS,, emacs, the digital version of +the Emacs Manual}. @end iftex On these systems, the @file{~@var{user-id}/} construct is supported only for the current user, i.e., only if @var{user-id} is the current @@ -125,9 +124,8 @@ file names, change the variable @code{insert-default-directory} to Nonetheless, relative file name arguments are still interpreted based on the same default directory. - For rules how to read remote file names in the minibuffer, see -@ref{Filename completion, file name completion,, tramp}, in the Tramp -manual. + You can also enter remote file names in the minibuffer. +@xref{Remote Files}. @node Minibuffer Edit @section Editing in the Minibuffer @@ -136,17 +134,17 @@ manual. usual Emacs commands are available for editing the argument text. (The prompt, however, is @dfn{read-only}, and cannot be changed.) - Since @key{RET} in the minibuffer is defined to exit the minibuffer, -you can't use it to insert a newline in the minibuffer. To do that, -type @kbd{C-o} or @kbd{C-q C-j}. (The newline character is really the -@acronym{ASCII} character control-J.) + Since @key{RET} in the minibuffer submits the argument, you can't +use it to insert a newline. You can do that with @kbd{C-q C-j}, which +inserts a @kbd{C-j} control character, which is formally equivalent to +a newline character (@pxref{Inserting Text}). Alternatively, you can +use the @kbd{C-o} (@code{open-line}) command (@pxref{Blank Lines}). - Inside a minibuffer, the keys @kbd{@key{TAB}}, @kbd{@key{SPC}}, and -@kbd{@key{?}} are often bound to commands that perform -@dfn{completion}. @xref{Completion}. You can use @kbd{C-q} -(@code{quoted-insert}) to insert a @key{TAB}, @key{SPC}, or @key{?} -character. For example, @kbd{C-q @key{TAB}} inserts a @key{TAB} -character. @xref{Inserting Text}. + Inside a minibuffer, the keys @key{TAB}, @key{SPC}, and @kbd{?} are +often bound to @dfn{completion commands}, which allow you to easily +fill in the desired text without typing all of it. @xref{Completion}. +As with @key{RET}, you can use @kbd{C-q} to insert a @key{TAB}, +@key{SPC}, or @samp{?} character. For convenience, @kbd{C-a} (@code{move-beginning-of-line}) in a minibuffer moves point to the beginning of the argument text, not the @@ -203,35 +201,28 @@ set the variable @code{enable-recursive-minibuffers} to @code{t}. @c it, the tutorial needs to be adjusted. @cindex completion - Sometimes, you can use a feature called @dfn{completion} to help you -enter arguments. This means that after you type part of the argument, -Emacs can fill in the rest, or some of it, based on what you have -typed so far. + You can often use a feature called @dfn{completion} to help enter +arguments. This means that after you type part of the argument, Emacs +can fill in the rest, or some of it, based on what was typed so far. +@cindex completion alternative When completion is available, certain keys (usually @key{TAB}, -@key{RET}, and @key{SPC}) are rebound to complete the text in the -minibuffer into a longer string chosen from a set of @dfn{completion -alternatives}. The set of completion alternatives depends on the -command that requested the argument, and on what you have typed so -far. In addition, you can usually type @kbd{?} to display a list of -possible completions. - - For example, @kbd{M-x} uses the minibuffer to read the name of a -command, so completion works by matching the minibuffer text against -the names of existing Emacs commands. So, to run the command -@code{insert-buffer}, you can type @kbd{M-x ins @key{SPC} b @key{RET}} -instead of the full @kbd{M-x insert-buffer @key{RET}}. - - Case is significant in completion when it is significant in the -argument you are entering, such as command names. Thus, -@samp{insert-buffer} is not a valid completion for @samp{IN}. -Completion ignores case distinctions for certain arguments in which -case does not matter. +@key{RET}, and @key{SPC}) are rebound in the minibuffer to special +completion commands (@pxref{Completion Commands}). These commands +attempt to complete the text in the minibuffer, based on a set of +@dfn{completion alternatives} provided by the command that requested +the argument. You can usually type @kbd{?} to see a list of +completion alternatives. + + Although completion is usually done in the minibuffer, the feature +is sometimes available in ordinary buffers too. @xref{Symbol +Completion}. @menu * Example: Completion Example. Examples of using completion. * Commands: Completion Commands. A list of completion commands. * Strict Completion:: Different types of completion. +* Completion Styles:: How completion matches are chosen. * Options: Completion Options. Options for completion. @end menu @@ -239,24 +230,31 @@ case does not matter. @subsection Completion Example @kindex TAB @r{(completion)} - A concrete example may help here. If you type @kbd{M-x a u -@key{TAB}}, the @key{TAB} looks for alternatives (in this case, -command names) that start with @samp{au}. There are several, -including @code{auto-fill-mode} and @code{autoconf-mode}, but they all -begin with @code{auto}, so the @samp{au} in the minibuffer completes -to @samp{auto}. + A simple example may help here. @kbd{M-x} uses the minibuffer to +read the name of a command, so completion works by matching the +minibuffer text against the names of existing Emacs commands. Suppose +you wish to run the command @code{auto-fill-mode}. You can do that by +typing @kbd{M-x auto-fill-mode @key{RET}}, but it is easier to use +completion. + + If you type @kbd{M-x a u @key{TAB}}, the @key{TAB} looks for +completion alternatives (in this case, command names) that start with +@samp{au}. There are several, including @code{auto-fill-mode} and +@code{autoconf-mode}, but they all begin with @code{auto}, so the +@samp{au} in the minibuffer completes to @samp{auto}. If you type @key{TAB} again immediately, it cannot determine the next character; it could be @samp{-}, @samp{a}, or @samp{c}. So it does not add any characters; instead, @key{TAB} displays a list of all possible completions in another window. - Next, type @kbd{- f}. The minibuffer now contains @samp{auto-f}, -and the only command name that starts with this is -@code{auto-fill-mode}. If you now type @key{TAB}, completion fills in -the rest of the argument @samp{auto-fill-mode} into the minibuffer. -You have been able to enter @samp{auto-fill-mode} by typing just -@kbd{a u @key{TAB} - f @key{TAB}}. + Next, type @kbd{-f}. The minibuffer now contains @samp{auto-f}, and +the only command name that starts with this is @code{auto-fill-mode}. +If you now type @key{TAB}, completion fills in the rest of the +argument @samp{auto-fill-mode} into the minibuffer. + + Hence, typing just @kbd{a u @key{TAB} - f @key{TAB}} allows you to +enter @samp{auto-fill-mode}. @node Completion Commands @subsection Completion Commands @@ -272,60 +270,24 @@ complete, display a list of possible completions (@code{minibuffer-complete}). @item @key{SPC} Complete up to one word from the minibuffer text before point -(@code{minibuffer-complete-word}). @key{SPC} for completion is not -available when entering a file name, since file names often include -spaces. +(@code{minibuffer-complete-word}). This command is not available for +arguments that often include spaces, such as file names. @item @key{RET} Submit the text in the minibuffer as the argument, possibly completing -first as described in the next -@iftex -subsection (@code{minibuffer-complete-and-exit}). -@end iftex -@ifnottex -node (@code{minibuffer-complete-and-exit}). @xref{Strict Completion}. -@end ifnottex +first (@code{minibuffer-complete-and-exit}). @xref{Strict Completion}. @item ? -Display a list of possible completions of the text before point -(@code{minibuffer-completion-help}). +Display a list of completions (@code{minibuffer-completion-help}). @end table -@kindex TAB +@kindex TAB @r{(completion)} @findex minibuffer-complete @key{TAB} (@code{minibuffer-complete}) is the most fundamental -completion command. It searches for all possible completion -alternatives that match the existing minibuffer text, and attempts to -complete as much as it can. The matching of completion alternatives -to the minibuffer text is performed according to somewhat intricate -rules, which are designed so that plausible completions are offered -under most circumstances. A valid completion alternative must satisfy -the following criteria: +completion command. It searches for all possible completions that +match the existing minibuffer text, and attempts to complete as much +as it can. @xref{Completion Styles}, for how completion alternatives +are chosen. -@itemize @bullet -@item -The minibuffer text before point must be the same as the beginning of -the completion alternative. If there is any minibuffer text after -point, it must be a substring of the remainder of the completion -alternative. - -@item -If no completion alternative satisfies the above rules, try using -@dfn{partial completion} rules: divide the minibuffer text into words -separated by hyphens or spaces, and complete each word separately. -Thus, when completing command names, @samp{em-l-m} completes to -@samp{emacs-lisp-mode}. - -@item -If there is still no completion alternative, try the first rule again, -but ignore the minibuffer text after point (i.e., don't try matching -it). -@end itemize - -@noindent -When performing these comparisons, a @samp{*} in the minibuffer text -acts as a @dfn{wildcard}---it matches any character at the -corresponding position in the completion alternative. - -@kindex SPC +@kindex SPC @r{(completion)} @findex minibuffer-complete-word @key{SPC} (@code{minibuffer-complete-word}) completes like @key{TAB}, but only up to the next hyphen or space. If you have @@ -334,50 +296,52 @@ completion is @samp{auto-fill-mode}, but it only inserts @samp{ill-}, giving @samp{auto-fill-}. Another @key{SPC} at this point completes all the way to @samp{auto-fill-mode}. +@kindex ? @r{(completion)} +@cindex completion list If @key{TAB} or @key{SPC} is unable to complete, it displays a list -of possible completions (if there are any) in a separate window. You -can choose a completion from this list using the following commands: +of matching completion alternatives (if there are any) in another +window. You can display the same list with @kbd{?} +(@code{minibuffer-completion-help}). The following commands can be +used with the completion list: @table @kbd @findex mouse-choose-completion @item Mouse-1 @itemx Mouse-2 -Clicking mouse button 1 or 2 on a completion possibility chooses that -completion (@code{mouse-choose-completion}). +Clicking mouse button 1 or 2 on a completion alternative chooses it +(@code{mouse-choose-completion}). @findex switch-to-completions @item M-v @itemx @key{PageUp} @itemx @key{prior} Typing @kbd{M-v}, while in the minibuffer, selects the window showing -the completion list buffer (@code{switch-to-completions}). This paves -the way for using the commands below. Typing @key{PageUp} or -@key{prior} does the same, as does selecting that window in other -ways. +the completion list (@code{switch-to-completions}). This paves the +way for using the commands below. @key{PageUp} or @key{prior} does +the same. You can also select the window in other ways +(@pxref{Windows}). @findex choose-completion @item @key{RET} -Typing @key{RET}, while in the completion list buffer, chooses the -completion that point is in or next to (@code{choose-completion}). To -use this command, you must first switch to the completion list window. +While in the completion list buffer, this chooses the completion at +point (@code{choose-completion}). @findex next-completion @item @key{Right} -Typing the right-arrow key @key{Right}, while in the completion list -buffer, moves point to the following completion possibility -(@code{next-completion}). +While in the completion list buffer, this moves point to the following +completion alternative (@code{next-completion}). @findex previous-completion @item @key{Left} -Typing the left-arrow key @key{Left}, while in the completion list -buffer, moves point to the previous completion possibility -(@code{previous-completion}). +While in the completion list buffer, this moves point to the previous +completion alternative (@code{previous-completion}). @end table @node Strict Completion @subsection Strict Completion - There are three different ways that @key{RET} can do completion, + There are three ways that the @key{RET} +(@code{minibuffer-complete-and-exit}) completion command can act, depending on how the argument will be used. @itemize @bullet @@ -406,67 +370,140 @@ completion, @key{RET} does not complete, it just submits the argument as you have entered it. @end itemize - The completion commands display a list of all possible completions -whenever they can't determine even one more character by completion. -Also, typing @kbd{?} explicitly requests such a list. You can scroll -the list with @kbd{C-M-v} (@pxref{Other Window}). + Like the other completion commands, @key{RET} displays a list of all +possible completions whenever it is supposed to complete but is unable +to complete any further. -@node Completion Options -@subsection Completion Options +@node Completion Styles +@subsection How Completion Alternatives Are Chosen +@cindex completion style -@vindex completion-auto-help - If @code{completion-auto-help} is set to @code{nil}, the completion -commands never display the completion list buffer; you must type -@kbd{?} to display the list. If the value is @code{lazy}, Emacs only -shows the completion list buffer on the second attempt to complete. -In other words, if there is nothing to complete, the first @key{TAB} -echoes @samp{Next char not unique}; the second @key{TAB} does the -completion list buffer. + Completion commands work by narrowing a large list of possible +completion alternatives to a smaller subset that ``matches'' what you +have typed in the minibuffer. In @ref{Completion Example}, we gave a +simple example of such matching. The procedure of determining what +constitutes a ``match'' is quite intricate. Emacs attempts to offer +plausible completions under most circumstances. -@vindex completion-ignored-extensions -@cindex ignored file names, in completion - When completing file names, certain file names are usually ignored. -The variable @code{completion-ignored-extensions} contains a list of -strings; a file name ending in any of those strings is ignored as a -completion candidate. The standard value of this variable has several -elements including @code{".o"}, @code{".elc"}, and @code{"~"}. For -example, if a directory contains @samp{foo.c} and @samp{foo.elc}, -@samp{foo} completes to @samp{foo.c}. However, if @emph{all} possible -completions end in ``ignored'' strings, they are not ignored: in the -previous example, @samp{foo.e} completes to @samp{foo.elc}. -Displaying a list of possible completions disregards -@code{completion-ignored-extensions}; it shows them all. + Emacs performs completion using one or more @dfn{completion +styles}---sets of criteria for matching minibuffer text to completion +alternatives. During completion, Emacs tries each completion style in +turn. If a style yields one or more matches, that is used as the list +of completion alternatives. If a style produces no matches, Emacs +falls back on the next style. - If an element of @code{completion-ignored-extensions} ends in a -slash (@file{/}), it's a subdirectory name; that directory and its -contents are ignored. Elements of -@code{completion-ignored-extensions} that do not end in a slash are -ordinary file names. +@vindex completion-styles + The list variable @code{completion-styles} specifies the completion +styles to use. Each list element is the name of a completion style (a +Lisp symbol). The default completion styles are (in order): + +@table @code +@item basic +A matching completion alternative must have the same beginning as the +text in the minibuffer before point. Furthermore, if there is any +text in the minibuffer after point, the rest of the completion +alternative must contain that text as a substring. + +@findex partial completion +@item partial-completion +This aggressive completion style divides the minibuffer text into +words separated by hyphens or spaces, and completes each word +separately. (For example, when completing command names, +@samp{em-l-m} completes to @samp{emacs-lisp-mode}.) + +Furthermore, a @samp{*} in the minibuffer text is treated as a +@dfn{wildcard}---it matches any character at the corresponding +position in the completion alternative. + +@item emacs22 +This completion style is similar to @code{basic}, except that it +ignores the text in the minibuffer after point. It is so-named +because it corresponds to the completion behavior in Emacs 22 and +earlier. +@end table + +@noindent +The following additional completion styles are also defined, and you +can add them to @code{completion-styles} if you wish +(@pxref{Customization}): + +@table @code +@item substring +A matching completion alternative must contain the text in the +minibuffer before point, and the text in the minibuffer after point, +as substrings (in that same order). + +Thus, if the text in the minibuffer is @samp{foobar}, with point +between @samp{foo} and @samp{bar}, that matches +@samp{@var{a}foo@var{b}bar@var{c}}, where @var{a}, @var{b}, and +@var{c} can be any string including the empty string. + +@item initials +This very aggressive completion style attempts to complete acronyms +and initialisms. For example, when completing command names, it +matches @samp{lch} to @samp{list-command-history}. +@end table + +@node Completion Options +@subsection Completion Options @cindex case-sensitivity and completion +@cindex case in completion + Case is significant when completing case-sensitive arguments, such +as command names. For example, when completing command names, +@samp{AU} does not complete to @samp{auto-fill-mode}. Case +differences are ignored when completing arguments in which case does +not matter. + @vindex read-file-name-completion-ignore-case @vindex read-buffer-completion-ignore-case - When completing file names, Emacs ignores case differences if the + When completing file names, case differences are ignored if the variable @code{read-file-name-completion-ignore-case} is non-@code{nil}. The default value is @code{nil} on systems that have case-sensitive file-names, such as GNU/Linux; it is non-@code{nil} on systems that have case-insensitive file-names, such as Microsoft -Windows. When completing buffer names, Emacs ignores case differences -if @code{read-buffer-completion-ignore-case} is non-@code{nil} (the -default value is @code{nil}). +Windows. When completing buffer names, case differences are ignored +if the variable @code{read-buffer-completion-ignore-case} is +non-@code{nil}; the default is @code{nil}. -@vindex completion-styles - You can customize the matching rules for completion alternatives -using the variable @code{completion-styles}. Its value should be a -list of symbols, each representing a @dfn{completion style}; valid -style symbols are @code{basic}, @code{partial-completion}, -@code{emacs22}, @code{emacs21}, and @code{initials}. When completing, -Emacs attempts to use the first completion style in the list; if this -does not return any completion alternatives, it tries the next -completion style in the list, and so on. The completion rules -described in @ref{Completion Commands} correspond to the default value -of @code{completion-styles}, which is @code{(basic partial-completion -emacs22)}. +@vindex completion-ignored-extensions +@cindex ignored file names, in completion + When completing file names, Emacs usually omits certain alternatives +that are considered unlikely to be chosen, as determined by the list +variable @code{completion-ignored-extensions}. Each element in the +list should be a string; any file name ending in such a string is +ignored as a completion alternative. Any element ending in a slash +(@file{/}) represents a subdirectory name. The standard value of +@code{completion-ignored-extensions} has several elements including +@code{".o"}, @code{".elc"}, and @code{"~"}. For example, if a +directory contains @samp{foo.c} and @samp{foo.elc}, @samp{foo} +completes to @samp{foo.c}. However, if @emph{all} possible +completions end in ``ignored'' strings, they are not ignored: in the +previous example, @samp{foo.e} completes to @samp{foo.elc}. Emacs +disregards @code{completion-ignored-extensions} when showing +completion alternatives in the completion list. + +@vindex completion-auto-help + If @code{completion-auto-help} is set to @code{nil}, the completion +commands never display the completion list buffer; you must type +@kbd{?} to display the list. If the value is @code{lazy}, Emacs only +shows the completion list buffer on the second attempt to complete. +In other words, if there is nothing to complete, the first @key{TAB} +echoes @samp{Next char not unique}; the second @key{TAB} does the +completion list buffer. + +@vindex completion-cycle-threshold + If @code{completion-cycle-threshold} is non-@code{nil}, completion +commands can ``cycle'' through completion alternatives. Normally, if +there is more than one completion alternative for the text in the +minibuffer, a completion command completes up to the longest common +substring. If you change @code{completion-cycle-threshold} to +@code{t}, the completion command instead completes to the first of +those completion alternatives; each subsequent invocation of the +completion command replaces that with the next completion alternative, +in a cyclic manner. If you give @code{completion-cycle-threshold} a +numeric value @var{n}, completion commands switch to this cycling +behavior only when there are fewer than @var{n} alternatives. @cindex Icomplete mode @findex icomplete-mode @@ -504,64 +541,60 @@ Move to a later item in the minibuffer history that matches @kindex M-p @r{(minibuffer history)} @kindex M-n @r{(minibuffer history)} +@kindex UP @r{(minibuffer history)} +@kindex DOWN @r{(minibuffer history)} @findex next-history-element @findex previous-history-element - While in the minibuffer, typing @kbd{M-p} or @key{Up} -(@code{previous-history-element}) moves up through the minibuffer -history list, one item at a time. Each @kbd{M-p} fetches an earlier -item from the history list into the minibuffer, replacing its existing -contents. Similarly, typing @kbd{M-n} or @key{Down} -(@code{next-history-element}) moves back down the history list, -fetching later entries into the minibuffer. You can think of these -commands as ``backwards'' and ``forwards'' through the history list. + While in the minibuffer, @kbd{M-p} or @key{Up} +(@code{previous-history-element}) moves through the minibuffer history +list, one item at a time. Each @kbd{M-p} fetches an earlier item from +the history list into the minibuffer, replacing its existing contents. +Typing @kbd{M-n} or @key{Down} (@code{next-history-element}) moves +through the minibuffer history list in the opposite direction, +fetching later entries into the minibuffer. If you type @kbd{M-n} in the minibuffer when there are no later entries in the minibuffer history (e.g., if you haven't previously typed @kbd{M-p}), Emacs tries fetching from a list of default -argument: values that you are likely to enter. You can think of this -as moving through the ``future list'' instead of the ``history list''. +arguments: values that you are likely to enter. You can think of this +as moving through the ``future history'' list. - The input that @kbd{M-p} or @kbd{M-n} fetches into the minibuffer -entirely replaces the existing contents of the minibuffer, so you can -simply type @key{RET} to use it as an argument. You can also edit the -text before you reuse it; this does not change the history element -that you ``moved'' to, but your new argument does go at the end of the -history list in its own right. + If you edit the text inserted by the @kbd{M-p} or @key{M-n} +minibuffer history commands, this does not change its entry in the +history list. However, the edited argument does go at the end of the +history list when you submit it. @findex previous-matching-history-element @findex next-matching-history-element @kindex M-r @r{(minibuffer history)} @kindex M-s @r{(minibuffer history)} - There are also commands to search forward or backward through the -history; they search for history elements that match a regular -expression. @kbd{M-r} (@code{previous-matching-history-element}) -searches older elements in the history, while @kbd{M-s} -(@code{next-matching-history-element}) searches newer elements. These -commands are unusual: they use the minibuffer to read the regular -expression even though they are invoked from the minibuffer. As with -incremental searching, an upper-case letter in the regular expression -makes the search case-sensitive (@pxref{Search Case}). You can also -search through the history using an incremental search (@pxref{Isearch -Minibuffer}). - - All uses of the minibuffer record your input on a history list, but -there are separate history lists for different kinds of arguments. -For example, there is a list for file names, used by all the commands -that read file names. (As a special feature, this history list -records the absolute file name, even if the name you entered was not -absolute.) - - There are several other specific history lists, including one for -buffer names, one for arguments of commands like @code{query-replace}, -one used by @kbd{M-x} for command names, and one used by -@code{compile} for compilation commands. Finally, there is one -``miscellaneous'' history list that most minibuffer arguments use. + You can use @kbd{M-r} (@code{previous-matching-history-element}) to +search through older elements in the history list, and @kbd{M-s} +(@code{next-matching-history-element}) to search through newer +entries. Each of these commands asks for a @dfn{regular expression} +as an argument, and fetches the first matching entry into the +minibuffer. @xref{Regexps}, for an explanation of regular +expressions. A numeric prefix argument @var{n} means to fetch the +@var{n}th matching entry. These commands are unusual, in that they +use the minibuffer to read the regular expression argument, even +though they are invoked from the minibuffer. An upper-case letter in +the regular expression makes the search case-sensitive (@pxref{Search +Case}). + + You can also search through the history using an incremental search. +@xref{Isearch Minibuffer}. + + Emacs keeps separate history lists for several different kinds of +arguments. For example, there is a list for file names, used by all +the commands that read file names. Other history lists include buffer +names, command names (used by @kbd{M-x}), and command arguments (used +by commands like @code{query-replace}). @vindex history-length The variable @code{history-length} specifies the maximum length of a minibuffer history list; adding a new element deletes the oldest -element if the list gets too long. If the value of -@code{history-length} is @code{t}, there is no maximum length. +element if the list gets too long. If the value is @code{t}, there is +no maximum length. @vindex history-delete-duplicates The variable @code{history-delete-duplicates} specifies whether to @@ -592,27 +625,25 @@ Display the entire command history, showing all the commands @kindex C-x ESC ESC @findex repeat-complex-command - @kbd{C-x @key{ESC} @key{ESC}} is used to re-execute a recent command -that used the minibuffer. With no argument, it repeats the last such -command. A numeric argument specifies which command to repeat; 1 -means the last one, 2 the previous, and so on. + @kbd{C-x @key{ESC} @key{ESC}} re-executes a recent command that used +the minibuffer. With no argument, it repeats the last such command. +A numeric argument specifies which command to repeat; 1 means the last +one, 2 the previous, and so on. @kbd{C-x @key{ESC} @key{ESC}} works by turning the previous command into a Lisp expression and then entering a minibuffer initialized with -the text for that expression. Even if you don't understand Lisp -syntax, it will probably be obvious which command is displayed for -repetition. If you type just @key{RET}, that repeats the command -unchanged. You can also change the command by editing the Lisp -expression before you execute it. The repeated command is added to -the front of the command history unless it is identical to the most -recent item. - - Once inside the minibuffer for @kbd{C-x @key{ESC} @key{ESC}}, you can -use the minibuffer history commands (@kbd{M-p}, @kbd{M-n}, @kbd{M-r}, -@kbd{M-s}; @pxref{Minibuffer History}) to move through the history list -of saved entire commands. After finding the desired previous command, -you can edit its expression as usual and then repeat it by typing -@key{RET}. +the text for that expression. Even if you don't know Lisp, it will +probably be obvious which command is displayed for repetition. If you +type just @key{RET}, that repeats the command unchanged. You can also +change the command by editing the Lisp expression before you execute +it. The repeated command is added to the front of the command history +unless it is identical to the most recent item. + + Once inside the minibuffer for @kbd{C-x @key{ESC} @key{ESC}}, you +can use the usual minibuffer history commands (@pxref{Minibuffer +History}) to move through the history list. After finding the desired +previous command, you can edit its expression as usual and then repeat +it by typing @key{RET}. @vindex isearch-resume-in-command-history Incremental search does not, strictly speaking, use the minibuffer. @@ -637,12 +668,11 @@ when you tell Emacs to visit a file on another machine via a network protocol such as FTP, you often need to supply a password to gain access to the machine (@pxref{Remote Files}). - Entering a password is, in a basic sense, similar to using a -minibuffer. Emacs displays a prompt in the echo area (such as -@samp{Password: }); after you type the required password, press -@key{RET} to submit it. To prevent others from seeing your password, -every character you type is displayed as a dot (@samp{.}) instead of -its usual form. + Entering a password is similar to using a minibuffer. Emacs +displays a prompt in the echo area (such as @samp{Password: }); after +you type the required password, press @key{RET} to submit it. To +prevent others from seeing your password, every character you type is +displayed as a dot (@samp{.}) instead of its usual form. Most of the features and commands associated with the minibuffer can @emph{not} be used when entering a password. There is no history or diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 4f1683ef5ea..29b6c69e38f 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -1707,10 +1707,9 @@ directionality when they are displayed. The default value is Each paragraph of bidirectional text can have its own @dfn{base direction}, either right-to-left or left-to-right. (Paragraph -boundaries are defined by the regular expressions -@code{paragraph-start} and @code{paragraph-separate}, see -@ref{Paragraphs}.) Text in left-to-right paragraphs begins at the -left margin of the window and is truncated or continued when it +boundaries are empty lines, i.e.@: lines consisting entirely of +whitespace characters.) Text in left-to-right paragraphs begins at +the left margin of the window and is truncated or continued when it reaches the right margin. By contrast, text in right-to-left paragraphs begins at the right margin and is continued or truncated at the left margin. @@ -1734,8 +1733,8 @@ The special character @code{RIGHT-TO-LEFT MARK}, or @sc{rlm}, forces the right-to-left direction on the following paragraph, while @code{LEFT-TO-RIGHT MARK}, or @sc{lrm} forces the left-to-right direction. (You can use @kbd{C-x 8 RET} to insert these characters.) -In a GUI session, the @sc{lrm} and @sc{rlm} characters display as -blanks. +In a GUI session, the @sc{lrm} and @sc{rlm} characters display as very +thin blank characters; on text terminals they display as blanks. Because characters are reordered for display, Emacs commands that operate in the logical order or on stretches of buffer positions may diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 0b0e4867ae5..96ccaa2b3c4 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -332,6 +332,8 @@ pages are often meaningful divisions of the file, Emacs provides commands to move over them and operate on them. @table @kbd +@item M-x what-page +Display the page number of point, and the line number within that page. @item C-x [ Move point to previous page boundary (@code{backward-page}). @item C-x ] @@ -342,6 +344,10 @@ Put point and mark around this page (or another page) (@code{mark-page}). Count the lines in this page (@code{count-lines-page}). @end table +@findex what-page + @kbd{M-x what-page} counts pages from the beginning of the file, and +counts lines within the page, showing both numbers in the echo area. + @kindex C-x [ @kindex C-x ] @findex forward-page diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index bb98cd884cf..fa5aac6e9ec 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,23 @@ +2011-10-11 Martin Rudalics <rudalics@gmx.at> + + * windows.texi (Deleting Windows): Mention which window gets + selected when deleting the selected window. + +2011-10-09 Martin Rudalics <rudalics@gmx.at> + + * buffers.texi (The Buffer List): Describe how bury-buffer deals + with the selected window. + * windows.texi (Buffers and Windows): Reformulate text on how + replace-buffer-in-windows deals with a window. + (Quitting Windows): Describe how quit-window deals with a + standalone frame. Describe new option frame-auto-hide-function. + +2011-10-08 Glenn Morris <rgm@gnu.org> + + * symbols.texi (Other Plists): Markup fix. (Bug#9702) + + * positions.texi (Excursions): Update warning message. + 2011-10-05 Chong Yidong <cyd@stupidchicken.com> * display.texi (Low-Level Font, Face Attributes, Font Lookup): Fix diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index ce1a8b0fb4e..816d0f9faa8 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi @@ -884,23 +884,28 @@ This buffer therefore becomes the least desirable candidate for @code{other-buffer} to return. The argument can be either a buffer itself or the name of one. -@code{bury-buffer} operates on each frame's @code{buffer-list} parameter -as well as the fundamental buffer list; therefore, the buffer that you -bury will come last in the value of @code{(buffer-list @var{frame})} and -in the value of @code{(buffer-list)}. - -If @var{buffer-or-name} is @code{nil} or omitted, this means to bury -the current buffer. In addition, if the buffer is displayed in the -selected window, this switches to some other buffer (obtained using -@code{other-buffer}) in the selected window. @xref{Switching -Buffers}. But if the selected window is dedicated to its buffer, it -deletes that window if there are other windows left on its frame. -Otherwise, if the selected window is the only window on its frame, it -iconifies that frame. If @var{buffer-or-name} is displayed in some +This functions operates on each frame's @code{buffer-list} parameter as +well as the fundamental buffer list; therefore, the buffer that you bury +will come last in the value of @code{(buffer-list @var{frame})} and in +the value of @code{(buffer-list)}. In addition, it also puts the buffer +at the end of the list of buffer of the selected window (@pxref{Window +History}) provided it is shown in that window. + +If @var{buffer-or-name} is @code{nil} or omitted, this means to bury the +current buffer. In addition, if the current buffer is displayed in the +selected window, this makes sure that the window is either deleted or +another buffer is shown in it. More precisely, if the window is +dedicated (@pxref{Dedicated Windows}) and there are other windows on its +frame, the window is deleted. If the window is both dedicated and the +only window on its frame's terminal, the function specified by +@code{frame-auto-hide-function} (@pxref{Quitting Windows}) will deal +with the window. If the window is not dedicated to its buffer, it calls +@code{switch-to-prev-buffer} (@pxref{Window History}) to show another +buffer in that window. If @var{buffer-or-name} is displayed in some other window, it remains displayed there. To replace a buffer in all the windows that display it, use -@code{replace-buffer-in-windows}. @xref{Buffers and Windows}. +@code{replace-buffer-in-windows}, @xref{Buffers and Windows}. @end deffn @deffn Command unbury-buffer diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index 1124d58ebcc..74444c7ad60 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -832,7 +832,7 @@ consequences, so the byte compiler warns if you call @code{set-buffer} during an excursion: @example -Warning: @code{save-excursion} defeated by @code{set-buffer} +Warning: Use `with-current-buffer' rather than save-excursion+set-buffer @end example @noindent diff --git a/doc/lispref/symbols.texi b/doc/lispref/symbols.texi index 60d14d567d4..79b3249d760 100644 --- a/doc/lispref/symbols.texi +++ b/doc/lispref/symbols.texi @@ -541,7 +541,7 @@ returns @code{nil}. For example, (plist-get '(foo 4 bad) 'foo) @result{} 4 (plist-get '(foo 4 bad) 'bad) - @result{} @code{nil} + @result{} nil (plist-get '(foo 4 bad) 'bar) @result{} nil @end example diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index bffea19210c..9dd03027ee2 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -1608,7 +1608,9 @@ This function removes @var{window} from display and returns @code{nil}. The argument @var{window} can denote any window and defaults to the selected one. An error is signaled if @var{window} is the only window on its frame. Hence @var{window} must have at least one sibling window -(@pxref{Windows and Frames}) in order to get deleted. +(@pxref{Windows and Frames}) in order to get deleted. If @var{window} +is the selected window on its frame, this function selects the most +recently selected live window on that frame instead. If the variable @code{ignore-window-parameters} (@pxref{Window Parameters}) is non-@code{nil}, this function ignores all parameters of @@ -1629,7 +1631,8 @@ combination. @deffn Command delete-other-windows &optional window This function makes @var{window} fill its frame and returns @code{nil}. The argument @var{window} can denote an arbitrary window and defaults to -the selected one. +the selected one. Upon exit, @var{window} will be the selected window +on its frame. If the variable @code{ignore-window-parameters} (@pxref{Window Parameters}) is non-@code{nil}, this function ignores all parameters of @@ -2076,16 +2079,17 @@ This command replaces @var{buffer-or-name} with some other buffer, in all windows displaying it. For each such window, it choose another buffer using @code{switch-to-prev-buffer} (@pxref{Window History}). -@var{buffer-or-name} may be a buffer, or the name of an existing -buffer; it defaults to the current buffer. +The argument @var{buffer-or-name} may be a buffer, or the name of an +existing buffer; it defaults to the current buffer. If a window displaying @var{buffer-or-name} is dedicated -(@pxref{Dedicated Windows}), has never displayed any other buffers and -is not the only window on its frame, that window is deleted. If that -window is the only window on its frame and there are other frames on the -frame's terminal, that frame is deleted too; otherwise, the buffer -provided by the function @code{switch-to-prev-buffer} (@pxref{Window -History}) is displayed instead. +(@pxref{Dedicated Windows}) and is not the only window on its frame, +that window is deleted. If that window is the only window on its frame +and there are other frames on the frame's terminal, that frame is dealt +with by the function spcecified by @code{frame-auto-hide-function} +(@pxref{Quitting Windows}). Otherwise, the buffer provided by the +function @code{switch-to-prev-buffer} (@pxref{Window History}) is +displayed in the window instead. @end deffn @@ -2784,14 +2788,14 @@ non-@code{nil} value. @section Quitting Windows When you want to get rid of a window used for displaying a buffer you -can use the function @code{delete-window} (@pxref{Deleting Windows}) to -remove that window from its frame. If the buffer has been shown on a -separate frame, you might want to call @code{delete-frame} -(@pxref{Deleting Frames}) instead. If, on the other hand, a window has -been reused for displaying the buffer, you might prefer showing the -buffer previously shown in that window by calling the function -@code{switch-to-prev-buffer} (@pxref{Window History}). Finally, you -might want to either bury (@pxref{The Buffer List}) or kill +can call @code{delete-window} or @code{delete-windows-on} +(@pxref{Deleting Windows}) to remove that window from its frame. If the +buffer is shown on a separate frame, you might want to call +@code{delete-frame} (@pxref{Deleting Frames}) instead. If, on the other +hand, a window has been reused for displaying the buffer, you might +prefer showing the buffer previously shown in that window by calling the +function @code{switch-to-prev-buffer} (@pxref{Window History}). +Finally, you might want to either bury (@pxref{The Buffer List}) or kill (@pxref{Killing Buffers}) the window's buffer. The following function uses information on how the window for @@ -2807,9 +2811,12 @@ instead of burying it. Quitting @var{window} means to proceed as follows: If @var{window} was created specially for displaying its current buffer, delete @var{window} provided its frame contains at least one other live window. If -@var{window} is the only window on its frame and other frames still -exist, delete the frame together with @var{window}. If, however, there -are no other frames left, display some other buffer in @var{window}. +@var{window} is the only window on its frame and there are other frames +on the frame's terminal, the value of @var{kill} determines how to +proceed with the window. If @var{kill} is @code{nil}, the fate of the +frame is determined by calling @code{frame-auto-hide-function} (see +below) with that frame as sole argument. If @var{kill} is +non-@code{nil}, the frame is deleted unconditionally. If @var{window} was reused for displaying its buffer, this command tries to display the buffer previously shown in it. It also tries to restore @@ -2831,6 +2838,31 @@ stored in @var{window}'s @code{quit-restore} window parameter (@pxref{Window Parameters}) and resets that parameter to @code{nil} after it's done. +The following option specifies how to deal with a frame containing just +one window that shall be either quit or whose buffer shall be buried. + +@defopt frame-auto-hide-function +The function specified by this option is called to automatically hide +frames. This function is called with one argument - a frame. + +The function specified here is called by @code{bury-buffer} (@pxref{The +Buffer List}) when the selected window is dedicated and shows the buffer +that shall be buried. It is also called by @code{quit-window} (see +above) when the frame of the window that shall be quit has been +specially created for displaying that window's buffer and the buffer +shall be buried. + +The default is to call @code{iconify-frame} (@pxref{Visibility of +Frames}). Alternatively, you may either specify @code{delete-frame} +(@pxref{Deleting Frames}) to remove the frame from its display, +@code{ignore} to leave the frame unchanged, or any other function that +can take a frame as its sole argument. + +Note that the function specified by this option is called if and only if +there's at least one other frame on the terminal of the frame it's +supposed to handle and that frame contains only one live window. +@end defopt + @node Window Point @section Windows and Point diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index bb88eb70344..93f722f806e 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,11 @@ +2011-10-12 Glenn Morris <rgm@gnu.org> + + * ert.texi: Whitespace trivia to make main menu items line up better. + +2011-10-08 Glenn Morris <rgm@gnu.org> + + * Makefile.in: Fix ert rules. + 2011-10-06 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus.texi (Gnus Utility Functions): Add more references and diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in index 28a949f81e2..34f136b09ff 100644 --- a/doc/misc/Makefile.in +++ b/doc/misc/Makefile.in @@ -370,12 +370,13 @@ erc.pdf: ${srcdir}/erc.texi $(ENVADD) $(TEXI2PDF) $< ert : $(infodir)/ert -$(infodir)/ert: ert.texi $(infodir) - cd $(srcdir); $(MAKEINFO) ert.texi -ert.dvi: ert.texi - $(ENVADD) $(TEXI2DVI) ${srcdir}/ert.texi -ert.pdf: ert.texi - $(ENVADD) $(TEXI2PDF) ${srcdir}/ert.texi +$(infodir)/ert: ert.texi + $(mkinfodir) + cd $(srcdir); $(MAKEINFO) $(MAKEINFO_OPTS) $< +ert.dvi: ${srcdir}/ert.texi + $(ENVADD) $(TEXI2DVI) $< +ert.pdf: ${srcdir}/ert.texi + $(ENVADD) $(TEXI2PDF) $< eshell : $(infodir)/eshell $(infodir)/eshell: eshell.texi diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index 978cac6992b..c9b624c6767 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi @@ -48,7 +48,7 @@ traditional software development methods. @menu * Introduction:: A simple example of an ERT test. -* How to Run Tests:: Run tests in your Emacs or from the command line. +* How to Run Tests:: Run tests in Emacs or from the command line. * How to Write Tests:: How to add tests to your Emacs Lisp code. * How to Debug Tests:: What to do if a test fails. * Extending ERT:: ERT is extensible in several ways. @@ -61,13 +61,13 @@ How to Run Tests * Running Tests Interactively:: Run tests in your current Emacs. * Running Tests in Batch Mode:: Run tests in emacs -Q. -* Test Selectors:: Choose which tests to run. +* Test Selectors:: Choose which tests to run. How to Write Tests -* The @code{should} Macro:: A powerful way to express assertions. +* The @code{should} Macro:: A powerful way to express assertions. * Expected Failures:: Tests for known bugs. -* Tests and Their Environment:: Don't depend on customizations; no side effects. +* Tests and Their Environment:: Don't depend on customizations; no side effects. * Useful Techniques:: Some examples. How to Debug Tests @@ -100,25 +100,18 @@ and also when HOME is set to C:\ by default. rather than their own completion code. *** `completion-at-point' now handles tags and semantic completion. - +--- *** Completion in a non-minibuffer now tries to detect the end of completion and pops down the *Completions* buffer accordingly. - ++++ *** Completion can cycle, depending on completion-cycle-threshold. - ++++ *** New completion style `substring'. *** Completion style can be set per-category `completion-category-overrides'. *** Completion of buffers now uses substring completion by default. -*** `completing-read' can be customized using the new variable -`completing-read-function'. - -*** minibuffer-local-filename-must-match-map is not used any more. -Instead, the bindings in minibuffer-local-filename-completion-map are combined -with minibuffer-local-must-match-map. - ** Mail changes The default of `send-mail-function' is now `sendmail-query-once', @@ -455,7 +448,10 @@ isearch-yank-kill. *** M-s C-e in Isearch is now bound to isearch-yank-line. +++ -** New command `count-words-region'. This does what you expect. +** New commands `count-words-region' and `count-words'. + +*** `count-lines-region' is now an alias for `count-words-region', +bound to M-=, which shows the number of lines, words, and characters. ** The default value of `backup-by-copying-when-mismatch' is now t. @@ -1063,6 +1059,10 @@ been introduced. This and all other functions for resizing windows no longer delete any windows when they become too small. +++ +*** Deleting the selected window now selects the most recently selected +live window on that frame instead. + ++++ *** `adjust-window-trailing-edge' adjustments. `adjust-window-trailing-edge' can now deal with fixed-size windows and is able to resize other windows if a window adjacent to the trailing @@ -1110,6 +1110,11 @@ See the docstring of `display-buffer' for details. The behavior of `quit-window' has been changed in order to restore the state before the last buffer display operation in that window. ++++ +*** The new option `frame-auto-hide-function' lets you choose between +iconfying or deleting a frame when burying a buffer shown in a dedicated +frame or quitting a window showing a buffer in a frame of its own. + ** Completion *** New variable completion-extra-properties used to specify extra properties @@ -1130,6 +1135,13 @@ can specify various details of the data returned by `all-completions': - `display-sort-function' to specify how to sort entries in *Completions*. - `cycle-sort-function' to specify how to sort entries when cycling. +*** minibuffer-local-filename-must-match-map is not used any more. +Instead, the bindings in minibuffer-local-filename-completion-map are +combined with minibuffer-local-must-match-map. + +*** New variable `completing-read-function' allows overriding the +behavior of `completing-read'. + ** `glyphless-char-display' can now distinguish between graphical and text terminal display, via a char-table entry that is a cons cell. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fdc61721a13..58a038676e7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,88 @@ +2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca> + + * textmodes/flyspell.el (flyspell-word): Move with-local-quit + from here... + (flyspell-post-command-hook): ...to here. + +2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca> + + * mail/sendmail.el (send-mail-function): Don't use sendmail-query-once + if not needed. + (sendmail-query-once): Remove OS dependencies. Make it a 3-way choice + using completion. Protect against "slow" callers. + Remove the "message hack". + +2011-10-11 Juri Linkov <juri@jurta.org> + + * isearch.el (isearch-lazy-highlight-word): New variable. + (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-search): + Use it. (Bug#9727) + +2011-10-11 Glenn Morris <rgm@gnu.org> + + * progmodes/f90.el (f90-next-statement): Ignore preprocessor lines, + like f90-previous-statement does. + +2011-10-11 Thierry Volpiatto <thierry.volpiatto@gmail.com> + + * eshell/eshell.el (eshell-command): History should be saved + only in interactive use, to avoid error. + +2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca> + + * minibuffer.el (completion-file-name-table): Fix last change, + i.e. ignore normal errors but not the other ones. + +2011-10-10 Martin Rudalics <rudalics@gmx.at> + + * window.el (special-display-buffer-names) + (special-display-regexps): Remove some remnants of earlier + changes from doc-strings. + (quit-windows-on): New function. + + * vc/vc.el (vc-revert, vc-rollback): + * vc/vc-dispatcher.el (vc-finish-logentry): Call quit-windows-on + instead of deleting windows. (Bug#4557) (Bug#5310) (Bug#5556) + (Bug#6183) (Bug#7074) (Bug#7447) + +2011-10-09 Martin Rudalics <rudalics@gmx.at> + + * window.el (frame-auto-hide-function): Add version tag. + (Bug#9699) + +2011-10-09 Michael Albinus <michael.albinus@gmx.de> + + * net/tramp.el (tramp-file-name-handler): Add 'debug to the error + condition. + +2011-10-09 Leo Liu <sdl.web@gmail.com> + + * mail/smtpmail.el (smtpmail-send-data): Add a missing space. + (Bug#9701) + +2011-10-08 Glenn Morris <rgm@gnu.org> + + * progmodes/f90.el (f90-calculate-indent): Give preprocessor lines + before the first code statement zero indent. (Bug#9690) + +2011-10-08 Chong Yidong <cyd@stupidchicken.com> + + * simple.el (count-words-region): Always count in the region. + Report the number of lines and characters too. + (count-words): New command, which counts in the buffer if the + region is inactive, as count-words-region used to. + (count-words--message): New function. Handle plurals. + (count-lines-region): Make it an alias for count-words-region. + + * bindings.el (esc-map): Replace count-lines-region with + count-words-region. + +2011-10-08 Martin Rudalics <rudalics@gmx.at> + + * window.el (window--delete): Delete dedicated frame + unconditionally when argument KILL is non-nil. (Bug#9699) + (switch-to-buffer): Fix doc-string typo. + 2011-10-08 Thierry Volpiatto <thierry.volpiatto@gmail.com> * lisp/eshell/eshell.el (eshell-command): Avoid using hooks. diff --git a/lisp/bindings.el b/lisp/bindings.el index c056fce1e60..1a10d117987 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -773,7 +773,7 @@ if `inhibit-field-text-motion' is non-nil." (define-key ctl-x-map "\C-o" 'delete-blank-lines) (define-key esc-map " " 'just-one-space) (define-key esc-map "z" 'zap-to-char) -(define-key esc-map "=" 'count-lines-region) +(define-key esc-map "=" 'count-words-region) (define-key ctl-x-map "=" 'what-cursor-position) (define-key esc-map ":" 'eval-expression) ;; Define ESC ESC : like ESC : for people who type ESC ESC out of habit. diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index c33c2ccf9d1..0c1c03941e5 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -349,11 +349,9 @@ With prefix ARG, insert output into the current buffer at point." (minibuffer-with-setup-hook #'(lambda () (eshell-mode) (eshell-return-exits-minibuffer)) - (unwind-protect - (unless command - (setq command (read-from-minibuffer "Emacs shell command: "))) - (when command - (eshell-add-input-to-history command))))) + (unless command + (setq command (read-from-minibuffer "Emacs shell command: ")) + (eshell-add-input-to-history command)))) (unless command (error "No command specified!")) ;; redirection into the current buffer is achieved by adding an diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 69041ccbbd0..2fd624e819b 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,23 @@ +2011-10-11 Andreas Schwab <schwab@linux-m68k.org> + + * html2text.el (html2text-clean-anchor): Check for quotes around + `href' value. + +2011-10-11 Teodor Zlatanov <tzz@lifelogs.com> + + * spam.el (spam-check-BBDB): Simplify and support BBDB 3.x when + searching. Drop `bbdb-cache'. + +2011-10-11 Katsumi Yamaoka <yamaoka@jpl.org> + + * message.el (message-signed-or-encrypted-p): Exclude header when + checking if there is signed or encrypted body in text/plain message. + +2011-10-09 Andreas Schwab <schwab@linux-m68k.org> + + * html2text.el (html2text-get-attr): Correctly handle attribute values + containing "=". + 2011-09-22 Kan-Ru Chen <kanru@kanru.info> * ecomplete.el (ecomplete-display-matches): Use a local keymap to diff --git a/lisp/gnus/html2text.el b/lisp/gnus/html2text.el index 0635ab0afc6..8cfd9b9f903 100644 --- a/lisp/gnus/html2text.el +++ b/lisp/gnus/html2text.el @@ -193,7 +193,7 @@ formatting, and then moved afterward.") ;; size=3 ((string-match "[^ ]=[^ ]" prev) (let ((attr (nth 0 (split-string prev "="))) - (value (nth 1 (split-string prev "=")))) + (value (substring prev (1+ (string-match "=" prev))))) (setq attr-list (cons (list attr value) attr-list)))) ;; size= 3 ((string-match "[^ ]=\\'" prev) @@ -204,7 +204,7 @@ formatting, and then moved afterward.") ;; size=3 ((string-match "[^ ]=[^ ]" this) (let ((attr (nth 0 (split-string this "="))) - (value (nth 1 (split-string this "=")))) + (value (substring prev (1+ (string-match "=" this))))) (setq attr-list (cons (list attr value) attr-list)))) ;; size =3 ((string-match "\\`=[^ ]" this) @@ -358,7 +358,8 @@ formatting, and then moved afterward.") (delete-region p1 p4) (when href (goto-char p1) - (insert (substring href 1 -1 )) + (insert (if (string-match "\\`['\"].*['\"]\\'" href) + (substring href 1 -1) href)) (put-text-property p1 (point) 'face 'bold)))) ;; diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 7203ef69a14..948892d1e13 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -7429,14 +7429,16 @@ is for the internal use." (with-temp-buffer (insert-buffer-substring cur) (when (setq handles (mm-dissect-buffer t t)) - (if (and (prog1 - (bufferp (car handles)) - (mm-destroy-parts handles)) + (if (and (bufferp (car handles)) (equal (mm-handle-media-type handles) "text/plain")) (progn + (erase-buffer) + (insert-buffer-substring (car handles)) (mm-decode-content-transfer-encoding (mm-handle-encoding handles)) + (mm-destroy-parts handles) (setq handles (mm-uu-dissect))) + (mm-destroy-parts handles) (setq handles nil)))))) (when handles (prog1 diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index c7f993d7293..fa152f688c4 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el @@ -2150,29 +2150,13 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." (defun spam-check-BBDB () "Mail from people in the BBDB is classified as ham or non-spam" - (let ((who (message-fetch-field "from")) - bbdb-cache bbdb-hashtable) - (when spam-cache-lookups - (setq bbdb-cache (gethash 'spam-use-BBDB spam-caches)) - (unless bbdb-cache - (setq bbdb-cache (make-vector 17 0)) ; a good starting hash value - ;; this is based on the expanded (bbdb-hashtable) macro - ;; without the debugging support - (with-current-buffer (bbdb-buffer) - (save-excursion - (save-window-excursion - (bbdb-records nil t) - (mapatoms - (lambda (symbol) - (intern (downcase (symbol-name symbol)) bbdb-cache)) - bbdb-hashtable)))) - (puthash 'spam-use-BBDB bbdb-cache spam-caches))) + (let ((who (message-fetch-field "from"))) (when who (setq who (nth 1 (gnus-extract-address-components who))) (if - (if spam-cache-lookups - (intern-soft (downcase who) bbdb-cache) - (bbdb-search-simple nil who)) + (if (fboundp 'bbdb-search) + (bbdb-search (bbdb-records) who) ;; v3 + (bbdb-search-simple nil who)) ;; v2 t (if spam-use-BBDB-exclusive spam-split-group diff --git a/lisp/isearch.el b/lisp/isearch.el index 81e0b4bf3b7..6cfcce59672 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2617,6 +2617,7 @@ since they have special meaning in a regexp." (defvar isearch-lazy-highlight-case-fold-search nil) (defvar isearch-lazy-highlight-regexp nil) (defvar isearch-lazy-highlight-space-regexp nil) +(defvar isearch-lazy-highlight-word nil) (defvar isearch-lazy-highlight-forward nil) (defvar isearch-lazy-highlight-error nil) @@ -2655,6 +2656,8 @@ by other Emacs features." isearch-case-fold-search)) (not (eq isearch-lazy-highlight-regexp isearch-regexp)) + (not (eq isearch-lazy-highlight-word + isearch-word)) (not (= (window-start) isearch-lazy-highlight-window-start)) (not (= (window-end) ; Window may have been split/joined. @@ -2675,11 +2678,12 @@ by other Emacs features." isearch-lazy-highlight-window-end (window-end) isearch-lazy-highlight-start (point) isearch-lazy-highlight-end (point) + isearch-lazy-highlight-wrapped nil isearch-lazy-highlight-last-string isearch-string isearch-lazy-highlight-case-fold-search isearch-case-fold-search - isearch-lazy-highlight-regexp isearch-regexp - isearch-lazy-highlight-wrapped nil + isearch-lazy-highlight-regexp isearch-regexp isearch-lazy-highlight-space-regexp search-whitespace-regexp + isearch-lazy-highlight-word isearch-word isearch-lazy-highlight-forward isearch-forward) (unless (equal isearch-string "") (setq isearch-lazy-highlight-timer @@ -2693,6 +2697,7 @@ Attempt to do the search exactly the way the pending Isearch would." (let ((case-fold-search isearch-lazy-highlight-case-fold-search) (isearch-regexp isearch-lazy-highlight-regexp) (search-spaces-regexp isearch-lazy-highlight-space-regexp) + (isearch-word isearch-lazy-highlight-word) (search-invisible nil) ; don't match invisible text (retry t) (success nil) diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index dedb5719934..4557bf0fb3f 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -140,7 +140,11 @@ Otherwise, let mailer send back a message to report errors." ;; Useful to set in site-init.el ;;;###autoload -(defcustom send-mail-function 'sendmail-query-once +(defcustom send-mail-function + ;; Assume smtpmail is the preferred choice if it's already configured. + (if (and (boundp 'smtpmail-smtp-server) + smtpmail-smtp-server) + 'smtpmail-send-it 'sendmail-query-once) "Function to call to send the current buffer as mail. The headers should be delimited by a line which is not a valid RFC822 header or continuation line, @@ -505,46 +509,33 @@ by Emacs.)") (defun sendmail-query-once () "Query for `send-mail-function' and send mail with it. This also saves the value of `send-mail-function' via Customize." - (let* ((mail-buffer (current-buffer)) - ;; Compute default mail sender, preferring smtpmail if it's - ;; already configured. - (default (cond - ((and (boundp 'smtpmail-smtp-server) - smtpmail-smtp-server) - 'smtpmail-send-it) - ((or (and window-system (eq system-type 'darwin)) - (eq system-type 'windows-nt)) - 'mailclient-send-it) - ((and sendmail-program - (executable-find sendmail-program)) - 'sendmail-send-it))) - (send-function (if (eq default 'smtpmail-send-it) - 'smtpmail-send-it))) - (unless send-function - ;; Query the user. - (with-temp-buffer - (rename-buffer "*Mail Help*" t) - (erase-buffer) - (insert "Emacs has not been set up for sending mail.\n -Type `y' to configure and use Emacs as a mail client, -or `n' to use your system's default mailer.\n + ;; If send-mail-function is already setup, we're incorrectly called + ;; a second time, probably because someone's using an old value + ;; of send-mail-function. + (when (eq send-mail-function 'sendmail-query-once) + (let* ((options `(("My favorite mail client" . mailclient-send-it) + ("Configuring Emacs's SMTP variables" . smtpmail-send-it) + ,@(when (and sendmail-program + (executable-find sendmail-program)) + '(("The system's mail transport agent" + . sendmail-send-it))))) + (choice + ;; Query the user. + (with-temp-buffer + (rename-buffer "*Mail Help*" t) + (insert "Emacs has not been set up for sending mail.\n +It can be told to send mail either via your favorite mail client, +or via the system's mail transport agent (\"sendmail\"), if any, +or it can send email on its own by configuring the SMTP parameters.\n To change your decision later, customize `send-mail-function'.\n") - (goto-char (point-min)) - (display-buffer (current-buffer)) - (if (y-or-n-p "Set up Emacs for sending SMTP mail? ") - ;; FIXME: We should check and correct the From: field too. - (setq send-function 'smtpmail-send-it) - (setq send-function default)))) - (when send-function - (customize-save-variable 'send-mail-function send-function) - ;; HACK: Message mode stupidly has `message-send-mail-function', - ;; so we must update it too or sending again in the current - ;; Emacs session will still call `sendmail-query-once'. - (and (boundp 'message-send-mail-function) - (eq message-send-mail-function 'sendmail-query-once) - (customize-set-variable 'message-send-mail-function - send-function)) - (funcall send-function)))) + (goto-char (point-min)) + (display-buffer (current-buffer)) + (let ((completion-ignore-case t)) + (completing-read "Send mail via: " + options nil 'require-match))))) + (customize-save-variable 'send-mail-function + (cdr (assoc-string choice options t))))) + (funcall send-mail-function)) (defun sendmail-sync-aliases () (when mail-personal-alias-file diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index edcc82011af..026b03e350f 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -924,7 +924,7 @@ The list is in preference order.") (defun smtpmail-send-data (process buffer) (let ((data-continue t) sending-data (pr (with-current-buffer buffer - (make-progress-reporter "Sending email" + (make-progress-reporter "Sending email " (point-min) (point-max))))) (with-current-buffer buffer (goto-char (point-min))) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index e2ed07f1ef1..acb71d115d1 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1789,59 +1789,60 @@ same as `substitute-in-file-name'." (defun completion-file-name-table (string pred action) "Completion table for file names." - (with-demoted-errors - (cond - ((eq action 'metadata) '(metadata (category . file))) - ((eq (car-safe action) 'boundaries) - (let ((start (length (file-name-directory string))) - (end (string-match-p "/" (cdr action)))) - (list* 'boundaries - ;; if `string' is "C:" in w32, (file-name-directory string) - ;; returns "C:/", so `start' is 3 rather than 2. - ;; Not quite sure what is The Right Fix, but clipping it - ;; back to 2 will work for this particular case. We'll - ;; see if we can come up with a better fix when we bump - ;; into more such problematic cases. - (min start (length string)) end))) - - ((eq action 'lambda) - (if (zerop (length string)) - nil ;Not sure why it's here, but it probably doesn't harm. - (funcall (or pred 'file-exists-p) string))) + (condition-case nil + (cond + ((eq action 'metadata) '(metadata (category . file))) + ((eq (car-safe action) 'boundaries) + (let ((start (length (file-name-directory string))) + (end (string-match-p "/" (cdr action)))) + (list* 'boundaries + ;; if `string' is "C:" in w32, (file-name-directory string) + ;; returns "C:/", so `start' is 3 rather than 2. + ;; Not quite sure what is The Right Fix, but clipping it + ;; back to 2 will work for this particular case. We'll + ;; see if we can come up with a better fix when we bump + ;; into more such problematic cases. + (min start (length string)) end))) - (t - (let* ((name (file-name-nondirectory string)) - (specdir (file-name-directory string)) - (realdir (or specdir default-directory))) + ((eq action 'lambda) + (if (zerop (length string)) + nil ;Not sure why it's here, but it probably doesn't harm. + (funcall (or pred 'file-exists-p) string))) - (cond - ((null action) - (let ((comp (file-name-completion name realdir pred))) - (if (stringp comp) - (concat specdir comp) - comp))) - - ((eq action t) - (let ((all (file-name-all-completions name realdir))) - - ;; Check the predicate, if necessary. - (unless (memq pred '(nil file-exists-p)) - (let ((comp ()) - (pred - (if (eq pred 'file-directory-p) - ;; Brute-force speed up for directory checking: - ;; Discard strings which don't end in a slash. - (lambda (s) - (let ((len (length s))) - (and (> len 0) (eq (aref s (1- len)) ?/)))) - ;; Must do it the hard (and slow) way. - pred))) - (let ((default-directory (expand-file-name realdir))) - (dolist (tem all) - (if (funcall pred tem) (push tem comp)))) - (setq all (nreverse comp)))) - - all)))))))) + (t + (let* ((name (file-name-nondirectory string)) + (specdir (file-name-directory string)) + (realdir (or specdir default-directory))) + + (cond + ((null action) + (let ((comp (file-name-completion name realdir pred))) + (if (stringp comp) + (concat specdir comp) + comp))) + + ((eq action t) + (let ((all (file-name-all-completions name realdir))) + + ;; Check the predicate, if necessary. + (unless (memq pred '(nil file-exists-p)) + (let ((comp ()) + (pred + (if (eq pred 'file-directory-p) + ;; Brute-force speed up for directory checking: + ;; Discard strings which don't end in a slash. + (lambda (s) + (let ((len (length s))) + (and (> len 0) (eq (aref s (1- len)) ?/)))) + ;; Must do it the hard (and slow) way. + pred))) + (let ((default-directory (expand-file-name realdir))) + (dolist (tem all) + (if (funcall pred tem) (push tem comp)))) + (setq all (nreverse comp)))) + + all)))))) + (file-error nil))) ;PCM often calls with invalid directories. (defvar read-file-name-predicate nil "Current predicate used by `read-file-name-internal'.") diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 1381d33efa2..7ace2911501 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1886,7 +1886,7 @@ Falls back to normal file name handler if no Tramp file name handler exists." (apply foreign operation args)) ;; Trace that somebody has interrupted the operation. - (quit + ((debug quit) (let (tramp-message-show-message) (tramp-message v 1 "Interrupt received in operation %s" @@ -1898,6 +1898,9 @@ Falls back to normal file name handler if no Tramp file name handler exists." ;; operations shall return at least a default value ;; in order to give the user a chance to correct the ;; file name in the minibuffer. + ;; We cannot use 'debug as error handler. In order + ;; to get a full backtrace, one could apply + ;; (setq debug-on-error t debug-on-signal t) (error (cond ((and completion (zerop (length localname)) @@ -3850,9 +3853,9 @@ Only works for Bourne-like shells." ;; * Run emerge on two remote files. Bug is described here: ;; <http://www.mail-archive.com/tramp-devel@nongnu.org/msg01041.html>. ;; (Bug#6850) - -;; Functions for file-name-handler-alist: -;; diff-latest-backup-file -- in diff.el +;; * It would be very useful if it were possible to load or save a +;; buffer using Tramp in a non-blocking way so that use of Emacs on +;; other buffers could continue. (Bug#9617) ;;; tramp.el ends here diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index eb33822ce55..007203a8b21 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -1489,14 +1489,19 @@ Does not check type and subprogram indentation." (if (not (f90-previous-statement)) ;; If f90-previous-statement returns nil, we must have been ;; called from on or before the first line of the first statement. - (setq icol (if (save-excursion - ;; f90-previous-statement has moved us over - ;; comment/blank lines, so we need to get - ;; back to the first code statement. - (when (looking-at "[ \t]*\\([!#]\\|$\\)") - (f90-next-statement)) - (skip-chars-forward " \t0-9") - (f90-looking-at-program-block-start)) + (setq icol (if (or (save-excursion + (goto-char pnt) + (beginning-of-line) + ;; Preprocessor line before code statement. + (looking-at "[ \t]*#")) + (progn + ;; f90-previous-statement has moved us over + ;; comment/blank lines, so we need to get + ;; back to the first code statement. + (when (looking-at "[ \t]*\\([!#]\\|$\\)") + (f90-next-statement)) + (skip-chars-forward " \t0-9") + (f90-looking-at-program-block-start))) 0 ;; No explicit PROGRAM start statement. f90-program-indent)) @@ -1573,7 +1578,7 @@ Return nil if no later statement is found." (while (and (setq not-last-statement (and (zerop (forward-line 1)) (not (eobp)))) - (looking-at "[ \t0-9]*\\(!\\|$\\)"))) + (looking-at "[ \t0-9]*\\(!\\|$\\|#\\)"))) not-last-statement)) (defun f90-beginning-of-subprogram () diff --git a/lisp/simple.el b/lisp/simple.el index c81385680bf..af6d855d9c0 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -945,28 +945,46 @@ rather than line counts." (forward-line (1- line))))) (defun count-words-region (start end) - "Count the number of words in the active region. -If the region is not active, counts the number of words in the buffer." - (interactive (if (use-region-p) (list (region-beginning) (region-end)) - (list (point-min) (point-max)))) - (let ((count 0)) + "Return the number of words between START and END. +If called interactively, print a message reporting the number of +lines, words, and characters in the region." + (interactive "r") + (let ((words 0)) (save-excursion (save-restriction (narrow-to-region start end) (goto-char (point-min)) (while (forward-word 1) - (setq count (1+ count))))) + (setq words (1+ words))))) (when (called-interactively-p 'interactive) - (message "%s has %d words" - (if (use-region-p) "Region" "Buffer") - count)) - count)) - -(defun count-lines-region (start end) - "Print number of lines and characters in the region." - (interactive "r") - (message "Region has %d lines, %d characters" - (count-lines start end) (- end start))) + (count-words--message "Region" + (count-lines start end) + words + (- end start))) + words)) + +(defun count-words () + "Display the number of lines, words, and characters in the buffer. +In Transient Mark mode when the mark is active, display the +number of lines, words, and characters in the region." + (interactive) + (if (use-region-p) + (call-interactively 'count-words-region) + (let* ((beg (point-min)) + (end (point-max)) + (lines (count-lines beg end)) + (words (count-words-region beg end)) + (chars (- end beg))) + (count-words--message "Buffer" lines words chars)))) + +(defun count-words--message (str lines words chars) + (message "%s has %d line%s, %d word%s, and %d character%s." + str + lines (if (= lines 1) "" "s") + words (if (= words 1) "" "s") + chars (if (= chars 1) "" "s"))) + +(defalias 'count-lines-region 'count-words-region) (defun what-line () "Print the current buffer line number and narrowed line number of point." diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 4eb4efc3766..c2af3f7be84 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -931,49 +931,52 @@ Mostly we check word delimiters." ;;* previous word nor the current word */ ;;*---------------------------------------------------------------------*/ (defun flyspell-post-command-hook () - "The `post-command-hook' used by flyspell to check a word in-the-fly." + "The `post-command-hook' used by flyspell to check a word on-the-fly." (interactive) (when flyspell-mode - (let ((command this-command) - ;; Prevent anything we do from affecting the mark. - deactivate-mark) - (if (flyspell-check-pre-word-p) - (with-current-buffer flyspell-pre-buffer - '(flyspell-debug-signal-pre-word-checked) - (save-excursion - (goto-char flyspell-pre-point) - (flyspell-word)))) - (if (flyspell-check-word-p) - (progn - '(flyspell-debug-signal-word-checked) - (flyspell-word) - ;; we remember which word we have just checked. - ;; this will be used next time we will check a word - ;; to compare the next current word with the word - ;; that as been registered in the pre-command-hook - ;; that is these variables are used within the predicate - ;; FLYSPELL-CHECK-PRE-WORD-P - (setq flyspell-pre-pre-buffer (current-buffer)) - (setq flyspell-pre-pre-point (point))) - (progn - (setq flyspell-pre-pre-buffer nil) - (setq flyspell-pre-pre-point nil) - ;; when a word is not checked because of a delayed command - ;; we do not disable the ispell cache. - (if (and (symbolp this-command) (get this-command 'flyspell-delayed)) - (progn - (setq flyspell-word-cache-end -1) - (setq flyspell-word-cache-result '_))))) - (while (and (not (input-pending-p)) (consp flyspell-changes)) - (let ((start (car (car flyspell-changes))) - (stop (cdr (car flyspell-changes)))) - (if (flyspell-check-changed-word-p start stop) - (save-excursion - '(flyspell-debug-signal-changed-checked) - (goto-char start) - (flyspell-word))) - (setq flyspell-changes (cdr flyspell-changes)))) - (setq flyspell-previous-command command)))) + (with-local-quit + (let ((command this-command) + ;; Prevent anything we do from affecting the mark. + deactivate-mark) + (if (flyspell-check-pre-word-p) + (with-current-buffer flyspell-pre-buffer + '(flyspell-debug-signal-pre-word-checked) + (save-excursion + (goto-char flyspell-pre-point) + (flyspell-word)))) + (if (flyspell-check-word-p) + (progn + '(flyspell-debug-signal-word-checked) + ;; FIXME: This should be asynchronous! + (flyspell-word) + ;; we remember which word we have just checked. + ;; this will be used next time we will check a word + ;; to compare the next current word with the word + ;; that as been registered in the pre-command-hook + ;; that is these variables are used within the predicate + ;; FLYSPELL-CHECK-PRE-WORD-P + (setq flyspell-pre-pre-buffer (current-buffer)) + (setq flyspell-pre-pre-point (point))) + (progn + (setq flyspell-pre-pre-buffer nil) + (setq flyspell-pre-pre-point nil) + ;; when a word is not checked because of a delayed command + ;; we do not disable the ispell cache. + (if (and (symbolp this-command) + (get this-command 'flyspell-delayed)) + (progn + (setq flyspell-word-cache-end -1) + (setq flyspell-word-cache-result '_))))) + (while (and (not (input-pending-p)) (consp flyspell-changes)) + (let ((start (car (car flyspell-changes))) + (stop (cdr (car flyspell-changes)))) + (if (flyspell-check-changed-word-p start stop) + (save-excursion + '(flyspell-debug-signal-changed-checked) + (goto-char start) + (flyspell-word))) + (setq flyspell-changes (cdr flyspell-changes)))) + (setq flyspell-previous-command command))))) ;;*---------------------------------------------------------------------*/ ;;* flyspell-notify-misspell ... */ @@ -1100,14 +1103,10 @@ misspelling and skips redundant spell-checking step." ;; we mark the ispell process so it can be killed ;; when emacs is exited without query (set-process-query-on-exit-flag ispell-process nil) - ;; Wait until ispell has processed word. Since this - ;; code is often executed from post-command-hook but - ;; the ispell process may not be responsive, it's - ;; important to make sure we re-enable C-g. - (with-local-quit - (while (progn - (accept-process-output ispell-process) - (not (string= "" (car ispell-filter)))))) + ;; Wait until ispell has processed word. + (while (progn + (accept-process-output ispell-process) + (not (string= "" (car ispell-filter))))) ;; (ispell-send-string "!\n") ;; back to terse mode. ;; Remove leading empty element diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 388d4c94a08..84c7f4a510b 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -666,18 +666,15 @@ the buffer contents as a comment." (funcall log-operation log-fileset log-entry)) - ;; Remove checkin window (after the checkin so that if that fails - ;; we don't zap the log buffer and the typing therein). - ;; -- IMO this should be replaced with quit-window - (cond ((and logbuf vc-delete-logbuf-window) - (delete-windows-on logbuf (selected-frame)) - ;; Kill buffer and delete any other dedicated windows/frames. - (kill-buffer logbuf)) - (logbuf - (with-selected-window (or (get-buffer-window logbuf 0) - (selected-window)) - (with-current-buffer logbuf - (bury-buffer))))) + + ;; Quit windows on logbuf. + (cond + ((not logbuf)) + (vc-delete-logbuf-window + (quit-windows-on logbuf t (selected-frame))) + (t + (quit-windows-on logbuf nil 0))) + ;; Now make sure we see the expanded headers (when log-fileset (mapc diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 6704a43e59b..62536fd94be 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2302,8 +2302,7 @@ to the working revision (except for keyword expansion)." (if (= nfiles 1) "" "s")))))) (error "Revert canceled"))) (when diff-buffer - (delete-windows-on diff-buffer) - (kill-buffer diff-buffer))) + (quit-windows-on diff-buffer t))) (dolist (file files) (message "Reverting %s..." (vc-delistify files)) (vc-revert-file file) @@ -2349,8 +2348,7 @@ depending on the underlying version-control system." ;; Display changes (unless (yes-or-no-p "Discard these revisions? ") (error "Rollback canceled")) - (delete-windows-on "*vc-diff*") - (kill-buffer"*vc-diff*") + (quit-windows-on "*vc-diff*" t) ;; Do the actual reversions (message "Rolling back %s..." (vc-delistify files)) (with-vc-properties diff --git a/lisp/window.el b/lisp/window.el index 74460ae6058..4d8b3c92b95 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2772,7 +2772,8 @@ shown in a separate frame like `quit-window' and `bury-buffer'." (const :tag "Do nothing" ignore) function) :group 'windows - :group 'frames) + :group 'frames + :version "24.1") (defun window--delete (&optional window dedicated-only kill) "Delete WINDOW if possible. @@ -2780,7 +2781,7 @@ WINDOW must be a live window and defaults to the selected one. Optional argument DEDICATED-ONLY non-nil means to delete WINDOW only if it's dedicated to its buffer. Optional argument KILL means the buffer shown in window will be killed. Return non-nil -if WINDOW gets deleted." +if WINDOW gets deleted or its frame is auto-hidden." (setq window (window-normalize-live-window window)) (unless (and dedicated-only (not (window-dedicated-p window))) (let* ((buffer (window-buffer window)) @@ -2788,8 +2789,11 @@ if WINDOW gets deleted." (cond ((eq deletable 'frame) (let ((frame (window-frame window))) - (when (functionp frame-auto-hide-function) - (funcall frame-auto-hide-function frame))) + (cond + (kill + (delete-frame frame)) + ((functionp frame-auto-hide-function) + (funcall frame-auto-hide-function frame)))) 'frame) (deletable (delete-window window) @@ -2980,6 +2984,27 @@ one. If non-nil, reset `quit-restore' parameter to nil." (if kill (kill-buffer buffer) (bury-buffer-internal buffer)))) + +(defun quit-windows-on (&optional buffer-or-name kill frame) + "Quit all windows showing BUFFER-OR-NAME. +BUFFER-OR-NAME may be a buffer or the name of an existing buffer +and defaults to the current buffer. Optional argument KILL +non-nil means to kill BUFFER-OR-NAME. KILL nil means to bury +BUFFER-OR-NAME. Optional argument FRAME is handled as by +`delete-windows-on'. + +This function calls `quit-window' on all candidate windows +showing BUFFER-OR-NAME." + (interactive "BQuit windows on (buffer):\nP") + (let ((buffer (window-normalize-buffer buffer-or-name)) + ;; Handle the "inverted" meaning of the FRAME argument wrt other + ;; `window-list-1' based function. + (all-frames (cond ((not frame) t) ((eq frame t) nil) (t frame)))) + (dolist (window (window-list-1 nil nil all-frames)) + (if (eq (window-buffer window) buffer) + (quit-window kill window) + ;; If a window doesn't show BUFFER, unrecord BUFFER in it. + (unrecord-window-buffer window buffer))))) ;;; Splitting windows. (defsubst window-split-min-size (&optional horizontal) @@ -3955,12 +3980,10 @@ Finally, an element of this list can be also specified as \(BUFFER-NAME FUNCTION OTHER-ARGS). In that case, `special-display-popup-frame' will call FUNCTION with the buffer named BUFFER-NAME as first argument, and OTHER-ARGS as the -second. If `special-display-function' specifies some other -function, that function is called with the buffer named -BUFFER-NAME as first, and the element's cdr as second argument. -In any case, that function is responsible for setting the value -The function specified here is responsible for setting the -quit-restore and help-setup parameters of the window used. +second. + +Any alternative function specified here is responsible for +setting up the quit-restore parameter of the window used. If this variable appears \"not to work\", because you added a name to it but the corresponding buffer is displayed in the @@ -4025,10 +4048,10 @@ as second argument. Finally, an element of this list can be also specified as \(REGEXP FUNCTION OTHER-ARGS). `special-display-popup-frame' will then call FUNCTION with the buffer whose name matched -REGEXP as first, and OTHER-ARGS as second argument. If -`special-display-function' specifies some other function, that -function is called with the buffer whose name matched REGEXP -as first, and the element's cdr as second argument. +REGEXP as first, and OTHER-ARGS as second argument. + +Any alternative function specified here is responsible for +setting up the quit-restore parameter of the window used. If this variable appears \"not to work\", because you added a name to it but the corresponding buffer is displayed in the @@ -4974,7 +4997,7 @@ one. If FORCE-SAME-WINDOW is non-nil, BUFFER-OR-NAME must be displayed in the selected window; signal an error if that is impossible (e.g. if the selected window is minibuffer-only). If -non-nil, BUFFER-OR-NAME may be displayed in another window. +nil, BUFFER-OR-NAME may be displayed in another window. Return the buffer switched to." (interactive diff --git a/src/ChangeLog b/src/ChangeLog index 00845a4c188..c2cf656b101 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,6 @@ -2011-10-11 Paul Eggert <eggert@cs.ucla.edu> +2011-10-12 Paul Eggert <eggert@cs.ucla.edu> - Fix integer width and related issues. + Fix integer width and related bugs. * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE) (string_bytes, check_sblock, allocate_string_data): @@ -784,6 +784,53 @@ rather than rolling our own approximation. (SCROLL_BAR_VEC_SIZE): Remove; not used. +2011-10-12 Eli Zaretskii <eliz@gnu.org> + + * bidi.c (bidi_level_of_next_char): + * xdisp.c (get_visually_first_element): Remove old incorrect + comments regarding the Unicode Line Separator character. + + * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR. + +2011-10-12 Dmitry Antipov <dmantipov@yandex.ru> + + * alloc.c (Fgc_status): Do not access beyond zombies array + boundary if nzombies > MAX_ZOMBIES. + * alloc.c (dump_zombies): Add missing format specifier. + +2011-10-12 Paul Eggert <eggert@cs.ucla.edu> + + * xdisp.c (set_cursor_from_row): Simplify conditionals, + to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow. + + * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff. + Some packages use them to denote characters with modifiers. + +2011-10-11 Andreas Schwab <schwab@linux-m68k.org> + + * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR) + (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid + matching a pp-number. Rename parameter var to var1. + +2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca> + + * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709). + +2011-10-08 Glenn Morris <rgm@gnu.org> + + * callint.c (Fcall_interactively): Give a more explicit error for the + 'c' case with a non-character input. (Bug#8479) + +2011-10-08 Eli Zaretskii <eliz@gnu.org> + + * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left + lines. + (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L + lines that are hscrolled on the left. + + * dispnew.c (buffer_posn_from_coords): Account for a possible + presence of header-line. (Bug#4426) + 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca> * buffer.c (syms_of_buffer) <enable-multibyte-characters>: Don't diff --git a/src/alloc.c b/src/alloc.c index ea2fea77e29..ee49a2dfb2e 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -4072,7 +4072,7 @@ DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "", { Lisp_Object args[8], zombie_list = Qnil; EMACS_INT i; - for (i = 0; i < nzombies; i++) + for (i = 0; i < min (MAX_ZOMBIES, nzombies); i++) zombie_list = Fcons (zombies[i], zombie_list); args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d\nzombies: %S"); args[1] = make_number (ngcs); @@ -4411,7 +4411,7 @@ dump_zombies (void) { int i; - fprintf (stderr, "\nZombies kept alive = %"pI":\n", nzombies); + fprintf (stderr, "\nZombies kept alive = %"pI"d:\n", nzombies); for (i = 0; i < min (MAX_ZOMBIES, nzombies); ++i) { fprintf (stderr, " %d = ", i); diff --git a/src/bidi.c b/src/bidi.c index a43490f4110..e4965ed59ac 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -808,6 +808,7 @@ bidi_init_it (ptrdiff_t charpos, ptrdiff_t bytepos, int frame_window_p, bidi_it->nchars = -1; /* to be computed in bidi_resolve_explicit_1 */ bidi_it->first_elt = 1; bidi_set_paragraph_end (bidi_it); + bidi_it->paragraph_dir = NEUTRAL_DIR; bidi_it->new_paragraph = 1; bidi_it->separator_limit = -1; bidi_it->type = NEUTRAL_B; @@ -2127,7 +2128,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) do { ch = bidi_fetch_char (bpos += clen, cpos += nc, &disp_pos, &dpp, &bs, fwp, &clen, &nc); - if (ch == '\n' || ch == BIDI_EOB /* || ch == LINESEP_CHAR */) + if (ch == '\n' || ch == BIDI_EOB) chtype = NEUTRAL_B; else chtype = bidi_get_type (ch, NEUTRAL_DIR); @@ -2177,7 +2178,6 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) else if (bidi_it->orig_type == NEUTRAL_B /* L1 */ || bidi_it->orig_type == NEUTRAL_S || bidi_it->ch == '\n' || bidi_it->ch == BIDI_EOB - /* || bidi_it->ch == LINESEP_CHAR */ || (bidi_it->orig_type == NEUTRAL_WS && (bidi_it->next_for_ws.type == NEUTRAL_B || bidi_it->next_for_ws.type == NEUTRAL_S))) diff --git a/src/callint.c b/src/callint.c index c2a43f0f8f9..5eb824b8c74 100644 --- a/src/callint.c +++ b/src/callint.c @@ -535,6 +535,8 @@ invoke it. If KEYS is omitted or nil, the return value of message1_nolog ((char *) 0); /* Passing args[i] directly stimulates compiler bug */ teml = args[i]; + /* See bug#8479. */ + if (! CHARACTERP (teml)) error ("Non-character input-event"); visargs[i] = Fchar_to_string (teml); break; diff --git a/src/dispnew.c b/src/dispnew.c index 32795a5fed9..93a990cff47 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5260,6 +5260,10 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); start_display (&it, w, startp); + /* start_display takes into account the header-line row, but IT's + vpos still counts from the glyph row that includes the window's + start position. Adjust for a possible header-line row. */ + it.vpos += WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; x0 = *x; diff --git a/src/lisp.h b/src/lisp.h index 2c54c9b41ed..17f1705675e 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2275,105 +2275,105 @@ struct gcpro #ifndef DEBUG_GCPRO -#define GCPRO1_VAR(var, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var; gcpro##1.nvars = 1; \ +#define GCPRO1_VAR(var1, gcpro) \ + {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ gcprolist = &gcpro##1; } #define GCPRO2_VAR(var1, var2, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ + {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ + gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ gcprolist = &gcpro##2; } #define GCPRO3_VAR(var1, var2, var3, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ + {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ + gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ + gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ gcprolist = &gcpro##3; } #define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ + {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ + gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ + gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ + gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ gcprolist = &gcpro##4; } #define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ - gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ + {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ + gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ + gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ + gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ + gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ gcprolist = &gcpro##5; } #define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ - gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ - gcpro##6.next = &gcpro##5; gcpro##6.var = &var6; gcpro##6.nvars = 1; \ + {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ + gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ + gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ + gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ + gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ + gcpro##6 .next = &gcpro##5; gcpro##6 .var = &var6; gcpro##6 .nvars = 1; \ gcprolist = &gcpro##6; } -#define UNGCPRO_VAR(gcpro) (gcprolist = gcpro##1.next) +#define UNGCPRO_VAR(gcpro) (gcprolist = gcpro##1 .next) #else extern int gcpro_level; -#define GCPRO1_VAR(var, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var; gcpro##1.nvars = 1; \ - gcpro##1.level = gcpro_level++; \ +#define GCPRO1_VAR(var1, gcpro) \ + {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ + gcpro##1 .level = gcpro_level++; \ gcprolist = &gcpro##1; } #define GCPRO2_VAR(var1, var2, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##1.level = gcpro_level; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##2.level = gcpro_level++; \ + {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ + gcpro##1 .level = gcpro_level; \ + gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ + gcpro##2 .level = gcpro_level++; \ gcprolist = &gcpro##2; } #define GCPRO3_VAR(var1, var2, var3, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##1.level = gcpro_level; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##3.level = gcpro_level++; \ + {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ + gcpro##1 .level = gcpro_level; \ + gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ + gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ + gcpro##3 .level = gcpro_level++; \ gcprolist = &gcpro##3; } #define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##1.level = gcpro_level; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ - gcpro##4.level = gcpro_level++; \ + {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ + gcpro##1 .level = gcpro_level; \ + gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ + gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ + gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ + gcpro##4 .level = gcpro_level++; \ gcprolist = &gcpro##4; } #define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##1.level = gcpro_level; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ - gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ - gcpro##5.level = gcpro_level++; \ + {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ + gcpro##1 .level = gcpro_level; \ + gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ + gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ + gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ + gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ + gcpro##5 .level = gcpro_level++; \ gcprolist = &gcpro##5; } #define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##1.level = gcpro_level; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ - gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ - gcpro##6.next = &gcpro##5; gcpro##6.var = &var6; gcpro##6.nvars = 1; \ - gcpro##6.level = gcpro_level++; \ + {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ + gcpro##1 .level = gcpro_level; \ + gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ + gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ + gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ + gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ + gcpro##6 .next = &gcpro##5; gcpro##6 .var = &var6; gcpro##6 .nvars = 1; \ + gcpro##6 .level = gcpro_level++; \ gcprolist = &gcpro##6; } #define UNGCPRO_VAR(gcpro) \ - ((--gcpro_level != gcpro##1.level) \ + ((--gcpro_level != gcpro##1 .level) \ ? (abort (), 0) \ - : ((gcprolist = gcpro##1.next), 0)) + : ((gcprolist = gcpro##1 .next), 0)) #endif /* DEBUG_GCPRO */ #endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ diff --git a/src/lread.c b/src/lread.c index 91195a88e63..75d05a2b2f3 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2215,7 +2215,7 @@ read_escape (Lisp_Object readcharfun, int stringp) case 'x': /* A hex escape, as in ANSI C. */ { - int i = 0; + unsigned int i = 0; int count = 0; while (1) { @@ -2239,7 +2239,9 @@ read_escape (Lisp_Object readcharfun, int stringp) UNREAD (c); break; } - if (MAX_CHAR < i) + /* Allow hex escapes as large as ?\xfffffff, because some + packages use them to denote characters with modifiers. */ + if ((CHAR_META | (CHAR_META - 1)) < i) error ("Hex character out of range: \\x%x...", i); count += count < 3; } diff --git a/src/minibuf.c b/src/minibuf.c index 9b905f748bb..0d2bc7234eb 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1859,9 +1859,10 @@ The arguments STRING and PREDICATE are as in `try-completion', /* First, look for a non-internal buffer in `res'. */ while (CONSP (bufs) && SREF (XCAR (bufs), 0) == ' ') bufs = XCDR (bufs); - if (NILP (bufs) && EQ (Flength (res), Flength (Vbuffer_alist))) - /* All bufs are internal, so don't trip them out. */ - return res; + if (NILP (bufs)) + return (EQ (Flength (res), Flength (Vbuffer_alist)) + /* If all bufs are internal don't strip them out. */ + ? res : bufs); res = bufs; while (CONSP (XCDR (bufs))) if (SREF (XCAR (XCDR (bufs)), 0) == ' ') diff --git a/src/xdisp.c b/src/xdisp.c index ce240922010..0be1c68780d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7154,7 +7154,6 @@ get_visually_first_element (struct it *it) } else if (it->bidi_it.charpos == bob || (!string_p - /* FIXME: Should support all Unicode line separators. */ && (FETCH_CHAR (it->bidi_it.bytepos - 1) == '\n' || FETCH_CHAR (it->bidi_it.bytepos) == '\n'))) { @@ -12072,6 +12071,7 @@ hscroll_window_tree (Lisp_Object window) = (desired_cursor_row->enabled_p ? desired_cursor_row : current_cursor_row); + int row_r2l_p = cursor_row->reversed_p; text_area_width = window_box_width (w, TEXT_AREA); @@ -12079,11 +12079,31 @@ hscroll_window_tree (Lisp_Object window) h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer)) - && ((XFASTINT (w->hscroll) - && w->cursor.x <= h_margin) - || (cursor_row->enabled_p - && cursor_row->truncated_on_right_p - && (w->cursor.x >= text_area_width - h_margin)))) + /* For left-to-right rows, hscroll when cursor is either + (i) inside the right hscroll margin, or (ii) if it is + inside the left margin and the window is already + hscrolled. */ + && ((!row_r2l_p + && ((XFASTINT (w->hscroll) + && w->cursor.x <= h_margin) + || (cursor_row->enabled_p + && cursor_row->truncated_on_right_p + && (w->cursor.x >= text_area_width - h_margin)))) + /* For right-to-left rows, the logic is similar, + except that rules for scrolling to left and right + are reversed. E.g., if cursor.x <= h_margin, we + need to hscroll "to the right" unconditionally, + and that will scroll the screen to the left so as + to reveal the next portion of the row. */ + || (row_r2l_p + && ((cursor_row->enabled_p + /* FIXME: It is confusing to set the + truncated_on_right_p flag when R2L rows + are actually truncated on the left. */ + && cursor_row->truncated_on_right_p + && w->cursor.x <= h_margin) + || (XFASTINT (w->hscroll) + && (w->cursor.x >= text_area_width - h_margin)))))) { struct it it; ptrdiff_t hscroll; @@ -12118,7 +12138,9 @@ hscroll_window_tree (Lisp_Object window) ? (text_area_width - 4 * FRAME_COLUMN_WIDTH (it.f)) : (text_area_width / 2)))) / FRAME_COLUMN_WIDTH (it.f); - else if (w->cursor.x >= text_area_width - h_margin) + else if ((!row_r2l_p + && w->cursor.x >= text_area_width - h_margin) + || (row_r2l_p && w->cursor.x <= h_margin)) { if (hscroll_relative_p) wanted_x = text_area_width * (1 - hscroll_step_rel) @@ -13858,21 +13880,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, glyph--; } } - else if (match_with_avoid_cursor - /* A truncated row may not include PT among its - character positions. Setting the cursor inside the - scroll margin will trigger recalculation of hscroll - in hscroll_window_tree. But if a display string - covers point, defer to the string-handling code - below to figure this out. */ - || (!string_seen - && ((row->truncated_on_left_p && pt_old < bpos_min) - || (row->truncated_on_right_p && pt_old > bpos_max) - /* Zero-width characters produce no glyphs. */ - || (!empty_line_p - && (row->reversed_p - ? glyph_after > glyphs_end - : glyph_after < glyphs_end))))) + else if (match_with_avoid_cursor) { cursor = glyph_after; x = -1; @@ -14013,6 +14021,26 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, && row->continued_p) return 0; } + /* A truncated row may not include PT among its character positions. + Setting the cursor inside the scroll margin will trigger + recalculation of hscroll in hscroll_window_tree. But if a + display string covers point, defer to the string-handling + code below to figure this out. */ + else if (row->truncated_on_left_p && pt_old < bpos_min) + { + cursor = glyph_before; + x = -1; + } + else if ((row->truncated_on_right_p && pt_old > bpos_max) + /* Zero-width characters produce no glyphs. */ + || (!empty_line_p + && (row->reversed_p + ? glyph_after > glyphs_end + : glyph_after < glyphs_end))) + { + cursor = glyph_after; + x = -1; + } } compute_x: |