aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-10-12 09:48:12 -0700
committerPaul Eggert2011-10-12 09:48:12 -0700
commit682432fc544c2bb4e0531c2931d43bce085eb16a (patch)
tree4bc9e4d78f34e19254382246b89a3462a0186311
parentd44287d4adc1e268ef9974ea72010f0186f40197 (diff)
parent79beb1785aac3f8326f58710462e4b6be7f0449a (diff)
downloademacs-682432fc544c2bb4e0531c2931d43bce085eb16a.tar.gz
emacs-682432fc544c2bb4e0531c2931d43bce085eb16a.zip
Merge from trunk.
-rw-r--r--ChangeLog9
-rw-r--r--autogen/config.in3
-rwxr-xr-xautogen/configure69
-rw-r--r--configure.in4
-rw-r--r--doc/emacs/ChangeLog43
-rw-r--r--doc/emacs/basic.texi39
-rw-r--r--doc/emacs/emacs.texi7
-rw-r--r--doc/emacs/files.texi4
-rw-r--r--doc/emacs/help.texi432
-rw-r--r--doc/emacs/mini.texi516
-rw-r--r--doc/emacs/mule.texi11
-rw-r--r--doc/emacs/text.texi6
-rw-r--r--doc/lispref/ChangeLog20
-rw-r--r--doc/lispref/buffers.texi33
-rw-r--r--doc/lispref/positions.texi2
-rw-r--r--doc/lispref/symbols.texi2
-rw-r--r--doc/lispref/windows.texi74
-rw-r--r--doc/misc/ChangeLog8
-rw-r--r--doc/misc/Makefile.in13
-rw-r--r--doc/misc/ert.texi8
-rw-r--r--etc/NEWS34
-rw-r--r--lisp/ChangeLog85
-rw-r--r--lisp/bindings.el2
-rw-r--r--lisp/eshell/eshell.el8
-rw-r--r--lisp/gnus/ChangeLog20
-rw-r--r--lisp/gnus/html2text.el7
-rw-r--r--lisp/gnus/message.el8
-rw-r--r--lisp/gnus/spam.el24
-rw-r--r--lisp/isearch.el9
-rw-r--r--lisp/mail/sendmail.el71
-rw-r--r--lisp/mail/smtpmail.el2
-rw-r--r--lisp/minibuffer.el103
-rw-r--r--lisp/net/tramp.el11
-rw-r--r--lisp/progmodes/f90.el23
-rw-r--r--lisp/simple.el50
-rw-r--r--lisp/textmodes/flyspell.el97
-rw-r--r--lisp/vc/vc-dispatcher.el21
-rw-r--r--lisp/vc/vc.el6
-rw-r--r--lisp/window.el53
-rw-r--r--src/ChangeLog51
-rw-r--r--src/alloc.c4
-rw-r--r--src/bidi.c4
-rw-r--r--src/callint.c2
-rw-r--r--src/dispnew.c4
-rw-r--r--src/lisp.h116
-rw-r--r--src/lread.c6
-rw-r--r--src/minibuf.c7
-rw-r--r--src/xdisp.c72
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 @@
12011-10-12 Paul Eggert <eggert@cs.ucla.edu>
2
3 * configure.in: Remove check for -lintl (Bug#9713).
4 The check breaks 'configure' in some CentOS 5.7 x86 configurations.
5 The check was helpful but not essential in Solaris 2.6 (1997),
6 and is no longer needed in Solaris 8 (2000). Solaris 2.6 is
7 obsolete -- Sun dropped support for it in 2006 -- and without
8 access to that Silurian platform we can't maintain the code anyway.
9
12011-10-07 Paul Eggert <eggert@cs.ucla.edu> 102011-10-07 Paul Eggert <eggert@cs.ucla.edu>
2 11
3 Merge from gnulib, fixing some 'configure' typos (Bug#9696). 12 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/>. */
420/* Define to 1 if you have the hesiod library (-lhesiod). */ 420/* Define to 1 if you have the hesiod library (-lhesiod). */
421#undef HAVE_LIBHESIOD 421#undef HAVE_LIBHESIOD
422 422
423/* Define to 1 if you have the `intl' library (-lintl). */
424#undef HAVE_LIBINTL
425
426/* Define to 1 if you have the `k5crypto' library (-lk5crypto). */ 423/* Define to 1 if you have the `k5crypto' library (-lk5crypto). */
427#undef HAVE_LIBK5CRYPTO 424#undef HAVE_LIBK5CRYPTO
428 425
diff --git a/autogen/configure b/autogen/configure
index a648a000713..e86db7a7362 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -6969,6 +6969,8 @@ esac
6969 # Code from module stat: 6969 # Code from module stat:
6970 # Code from module stdarg: 6970 # Code from module stdarg:
6971 6971
6972
6973
6972 # Code from module stdbool: 6974 # Code from module stdbool:
6973 # Code from module stddef: 6975 # Code from module stddef:
6974 # Code from module stdint: 6976 # Code from module stdint:
@@ -15290,54 +15292,6 @@ fi
15290 15292
15291 15293
15292 15294
15293# Solaris requires -lintl if you want strerror (which calls dgettext)
15294# to return localized messages.
15295{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5
15296$as_echo_n "checking for dgettext in -lintl... " >&6; }
15297if test "${ac_cv_lib_intl_dgettext+set}" = set; then :
15298 $as_echo_n "(cached) " >&6
15299else
15300 ac_check_lib_save_LIBS=$LIBS
15301LIBS="-lintl $LIBS"
15302cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15303/* end confdefs.h. */
15304
15305/* Override any GCC internal prototype to avoid an error.
15306 Use char because int might match the return type of a GCC
15307 builtin and then its argument prototype would still apply. */
15308#ifdef __cplusplus
15309extern "C"
15310#endif
15311char dgettext ();
15312int
15313main ()
15314{
15315return dgettext ();
15316 ;
15317 return 0;
15318}
15319_ACEOF
15320if ac_fn_c_try_link "$LINENO"; then :
15321 ac_cv_lib_intl_dgettext=yes
15322else
15323 ac_cv_lib_intl_dgettext=no
15324fi
15325rm -f core conftest.err conftest.$ac_objext \
15326 conftest$ac_exeext conftest.$ac_ext
15327LIBS=$ac_check_lib_save_LIBS
15328fi
15329{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5
15330$as_echo "$ac_cv_lib_intl_dgettext" >&6; }
15331if test "x$ac_cv_lib_intl_dgettext" = x""yes; then :
15332 cat >>confdefs.h <<_ACEOF
15333#define HAVE_LIBINTL 1
15334_ACEOF
15335
15336 LIBS="-lintl $LIBS"
15337
15338fi
15339
15340
15341{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime caches TZ" >&5 15295{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime caches TZ" >&5
15342$as_echo_n "checking whether localtime caches TZ... " >&6; } 15296$as_echo_n "checking whether localtime caches TZ... " >&6; }
15343if test "${emacs_cv_localtime_cache+set}" = set; then : 15297if test "${emacs_cv_localtime_cache+set}" = set; then :
@@ -21903,12 +21857,6 @@ fi
21903 21857
21904 21858
21905 gl_gnulib_enabled_sigprocmask=true 21859 gl_gnulib_enabled_sigprocmask=true
21906 if $condition; then
21907 func_gl_gnulib_m4code_raise
21908 fi
21909 if $condition; then
21910 func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616
21911 fi
21912 fi 21860 fi
21913 } 21861 }
21914 func_gl_gnulib_m4code_stat () 21862 func_gl_gnulib_m4code_stat ()
@@ -22040,13 +21988,10 @@ fi
22040 21988
22041 21989
22042 gl_gnulib_enabled_stat=true 21990 gl_gnulib_enabled_stat=true
22043 if $condition; then 21991 if test $REPLACE_STAT = 1; then
22044 func_gl_gnulib_m4code_dosname 21992 func_gl_gnulib_m4code_dosname
22045 fi 21993 fi
22046 if $condition; then 21994 if test $REPLACE_STAT = 1; then
22047 func_gl_gnulib_m4code_pathmax
22048 fi
22049 if $condition; then
22050 func_gl_gnulib_m4code_verify 21995 func_gl_gnulib_m4code_verify
22051 fi 21996 fi
22052 fi 21997 fi
@@ -22161,12 +22106,6 @@ fi
22161 gl_gnulib_enabled_verify=true 22106 gl_gnulib_enabled_verify=true
22162 fi 22107 fi
22163 } 22108 }
22164 if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
22165 func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616
22166 fi
22167 if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
22168 func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07
22169 fi
22170 if test $REPLACE_GETOPT = 1; then 22109 if test $REPLACE_GETOPT = 1; then
22171 func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 22110 func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36
22172 fi 22111 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)
3008AC_SUBST(DESLIB) 3008AC_SUBST(DESLIB)
3009AC_SUBST(KRB4LIB) 3009AC_SUBST(KRB4LIB)
3010 3010
3011# Solaris requires -lintl if you want strerror (which calls dgettext)
3012# to return localized messages.
3013AC_CHECK_LIB(intl, dgettext)
3014
3015AC_MSG_CHECKING(whether localtime caches TZ) 3011AC_MSG_CHECKING(whether localtime caches TZ)
3016AC_CACHE_VAL(emacs_cv_localtime_cache, 3012AC_CACHE_VAL(emacs_cv_localtime_cache,
3017[if test x$ac_cv_func_tzset = xyes; then 3013[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 @@
12011-10-09 Chong Yidong <cyd@stupidchicken.com>
2
3 * help.texi (Help, Help Summary): Eliminate the unnecessary "help
4 option" terminology.
5 (Key Help): Add command names. Define "documentation string".
6 (Name Help): Remove an over-long joke.
7 (Apropos): Document prefix args. Remove duplicated descriptions.
8 (Help Mode): Add C-c C-b to table. Update TAB binding.
9 (Package Keywords): Rename from "Library by Keyword". Describe
10 new package menu interface.
11 (Help Files, Help Echo): Tweak description.
12
13 * mini.texi (Completion Options): Add completion-cycle-threshold.
14 (Minibuffer History): Document numeric args to history commands.
15
162011-10-08 Eli Zaretskii <eliz@gnu.org>
17
18 * mule.texi (Bidirectional Editing): Correct some inaccuracies.
19
202011-10-08 Chong Yidong <cyd@stupidchicken.com>
21
22 * basic.texi (Position Info): Omit page commands. Document
23 count-words-region and count-words.
24
25 * text.texi (Pages): Move what-page documentation here.
26
272011-10-08 Chong Yidong <cyd@stupidchicken.com>
28
29 * mini.texi (Minibuffer File): Minor copyedits. Use xref to
30 Remote Files node instead of linking directly to the Tramp manual.
31 (Minibuffer Edit): Add xref to Blank Lines.
32 (Completion): Add xref to Symbol Completion. Remove redundant
33 example, which is repeated in the next node.
34 (Completion Commands): Minor clarifications.
35 (Completion Styles): New node, split from Completion Commands.
36 Document substring and initials styles.
37 (Strict Completion): Remove information duplicated in other nodes.
38 (Completion Options): Consolidate case difference discussion here.
39
40 * help.texi (Help Mode): Fix kindex entries.
41
42 * files.texi (File Names): Add index entries.
43
12011-10-07 Chong Yidong <cyd@stupidchicken.com> 442011-10-07 Chong Yidong <cyd@stupidchicken.com>
2 45
3 * basic.texi (Inserting Text): Add xref to Completion. Add 46 * 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
23* Help: Basic Help. Asking what a character does. 23* Help: Basic Help. Asking what a character does.
24* Blank Lines:: Making and deleting blank lines. 24* Blank Lines:: Making and deleting blank lines.
25* Continuation Lines:: How Emacs displays lines too wide for the screen. 25* Continuation Lines:: How Emacs displays lines too wide for the screen.
26* Position Info:: What page, line, row, or column is point on? 26* Position Info:: What line, row, or column is point on?
27* Arguments:: Numeric arguments for repeating a command N times. 27* Arguments:: Numeric arguments for repeating a command N times.
28* Repeating:: Repeating the previous command quickly. 28* Repeating:: Repeating the previous command quickly.
29@end menu 29@end menu
@@ -569,28 +569,26 @@ logical lines. @xref{Visual Line Mode}.
569@section Cursor Position Information 569@section Cursor Position Information
570 570
571 Here are commands to get information about the size and position of 571 Here are commands to get information about the size and position of
572parts of the buffer, and to count lines. 572parts of the buffer, and to count words and lines.
573 573
574@table @kbd 574@table @kbd
575@item M-x what-page
576Display the page number of point, and the line number within that page.
577@item M-x what-line 575@item M-x what-line
578Display the line number of point in the whole buffer. 576Display the line number of point.
579@item M-x line-number-mode 577@item M-x line-number-mode
580@itemx M-x column-number-mode 578@itemx M-x column-number-mode
581Toggle automatic display of the current line number or column number. 579Toggle automatic display of the current line number or column number.
582@xref{Optional Mode Line}. 580@xref{Optional Mode Line}.
583 581
584@item M-= 582@item M-=
585Display the number of lines in the region (@code{count-lines-region}). 583Display the number of lines, words, and characters that are present in
586@xref{Mark}, for information about the region. 584the region (@code{count-words-region}). @xref{Mark}, for information
585about the region.
587 586
588@item C-x l 587@item M-x count-words
589Display the number of lines in the current page 588Display the number of lines, words, and characters that are present in
590(@code{count-lines-page}). @xref{Pages}. 589the buffer. If the region is active (@pxref{Mark}), display the
590numbers for the region instead.
591 591
592@item M-x count-words-region
593Display the number of words in the region.
594@item C-x = 592@item C-x =
595Display the character code of character after point, character position of 593Display the character code of character after point, character position of
596point, and column of point (@code{what-cursor-position}). 594point, and column of point (@code{what-cursor-position}).
@@ -602,7 +600,6 @@ Toggle automatic display of the size of the buffer.
602@xref{Optional Mode Line}. 600@xref{Optional Mode Line}.
603@end table 601@end table
604 602
605@findex what-page
606@findex what-line 603@findex what-line
607@cindex line number commands 604@cindex line number commands
608@cindex location of point 605@cindex location of point
@@ -616,16 +613,14 @@ the accessible portion (@pxref{Narrowing}). By contrast,
616@code{what-line} displays both the line number relative to the 613@code{what-line} displays both the line number relative to the
617narrowed region and the line number relative to the whole buffer. 614narrowed region and the line number relative to the whole buffer.
618 615
619 @kbd{M-x what-page} counts pages from the beginning of the file, and
620counts lines within the page, showing both numbers in the echo area.
621@xref{Pages}.
622
623@kindex M-= 616@kindex M-=
624@findex count-lines-region 617@findex count-words-region
625 @kbd{M-=} (@code{count-lines-region}) displays the number of lines 618@findex count-words
626in the region (@pxref{Mark}), while @kbd{C-x l} 619 @kbd{M-=} (@code{count-words-region}) displays a message reporting
627(@code{count-lines-page}) counts the lines in the current page 620the number of lines, words, and characters in the region. @kbd{M-x
628(@pxref{Pages}). 621count-words} displays a similar message for the entire buffer, or for
622the region if the region is @dfn{active}. @xref{Mark}, for an
623explanation of the region.
629 624
630@kindex C-x = 625@kindex C-x =
631@findex what-cursor-position 626@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
264* Basic Help:: Asking what a character does. 264* Basic Help:: Asking what a character does.
265* Blank Lines:: Making and deleting blank lines. 265* Blank Lines:: Making and deleting blank lines.
266* Continuation Lines:: How Emacs displays lines too wide for the screen. 266* Continuation Lines:: How Emacs displays lines too wide for the screen.
267* Position Info:: What page, line, row, or column is point on? 267* Position Info:: What line, row, or column is point on?
268* Arguments:: Numeric arguments for repeating a command N times. 268* Arguments:: Numeric arguments for repeating a command N times.
269* Repeating:: Repeating the previous command quickly. 269* Repeating:: Repeating the previous command quickly.
270 270
@@ -282,6 +282,7 @@ Completion
282* Completion Example:: Examples of using completion. 282* Completion Example:: Examples of using completion.
283* Completion Commands:: A list of completion commands. 283* Completion Commands:: A list of completion commands.
284* Strict Completion:: Different types of completion. 284* Strict Completion:: Different types of completion.
285* Completion Styles:: How completion matches are chosen.
285* Completion Options:: Options for completion. 286* Completion Options:: Options for completion.
286 287
287Help 288Help
@@ -291,10 +292,10 @@ Help
291* Name Help:: Asking about a command, variable or function name. 292* Name Help:: Asking about a command, variable or function name.
292* Apropos:: Asking what pertains to a given topic. 293* Apropos:: Asking what pertains to a given topic.
293* Help Mode:: Special features of Help mode and Help buffers. 294* Help Mode:: Special features of Help mode and Help buffers.
294* Library Keywords:: Finding Lisp libraries by keywords (topics). 295* Package Keywords:: Finding Lisp libraries by keywords (topics).
295* Language Help:: Help relating to international language support. 296* Language Help:: Help relating to international language support.
296* Misc Help:: Other help commands. 297* Misc Help:: Other help commands.
297* Help Files:: Commands to display pre-written help files. 298* Help Files:: Commands to display auxilliary help files.
298* Help Echo:: Help on active text and tooltips (`balloon help'). 299* Help Echo:: Help on active text and tooltips (`balloon help').
299 300
300The Mark and the Region 301The 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
54appear in the variable @code{completion-ignored-extensions} 54appear in the variable @code{completion-ignored-extensions}
55(@pxref{Completion Options}). 55(@pxref{Completion Options}).
56 56
57@cindex default file name
57 For most operations, there is a @dfn{default file name} which is 58 For most operations, there is a @dfn{default file name} which is
58used if you type just @key{RET} to enter an empty argument. Normally, 59used if you type just @key{RET} to enter an empty argument. Normally,
59the default file name is the name of the file visited in the current 60the default file name is the name of the file visited in the current
60buffer. 61buffer.
61 62
63@cindex default directory
62@vindex default-directory 64@vindex default-directory
63@vindex insert-default-directory 65@vindex insert-default-directory
64 Each buffer has a @dfn{default directory} which is normally the same 66 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
1863@cindex file name caching 1865@cindex file name caching
1864@cindex cache of file names 1866@cindex cache of file names
1865@pindex find 1867@pindex find
1866@kindex C-@key{TAB} 1868@kindex C-TAB
1867@findex file-cache-minibuffer-complete 1869@findex file-cache-minibuffer-complete
1868 You can use the @dfn{file name cache} to make it easy to locate a 1870 You can use the @dfn{file name cache} to make it easy to locate a
1869file by name, without having to remember exactly where it is located. 1871file 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 @@
11@kindex C-h 11@kindex C-h
12@kindex F1 12@kindex F1
13 13
14 Emacs provides extensive help features, all accessible through the
15@dfn{help character}, @kbd{C-h}. This is a prefix key that is used
16for commands that display documentation; the next character you type
17should be a @dfn{help option}, to ask for a particular kind of help.
18You can cancel the @kbd{C-h} command with @kbd{C-g}. The function key
19@key{F1} is equivalent to @kbd{C-h}.
20
21@kindex C-h C-h 14@kindex C-h C-h
22@findex help-for-help 15@findex help-for-help
23 @kbd{C-h} itself is one of the help options; @kbd{C-h C-h} displays 16 Emacs provides a wide variety of help commands, all accessible
24a list of help options, with a brief description of each one 17through the prefix key @kbd{C-h} (or, equivalently, the function key
25(@code{help-for-help}). You can scroll the list with @key{SPC} and 18@key{F1}). These help commands are described in the following
26@key{DEL}, then type the help option you want. To cancel, type 19sections. You can also type @kbd{C-h C-h} to view a list of help
27@kbd{C-g}. 20commands (@code{help-for-help}). You can scroll the list with
28 21@key{SPC} and @key{DEL}, then type the help command you want. To
29 @kbd{C-h} or @key{F1} means ``help'' in various other contexts as 22cancel, type @kbd{C-g}.
30well. For instance, you can type them after a prefix key to display 23
31a list of the keys that can follow the prefix key. (A few prefix keys 24 Many help commands display their information in a special @dfn{help
32don't support @kbd{C-h} in this way, because they define other 25buffer}. In this buffer, you can type @key{SPC} and @key{DEL} to
33meanings for it, but they all support @key{F1} for help.) 26scroll and type @key{RET} to follow hyperlinks. @xref{Help Mode}.
34
35 Most help buffers use a special major mode, Help mode, which lets
36you scroll conveniently with @key{SPC} and @key{DEL}. You can also
37follow hyperlinks to URLs, and to other facilities including Info
38nodes and customization buffers. @xref{Help Mode}.
39 27
40@cindex searching documentation efficiently 28@cindex searching documentation efficiently
41@cindex looking for a subject in documentation 29@cindex looking for a subject in documentation
@@ -51,33 +39,38 @@ This searches for commands whose names match the argument
51regular expression (@pxref{Regexps}). @xref{Apropos}. 39regular expression (@pxref{Regexps}). @xref{Apropos}.
52 40
53@item C-h i d m emacs @key{RET} i @var{topic} @key{RET} 41@item C-h i d m emacs @key{RET} i @var{topic} @key{RET}
54This searches for @var{topic} in the indices of the on-line Emacs 42This searches for @var{topic} in the indices of the Emacs Info manual,
55manual, and displays the first match found. Press @kbd{,} to see 43displaying the first match found. Press @kbd{,} to see subsequent
56subsequent matches. You can use a regular expression as @var{topic}. 44matches. You can use a regular expression as @var{topic}.
57 45
58@item C-h i d m emacs @key{RET} s @var{topic} @key{RET} 46@item C-h i d m emacs @key{RET} s @var{topic} @key{RET}
59Similar, but searches the @emph{text} of the manual rather than the 47Similar, but searches the @emph{text} of the manual rather than the
60indices. 48indices.
61 49
62@item C-h C-f 50@item C-h C-f
63This displays the Emacs FAQ. You can use the Info commands 51This displays the Emacs FAQ, using Info.
64to browse it.
65 52
66@item C-h p 53@item C-h p
67This displays the available Emacs packages based on keywords. 54This displays the available Emacs packages based on keywords.
68@xref{Library Keywords}. 55@xref{Package Keywords}.
69@end table 56@end table
70 57
58 @kbd{C-h} or @key{F1} means ``help'' in various other contexts as
59well. For instance, you can type them after a prefix key to view a
60list of the keys that can follow the prefix key. (A few prefix keys
61don't support @kbd{C-h} in this way, because they define other
62meanings for it, but they all support @key{F1} for help.)
63
71@menu 64@menu
72* Help Summary:: Brief list of all Help commands. 65* Help Summary:: Brief list of all Help commands.
73* Key Help:: Asking what a key does in Emacs. 66* Key Help:: Asking what a key does in Emacs.
74* Name Help:: Asking about a command, variable or function name. 67* Name Help:: Asking about a command, variable or function name.
75* Apropos:: Asking what pertains to a given topic. 68* Apropos:: Asking what pertains to a given topic.
76* Help Mode:: Special features of Help mode and Help buffers. 69* Help Mode:: Special features of Help mode and Help buffers.
77* Library Keywords:: Finding Lisp libraries by keywords (topics). 70* Package Keywords:: Finding Lisp libraries by keywords (topics).
78* Language Help:: Help relating to international language support. 71* Language Help:: Help relating to international language support.
79* Misc Help:: Other help commands. 72* Misc Help:: Other help commands.
80* Help Files:: Commands to display pre-written help files. 73* Help Files:: Commands to display auxilliary help files.
81* Help Echo:: Help on active text and tooltips (`balloon help'). 74* Help Echo:: Help on active text and tooltips (`balloon help').
82@end menu 75@end menu
83 76
@@ -89,21 +82,20 @@ This displays the available Emacs packages based on keywords.
89@section Help Summary 82@section Help Summary
90@end ifnottex 83@end ifnottex
91 84
92 Here is a summary of the Emacs interactive help commands. (The 85 Here is a summary of help commands for accessing the built-in
93character that follows @kbd{C-h} is the ``help option.'') See 86documentation. Most of these are described in more detail in the
94@ref{Help Files}, for other help commands that display fixed files 87following sections.
95of information.
96 88
97@table @kbd 89@table @kbd
98@item C-h a @var{topics} @key{RET} 90@item C-h a @var{topics} @key{RET}
99Display a list of commands whose names match @var{topics} 91Display a list of commands whose names match @var{topics}
100(@code{apropos-command}; @pxref{Apropos}). 92(@code{apropos-command}).
101@item C-h b 93@item C-h b
102Display all active key bindings; minor mode bindings first, then those 94Display all active key bindings; minor mode bindings first, then those
103of the major mode, then global bindings (@code{describe-bindings}). 95of the major mode, then global bindings (@code{describe-bindings}).
104@item C-h c @var{key} 96@item C-h c @var{key}
105Given a key sequence @var{key}, show the name of the command that it 97Show the name of the command that the key sequence @var{key} is bound
106runs (@code{describe-key-briefly}). Here @kbd{c} stands for 98to (@code{describe-key-briefly}). Here @kbd{c} stands for
107``character.'' For more extensive information on @var{key}, use 99``character.'' For more extensive information on @var{key}, use
108@kbd{C-h k}. 100@kbd{C-h k}.
109@item C-h d @var{topics} @key{RET} 101@item C-h d @var{topics} @key{RET}
@@ -120,8 +112,8 @@ this works for commands too.
120Display the @file{HELLO} file, which shows examples of various character 112Display the @file{HELLO} file, which shows examples of various character
121sets. 113sets.
122@item C-h i 114@item C-h i
123Run Info, the GNU documentation browser (@code{info}). 115Run Info, the GNU documentation browser (@code{info}). The Emacs
124The complete Emacs manual is available on-line in Info. 116manual is available in Info.
125@item C-h k @var{key} 117@item C-h k @var{key}
126Display the name and documentation of the command that @var{key} runs 118Display the name and documentation of the command that @var{key} runs
127(@code{describe-key}). 119(@code{describe-key}).
@@ -134,20 +126,18 @@ Display documentation of the current major mode (@code{describe-mode}).
134Display news of recent Emacs changes (@code{view-emacs-news}). 126Display news of recent Emacs changes (@code{view-emacs-news}).
135@item C-h p 127@item C-h p
136Find packages by topic keyword (@code{finder-by-keyword}). This lists 128Find packages by topic keyword (@code{finder-by-keyword}). This lists
137packages using a package menu buffer (@pxref{Package Menu}); for an 129packages using a package menu buffer. @xref{Packages}.
138alternative interface to the same information, try the
139@code{info-finder} command.
140@item C-h P @var{package} @key{RET} 130@item C-h P @var{package} @key{RET}
141Display documentation about the package named @var{package} 131Display documentation about the package named @var{package}
142(@code{describe-package}; @pxref{Packages}). 132(@code{describe-package}).
143@item C-h r 133@item C-h r
144Display the Emacs manual in Info (@code{info-emacs-manual}). 134Display the Emacs manual in Info (@code{info-emacs-manual}).
145@item C-h s 135@item C-h s
146Display the current contents of the @dfn{syntax table}, with an 136Display the contents of the current @dfn{syntax table}
147explanation of what they mean (@code{describe-syntax}). The syntax 137(@code{describe-syntax}). The syntax table says which characters are
148table says which characters are opening delimiters, which are parts of 138opening delimiters, which are parts of words, and so on. @xref{Syntax
149words, which are string quotes, and so on. @xref{Syntax Tables,, 139Tables,, Syntax Tables, elisp, The Emacs Lisp Reference Manual}, for
150Syntax Tables, elisp, The Emacs Lisp Reference Manual}, for details. 140details.
151@item C-h t 141@item C-h t
152Enter the Emacs interactive tutorial (@code{help-with-tutorial}). 142Enter the Emacs interactive tutorial (@code{help-with-tutorial}).
153@item C-h v @var{var} @key{RET} 143@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
184@node Key Help 174@node Key Help
185@section Documentation for a Key 175@section Documentation for a Key
186 176
187@kindex C-h c
188@findex describe-key-briefly 177@findex describe-key-briefly
178@findex describe-key
189 The help commands to get information about a key sequence are 179 The help commands to get information about a key sequence are
190@kbd{C-h c} and @w{@kbd{C-h k}}. @kbd{C-h c @var{key}} displays in 180@kbd{C-h c} (@code{describe-key-briefly}) and @kbd{C-h k}
191the echo area the name of the command that @var{key} is bound to. For 181(@code{describe-key}).
192example, @kbd{C-h c C-f} displays @samp{forward-char}. Since command 182
193names are chosen to describe what the commands do, this gives you a 183@kindex C-h c
194very brief description of what @var{key} does. 184 @kbd{C-h c @var{key}} displays in the echo area the name of the
185command that @var{key} is bound to. For example, @kbd{C-h c C-f}
186displays @samp{forward-char}.
195 187
188@cindex documentation string
196@kindex C-h k 189@kindex C-h k
197@findex describe-key
198 @kbd{C-h k @var{key}} is similar but gives more information: it 190 @kbd{C-h k @var{key}} is similar but gives more information: it
199displays the documentation string of the command as well as its name. 191displays a help buffer containing the command's @dfn{documentation
200It displays this information in a window, since it may not fit in the 192string}, which describes exactly what the command does.
201echo area.
202 193
203@kindex C-h K 194@kindex C-h K
204@findex Info-goto-emacs-key-command-node 195@findex Info-goto-emacs-key-command-node
205 To find the documentation of a key sequence @var{key}, type @kbd{C-h 196 @kbd{C-h K @var{key}} displays the section of the Emacs manual that
206K @var{key}}. This displays the appropriate manual section which 197describes the command corresponding to @var{key}.
207contains the documentation of @var{key}.
208 198
209 @kbd{C-h c}, @kbd{C-h k} and @kbd{C-h K} work for any sort of key 199 @kbd{C-h c}, @kbd{C-h k} and @kbd{C-h K} work for any sort of key
210sequences, including function keys, menus, and mouse events. For 200sequences, 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
271defined Lisp variable. @xref{Variables}. 261defined Lisp variable. @xref{Variables}.
272 262
273 Help buffers that describe Emacs variables and functions normally 263 Help buffers that describe Emacs variables and functions normally
274have hyperlinks to the corresponding source definition, if you have 264have hyperlinks to the corresponding source code, if you have the
275the source files installed. (@xref{Hyperlinking}.) If you know Lisp 265source files installed (@pxref{Hyperlinking}).
276(or C), this provides the ultimate documentation. If you don't know
277Lisp, you should learn it. (The Introduction to Emacs Lisp
278Programming, available from the FSF through fsf.org, is a good way to
279get started.) If Emacs feels you are just @emph{using} it, treating
280it as an object program, its feelings may be hurt. For real intimacy,
281read the Emacs source code.
282 266
283@kindex C-h F 267@kindex C-h F
284@findex Info-goto-emacs-command-node 268@findex Info-goto-emacs-command-node
@@ -288,53 +272,58 @@ manuals, not just the Emacs manual, and finds the right one.
288 272
289@node Apropos 273@node Apropos
290@section Apropos 274@section Apropos
275@cindex apropos
291 276
292 The @dfn{apropos} commands answer questions like, ``What are the 277 The @dfn{apropos} commands answer questions like, ``What are the
293commands for working with files?'' More precisely, you specify an 278commands for working with files?'' More precisely, you specify an
294@dfn{apropos pattern}, which means either a word, a list of words, or 279@dfn{apropos pattern}, which means either a word, a list of words, or
295a regular expression. Each apropos command displays a list of items 280a regular expression.
296that match the pattern, in a separate buffer. 281
282 Each of the following apropos commands reads an apropos pattern in
283the minibuffer, searches for items that match the pattern, and
284displays the results in a different window.
297 285
298@table @kbd 286@table @kbd
299@item C-h a @var{pattern} @key{RET} 287@item C-h a
300Search for commands whose names match @var{pattern}. 288@kindex C-h a
289@findex apropos-command
290Search for commands (@code{apropos-command}). With a prefix argument,
291search for noninteractive functions too.
301 292
302@item M-x apropos @key{RET} @var{pattern} @key{RET} 293@item M-x apropos
303Search for functions and variables whose names match @var{pattern}. 294@findex apropos
304Both interactive functions (commands) and noninteractive functions can 295Search for functions and variables. Both interactive functions
305be found by this command. 296(commands) and noninteractive functions can be found by this.
306 297
307@item M-x apropos-variable @key{RET} @var{pattern} @key{RET} 298@item M-x apropos-variable
308Search for user-option variables whose names match @var{pattern}. 299@findex apropos-variable
300Search for user-customizable variables. With a prefix argument,
301search for non-customizable variables too.
309 302
310@item M-x apropos-value @key{RET} @var{pattern} @key{RET} 303@item M-x apropos-value
311Search for functions whose definitions match @var{pattern}, and 304@findex apropos-value
312variables whose values match @var{pattern}. 305Search for variables whose values match the specified pattern. With a
306prefix argument, search also for functions with definitions matching
307the pattern, and Lisp symbols with properties matching the pattern.
313 308
314@item C-h d @var{pattern} @key{RET} 309@item C-h d
315Search for functions and variables whose @strong{documentation 310@kindex C-h d
316strings} match @var{pattern}. 311@findex apropos-documentation
312Search for functions and variables whose documentation strings match
313the specified pattern (@code{apropos-documentation}).
317@end table 314@end table
318 315
319@kindex C-h a 316 The simplest kind of apropos pattern is one word. Anything
320@findex apropos-command 317containing that word matches the pattern. Thus, to find commands that
321@cindex apropos 318work on files, type @kbd{C-h a file @key{RET}}. This displays a list
322 The simplest kind of apropos pattern is one word. Anything which 319of all command names that contain @samp{file}, including
323contains that word matches the pattern. Thus, to find the commands
324that work on files, type @kbd{C-h a file @key{RET}}. This displays a
325list of all command names that contain @samp{file}, including
326@code{copy-file}, @code{find-file}, and so on. Each command name 320@code{copy-file}, @code{find-file}, and so on. Each command name
327comes with a brief description and a list of keys you can currently 321comes with a brief description and a list of keys you can currently
328invoke it with. In our example, it would say that you can invoke 322invoke it with. In our example, it would say that you can invoke
329@code{find-file} by typing @kbd{C-x C-f}. 323@code{find-file} by typing @kbd{C-x C-f}.
330 324
331 The @kbd{a} in @kbd{C-h a} stands for ``Apropos''; @kbd{C-h a}
332runs the command @code{apropos-command}. This command normally checks
333only commands (interactive functions); if you specify a prefix
334argument, it checks noninteractive functions as well.
335
336 For more information about a function definition, variable or symbol 325 For more information about a function definition, variable or symbol
337property listed in the apropos buffer, you can click on it with 326property listed in an apropos buffer, you can click on it with
338@kbd{Mouse-1} or @kbd{Mouse-2}, or move there and type @key{RET}. 327@kbd{Mouse-1} or @kbd{Mouse-2}, or move there and type @key{RET}.
339 328
340 When you specify more than one word in the apropos pattern, a name 329 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,
362view, describe, default. 351view, describe, default.
363@end quotation 352@end quotation
364 353
365@findex apropos
366 Use @kbd{M-x apropos} instead of @kbd{C-h a} to list all the Lisp
367symbols that match an apropos pattern, not just the symbols that are
368commands. This command does not list key bindings by default; specify
369a numeric argument if you want it to list them.
370
371@findex apropos-variable
372 Use @kbd{M-x apropos-variable} to list user-customizable variables
373that match an apropos pattern. If you specify a prefix argument, it
374lists all matching variables.
375
376@kindex C-h d
377@findex apropos-documentation
378 The @code{apropos-documentation} command is like @code{apropos}
379except that it searches documentation strings instead of symbol names
380for matches.
381
382@findex apropos-value
383 The @code{apropos-value} command is like @code{apropos} except that
384it searches variables' values for matches for the apropos pattern.
385With a prefix argument, it also checks symbols' function definitions
386and property lists.
387
388@vindex apropos-do-all 354@vindex apropos-do-all
389 If the variable @code{apropos-do-all} is non-@code{nil}, the apropos 355 If the variable @code{apropos-do-all} is non-@code{nil}, the apropos
390commands always behave as if they had been given a prefix argument. 356commands always behave as if they had been given a prefix argument.
391 357
392@vindex apropos-sort-by-scores 358@vindex apropos-sort-by-scores
393@cindex apropos search results, order by score 359@cindex apropos search results, order by score
394 By default, apropos lists the search results in alphabetical order.
395If the variable @code{apropos-sort-by-scores} is non-@code{nil}, the
396apropos commands try to guess the relevance of each result, and
397display the most relevant ones first.
398
399@vindex apropos-documentation-sort-by-scores 360@vindex apropos-documentation-sort-by-scores
400 By default, apropos lists the search results for 361 By default, all apropos commands except @code{apropos-documentation}
401@code{apropos-documentation} in order of relevance of the match. If 362list their results in alphabetical order. If the variable
402the variable @code{apropos-documentation-sort-by-scores} is 363@code{apropos-sort-by-scores} is non-@code{nil}, these commands
403@code{nil}, apropos lists the symbols found in alphabetical order. 364instead try to guess the relevance of each result, and display the
365most relevant ones first. The @code{apropos-documentation} command
366lists its results in order of relevance by default; to list them in
367alphabetical order, change the variable
368@code{apropos-documentation-sort-by-scores} to @code{nil}.
404 369
405@node Help Mode 370@node Help Mode
406@section Help Mode Commands 371@section Help Mode Commands
407 372
408 Help buffers provide the same commands as View mode (@pxref{View 373 Help buffers provide the same commands as View mode (@pxref{View
409Mode}), plus a few special commands of their own. 374Mode}); for instance, @key{SPC} scrolls forward, and @key{DEL} scrolls
375backward. A few special commands are also provided:
410 376
411@table @kbd 377@table @kbd
412@item @key{SPC}
413Scroll forward.
414@item @key{DEL}
415Scroll backward.
416@item @key{RET} 378@item @key{RET}
417Follow a cross reference at point. 379Follow a cross reference at point (@code{help-follow}).
418@item @key{TAB} 380@item @key{TAB}
419Move point forward to the next cross reference. 381Move point forward to the next hyperlink (@code{forward-button}).
420@item S-@key{TAB} 382@item S-@key{TAB}
421Move point back to the previous cross reference. 383Move point back to the previous hyperlink (@code{backward-button}).
422@item Mouse-1 384@item Mouse-1
423@itemx Mouse-2 385@itemx Mouse-2
424Follow a cross reference that you click on. 386Follow a hyperlink that you click on.
425@item C-c C-c 387@item C-c C-c
426Show all documentation about the symbol at point. 388Show all documentation about the symbol at point
389(@code{help-follow-symbol}).
390@item C-c C-b
391Go back to the previous help topic (@code{help-go-back}).
427@end table 392@end table
428 393
429 When a function name (@pxref{M-x,, Running Commands by Name}), 394@cindex hyperlink
430variable name (@pxref{Variables}), or face name (@pxref{Faces}) 395@findex help-follow
431appears in the documentation, it normally appears inside paired 396@findex help-go-back
432single-quotes. To view the documentation of that command, variable or 397@kindex RET @r{(Help mode)}
433face, you can click on the name with @kbd{Mouse-1} or @kbd{Mouse-2}, 398@kindex C-c C-b @r{(Help mode)}
434or move point there and type @key{RET}. Use @kbd{C-c C-b} to retrace 399 When a function name, variable name, or face name (@pxref{Faces})
435your steps. 400appears in the documentation in the help buffer, it is normally an
401underlined @dfn{hyperlink}. To view the associated documentation,
402move point there and type @key{RET} (@code{help-follow}), or click on
403the hyperlink with @kbd{Mouse-1} or @kbd{Mouse-2}. Doing so replaces
404the contents of the help buffer; to retrace your steps, type @kbd{C-c
405C-b} (@code{help-go-back}).
436 406
437@cindex URL, viewing in help 407@cindex URL, viewing in help
438@cindex help, viewing web pages 408@cindex help, viewing web pages
439@cindex viewing web pages in help 409@cindex viewing web pages in help
440@cindex web pages, viewing in help 410@cindex web pages, viewing in help
441@findex browse-url 411@findex browse-url
442 You can follow cross references to URLs (web pages) also. This uses 412 A help buffer can also contain hyperlinks to Info manuals, source
443the @code{browse-url} command to view the page in the browser you 413code definitions, and URLs (web pages). The first two are opened in
444choose. @xref{Browse-URL}. 414Emacs, and the third using a web browser via the @code{browse-url}
445 415command (@pxref{Browse-URL}).
446@kindex @key{TAB} @r{(Help mode)} 416
447@findex help-next-ref 417@kindex TAB @r{(Help mode)}
448@kindex S-@key{TAB} @r{(Help mode)} 418@findex forward-button
449@findex help-previous-ref 419@kindex S-TAB @r{(Help mode)}
450 There are convenient commands to move point to cross references in 420@findex backward-button
451the help text. @key{TAB} (@code{help-next-ref}) moves point down to 421 In a help buffer, @key{TAB} (@code{forward-button}) moves point
452the next cross reference. @kbd{S-@key{TAB}} moves up to the previous 422forward to the next hyperlink, while @kbd{S-@key{TAB}}
453cross reference (@code{help-previous-ref}). 423(@code{backward-button}) point back to the previous hyperlink. These
454 424commands act cyclically; for instance, typing @key{TAB} at the last
455 To view all documentation about any symbol name that appears in the 425hyperlink moves back to the first hyperlink.
456text, move point to the symbol name and type @kbd{C-c C-c} 426
457(@code{help-follow-symbol}). This shows all available documentation 427 To view all documentation about any symbol in the text, move point
458about the symbol as a variable, function and/or face. As above, use 428to there and type @kbd{C-c C-c} (@code{help-follow-symbol}). This
459@kbd{C-c C-b} to retrace your steps. 429shows all available documentation about the symbol---as a variable,
460 430function and/or face.
461@node Library Keywords 431
462@section Keyword Search for Lisp Libraries 432@node Package Keywords
433@section Keyword Search for Packages
434@cindex finder
435
436Most optional features in Emacs are grouped into @dfn{packages}.
437Emacs contains several hundred built-in packages, and more can be
438installed over the network (@pxref{Packages}).
463 439
464@kindex C-h p 440@kindex C-h p
465@findex finder-by-keyword 441@findex finder-by-keyword
466The @kbd{C-h p} command lets you search the standard Emacs Lisp 442 To make it easier to find packages related to a topic, most packages
467libraries by topic keywords. Here is a partial list of keywords you can 443are associated with one or more @dfn{keywords} based on what they do.
468use: 444Type @kbd{C-h p} (@code{finder-by-keyword}) to bring up a list of
469 445package keywords, together with a description of what the keywords
470@multitable {convenience} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} 446mean. To view a list of packages for a given keyword, type @key{RET}
471@item abbrev@tab abbreviation handling, typing shortcuts, macros. 447on that line; this displays the list of packages in a Package Menu
472@item bib@tab code related to the @code{bib} bibliography processor. 448buffer (@pxref{Package Menu}).
473@item c@tab support for the C language and related languages. 449
474@item calendar@tab calendar and time management support. 450@findex describe-package
475@item comm@tab communications, networking, remote access to files. 451@kindex C-h P
476@item convenience@tab convenience features for faster editing. 452 @kbd{C-h P} (@code{describe-package}) prompts for the name of a
477@item data@tab support for editing files of data. 453package, and displays a help buffer describing the attributes of the
478@item docs@tab support for Emacs documentation. 454package and the features that it implements.
479@item emulations@tab emulations of other editors.
480@item extensions@tab Emacs Lisp language extensions.
481@item faces@tab support for multiple fonts.
482@item files@tab support for editing and manipulating files.
483@item frames@tab support for Emacs frames and window systems.
484@item games@tab games, jokes and amusements.
485@item hardware@tab support for interfacing with exotic hardware.
486@item help@tab support for on-line help systems.
487@item hypermedia@tab support for links between text or other media types.
488@item i18n@tab internationalization and alternate character-set support.
489@item internal@tab code for Emacs internals, build process, defaults.
490@item languages@tab specialized modes for editing programming languages.
491@item lisp@tab Lisp support, including Emacs Lisp.
492@item local@tab code local to your site.
493@item maint@tab maintenance aids for the Emacs development group.
494@item mail@tab modes for electronic-mail handling.
495@item matching@tab various sorts of searching and matching.
496@item mouse@tab mouse support.
497@item multimedia@tab images and sound support.
498@item news@tab support for netnews reading and posting.
499@item oop@tab support for object-oriented programming.
500@item outlines@tab support for hierarchical outlining.
501@item processes@tab process, subshell, compilation, and job control support.
502@item terminals@tab support for terminal types.
503@item tex@tab supporting code for the @TeX{} formatter.
504@item tools@tab programming tools.
505@item unix@tab front-ends/assistants for, or emulators of, UNIX-like features.
506@item wp@tab word processing.
507@end multitable
508 455
509@node Language Help 456@node Language Help
510@section Help for International Language Support 457@section Help for International Language Support
511 458
512 You can use the command @kbd{C-h L} 459 For information on a specific language environment (@pxref{Language
513(@code{describe-language-environment}) to get information about a 460Environments}), type @kbd{C-h L}
514specific language environment. @xref{Language Environments}. This 461(@code{describe-language-environment}). This displays a help buffer
515tells you which languages this language environment supports. It also 462describing the languages supported by the language environment, and
516lists the character sets, coding systems, and input methods that work 463listing the associated character sets, coding systems, and input
517with this language environment, and finally shows some sample text to 464methods, as well as some sample text for that language environment.
518illustrate scripts.
519 465
520 The command @kbd{C-h h} (@code{view-hello-file}) displays the file 466 The command @kbd{C-h h} (@code{view-hello-file}) displays the file
521@file{etc/HELLO}, which shows how to say ``hello'' in many languages. 467@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
604@node Help Files 550@node Help Files
605@section Help Files 551@section Help Files
606 552
607 The Emacs help commands described above display dynamic help based 553 Apart from the built-in documentation and manuals, Emacs contains
608on the current state within Emacs, or refer to manuals. Other help 554several other files describing topics like copying conditions, release
609commands display pre-written, static help files. 555notes, instructions for debugging and reporting bugs, and so forth.
610 556You can use the following commands to view these files. Apart from
611 Except for @kbd{C-h g}, these commands all have the form @kbd{C-h 557@kbd{C-h g}, they all have the form @kbd{C-h C-@var{char}}.
612C-@var{char}}; that is, @kbd{C-h} followed by a control character.
613 558
614@kindex C-h C-c 559@kindex C-h C-c
615@findex describe-copying 560@findex describe-copying
@@ -636,24 +581,23 @@ C-@var{char}}; that is, @kbd{C-h} followed by a control character.
636 581
637@table @kbd 582@table @kbd
638@item C-h C-c 583@item C-h C-c
639Display the Emacs copying conditions (@code{describe-copying}). 584Display the rules under which you can copy and redistribute Emacs
640These are the rules under which you can copy and redistribute Emacs. 585(@code{describe-copying}).
641@item C-h C-d 586@item C-h C-d
642Display help for debugging Emacs (@code{view-emacs-debugging}). 587Display help for debugging Emacs (@code{view-emacs-debugging}).
643@item C-h C-e 588@item C-h C-e
644Display external packages and information about Emacs 589Display information about where to get external packages
645(@code{view-external-packages}). 590(@code{view-external-packages}).
646@item C-h C-f 591@item C-h C-f
647Display the Emacs frequently-answered-questions list (@code{view-emacs-FAQ}). 592Display the Emacs frequently-answered-questions list (@code{view-emacs-FAQ}).
648@item C-h g 593@item C-h g
649Display general information about the GNU Project 594Display information about the GNU Project (@code{describe-gnu-project}).
650(@code{describe-gnu-project}).
651@item C-h C-m 595@item C-h C-m
652Display how to order printed copies of Emacs manuals 596Display information about ordering printed copies of Emacs manuals
653(@code{view-order-manuals}). 597(@code{view-order-manuals}).
654@item C-h C-n 598@item C-h C-n
655Display the Emacs ``news'' file, which lists new features in the most 599Display the ``news'' file, which lists the new features in this
656recent version of Emacs (@code{view-emacs-news}). 600version of Emacs (@code{view-emacs-news}).
657@item C-h C-o 601@item C-h C-o
658Display how to order or download the latest version of 602Display how to order or download the latest version of
659Emacs and other GNU software (@code{describe-distribution}). 603Emacs and other GNU software (@code{describe-distribution}).
@@ -672,20 +616,20 @@ Emacs (@code{describe-no-warranty}).
672 616
673@cindex tooltips 617@cindex tooltips
674@cindex balloon help 618@cindex balloon help
675 When text on the screen is ``active'', so that it does something 619 In Emacs, stretches of ``active text'' (text that does something
676special in response to mouse clicks or @kbd{RET}, it often has associated 620special in response to mouse clicks or @key{RET}) often have
677help text. For instance, most parts of the mode line have help text. On 621associated help text. This includes hyperlinks in Emacs buffers, as
678terminals that support mouse tracking, Emacs displays the help text as a 622well as parts of the mode line. On graphical displays, as well as
679``tooltip'' (sometimes known as ``balloon help'') or in the echo area, 623some text terminals which support mouse tracking, moving the mouse
680whenever you leave the mouse stationary over the active text. 624over the active text displays the help text as a @dfn{tooltip}.
681@xref{Tooltips}. 625@xref{Tooltips}.
682 626
683@kindex C-h . 627@kindex C-h .
684@findex display-local-help 628@findex display-local-help
685@vindex help-at-pt-display-when-idle 629@vindex help-at-pt-display-when-idle
686 If your terminal doesn't support mouse-tracking, you can display the 630 On terminals that don't support mouse-tracking, you can display the
687help text for active buffer text using the keyboard. @kbd{C-h .} 631help text for active buffer text at point by typing @kbd{C-h .}
688(@code{display-local-help}) displays any help text associated with the 632(@code{display-local-help}). This shows the help text in the echo
689character after point, using the echo area. To display help text 633area. To display help text automatically whenever it is available at
690automatically whenever it is available on the character after point, set 634point, set the variable @code{help-at-pt-display-when-idle} to
691the variable @code{help-at-pt-display-when-idle} to @code{t}. 635@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.
15 15
16@cindex prompt 16@cindex prompt
17 When the minibuffer is in use, it appears in the echo area, with a 17 When the minibuffer is in use, it appears in the echo area, with a
18cursor. The minibuffer display starts with a @dfn{prompt} in a 18cursor. The minibuffer starts with a @dfn{prompt} in a distinct
19distinct color, usually ending with a colon. The prompt states what 19color, usually ending with a colon. The prompt states what kind of
20kind of input is expected, and how it will be used. 20input is expected, and how it will be used.
21 21
22 The simplest way to enter a minibuffer argument is to type the text, 22 The simplest way to enter a minibuffer argument is to type the text,
23then @key{RET} to submit the argument and exit the minibuffer. You 23then @key{RET} to submit the argument and exit the minibuffer. You
@@ -26,19 +26,17 @@ typing @kbd{C-g}.
26 26
27@cindex default argument 27@cindex default argument
28 Sometimes, a @dfn{default argument} appears in the prompt, inside 28 Sometimes, a @dfn{default argument} appears in the prompt, inside
29parentheses before the colon. The default will be used as the 29parentheses before the colon. This default will be used as the
30argument value if you just type @key{RET}. For example, commands that 30argument if you just type @key{RET}. For example, commands that read
31read buffer names usually show a buffer name as the default; you can 31buffer names usually show a buffer name as the default; you can type
32type @key{RET} to operate on that default buffer. 32@key{RET} to operate on that default buffer.
33 33
34 Since the minibuffer appears in the echo area, it can conflict with 34 Since the minibuffer appears in the echo area, it can conflict with
35other uses of the echo area. If an error occurs while the minibuffer 35other uses of the echo area. If an error message or an informative
36is active, the error message hides the minibuffer for a few seconds, 36message is emitted while the minibuffer is active, the message hides
37or until you type something; then the minibuffer comes back. If a 37the minibuffer for a few seconds, or until you type something; then
38command such as @kbd{C-x =} needs to display a message in the echo 38the minibuffer comes back. While the minibuffer is in use, keystrokes
39area, the message hides the minibuffer for a few seconds, or until you 39do not echo.
40type something; then the minibuffer comes back. While the minibuffer
41is in use, keystrokes do not echo.
42 40
43@menu 41@menu
44* Minibuffer File:: Entering file names with the minibuffer. 42* Minibuffer File:: Entering file names with the minibuffer.
@@ -52,6 +50,7 @@ is in use, keystrokes do not echo.
52@node Minibuffer File 50@node Minibuffer File
53@section Minibuffers for File Names 51@section Minibuffers for File Names
54 52
53@cindex default directory
55 Commands such as @kbd{C-x C-f} (@code{find-file}) use the minibuffer 54 Commands such as @kbd{C-x C-f} (@code{find-file}) use the minibuffer
56to read a file name argument (@pxref{Basic Files}). When the 55to read a file name argument (@pxref{Basic Files}). When the
57minibuffer is used to read a file name, it typically starts out with 56minibuffer 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
92second slash in the pair.'' In the example above, 91second slash in the pair.'' In the example above,
93@file{/u2/emacs/src/} is ignored, so the argument you supplied is 92@file{/u2/emacs/src/} is ignored, so the argument you supplied is
94@file{/etc/termcap}. The ignored part of the file name is dimmed if 93@file{/etc/termcap}. The ignored part of the file name is dimmed if
95the terminal allows it (to disable this dimming, turn off File Name 94the terminal allows it. (To disable this dimming, turn off File Name
96Shadow mode with the command @kbd{M-x file-name-shadow-mode}.) 95Shadow mode with the command @kbd{M-x file-name-shadow-mode}.)
97 96
98@cindex home directory shorthand 97@cindex home directory shorthand
@@ -108,11 +107,11 @@ directory name in front of the @file{~} is ignored: thus,
108home directory, Emacs uses several alternatives. For MS-Windows, see 107home directory, Emacs uses several alternatives. For MS-Windows, see
109@ref{Windows HOME}; for MS-DOS, see 108@ref{Windows HOME}; for MS-DOS, see
110@ifnottex 109@ifnottex
111@ref{MS-DOS File Names, HOME on MS-DOS}. 110@ref{MS-DOS File Names}.
112@end ifnottex 111@end ifnottex
113@iftex 112@iftex
114@ref{MS-DOS File Names, HOME on MS-DOS,, emacs, the Emacs Manual}, in 113@ref{MS-DOS File Names, HOME on MS-DOS,, emacs, the digital version of
115the main Emacs manual. 114the Emacs Manual}.
116@end iftex 115@end iftex
117On these systems, the @file{~@var{user-id}/} construct is supported 116On these systems, the @file{~@var{user-id}/} construct is supported
118only for the current user, i.e., only if @var{user-id} is the current 117only 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
125Nonetheless, relative file name arguments are still interpreted based 124Nonetheless, relative file name arguments are still interpreted based
126on the same default directory. 125on the same default directory.
127 126
128 For rules how to read remote file names in the minibuffer, see 127 You can also enter remote file names in the minibuffer.
129@ref{Filename completion, file name completion,, tramp}, in the Tramp 128@xref{Remote Files}.
130manual.
131 129
132@node Minibuffer Edit 130@node Minibuffer Edit
133@section Editing in the Minibuffer 131@section Editing in the Minibuffer
@@ -136,17 +134,17 @@ manual.
136usual Emacs commands are available for editing the argument text. 134usual Emacs commands are available for editing the argument text.
137(The prompt, however, is @dfn{read-only}, and cannot be changed.) 135(The prompt, however, is @dfn{read-only}, and cannot be changed.)
138 136
139 Since @key{RET} in the minibuffer is defined to exit the minibuffer, 137 Since @key{RET} in the minibuffer submits the argument, you can't
140you can't use it to insert a newline in the minibuffer. To do that, 138use it to insert a newline. You can do that with @kbd{C-q C-j}, which
141type @kbd{C-o} or @kbd{C-q C-j}. (The newline character is really the 139inserts a @kbd{C-j} control character, which is formally equivalent to
142@acronym{ASCII} character control-J.) 140a newline character (@pxref{Inserting Text}). Alternatively, you can
141use the @kbd{C-o} (@code{open-line}) command (@pxref{Blank Lines}).
143 142
144 Inside a minibuffer, the keys @kbd{@key{TAB}}, @kbd{@key{SPC}}, and 143 Inside a minibuffer, the keys @key{TAB}, @key{SPC}, and @kbd{?} are
145@kbd{@key{?}} are often bound to commands that perform 144often bound to @dfn{completion commands}, which allow you to easily
146@dfn{completion}. @xref{Completion}. You can use @kbd{C-q} 145fill in the desired text without typing all of it. @xref{Completion}.
147(@code{quoted-insert}) to insert a @key{TAB}, @key{SPC}, or @key{?} 146As with @key{RET}, you can use @kbd{C-q} to insert a @key{TAB},
148character. For example, @kbd{C-q @key{TAB}} inserts a @key{TAB} 147@key{SPC}, or @samp{?} character.
149character. @xref{Inserting Text}.
150 148
151 For convenience, @kbd{C-a} (@code{move-beginning-of-line}) in a 149 For convenience, @kbd{C-a} (@code{move-beginning-of-line}) in a
152minibuffer moves point to the beginning of the argument text, not the 150minibuffer 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}.
203@c it, the tutorial needs to be adjusted. 201@c it, the tutorial needs to be adjusted.
204@cindex completion 202@cindex completion
205 203
206 Sometimes, you can use a feature called @dfn{completion} to help you 204 You can often use a feature called @dfn{completion} to help enter
207enter arguments. This means that after you type part of the argument, 205arguments. This means that after you type part of the argument, Emacs
208Emacs can fill in the rest, or some of it, based on what you have 206can fill in the rest, or some of it, based on what was typed so far.
209typed so far.
210 207
208@cindex completion alternative
211 When completion is available, certain keys (usually @key{TAB}, 209 When completion is available, certain keys (usually @key{TAB},
212@key{RET}, and @key{SPC}) are rebound to complete the text in the 210@key{RET}, and @key{SPC}) are rebound in the minibuffer to special
213minibuffer into a longer string chosen from a set of @dfn{completion 211completion commands (@pxref{Completion Commands}). These commands
214alternatives}. The set of completion alternatives depends on the 212attempt to complete the text in the minibuffer, based on a set of
215command that requested the argument, and on what you have typed so 213@dfn{completion alternatives} provided by the command that requested
216far. In addition, you can usually type @kbd{?} to display a list of 214the argument. You can usually type @kbd{?} to see a list of
217possible completions. 215completion alternatives.
218 216
219 For example, @kbd{M-x} uses the minibuffer to read the name of a 217 Although completion is usually done in the minibuffer, the feature
220command, so completion works by matching the minibuffer text against 218is sometimes available in ordinary buffers too. @xref{Symbol
221the names of existing Emacs commands. So, to run the command 219Completion}.
222@code{insert-buffer}, you can type @kbd{M-x ins @key{SPC} b @key{RET}}
223instead of the full @kbd{M-x insert-buffer @key{RET}}.
224
225 Case is significant in completion when it is significant in the
226argument you are entering, such as command names. Thus,
227@samp{insert-buffer} is not a valid completion for @samp{IN}.
228Completion ignores case distinctions for certain arguments in which
229case does not matter.
230 220
231@menu 221@menu
232* Example: Completion Example. Examples of using completion. 222* Example: Completion Example. Examples of using completion.
233* Commands: Completion Commands. A list of completion commands. 223* Commands: Completion Commands. A list of completion commands.
234* Strict Completion:: Different types of completion. 224* Strict Completion:: Different types of completion.
225* Completion Styles:: How completion matches are chosen.
235* Options: Completion Options. Options for completion. 226* Options: Completion Options. Options for completion.
236@end menu 227@end menu
237 228
@@ -239,24 +230,31 @@ case does not matter.
239@subsection Completion Example 230@subsection Completion Example
240 231
241@kindex TAB @r{(completion)} 232@kindex TAB @r{(completion)}
242 A concrete example may help here. If you type @kbd{M-x a u 233 A simple example may help here. @kbd{M-x} uses the minibuffer to
243@key{TAB}}, the @key{TAB} looks for alternatives (in this case, 234read the name of a command, so completion works by matching the
244command names) that start with @samp{au}. There are several, 235minibuffer text against the names of existing Emacs commands. Suppose
245including @code{auto-fill-mode} and @code{autoconf-mode}, but they all 236you wish to run the command @code{auto-fill-mode}. You can do that by
246begin with @code{auto}, so the @samp{au} in the minibuffer completes 237typing @kbd{M-x auto-fill-mode @key{RET}}, but it is easier to use
247to @samp{auto}. 238completion.
239
240 If you type @kbd{M-x a u @key{TAB}}, the @key{TAB} looks for
241completion alternatives (in this case, command names) that start with
242@samp{au}. There are several, including @code{auto-fill-mode} and
243@code{autoconf-mode}, but they all begin with @code{auto}, so the
244@samp{au} in the minibuffer completes to @samp{auto}.
248 245
249 If you type @key{TAB} again immediately, it cannot determine the 246 If you type @key{TAB} again immediately, it cannot determine the
250next character; it could be @samp{-}, @samp{a}, or @samp{c}. So it 247next character; it could be @samp{-}, @samp{a}, or @samp{c}. So it
251does not add any characters; instead, @key{TAB} displays a list of all 248does not add any characters; instead, @key{TAB} displays a list of all
252possible completions in another window. 249possible completions in another window.
253 250
254 Next, type @kbd{- f}. The minibuffer now contains @samp{auto-f}, 251 Next, type @kbd{-f}. The minibuffer now contains @samp{auto-f}, and
255and the only command name that starts with this is 252the only command name that starts with this is @code{auto-fill-mode}.
256@code{auto-fill-mode}. If you now type @key{TAB}, completion fills in 253If you now type @key{TAB}, completion fills in the rest of the
257the rest of the argument @samp{auto-fill-mode} into the minibuffer. 254argument @samp{auto-fill-mode} into the minibuffer.
258You have been able to enter @samp{auto-fill-mode} by typing just 255
259@kbd{a u @key{TAB} - f @key{TAB}}. 256 Hence, typing just @kbd{a u @key{TAB} - f @key{TAB}} allows you to
257enter @samp{auto-fill-mode}.
260 258
261@node Completion Commands 259@node Completion Commands
262@subsection Completion Commands 260@subsection Completion Commands
@@ -272,60 +270,24 @@ complete, display a list of possible completions
272(@code{minibuffer-complete}). 270(@code{minibuffer-complete}).
273@item @key{SPC} 271@item @key{SPC}
274Complete up to one word from the minibuffer text before point 272Complete up to one word from the minibuffer text before point
275(@code{minibuffer-complete-word}). @key{SPC} for completion is not 273(@code{minibuffer-complete-word}). This command is not available for
276available when entering a file name, since file names often include 274arguments that often include spaces, such as file names.
277spaces.
278@item @key{RET} 275@item @key{RET}
279Submit the text in the minibuffer as the argument, possibly completing 276Submit the text in the minibuffer as the argument, possibly completing
280first as described in the next 277first (@code{minibuffer-complete-and-exit}). @xref{Strict Completion}.
281@iftex
282subsection (@code{minibuffer-complete-and-exit}).
283@end iftex
284@ifnottex
285node (@code{minibuffer-complete-and-exit}). @xref{Strict Completion}.
286@end ifnottex
287@item ? 278@item ?
288Display a list of possible completions of the text before point 279Display a list of completions (@code{minibuffer-completion-help}).
289(@code{minibuffer-completion-help}).
290@end table 280@end table
291 281
292@kindex TAB 282@kindex TAB @r{(completion)}
293@findex minibuffer-complete 283@findex minibuffer-complete
294 @key{TAB} (@code{minibuffer-complete}) is the most fundamental 284 @key{TAB} (@code{minibuffer-complete}) is the most fundamental
295completion command. It searches for all possible completion 285completion command. It searches for all possible completions that
296alternatives that match the existing minibuffer text, and attempts to 286match the existing minibuffer text, and attempts to complete as much
297complete as much as it can. The matching of completion alternatives 287as it can. @xref{Completion Styles}, for how completion alternatives
298to the minibuffer text is performed according to somewhat intricate 288are chosen.
299rules, which are designed so that plausible completions are offered
300under most circumstances. A valid completion alternative must satisfy
301the following criteria:
302 289
303@itemize @bullet 290@kindex SPC @r{(completion)}
304@item
305The minibuffer text before point must be the same as the beginning of
306the completion alternative. If there is any minibuffer text after
307point, it must be a substring of the remainder of the completion
308alternative.
309
310@item
311If no completion alternative satisfies the above rules, try using
312@dfn{partial completion} rules: divide the minibuffer text into words
313separated by hyphens or spaces, and complete each word separately.
314Thus, when completing command names, @samp{em-l-m} completes to
315@samp{emacs-lisp-mode}.
316
317@item
318If there is still no completion alternative, try the first rule again,
319but ignore the minibuffer text after point (i.e., don't try matching
320it).
321@end itemize
322
323@noindent
324When performing these comparisons, a @samp{*} in the minibuffer text
325acts as a @dfn{wildcard}---it matches any character at the
326corresponding position in the completion alternative.
327
328@kindex SPC
329@findex minibuffer-complete-word 291@findex minibuffer-complete-word
330 @key{SPC} (@code{minibuffer-complete-word}) completes like 292 @key{SPC} (@code{minibuffer-complete-word}) completes like
331@key{TAB}, but only up to the next hyphen or space. If you have 293@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-},
334giving @samp{auto-fill-}. Another @key{SPC} at this point completes 296giving @samp{auto-fill-}. Another @key{SPC} at this point completes
335all the way to @samp{auto-fill-mode}. 297all the way to @samp{auto-fill-mode}.
336 298
299@kindex ? @r{(completion)}
300@cindex completion list
337 If @key{TAB} or @key{SPC} is unable to complete, it displays a list 301 If @key{TAB} or @key{SPC} is unable to complete, it displays a list
338of possible completions (if there are any) in a separate window. You 302of matching completion alternatives (if there are any) in another
339can choose a completion from this list using the following commands: 303window. You can display the same list with @kbd{?}
304(@code{minibuffer-completion-help}). The following commands can be
305used with the completion list:
340 306
341@table @kbd 307@table @kbd
342@findex mouse-choose-completion 308@findex mouse-choose-completion
343@item Mouse-1 309@item Mouse-1
344@itemx Mouse-2 310@itemx Mouse-2
345Clicking mouse button 1 or 2 on a completion possibility chooses that 311Clicking mouse button 1 or 2 on a completion alternative chooses it
346completion (@code{mouse-choose-completion}). 312(@code{mouse-choose-completion}).
347 313
348@findex switch-to-completions 314@findex switch-to-completions
349@item M-v 315@item M-v
350@itemx @key{PageUp} 316@itemx @key{PageUp}
351@itemx @key{prior} 317@itemx @key{prior}
352Typing @kbd{M-v}, while in the minibuffer, selects the window showing 318Typing @kbd{M-v}, while in the minibuffer, selects the window showing
353the completion list buffer (@code{switch-to-completions}). This paves 319the completion list (@code{switch-to-completions}). This paves the
354the way for using the commands below. Typing @key{PageUp} or 320way for using the commands below. @key{PageUp} or @key{prior} does
355@key{prior} does the same, as does selecting that window in other 321the same. You can also select the window in other ways
356ways. 322(@pxref{Windows}).
357 323
358@findex choose-completion 324@findex choose-completion
359@item @key{RET} 325@item @key{RET}
360Typing @key{RET}, while in the completion list buffer, chooses the 326While in the completion list buffer, this chooses the completion at
361completion that point is in or next to (@code{choose-completion}). To 327point (@code{choose-completion}).
362use this command, you must first switch to the completion list window.
363 328
364@findex next-completion 329@findex next-completion
365@item @key{Right} 330@item @key{Right}
366Typing the right-arrow key @key{Right}, while in the completion list 331While in the completion list buffer, this moves point to the following
367buffer, moves point to the following completion possibility 332completion alternative (@code{next-completion}).
368(@code{next-completion}).
369 333
370@findex previous-completion 334@findex previous-completion
371@item @key{Left} 335@item @key{Left}
372Typing the left-arrow key @key{Left}, while in the completion list 336While in the completion list buffer, this moves point to the previous
373buffer, moves point to the previous completion possibility 337completion alternative (@code{previous-completion}).
374(@code{previous-completion}).
375@end table 338@end table
376 339
377@node Strict Completion 340@node Strict Completion
378@subsection Strict Completion 341@subsection Strict Completion
379 342
380 There are three different ways that @key{RET} can do completion, 343 There are three ways that the @key{RET}
344(@code{minibuffer-complete-and-exit}) completion command can act,
381depending on how the argument will be used. 345depending on how the argument will be used.
382 346
383@itemize @bullet 347@itemize @bullet
@@ -406,67 +370,140 @@ completion, @key{RET} does not complete, it just submits the argument
406as you have entered it. 370as you have entered it.
407@end itemize 371@end itemize
408 372
409 The completion commands display a list of all possible completions 373 Like the other completion commands, @key{RET} displays a list of all
410whenever they can't determine even one more character by completion. 374possible completions whenever it is supposed to complete but is unable
411Also, typing @kbd{?} explicitly requests such a list. You can scroll 375to complete any further.
412the list with @kbd{C-M-v} (@pxref{Other Window}).
413 376
414@node Completion Options 377@node Completion Styles
415@subsection Completion Options 378@subsection How Completion Alternatives Are Chosen
379@cindex completion style
416 380
417@vindex completion-auto-help 381 Completion commands work by narrowing a large list of possible
418 If @code{completion-auto-help} is set to @code{nil}, the completion 382completion alternatives to a smaller subset that ``matches'' what you
419commands never display the completion list buffer; you must type 383have typed in the minibuffer. In @ref{Completion Example}, we gave a
420@kbd{?} to display the list. If the value is @code{lazy}, Emacs only 384simple example of such matching. The procedure of determining what
421shows the completion list buffer on the second attempt to complete. 385constitutes a ``match'' is quite intricate. Emacs attempts to offer
422In other words, if there is nothing to complete, the first @key{TAB} 386plausible completions under most circumstances.
423echoes @samp{Next char not unique}; the second @key{TAB} does the
424completion list buffer.
425 387
426@vindex completion-ignored-extensions 388 Emacs performs completion using one or more @dfn{completion
427@cindex ignored file names, in completion 389styles}---sets of criteria for matching minibuffer text to completion
428 When completing file names, certain file names are usually ignored. 390alternatives. During completion, Emacs tries each completion style in
429The variable @code{completion-ignored-extensions} contains a list of 391turn. If a style yields one or more matches, that is used as the list
430strings; a file name ending in any of those strings is ignored as a 392of completion alternatives. If a style produces no matches, Emacs
431completion candidate. The standard value of this variable has several 393falls back on the next style.
432elements including @code{".o"}, @code{".elc"}, and @code{"~"}. For
433example, if a directory contains @samp{foo.c} and @samp{foo.elc},
434@samp{foo} completes to @samp{foo.c}. However, if @emph{all} possible
435completions end in ``ignored'' strings, they are not ignored: in the
436previous example, @samp{foo.e} completes to @samp{foo.elc}.
437Displaying a list of possible completions disregards
438@code{completion-ignored-extensions}; it shows them all.
439 394
440 If an element of @code{completion-ignored-extensions} ends in a 395@vindex completion-styles
441slash (@file{/}), it's a subdirectory name; that directory and its 396 The list variable @code{completion-styles} specifies the completion
442contents are ignored. Elements of 397styles to use. Each list element is the name of a completion style (a
443@code{completion-ignored-extensions} that do not end in a slash are 398Lisp symbol). The default completion styles are (in order):
444ordinary file names. 399
400@table @code
401@item basic
402A matching completion alternative must have the same beginning as the
403text in the minibuffer before point. Furthermore, if there is any
404text in the minibuffer after point, the rest of the completion
405alternative must contain that text as a substring.
406
407@findex partial completion
408@item partial-completion
409This aggressive completion style divides the minibuffer text into
410words separated by hyphens or spaces, and completes each word
411separately. (For example, when completing command names,
412@samp{em-l-m} completes to @samp{emacs-lisp-mode}.)
413
414Furthermore, a @samp{*} in the minibuffer text is treated as a
415@dfn{wildcard}---it matches any character at the corresponding
416position in the completion alternative.
417
418@item emacs22
419This completion style is similar to @code{basic}, except that it
420ignores the text in the minibuffer after point. It is so-named
421because it corresponds to the completion behavior in Emacs 22 and
422earlier.
423@end table
424
425@noindent
426The following additional completion styles are also defined, and you
427can add them to @code{completion-styles} if you wish
428(@pxref{Customization}):
429
430@table @code
431@item substring
432A matching completion alternative must contain the text in the
433minibuffer before point, and the text in the minibuffer after point,
434as substrings (in that same order).
435
436Thus, if the text in the minibuffer is @samp{foobar}, with point
437between @samp{foo} and @samp{bar}, that matches
438@samp{@var{a}foo@var{b}bar@var{c}}, where @var{a}, @var{b}, and
439@var{c} can be any string including the empty string.
440
441@item initials
442This very aggressive completion style attempts to complete acronyms
443and initialisms. For example, when completing command names, it
444matches @samp{lch} to @samp{list-command-history}.
445@end table
446
447@node Completion Options
448@subsection Completion Options
445 449
446@cindex case-sensitivity and completion 450@cindex case-sensitivity and completion
451@cindex case in completion
452 Case is significant when completing case-sensitive arguments, such
453as command names. For example, when completing command names,
454@samp{AU} does not complete to @samp{auto-fill-mode}. Case
455differences are ignored when completing arguments in which case does
456not matter.
457
447@vindex read-file-name-completion-ignore-case 458@vindex read-file-name-completion-ignore-case
448@vindex read-buffer-completion-ignore-case 459@vindex read-buffer-completion-ignore-case
449 When completing file names, Emacs ignores case differences if the 460 When completing file names, case differences are ignored if the
450variable @code{read-file-name-completion-ignore-case} is 461variable @code{read-file-name-completion-ignore-case} is
451non-@code{nil}. The default value is @code{nil} on systems that have 462non-@code{nil}. The default value is @code{nil} on systems that have
452case-sensitive file-names, such as GNU/Linux; it is non-@code{nil} on 463case-sensitive file-names, such as GNU/Linux; it is non-@code{nil} on
453systems that have case-insensitive file-names, such as Microsoft 464systems that have case-insensitive file-names, such as Microsoft
454Windows. When completing buffer names, Emacs ignores case differences 465Windows. When completing buffer names, case differences are ignored
455if @code{read-buffer-completion-ignore-case} is non-@code{nil} (the 466if the variable @code{read-buffer-completion-ignore-case} is
456default value is @code{nil}). 467non-@code{nil}; the default is @code{nil}.
457 468
458@vindex completion-styles 469@vindex completion-ignored-extensions
459 You can customize the matching rules for completion alternatives 470@cindex ignored file names, in completion
460using the variable @code{completion-styles}. Its value should be a 471 When completing file names, Emacs usually omits certain alternatives
461list of symbols, each representing a @dfn{completion style}; valid 472that are considered unlikely to be chosen, as determined by the list
462style symbols are @code{basic}, @code{partial-completion}, 473variable @code{completion-ignored-extensions}. Each element in the
463@code{emacs22}, @code{emacs21}, and @code{initials}. When completing, 474list should be a string; any file name ending in such a string is
464Emacs attempts to use the first completion style in the list; if this 475ignored as a completion alternative. Any element ending in a slash
465does not return any completion alternatives, it tries the next 476(@file{/}) represents a subdirectory name. The standard value of
466completion style in the list, and so on. The completion rules 477@code{completion-ignored-extensions} has several elements including
467described in @ref{Completion Commands} correspond to the default value 478@code{".o"}, @code{".elc"}, and @code{"~"}. For example, if a
468of @code{completion-styles}, which is @code{(basic partial-completion 479directory contains @samp{foo.c} and @samp{foo.elc}, @samp{foo}
469emacs22)}. 480completes to @samp{foo.c}. However, if @emph{all} possible
481completions end in ``ignored'' strings, they are not ignored: in the
482previous example, @samp{foo.e} completes to @samp{foo.elc}. Emacs
483disregards @code{completion-ignored-extensions} when showing
484completion alternatives in the completion list.
485
486@vindex completion-auto-help
487 If @code{completion-auto-help} is set to @code{nil}, the completion
488commands never display the completion list buffer; you must type
489@kbd{?} to display the list. If the value is @code{lazy}, Emacs only
490shows the completion list buffer on the second attempt to complete.
491In other words, if there is nothing to complete, the first @key{TAB}
492echoes @samp{Next char not unique}; the second @key{TAB} does the
493completion list buffer.
494
495@vindex completion-cycle-threshold
496 If @code{completion-cycle-threshold} is non-@code{nil}, completion
497commands can ``cycle'' through completion alternatives. Normally, if
498there is more than one completion alternative for the text in the
499minibuffer, a completion command completes up to the longest common
500substring. If you change @code{completion-cycle-threshold} to
501@code{t}, the completion command instead completes to the first of
502those completion alternatives; each subsequent invocation of the
503completion command replaces that with the next completion alternative,
504in a cyclic manner. If you give @code{completion-cycle-threshold} a
505numeric value @var{n}, completion commands switch to this cycling
506behavior only when there are fewer than @var{n} alternatives.
470 507
471@cindex Icomplete mode 508@cindex Icomplete mode
472@findex icomplete-mode 509@findex icomplete-mode
@@ -504,64 +541,60 @@ Move to a later item in the minibuffer history that matches
504 541
505@kindex M-p @r{(minibuffer history)} 542@kindex M-p @r{(minibuffer history)}
506@kindex M-n @r{(minibuffer history)} 543@kindex M-n @r{(minibuffer history)}
544@kindex UP @r{(minibuffer history)}
545@kindex DOWN @r{(minibuffer history)}
507@findex next-history-element 546@findex next-history-element
508@findex previous-history-element 547@findex previous-history-element
509 While in the minibuffer, typing @kbd{M-p} or @key{Up} 548 While in the minibuffer, @kbd{M-p} or @key{Up}
510(@code{previous-history-element}) moves up through the minibuffer 549(@code{previous-history-element}) moves through the minibuffer history
511history list, one item at a time. Each @kbd{M-p} fetches an earlier 550list, one item at a time. Each @kbd{M-p} fetches an earlier item from
512item from the history list into the minibuffer, replacing its existing 551the history list into the minibuffer, replacing its existing contents.
513contents. Similarly, typing @kbd{M-n} or @key{Down} 552Typing @kbd{M-n} or @key{Down} (@code{next-history-element}) moves
514(@code{next-history-element}) moves back down the history list, 553through the minibuffer history list in the opposite direction,
515fetching later entries into the minibuffer. You can think of these 554fetching later entries into the minibuffer.
516commands as ``backwards'' and ``forwards'' through the history list.
517 555
518 If you type @kbd{M-n} in the minibuffer when there are no later 556 If you type @kbd{M-n} in the minibuffer when there are no later
519entries in the minibuffer history (e.g., if you haven't previously 557entries in the minibuffer history (e.g., if you haven't previously
520typed @kbd{M-p}), Emacs tries fetching from a list of default 558typed @kbd{M-p}), Emacs tries fetching from a list of default
521argument: values that you are likely to enter. You can think of this 559arguments: values that you are likely to enter. You can think of this
522as moving through the ``future list'' instead of the ``history list''. 560as moving through the ``future history'' list.
523 561
524 The input that @kbd{M-p} or @kbd{M-n} fetches into the minibuffer 562 If you edit the text inserted by the @kbd{M-p} or @key{M-n}
525entirely replaces the existing contents of the minibuffer, so you can 563minibuffer history commands, this does not change its entry in the
526simply type @key{RET} to use it as an argument. You can also edit the 564history list. However, the edited argument does go at the end of the
527text before you reuse it; this does not change the history element 565history list when you submit it.
528that you ``moved'' to, but your new argument does go at the end of the
529history list in its own right.
530 566
531@findex previous-matching-history-element 567@findex previous-matching-history-element
532@findex next-matching-history-element 568@findex next-matching-history-element
533@kindex M-r @r{(minibuffer history)} 569@kindex M-r @r{(minibuffer history)}
534@kindex M-s @r{(minibuffer history)} 570@kindex M-s @r{(minibuffer history)}
535 There are also commands to search forward or backward through the 571 You can use @kbd{M-r} (@code{previous-matching-history-element}) to
536history; they search for history elements that match a regular 572search through older elements in the history list, and @kbd{M-s}
537expression. @kbd{M-r} (@code{previous-matching-history-element}) 573(@code{next-matching-history-element}) to search through newer
538searches older elements in the history, while @kbd{M-s} 574entries. Each of these commands asks for a @dfn{regular expression}
539(@code{next-matching-history-element}) searches newer elements. These 575as an argument, and fetches the first matching entry into the
540commands are unusual: they use the minibuffer to read the regular 576minibuffer. @xref{Regexps}, for an explanation of regular
541expression even though they are invoked from the minibuffer. As with 577expressions. A numeric prefix argument @var{n} means to fetch the
542incremental searching, an upper-case letter in the regular expression 578@var{n}th matching entry. These commands are unusual, in that they
543makes the search case-sensitive (@pxref{Search Case}). You can also 579use the minibuffer to read the regular expression argument, even
544search through the history using an incremental search (@pxref{Isearch 580though they are invoked from the minibuffer. An upper-case letter in
545Minibuffer}). 581the regular expression makes the search case-sensitive (@pxref{Search
546 582Case}).
547 All uses of the minibuffer record your input on a history list, but 583
548there are separate history lists for different kinds of arguments. 584 You can also search through the history using an incremental search.
549For example, there is a list for file names, used by all the commands 585@xref{Isearch Minibuffer}.
550that read file names. (As a special feature, this history list 586
551records the absolute file name, even if the name you entered was not 587 Emacs keeps separate history lists for several different kinds of
552absolute.) 588arguments. For example, there is a list for file names, used by all
553 589the commands that read file names. Other history lists include buffer
554 There are several other specific history lists, including one for 590names, command names (used by @kbd{M-x}), and command arguments (used
555buffer names, one for arguments of commands like @code{query-replace}, 591by commands like @code{query-replace}).
556one used by @kbd{M-x} for command names, and one used by
557@code{compile} for compilation commands. Finally, there is one
558``miscellaneous'' history list that most minibuffer arguments use.
559 592
560@vindex history-length 593@vindex history-length
561 The variable @code{history-length} specifies the maximum length of a 594 The variable @code{history-length} specifies the maximum length of a
562minibuffer history list; adding a new element deletes the oldest 595minibuffer history list; adding a new element deletes the oldest
563element if the list gets too long. If the value of 596element if the list gets too long. If the value is @code{t}, there is
564@code{history-length} is @code{t}, there is no maximum length. 597no maximum length.
565 598
566@vindex history-delete-duplicates 599@vindex history-delete-duplicates
567 The variable @code{history-delete-duplicates} specifies whether to 600 The variable @code{history-delete-duplicates} specifies whether to
@@ -592,27 +625,25 @@ Display the entire command history, showing all the commands
592 625
593@kindex C-x ESC ESC 626@kindex C-x ESC ESC
594@findex repeat-complex-command 627@findex repeat-complex-command
595 @kbd{C-x @key{ESC} @key{ESC}} is used to re-execute a recent command 628 @kbd{C-x @key{ESC} @key{ESC}} re-executes a recent command that used
596that used the minibuffer. With no argument, it repeats the last such 629the minibuffer. With no argument, it repeats the last such command.
597command. A numeric argument specifies which command to repeat; 1 630A numeric argument specifies which command to repeat; 1 means the last
598means the last one, 2 the previous, and so on. 631one, 2 the previous, and so on.
599 632
600 @kbd{C-x @key{ESC} @key{ESC}} works by turning the previous command 633 @kbd{C-x @key{ESC} @key{ESC}} works by turning the previous command
601into a Lisp expression and then entering a minibuffer initialized with 634into a Lisp expression and then entering a minibuffer initialized with
602the text for that expression. Even if you don't understand Lisp 635the text for that expression. Even if you don't know Lisp, it will
603syntax, it will probably be obvious which command is displayed for 636probably be obvious which command is displayed for repetition. If you
604repetition. If you type just @key{RET}, that repeats the command 637type just @key{RET}, that repeats the command unchanged. You can also
605unchanged. You can also change the command by editing the Lisp 638change the command by editing the Lisp expression before you execute
606expression before you execute it. The repeated command is added to 639it. The repeated command is added to the front of the command history
607the front of the command history unless it is identical to the most 640unless it is identical to the most recent item.
608recent item. 641
609 642 Once inside the minibuffer for @kbd{C-x @key{ESC} @key{ESC}}, you
610 Once inside the minibuffer for @kbd{C-x @key{ESC} @key{ESC}}, you can 643can use the usual minibuffer history commands (@pxref{Minibuffer
611use the minibuffer history commands (@kbd{M-p}, @kbd{M-n}, @kbd{M-r}, 644History}) to move through the history list. After finding the desired
612@kbd{M-s}; @pxref{Minibuffer History}) to move through the history list 645previous command, you can edit its expression as usual and then repeat
613of saved entire commands. After finding the desired previous command, 646it by typing @key{RET}.
614you can edit its expression as usual and then repeat it by typing
615@key{RET}.
616 647
617@vindex isearch-resume-in-command-history 648@vindex isearch-resume-in-command-history
618 Incremental search does not, strictly speaking, use the minibuffer. 649 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
637protocol such as FTP, you often need to supply a password to gain 668protocol such as FTP, you often need to supply a password to gain
638access to the machine (@pxref{Remote Files}). 669access to the machine (@pxref{Remote Files}).
639 670
640 Entering a password is, in a basic sense, similar to using a 671 Entering a password is similar to using a minibuffer. Emacs
641minibuffer. Emacs displays a prompt in the echo area (such as 672displays a prompt in the echo area (such as @samp{Password: }); after
642@samp{Password: }); after you type the required password, press 673you type the required password, press @key{RET} to submit it. To
643@key{RET} to submit it. To prevent others from seeing your password, 674prevent others from seeing your password, every character you type is
644every character you type is displayed as a dot (@samp{.}) instead of 675displayed as a dot (@samp{.}) instead of its usual form.
645its usual form.
646 676
647 Most of the features and commands associated with the minibuffer can 677 Most of the features and commands associated with the minibuffer can
648@emph{not} be used when entering a password. There is no history or 678@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
1707 1707
1708 Each paragraph of bidirectional text can have its own @dfn{base 1708 Each paragraph of bidirectional text can have its own @dfn{base
1709direction}, either right-to-left or left-to-right. (Paragraph 1709direction}, either right-to-left or left-to-right. (Paragraph
1710boundaries are defined by the regular expressions 1710boundaries are empty lines, i.e.@: lines consisting entirely of
1711@code{paragraph-start} and @code{paragraph-separate}, see 1711whitespace characters.) Text in left-to-right paragraphs begins at
1712@ref{Paragraphs}.) Text in left-to-right paragraphs begins at the 1712the left margin of the window and is truncated or continued when it
1713left margin of the window and is truncated or continued when it
1714reaches the right margin. By contrast, text in right-to-left 1713reaches the right margin. By contrast, text in right-to-left
1715paragraphs begins at the right margin and is continued or truncated at 1714paragraphs begins at the right margin and is continued or truncated at
1716the left margin. 1715the left margin.
@@ -1734,8 +1733,8 @@ The special character @code{RIGHT-TO-LEFT MARK}, or @sc{rlm}, forces
1734the right-to-left direction on the following paragraph, while 1733the right-to-left direction on the following paragraph, while
1735@code{LEFT-TO-RIGHT MARK}, or @sc{lrm} forces the left-to-right 1734@code{LEFT-TO-RIGHT MARK}, or @sc{lrm} forces the left-to-right
1736direction. (You can use @kbd{C-x 8 RET} to insert these characters.) 1735direction. (You can use @kbd{C-x 8 RET} to insert these characters.)
1737In a GUI session, the @sc{lrm} and @sc{rlm} characters display as 1736In a GUI session, the @sc{lrm} and @sc{rlm} characters display as very
1738blanks. 1737thin blank characters; on text terminals they display as blanks.
1739 1738
1740 Because characters are reordered for display, Emacs commands that 1739 Because characters are reordered for display, Emacs commands that
1741operate in the logical order or on stretches of buffer positions may 1740operate 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
332commands to move over them and operate on them. 332commands to move over them and operate on them.
333 333
334@table @kbd 334@table @kbd
335@item M-x what-page
336Display the page number of point, and the line number within that page.
335@item C-x [ 337@item C-x [
336Move point to previous page boundary (@code{backward-page}). 338Move point to previous page boundary (@code{backward-page}).
337@item C-x ] 339@item C-x ]
@@ -342,6 +344,10 @@ Put point and mark around this page (or another page) (@code{mark-page}).
342Count the lines in this page (@code{count-lines-page}). 344Count the lines in this page (@code{count-lines-page}).
343@end table 345@end table
344 346
347@findex what-page
348 @kbd{M-x what-page} counts pages from the beginning of the file, and
349counts lines within the page, showing both numbers in the echo area.
350
345@kindex C-x [ 351@kindex C-x [
346@kindex C-x ] 352@kindex C-x ]
347@findex forward-page 353@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 @@
12011-10-11 Martin Rudalics <rudalics@gmx.at>
2
3 * windows.texi (Deleting Windows): Mention which window gets
4 selected when deleting the selected window.
5
62011-10-09 Martin Rudalics <rudalics@gmx.at>
7
8 * buffers.texi (The Buffer List): Describe how bury-buffer deals
9 with the selected window.
10 * windows.texi (Buffers and Windows): Reformulate text on how
11 replace-buffer-in-windows deals with a window.
12 (Quitting Windows): Describe how quit-window deals with a
13 standalone frame. Describe new option frame-auto-hide-function.
14
152011-10-08 Glenn Morris <rgm@gnu.org>
16
17 * symbols.texi (Other Plists): Markup fix. (Bug#9702)
18
19 * positions.texi (Excursions): Update warning message.
20
12011-10-05 Chong Yidong <cyd@stupidchicken.com> 212011-10-05 Chong Yidong <cyd@stupidchicken.com>
2 22
3 * display.texi (Low-Level Font, Face Attributes, Font Lookup): Fix 23 * 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
884@code{other-buffer} to return. The argument can be either a buffer 884@code{other-buffer} to return. The argument can be either a buffer
885itself or the name of one. 885itself or the name of one.
886 886
887@code{bury-buffer} operates on each frame's @code{buffer-list} parameter 887This functions operates on each frame's @code{buffer-list} parameter as
888as well as the fundamental buffer list; therefore, the buffer that you 888well as the fundamental buffer list; therefore, the buffer that you bury
889bury will come last in the value of @code{(buffer-list @var{frame})} and 889will come last in the value of @code{(buffer-list @var{frame})} and in
890in the value of @code{(buffer-list)}. 890the value of @code{(buffer-list)}. In addition, it also puts the buffer
891 891at the end of the list of buffer of the selected window (@pxref{Window
892If @var{buffer-or-name} is @code{nil} or omitted, this means to bury 892History}) provided it is shown in that window.
893the current buffer. In addition, if the buffer is displayed in the 893
894selected window, this switches to some other buffer (obtained using 894If @var{buffer-or-name} is @code{nil} or omitted, this means to bury the
895@code{other-buffer}) in the selected window. @xref{Switching 895current buffer. In addition, if the current buffer is displayed in the
896Buffers}. But if the selected window is dedicated to its buffer, it 896selected window, this makes sure that the window is either deleted or
897deletes that window if there are other windows left on its frame. 897another buffer is shown in it. More precisely, if the window is
898Otherwise, if the selected window is the only window on its frame, it 898dedicated (@pxref{Dedicated Windows}) and there are other windows on its
899iconifies that frame. If @var{buffer-or-name} is displayed in some 899frame, the window is deleted. If the window is both dedicated and the
900only window on its frame's terminal, the function specified by
901@code{frame-auto-hide-function} (@pxref{Quitting Windows}) will deal
902with the window. If the window is not dedicated to its buffer, it calls
903@code{switch-to-prev-buffer} (@pxref{Window History}) to show another
904buffer in that window. If @var{buffer-or-name} is displayed in some
900other window, it remains displayed there. 905other window, it remains displayed there.
901 906
902To replace a buffer in all the windows that display it, use 907To replace a buffer in all the windows that display it, use
903@code{replace-buffer-in-windows}. @xref{Buffers and Windows}. 908@code{replace-buffer-in-windows}, @xref{Buffers and Windows}.
904@end deffn 909@end deffn
905 910
906@deffn Command unbury-buffer 911@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}
832during an excursion: 832during an excursion:
833 833
834@example 834@example
835Warning: @code{save-excursion} defeated by @code{set-buffer} 835Warning: Use `with-current-buffer' rather than save-excursion+set-buffer
836@end example 836@end example
837 837
838@noindent 838@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,
541(plist-get '(foo 4 bad) 'foo) 541(plist-get '(foo 4 bad) 'foo)
542 @result{} 4 542 @result{} 4
543(plist-get '(foo 4 bad) 'bad) 543(plist-get '(foo 4 bad) 'bad)
544 @result{} @code{nil} 544 @result{} nil
545(plist-get '(foo 4 bad) 'bar) 545(plist-get '(foo 4 bad) 'bar)
546 @result{} nil 546 @result{} nil
547@end example 547@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}.
1608The argument @var{window} can denote any window and defaults to the 1608The argument @var{window} can denote any window and defaults to the
1609selected one. An error is signaled if @var{window} is the only window 1609selected one. An error is signaled if @var{window} is the only window
1610on its frame. Hence @var{window} must have at least one sibling window 1610on its frame. Hence @var{window} must have at least one sibling window
1611(@pxref{Windows and Frames}) in order to get deleted. 1611(@pxref{Windows and Frames}) in order to get deleted. If @var{window}
1612is the selected window on its frame, this function selects the most
1613recently selected live window on that frame instead.
1612 1614
1613If the variable @code{ignore-window-parameters} (@pxref{Window 1615If the variable @code{ignore-window-parameters} (@pxref{Window
1614Parameters}) is non-@code{nil}, this function ignores all parameters of 1616Parameters}) is non-@code{nil}, this function ignores all parameters of
@@ -1629,7 +1631,8 @@ combination.
1629@deffn Command delete-other-windows &optional window 1631@deffn Command delete-other-windows &optional window
1630This function makes @var{window} fill its frame and returns @code{nil}. 1632This function makes @var{window} fill its frame and returns @code{nil}.
1631The argument @var{window} can denote an arbitrary window and defaults to 1633The argument @var{window} can denote an arbitrary window and defaults to
1632the selected one. 1634the selected one. Upon exit, @var{window} will be the selected window
1635on its frame.
1633 1636
1634If the variable @code{ignore-window-parameters} (@pxref{Window 1637If the variable @code{ignore-window-parameters} (@pxref{Window
1635Parameters}) is non-@code{nil}, this function ignores all parameters of 1638Parameters}) 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
2076all windows displaying it. For each such window, it choose another 2079all windows displaying it. For each such window, it choose another
2077buffer using @code{switch-to-prev-buffer} (@pxref{Window History}). 2080buffer using @code{switch-to-prev-buffer} (@pxref{Window History}).
2078 2081
2079@var{buffer-or-name} may be a buffer, or the name of an existing 2082The argument @var{buffer-or-name} may be a buffer, or the name of an
2080buffer; it defaults to the current buffer. 2083existing buffer; it defaults to the current buffer.
2081 2084
2082If a window displaying @var{buffer-or-name} is dedicated 2085If a window displaying @var{buffer-or-name} is dedicated
2083(@pxref{Dedicated Windows}), has never displayed any other buffers and 2086(@pxref{Dedicated Windows}) and is not the only window on its frame,
2084is not the only window on its frame, that window is deleted. If that 2087that window is deleted. If that window is the only window on its frame
2085window is the only window on its frame and there are other frames on the 2088and there are other frames on the frame's terminal, that frame is dealt
2086frame's terminal, that frame is deleted too; otherwise, the buffer 2089with by the function spcecified by @code{frame-auto-hide-function}
2087provided by the function @code{switch-to-prev-buffer} (@pxref{Window 2090(@pxref{Quitting Windows}). Otherwise, the buffer provided by the
2088History}) is displayed instead. 2091function @code{switch-to-prev-buffer} (@pxref{Window History}) is
2092displayed in the window instead.
2089@end deffn 2093@end deffn
2090 2094
2091 2095
@@ -2784,14 +2788,14 @@ non-@code{nil} value.
2784@section Quitting Windows 2788@section Quitting Windows
2785 2789
2786When you want to get rid of a window used for displaying a buffer you 2790When you want to get rid of a window used for displaying a buffer you
2787can use the function @code{delete-window} (@pxref{Deleting Windows}) to 2791can call @code{delete-window} or @code{delete-windows-on}
2788remove that window from its frame. If the buffer has been shown on a 2792(@pxref{Deleting Windows}) to remove that window from its frame. If the
2789separate frame, you might want to call @code{delete-frame} 2793buffer is shown on a separate frame, you might want to call
2790(@pxref{Deleting Frames}) instead. If, on the other hand, a window has 2794@code{delete-frame} (@pxref{Deleting Frames}) instead. If, on the other
2791been reused for displaying the buffer, you might prefer showing the 2795hand, a window has been reused for displaying the buffer, you might
2792buffer previously shown in that window by calling the function 2796prefer showing the buffer previously shown in that window by calling the
2793@code{switch-to-prev-buffer} (@pxref{Window History}). Finally, you 2797function @code{switch-to-prev-buffer} (@pxref{Window History}).
2794might want to either bury (@pxref{The Buffer List}) or kill 2798Finally, you might want to either bury (@pxref{The Buffer List}) or kill
2795(@pxref{Killing Buffers}) the window's buffer. 2799(@pxref{Killing Buffers}) the window's buffer.
2796 2800
2797 The following function uses information on how the window for 2801 The following function uses information on how the window for
@@ -2807,9 +2811,12 @@ instead of burying it.
2807Quitting @var{window} means to proceed as follows: If @var{window} was 2811Quitting @var{window} means to proceed as follows: If @var{window} was
2808created specially for displaying its current buffer, delete @var{window} 2812created specially for displaying its current buffer, delete @var{window}
2809provided its frame contains at least one other live window. If 2813provided its frame contains at least one other live window. If
2810@var{window} is the only window on its frame and other frames still 2814@var{window} is the only window on its frame and there are other frames
2811exist, delete the frame together with @var{window}. If, however, there 2815on the frame's terminal, the value of @var{kill} determines how to
2812are no other frames left, display some other buffer in @var{window}. 2816proceed with the window. If @var{kill} is @code{nil}, the fate of the
2817frame is determined by calling @code{frame-auto-hide-function} (see
2818below) with that frame as sole argument. If @var{kill} is
2819non-@code{nil}, the frame is deleted unconditionally.
2813 2820
2814If @var{window} was reused for displaying its buffer, this command tries 2821If @var{window} was reused for displaying its buffer, this command tries
2815to display the buffer previously shown in it. It also tries to restore 2822to 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
2831(@pxref{Window Parameters}) and resets that parameter to @code{nil} 2838(@pxref{Window Parameters}) and resets that parameter to @code{nil}
2832after it's done. 2839after it's done.
2833 2840
2841The following option specifies how to deal with a frame containing just
2842one window that shall be either quit or whose buffer shall be buried.
2843
2844@defopt frame-auto-hide-function
2845The function specified by this option is called to automatically hide
2846frames. This function is called with one argument - a frame.
2847
2848The function specified here is called by @code{bury-buffer} (@pxref{The
2849Buffer List}) when the selected window is dedicated and shows the buffer
2850that shall be buried. It is also called by @code{quit-window} (see
2851above) when the frame of the window that shall be quit has been
2852specially created for displaying that window's buffer and the buffer
2853shall be buried.
2854
2855The default is to call @code{iconify-frame} (@pxref{Visibility of
2856Frames}). Alternatively, you may either specify @code{delete-frame}
2857(@pxref{Deleting Frames}) to remove the frame from its display,
2858@code{ignore} to leave the frame unchanged, or any other function that
2859can take a frame as its sole argument.
2860
2861Note that the function specified by this option is called if and only if
2862there's at least one other frame on the terminal of the frame it's
2863supposed to handle and that frame contains only one live window.
2864@end defopt
2865
2834 2866
2835@node Window Point 2867@node Window Point
2836@section Windows and Point 2868@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 @@
12011-10-12 Glenn Morris <rgm@gnu.org>
2
3 * ert.texi: Whitespace trivia to make main menu items line up better.
4
52011-10-08 Glenn Morris <rgm@gnu.org>
6
7 * Makefile.in: Fix ert rules.
8
12011-10-06 Lars Magne Ingebrigtsen <larsi@gnus.org> 92011-10-06 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 10
3 * gnus.texi (Gnus Utility Functions): Add more references and 11 * 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
370 $(ENVADD) $(TEXI2PDF) $< 370 $(ENVADD) $(TEXI2PDF) $<
371 371
372ert : $(infodir)/ert 372ert : $(infodir)/ert
373$(infodir)/ert: ert.texi $(infodir) 373$(infodir)/ert: ert.texi
374 cd $(srcdir); $(MAKEINFO) ert.texi 374 $(mkinfodir)
375ert.dvi: ert.texi 375 cd $(srcdir); $(MAKEINFO) $(MAKEINFO_OPTS) $<
376 $(ENVADD) $(TEXI2DVI) ${srcdir}/ert.texi 376ert.dvi: ${srcdir}/ert.texi
377ert.pdf: ert.texi 377 $(ENVADD) $(TEXI2DVI) $<
378 $(ENVADD) $(TEXI2PDF) ${srcdir}/ert.texi 378ert.pdf: ${srcdir}/ert.texi
379 $(ENVADD) $(TEXI2PDF) $<
379 380
380eshell : $(infodir)/eshell 381eshell : $(infodir)/eshell
381$(infodir)/eshell: eshell.texi 382$(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.
48 48
49@menu 49@menu
50* Introduction:: A simple example of an ERT test. 50* Introduction:: A simple example of an ERT test.
51* How to Run Tests:: Run tests in your Emacs or from the command line. 51* How to Run Tests:: Run tests in Emacs or from the command line.
52* How to Write Tests:: How to add tests to your Emacs Lisp code. 52* How to Write Tests:: How to add tests to your Emacs Lisp code.
53* How to Debug Tests:: What to do if a test fails. 53* How to Debug Tests:: What to do if a test fails.
54* Extending ERT:: ERT is extensible in several ways. 54* Extending ERT:: ERT is extensible in several ways.
@@ -61,13 +61,13 @@ How to Run Tests
61 61
62* Running Tests Interactively:: Run tests in your current Emacs. 62* Running Tests Interactively:: Run tests in your current Emacs.
63* Running Tests in Batch Mode:: Run tests in emacs -Q. 63* Running Tests in Batch Mode:: Run tests in emacs -Q.
64* Test Selectors:: Choose which tests to run. 64* Test Selectors:: Choose which tests to run.
65 65
66How to Write Tests 66How to Write Tests
67 67
68* The @code{should} Macro:: A powerful way to express assertions. 68* The @code{should} Macro:: A powerful way to express assertions.
69* Expected Failures:: Tests for known bugs. 69* Expected Failures:: Tests for known bugs.
70* Tests and Their Environment:: Don't depend on customizations; no side effects. 70* Tests and Their Environment:: Don't depend on customizations; no side effects.
71* Useful Techniques:: Some examples. 71* Useful Techniques:: Some examples.
72 72
73How to Debug Tests 73How to Debug Tests
diff --git a/etc/NEWS b/etc/NEWS
index 2c48a30e5f6..8095cd964f6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -100,25 +100,18 @@ and also when HOME is set to C:\ by default.
100rather than their own completion code. 100rather than their own completion code.
101 101
102*** `completion-at-point' now handles tags and semantic completion. 102*** `completion-at-point' now handles tags and semantic completion.
103 103---
104*** Completion in a non-minibuffer now tries to detect the end of completion 104*** Completion in a non-minibuffer now tries to detect the end of completion
105and pops down the *Completions* buffer accordingly. 105and pops down the *Completions* buffer accordingly.
106 106+++
107*** Completion can cycle, depending on completion-cycle-threshold. 107*** Completion can cycle, depending on completion-cycle-threshold.
108 108+++
109*** New completion style `substring'. 109*** New completion style `substring'.
110 110
111*** Completion style can be set per-category `completion-category-overrides'. 111*** Completion style can be set per-category `completion-category-overrides'.
112 112
113*** Completion of buffers now uses substring completion by default. 113*** Completion of buffers now uses substring completion by default.
114 114
115*** `completing-read' can be customized using the new variable
116`completing-read-function'.
117
118*** minibuffer-local-filename-must-match-map is not used any more.
119Instead, the bindings in minibuffer-local-filename-completion-map are combined
120with minibuffer-local-must-match-map.
121
122** Mail changes 115** Mail changes
123 116
124The default of `send-mail-function' is now `sendmail-query-once', 117The default of `send-mail-function' is now `sendmail-query-once',
@@ -455,7 +448,10 @@ isearch-yank-kill.
455*** M-s C-e in Isearch is now bound to isearch-yank-line. 448*** M-s C-e in Isearch is now bound to isearch-yank-line.
456 449
457+++ 450+++
458** New command `count-words-region'. This does what you expect. 451** New commands `count-words-region' and `count-words'.
452
453*** `count-lines-region' is now an alias for `count-words-region',
454bound to M-=, which shows the number of lines, words, and characters.
459 455
460** The default value of `backup-by-copying-when-mismatch' is now t. 456** The default value of `backup-by-copying-when-mismatch' is now t.
461 457
@@ -1063,6 +1059,10 @@ been introduced. This and all other functions for resizing windows no
1063longer delete any windows when they become too small. 1059longer delete any windows when they become too small.
1064 1060
1065+++ 1061+++
1062*** Deleting the selected window now selects the most recently selected
1063live window on that frame instead.
1064
1065+++
1066*** `adjust-window-trailing-edge' adjustments. 1066*** `adjust-window-trailing-edge' adjustments.
1067`adjust-window-trailing-edge' can now deal with fixed-size windows and 1067`adjust-window-trailing-edge' can now deal with fixed-size windows and
1068is able to resize other windows if a window adjacent to the trailing 1068is able to resize other windows if a window adjacent to the trailing
@@ -1110,6 +1110,11 @@ See the docstring of `display-buffer' for details.
1110The behavior of `quit-window' has been changed in order to restore the 1110The behavior of `quit-window' has been changed in order to restore the
1111state before the last buffer display operation in that window. 1111state before the last buffer display operation in that window.
1112 1112
1113+++
1114*** The new option `frame-auto-hide-function' lets you choose between
1115iconfying or deleting a frame when burying a buffer shown in a dedicated
1116frame or quitting a window showing a buffer in a frame of its own.
1117
1113** Completion 1118** Completion
1114 1119
1115*** New variable completion-extra-properties used to specify extra properties 1120*** 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':
1130- `display-sort-function' to specify how to sort entries in *Completions*. 1135- `display-sort-function' to specify how to sort entries in *Completions*.
1131- `cycle-sort-function' to specify how to sort entries when cycling. 1136- `cycle-sort-function' to specify how to sort entries when cycling.
1132 1137
1138*** minibuffer-local-filename-must-match-map is not used any more.
1139Instead, the bindings in minibuffer-local-filename-completion-map are
1140combined with minibuffer-local-must-match-map.
1141
1142*** New variable `completing-read-function' allows overriding the
1143behavior of `completing-read'.
1144
1133** `glyphless-char-display' can now distinguish between graphical and 1145** `glyphless-char-display' can now distinguish between graphical and
1134text terminal display, via a char-table entry that is a cons cell. 1146text terminal display, via a char-table entry that is a cons cell.
1135 1147
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fdc61721a13..58a038676e7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,88 @@
12011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * textmodes/flyspell.el (flyspell-word): Move with-local-quit
4 from here...
5 (flyspell-post-command-hook): ...to here.
6
72011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8
9 * mail/sendmail.el (send-mail-function): Don't use sendmail-query-once
10 if not needed.
11 (sendmail-query-once): Remove OS dependencies. Make it a 3-way choice
12 using completion. Protect against "slow" callers.
13 Remove the "message hack".
14
152011-10-11 Juri Linkov <juri@jurta.org>
16
17 * isearch.el (isearch-lazy-highlight-word): New variable.
18 (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-search):
19 Use it. (Bug#9727)
20
212011-10-11 Glenn Morris <rgm@gnu.org>
22
23 * progmodes/f90.el (f90-next-statement): Ignore preprocessor lines,
24 like f90-previous-statement does.
25
262011-10-11 Thierry Volpiatto <thierry.volpiatto@gmail.com>
27
28 * eshell/eshell.el (eshell-command): History should be saved
29 only in interactive use, to avoid error.
30
312011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
32
33 * minibuffer.el (completion-file-name-table): Fix last change,
34 i.e. ignore normal errors but not the other ones.
35
362011-10-10 Martin Rudalics <rudalics@gmx.at>
37
38 * window.el (special-display-buffer-names)
39 (special-display-regexps): Remove some remnants of earlier
40 changes from doc-strings.
41 (quit-windows-on): New function.
42
43 * vc/vc.el (vc-revert, vc-rollback):
44 * vc/vc-dispatcher.el (vc-finish-logentry): Call quit-windows-on
45 instead of deleting windows. (Bug#4557) (Bug#5310) (Bug#5556)
46 (Bug#6183) (Bug#7074) (Bug#7447)
47
482011-10-09 Martin Rudalics <rudalics@gmx.at>
49
50 * window.el (frame-auto-hide-function): Add version tag.
51 (Bug#9699)
52
532011-10-09 Michael Albinus <michael.albinus@gmx.de>
54
55 * net/tramp.el (tramp-file-name-handler): Add 'debug to the error
56 condition.
57
582011-10-09 Leo Liu <sdl.web@gmail.com>
59
60 * mail/smtpmail.el (smtpmail-send-data): Add a missing space.
61 (Bug#9701)
62
632011-10-08 Glenn Morris <rgm@gnu.org>
64
65 * progmodes/f90.el (f90-calculate-indent): Give preprocessor lines
66 before the first code statement zero indent. (Bug#9690)
67
682011-10-08 Chong Yidong <cyd@stupidchicken.com>
69
70 * simple.el (count-words-region): Always count in the region.
71 Report the number of lines and characters too.
72 (count-words): New command, which counts in the buffer if the
73 region is inactive, as count-words-region used to.
74 (count-words--message): New function. Handle plurals.
75 (count-lines-region): Make it an alias for count-words-region.
76
77 * bindings.el (esc-map): Replace count-lines-region with
78 count-words-region.
79
802011-10-08 Martin Rudalics <rudalics@gmx.at>
81
82 * window.el (window--delete): Delete dedicated frame
83 unconditionally when argument KILL is non-nil. (Bug#9699)
84 (switch-to-buffer): Fix doc-string typo.
85
12011-10-08 Thierry Volpiatto <thierry.volpiatto@gmail.com> 862011-10-08 Thierry Volpiatto <thierry.volpiatto@gmail.com>
2 87
3 * lisp/eshell/eshell.el (eshell-command): Avoid using hooks. 88 * 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."
773(define-key ctl-x-map "\C-o" 'delete-blank-lines) 773(define-key ctl-x-map "\C-o" 'delete-blank-lines)
774(define-key esc-map " " 'just-one-space) 774(define-key esc-map " " 'just-one-space)
775(define-key esc-map "z" 'zap-to-char) 775(define-key esc-map "z" 'zap-to-char)
776(define-key esc-map "=" 'count-lines-region) 776(define-key esc-map "=" 'count-words-region)
777(define-key ctl-x-map "=" 'what-cursor-position) 777(define-key ctl-x-map "=" 'what-cursor-position)
778(define-key esc-map ":" 'eval-expression) 778(define-key esc-map ":" 'eval-expression)
779;; Define ESC ESC : like ESC : for people who type ESC ESC out of habit. 779;; 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."
349 (minibuffer-with-setup-hook #'(lambda () 349 (minibuffer-with-setup-hook #'(lambda ()
350 (eshell-mode) 350 (eshell-mode)
351 (eshell-return-exits-minibuffer)) 351 (eshell-return-exits-minibuffer))
352 (unwind-protect 352 (unless command
353 (unless command 353 (setq command (read-from-minibuffer "Emacs shell command: "))
354 (setq command (read-from-minibuffer "Emacs shell command: "))) 354 (eshell-add-input-to-history command))))
355 (when command
356 (eshell-add-input-to-history command)))))
357 (unless command 355 (unless command
358 (error "No command specified!")) 356 (error "No command specified!"))
359 ;; redirection into the current buffer is achieved by adding an 357 ;; 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 @@
12011-10-11 Andreas Schwab <schwab@linux-m68k.org>
2
3 * html2text.el (html2text-clean-anchor): Check for quotes around
4 `href' value.
5
62011-10-11 Teodor Zlatanov <tzz@lifelogs.com>
7
8 * spam.el (spam-check-BBDB): Simplify and support BBDB 3.x when
9 searching. Drop `bbdb-cache'.
10
112011-10-11 Katsumi Yamaoka <yamaoka@jpl.org>
12
13 * message.el (message-signed-or-encrypted-p): Exclude header when
14 checking if there is signed or encrypted body in text/plain message.
15
162011-10-09 Andreas Schwab <schwab@linux-m68k.org>
17
18 * html2text.el (html2text-get-attr): Correctly handle attribute values
19 containing "=".
20
12011-09-22 Kan-Ru Chen <kanru@kanru.info> 212011-09-22 Kan-Ru Chen <kanru@kanru.info>
2 22
3 * ecomplete.el (ecomplete-display-matches): Use a local keymap to 23 * 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.")
193 ;; size=3 193 ;; size=3
194 ((string-match "[^ ]=[^ ]" prev) 194 ((string-match "[^ ]=[^ ]" prev)
195 (let ((attr (nth 0 (split-string prev "="))) 195 (let ((attr (nth 0 (split-string prev "=")))
196 (value (nth 1 (split-string prev "=")))) 196 (value (substring prev (1+ (string-match "=" prev)))))
197 (setq attr-list (cons (list attr value) attr-list)))) 197 (setq attr-list (cons (list attr value) attr-list))))
198 ;; size= 3 198 ;; size= 3
199 ((string-match "[^ ]=\\'" prev) 199 ((string-match "[^ ]=\\'" prev)
@@ -204,7 +204,7 @@ formatting, and then moved afterward.")
204 ;; size=3 204 ;; size=3
205 ((string-match "[^ ]=[^ ]" this) 205 ((string-match "[^ ]=[^ ]" this)
206 (let ((attr (nth 0 (split-string this "="))) 206 (let ((attr (nth 0 (split-string this "=")))
207 (value (nth 1 (split-string this "=")))) 207 (value (substring prev (1+ (string-match "=" this)))))
208 (setq attr-list (cons (list attr value) attr-list)))) 208 (setq attr-list (cons (list attr value) attr-list))))
209 ;; size =3 209 ;; size =3
210 ((string-match "\\`=[^ ]" this) 210 ((string-match "\\`=[^ ]" this)
@@ -358,7 +358,8 @@ formatting, and then moved afterward.")
358 (delete-region p1 p4) 358 (delete-region p1 p4)
359 (when href 359 (when href
360 (goto-char p1) 360 (goto-char p1)
361 (insert (substring href 1 -1 )) 361 (insert (if (string-match "\\`['\"].*['\"]\\'" href)
362 (substring href 1 -1) href))
362 (put-text-property p1 (point) 'face 'bold)))) 363 (put-text-property p1 (point) 'face 'bold))))
363 364
364;; 365;;
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."
7429 (with-temp-buffer 7429 (with-temp-buffer
7430 (insert-buffer-substring cur) 7430 (insert-buffer-substring cur)
7431 (when (setq handles (mm-dissect-buffer t t)) 7431 (when (setq handles (mm-dissect-buffer t t))
7432 (if (and (prog1 7432 (if (and (bufferp (car handles))
7433 (bufferp (car handles))
7434 (mm-destroy-parts handles))
7435 (equal (mm-handle-media-type handles) "text/plain")) 7433 (equal (mm-handle-media-type handles) "text/plain"))
7436 (progn 7434 (progn
7435 (erase-buffer)
7436 (insert-buffer-substring (car handles))
7437 (mm-decode-content-transfer-encoding 7437 (mm-decode-content-transfer-encoding
7438 (mm-handle-encoding handles)) 7438 (mm-handle-encoding handles))
7439 (mm-destroy-parts handles)
7439 (setq handles (mm-uu-dissect))) 7440 (setq handles (mm-uu-dissect)))
7441 (mm-destroy-parts handles)
7440 (setq handles nil)))))) 7442 (setq handles nil))))))
7441 (when handles 7443 (when handles
7442 (prog1 7444 (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."
2150 2150
2151 (defun spam-check-BBDB () 2151 (defun spam-check-BBDB ()
2152 "Mail from people in the BBDB is classified as ham or non-spam" 2152 "Mail from people in the BBDB is classified as ham or non-spam"
2153 (let ((who (message-fetch-field "from")) 2153 (let ((who (message-fetch-field "from")))
2154 bbdb-cache bbdb-hashtable)
2155 (when spam-cache-lookups
2156 (setq bbdb-cache (gethash 'spam-use-BBDB spam-caches))
2157 (unless bbdb-cache
2158 (setq bbdb-cache (make-vector 17 0)) ; a good starting hash value
2159 ;; this is based on the expanded (bbdb-hashtable) macro
2160 ;; without the debugging support
2161 (with-current-buffer (bbdb-buffer)
2162 (save-excursion
2163 (save-window-excursion
2164 (bbdb-records nil t)
2165 (mapatoms
2166 (lambda (symbol)
2167 (intern (downcase (symbol-name symbol)) bbdb-cache))
2168 bbdb-hashtable))))
2169 (puthash 'spam-use-BBDB bbdb-cache spam-caches)))
2170 (when who 2154 (when who
2171 (setq who (nth 1 (gnus-extract-address-components who))) 2155 (setq who (nth 1 (gnus-extract-address-components who)))
2172 (if 2156 (if
2173 (if spam-cache-lookups 2157 (if (fboundp 'bbdb-search)
2174 (intern-soft (downcase who) bbdb-cache) 2158 (bbdb-search (bbdb-records) who) ;; v3
2175 (bbdb-search-simple nil who)) 2159 (bbdb-search-simple nil who)) ;; v2
2176 t 2160 t
2177 (if spam-use-BBDB-exclusive 2161 (if spam-use-BBDB-exclusive
2178 spam-split-group 2162 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."
2617(defvar isearch-lazy-highlight-case-fold-search nil) 2617(defvar isearch-lazy-highlight-case-fold-search nil)
2618(defvar isearch-lazy-highlight-regexp nil) 2618(defvar isearch-lazy-highlight-regexp nil)
2619(defvar isearch-lazy-highlight-space-regexp nil) 2619(defvar isearch-lazy-highlight-space-regexp nil)
2620(defvar isearch-lazy-highlight-word nil)
2620(defvar isearch-lazy-highlight-forward nil) 2621(defvar isearch-lazy-highlight-forward nil)
2621(defvar isearch-lazy-highlight-error nil) 2622(defvar isearch-lazy-highlight-error nil)
2622 2623
@@ -2655,6 +2656,8 @@ by other Emacs features."
2655 isearch-case-fold-search)) 2656 isearch-case-fold-search))
2656 (not (eq isearch-lazy-highlight-regexp 2657 (not (eq isearch-lazy-highlight-regexp
2657 isearch-regexp)) 2658 isearch-regexp))
2659 (not (eq isearch-lazy-highlight-word
2660 isearch-word))
2658 (not (= (window-start) 2661 (not (= (window-start)
2659 isearch-lazy-highlight-window-start)) 2662 isearch-lazy-highlight-window-start))
2660 (not (= (window-end) ; Window may have been split/joined. 2663 (not (= (window-end) ; Window may have been split/joined.
@@ -2675,11 +2678,12 @@ by other Emacs features."
2675 isearch-lazy-highlight-window-end (window-end) 2678 isearch-lazy-highlight-window-end (window-end)
2676 isearch-lazy-highlight-start (point) 2679 isearch-lazy-highlight-start (point)
2677 isearch-lazy-highlight-end (point) 2680 isearch-lazy-highlight-end (point)
2681 isearch-lazy-highlight-wrapped nil
2678 isearch-lazy-highlight-last-string isearch-string 2682 isearch-lazy-highlight-last-string isearch-string
2679 isearch-lazy-highlight-case-fold-search isearch-case-fold-search 2683 isearch-lazy-highlight-case-fold-search isearch-case-fold-search
2680 isearch-lazy-highlight-regexp isearch-regexp 2684 isearch-lazy-highlight-regexp isearch-regexp
2681 isearch-lazy-highlight-wrapped nil
2682 isearch-lazy-highlight-space-regexp search-whitespace-regexp 2685 isearch-lazy-highlight-space-regexp search-whitespace-regexp
2686 isearch-lazy-highlight-word isearch-word
2683 isearch-lazy-highlight-forward isearch-forward) 2687 isearch-lazy-highlight-forward isearch-forward)
2684 (unless (equal isearch-string "") 2688 (unless (equal isearch-string "")
2685 (setq isearch-lazy-highlight-timer 2689 (setq isearch-lazy-highlight-timer
@@ -2693,6 +2697,7 @@ Attempt to do the search exactly the way the pending Isearch would."
2693 (let ((case-fold-search isearch-lazy-highlight-case-fold-search) 2697 (let ((case-fold-search isearch-lazy-highlight-case-fold-search)
2694 (isearch-regexp isearch-lazy-highlight-regexp) 2698 (isearch-regexp isearch-lazy-highlight-regexp)
2695 (search-spaces-regexp isearch-lazy-highlight-space-regexp) 2699 (search-spaces-regexp isearch-lazy-highlight-space-regexp)
2700 (isearch-word isearch-lazy-highlight-word)
2696 (search-invisible nil) ; don't match invisible text 2701 (search-invisible nil) ; don't match invisible text
2697 (retry t) 2702 (retry t)
2698 (success nil) 2703 (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."
140 140
141;; Useful to set in site-init.el 141;; Useful to set in site-init.el
142;;;###autoload 142;;;###autoload
143(defcustom send-mail-function 'sendmail-query-once 143(defcustom send-mail-function
144 ;; Assume smtpmail is the preferred choice if it's already configured.
145 (if (and (boundp 'smtpmail-smtp-server)
146 smtpmail-smtp-server)
147 'smtpmail-send-it 'sendmail-query-once)
144 "Function to call to send the current buffer as mail. 148 "Function to call to send the current buffer as mail.
145The headers should be delimited by a line which is 149The headers should be delimited by a line which is
146not a valid RFC822 header or continuation line, 150not a valid RFC822 header or continuation line,
@@ -505,46 +509,33 @@ by Emacs.)")
505(defun sendmail-query-once () 509(defun sendmail-query-once ()
506 "Query for `send-mail-function' and send mail with it. 510 "Query for `send-mail-function' and send mail with it.
507This also saves the value of `send-mail-function' via Customize." 511This also saves the value of `send-mail-function' via Customize."
508 (let* ((mail-buffer (current-buffer)) 512 ;; If send-mail-function is already setup, we're incorrectly called
509 ;; Compute default mail sender, preferring smtpmail if it's 513 ;; a second time, probably because someone's using an old value
510 ;; already configured. 514 ;; of send-mail-function.
511 (default (cond 515 (when (eq send-mail-function 'sendmail-query-once)
512 ((and (boundp 'smtpmail-smtp-server) 516 (let* ((options `(("My favorite mail client" . mailclient-send-it)
513 smtpmail-smtp-server) 517 ("Configuring Emacs's SMTP variables" . smtpmail-send-it)
514 'smtpmail-send-it) 518 ,@(when (and sendmail-program
515 ((or (and window-system (eq system-type 'darwin)) 519 (executable-find sendmail-program))
516 (eq system-type 'windows-nt)) 520 '(("The system's mail transport agent"
517 'mailclient-send-it) 521 . sendmail-send-it)))))
518 ((and sendmail-program 522 (choice
519 (executable-find sendmail-program)) 523 ;; Query the user.
520 'sendmail-send-it))) 524 (with-temp-buffer
521 (send-function (if (eq default 'smtpmail-send-it) 525 (rename-buffer "*Mail Help*" t)
522 'smtpmail-send-it))) 526 (insert "Emacs has not been set up for sending mail.\n
523 (unless send-function 527It can be told to send mail either via your favorite mail client,
524 ;; Query the user. 528or via the system's mail transport agent (\"sendmail\"), if any,
525 (with-temp-buffer 529or it can send email on its own by configuring the SMTP parameters.\n
526 (rename-buffer "*Mail Help*" t)
527 (erase-buffer)
528 (insert "Emacs has not been set up for sending mail.\n
529Type `y' to configure and use Emacs as a mail client,
530or `n' to use your system's default mailer.\n
531To change your decision later, customize `send-mail-function'.\n") 530To change your decision later, customize `send-mail-function'.\n")
532 (goto-char (point-min)) 531 (goto-char (point-min))
533 (display-buffer (current-buffer)) 532 (display-buffer (current-buffer))
534 (if (y-or-n-p "Set up Emacs for sending SMTP mail? ") 533 (let ((completion-ignore-case t))
535 ;; FIXME: We should check and correct the From: field too. 534 (completing-read "Send mail via: "
536 (setq send-function 'smtpmail-send-it) 535 options nil 'require-match)))))
537 (setq send-function default)))) 536 (customize-save-variable 'send-mail-function
538 (when send-function 537 (cdr (assoc-string choice options t)))))
539 (customize-save-variable 'send-mail-function send-function) 538 (funcall send-mail-function))
540 ;; HACK: Message mode stupidly has `message-send-mail-function',
541 ;; so we must update it too or sending again in the current
542 ;; Emacs session will still call `sendmail-query-once'.
543 (and (boundp 'message-send-mail-function)
544 (eq message-send-mail-function 'sendmail-query-once)
545 (customize-set-variable 'message-send-mail-function
546 send-function))
547 (funcall send-function))))
548 539
549(defun sendmail-sync-aliases () 540(defun sendmail-sync-aliases ()
550 (when mail-personal-alias-file 541 (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.")
924(defun smtpmail-send-data (process buffer) 924(defun smtpmail-send-data (process buffer)
925 (let ((data-continue t) sending-data 925 (let ((data-continue t) sending-data
926 (pr (with-current-buffer buffer 926 (pr (with-current-buffer buffer
927 (make-progress-reporter "Sending email" 927 (make-progress-reporter "Sending email "
928 (point-min) (point-max))))) 928 (point-min) (point-max)))))
929 (with-current-buffer buffer 929 (with-current-buffer buffer
930 (goto-char (point-min))) 930 (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'."
1789 1789
1790(defun completion-file-name-table (string pred action) 1790(defun completion-file-name-table (string pred action)
1791 "Completion table for file names." 1791 "Completion table for file names."
1792 (with-demoted-errors 1792 (condition-case nil
1793 (cond 1793 (cond
1794 ((eq action 'metadata) '(metadata (category . file))) 1794 ((eq action 'metadata) '(metadata (category . file)))
1795 ((eq (car-safe action) 'boundaries) 1795 ((eq (car-safe action) 'boundaries)
1796 (let ((start (length (file-name-directory string))) 1796 (let ((start (length (file-name-directory string)))
1797 (end (string-match-p "/" (cdr action)))) 1797 (end (string-match-p "/" (cdr action))))
1798 (list* 'boundaries 1798 (list* 'boundaries
1799 ;; if `string' is "C:" in w32, (file-name-directory string) 1799 ;; if `string' is "C:" in w32, (file-name-directory string)
1800 ;; returns "C:/", so `start' is 3 rather than 2. 1800 ;; returns "C:/", so `start' is 3 rather than 2.
1801 ;; Not quite sure what is The Right Fix, but clipping it 1801 ;; Not quite sure what is The Right Fix, but clipping it
1802 ;; back to 2 will work for this particular case. We'll 1802 ;; back to 2 will work for this particular case. We'll
1803 ;; see if we can come up with a better fix when we bump 1803 ;; see if we can come up with a better fix when we bump
1804 ;; into more such problematic cases. 1804 ;; into more such problematic cases.
1805 (min start (length string)) end))) 1805 (min start (length string)) end)))
1806
1807 ((eq action 'lambda)
1808 (if (zerop (length string))
1809 nil ;Not sure why it's here, but it probably doesn't harm.
1810 (funcall (or pred 'file-exists-p) string)))
1811 1806
1812 (t 1807 ((eq action 'lambda)
1813 (let* ((name (file-name-nondirectory string)) 1808 (if (zerop (length string))
1814 (specdir (file-name-directory string)) 1809 nil ;Not sure why it's here, but it probably doesn't harm.
1815 (realdir (or specdir default-directory))) 1810 (funcall (or pred 'file-exists-p) string)))
1816 1811
1817 (cond 1812 (t
1818 ((null action) 1813 (let* ((name (file-name-nondirectory string))
1819 (let ((comp (file-name-completion name realdir pred))) 1814 (specdir (file-name-directory string))
1820 (if (stringp comp) 1815 (realdir (or specdir default-directory)))
1821 (concat specdir comp) 1816
1822 comp))) 1817 (cond
1823 1818 ((null action)
1824 ((eq action t) 1819 (let ((comp (file-name-completion name realdir pred)))
1825 (let ((all (file-name-all-completions name realdir))) 1820 (if (stringp comp)
1826 1821 (concat specdir comp)
1827 ;; Check the predicate, if necessary. 1822 comp)))
1828 (unless (memq pred '(nil file-exists-p)) 1823
1829 (let ((comp ()) 1824 ((eq action t)
1830 (pred 1825 (let ((all (file-name-all-completions name realdir)))
1831 (if (eq pred 'file-directory-p) 1826
1832 ;; Brute-force speed up for directory checking: 1827 ;; Check the predicate, if necessary.
1833 ;; Discard strings which don't end in a slash. 1828 (unless (memq pred '(nil file-exists-p))
1834 (lambda (s) 1829 (let ((comp ())
1835 (let ((len (length s))) 1830 (pred
1836 (and (> len 0) (eq (aref s (1- len)) ?/)))) 1831 (if (eq pred 'file-directory-p)
1837 ;; Must do it the hard (and slow) way. 1832 ;; Brute-force speed up for directory checking:
1838 pred))) 1833 ;; Discard strings which don't end in a slash.
1839 (let ((default-directory (expand-file-name realdir))) 1834 (lambda (s)
1840 (dolist (tem all) 1835 (let ((len (length s)))
1841 (if (funcall pred tem) (push tem comp)))) 1836 (and (> len 0) (eq (aref s (1- len)) ?/))))
1842 (setq all (nreverse comp)))) 1837 ;; Must do it the hard (and slow) way.
1843 1838 pred)))
1844 all)))))))) 1839 (let ((default-directory (expand-file-name realdir)))
1840 (dolist (tem all)
1841 (if (funcall pred tem) (push tem comp))))
1842 (setq all (nreverse comp))))
1843
1844 all))))))
1845 (file-error nil))) ;PCM often calls with invalid directories.
1845 1846
1846(defvar read-file-name-predicate nil 1847(defvar read-file-name-predicate nil
1847 "Current predicate used by `read-file-name-internal'.") 1848 "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."
1886 (apply foreign operation args)) 1886 (apply foreign operation args))
1887 1887
1888 ;; Trace that somebody has interrupted the operation. 1888 ;; Trace that somebody has interrupted the operation.
1889 (quit 1889 ((debug quit)
1890 (let (tramp-message-show-message) 1890 (let (tramp-message-show-message)
1891 (tramp-message 1891 (tramp-message
1892 v 1 "Interrupt received in operation %s" 1892 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."
1898 ;; operations shall return at least a default value 1898 ;; operations shall return at least a default value
1899 ;; in order to give the user a chance to correct the 1899 ;; in order to give the user a chance to correct the
1900 ;; file name in the minibuffer. 1900 ;; file name in the minibuffer.
1901 ;; We cannot use 'debug as error handler. In order
1902 ;; to get a full backtrace, one could apply
1903 ;; (setq debug-on-error t debug-on-signal t)
1901 (error 1904 (error
1902 (cond 1905 (cond
1903 ((and completion (zerop (length localname)) 1906 ((and completion (zerop (length localname))
@@ -3850,9 +3853,9 @@ Only works for Bourne-like shells."
3850;; * Run emerge on two remote files. Bug is described here: 3853;; * Run emerge on two remote files. Bug is described here:
3851;; <http://www.mail-archive.com/tramp-devel@nongnu.org/msg01041.html>. 3854;; <http://www.mail-archive.com/tramp-devel@nongnu.org/msg01041.html>.
3852;; (Bug#6850) 3855;; (Bug#6850)
3853 3856;; * It would be very useful if it were possible to load or save a
3854;; Functions for file-name-handler-alist: 3857;; buffer using Tramp in a non-blocking way so that use of Emacs on
3855;; diff-latest-backup-file -- in diff.el 3858;; other buffers could continue. (Bug#9617)
3856 3859
3857;;; tramp.el ends here 3860;;; tramp.el ends here
3858 3861
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."
1489 (if (not (f90-previous-statement)) 1489 (if (not (f90-previous-statement))
1490 ;; If f90-previous-statement returns nil, we must have been 1490 ;; If f90-previous-statement returns nil, we must have been
1491 ;; called from on or before the first line of the first statement. 1491 ;; called from on or before the first line of the first statement.
1492 (setq icol (if (save-excursion 1492 (setq icol (if (or (save-excursion
1493 ;; f90-previous-statement has moved us over 1493 (goto-char pnt)
1494 ;; comment/blank lines, so we need to get 1494 (beginning-of-line)
1495 ;; back to the first code statement. 1495 ;; Preprocessor line before code statement.
1496 (when (looking-at "[ \t]*\\([!#]\\|$\\)") 1496 (looking-at "[ \t]*#"))
1497 (f90-next-statement)) 1497 (progn
1498 (skip-chars-forward " \t0-9") 1498 ;; f90-previous-statement has moved us over
1499 (f90-looking-at-program-block-start)) 1499 ;; comment/blank lines, so we need to get
1500 ;; back to the first code statement.
1501 (when (looking-at "[ \t]*\\([!#]\\|$\\)")
1502 (f90-next-statement))
1503 (skip-chars-forward " \t0-9")
1504 (f90-looking-at-program-block-start)))
1500 0 1505 0
1501 ;; No explicit PROGRAM start statement. 1506 ;; No explicit PROGRAM start statement.
1502 f90-program-indent)) 1507 f90-program-indent))
@@ -1573,7 +1578,7 @@ Return nil if no later statement is found."
1573 (while (and (setq not-last-statement 1578 (while (and (setq not-last-statement
1574 (and (zerop (forward-line 1)) 1579 (and (zerop (forward-line 1))
1575 (not (eobp)))) 1580 (not (eobp))))
1576 (looking-at "[ \t0-9]*\\(!\\|$\\)"))) 1581 (looking-at "[ \t0-9]*\\(!\\|$\\|#\\)")))
1577 not-last-statement)) 1582 not-last-statement))
1578 1583
1579(defun f90-beginning-of-subprogram () 1584(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."
945 (forward-line (1- line))))) 945 (forward-line (1- line)))))
946 946
947(defun count-words-region (start end) 947(defun count-words-region (start end)
948 "Count the number of words in the active region. 948 "Return the number of words between START and END.
949If the region is not active, counts the number of words in the buffer." 949If called interactively, print a message reporting the number of
950 (interactive (if (use-region-p) (list (region-beginning) (region-end)) 950lines, words, and characters in the region."
951 (list (point-min) (point-max)))) 951 (interactive "r")
952 (let ((count 0)) 952 (let ((words 0))
953 (save-excursion 953 (save-excursion
954 (save-restriction 954 (save-restriction
955 (narrow-to-region start end) 955 (narrow-to-region start end)
956 (goto-char (point-min)) 956 (goto-char (point-min))
957 (while (forward-word 1) 957 (while (forward-word 1)
958 (setq count (1+ count))))) 958 (setq words (1+ words)))))
959 (when (called-interactively-p 'interactive) 959 (when (called-interactively-p 'interactive)
960 (message "%s has %d words" 960 (count-words--message "Region"
961 (if (use-region-p) "Region" "Buffer") 961 (count-lines start end)
962 count)) 962 words
963 count)) 963 (- end start)))
964 964 words))
965(defun count-lines-region (start end) 965
966 "Print number of lines and characters in the region." 966(defun count-words ()
967 (interactive "r") 967 "Display the number of lines, words, and characters in the buffer.
968 (message "Region has %d lines, %d characters" 968In Transient Mark mode when the mark is active, display the
969 (count-lines start end) (- end start))) 969number of lines, words, and characters in the region."
970 (interactive)
971 (if (use-region-p)
972 (call-interactively 'count-words-region)
973 (let* ((beg (point-min))
974 (end (point-max))
975 (lines (count-lines beg end))
976 (words (count-words-region beg end))
977 (chars (- end beg)))
978 (count-words--message "Buffer" lines words chars))))
979
980(defun count-words--message (str lines words chars)
981 (message "%s has %d line%s, %d word%s, and %d character%s."
982 str
983 lines (if (= lines 1) "" "s")
984 words (if (= words 1) "" "s")
985 chars (if (= chars 1) "" "s")))
986
987(defalias 'count-lines-region 'count-words-region)
970 988
971(defun what-line () 989(defun what-line ()
972 "Print the current buffer line number and narrowed line number of point." 990 "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."
931;;* previous word nor the current word */ 931;;* previous word nor the current word */
932;;*---------------------------------------------------------------------*/ 932;;*---------------------------------------------------------------------*/
933(defun flyspell-post-command-hook () 933(defun flyspell-post-command-hook ()
934 "The `post-command-hook' used by flyspell to check a word in-the-fly." 934 "The `post-command-hook' used by flyspell to check a word on-the-fly."
935 (interactive) 935 (interactive)
936 (when flyspell-mode 936 (when flyspell-mode
937 (let ((command this-command) 937 (with-local-quit
938 ;; Prevent anything we do from affecting the mark. 938 (let ((command this-command)
939 deactivate-mark) 939 ;; Prevent anything we do from affecting the mark.
940 (if (flyspell-check-pre-word-p) 940 deactivate-mark)
941 (with-current-buffer flyspell-pre-buffer 941 (if (flyspell-check-pre-word-p)
942 '(flyspell-debug-signal-pre-word-checked) 942 (with-current-buffer flyspell-pre-buffer
943 (save-excursion 943 '(flyspell-debug-signal-pre-word-checked)
944 (goto-char flyspell-pre-point) 944 (save-excursion
945 (flyspell-word)))) 945 (goto-char flyspell-pre-point)
946 (if (flyspell-check-word-p) 946 (flyspell-word))))
947 (progn 947 (if (flyspell-check-word-p)
948 '(flyspell-debug-signal-word-checked) 948 (progn
949 (flyspell-word) 949 '(flyspell-debug-signal-word-checked)
950 ;; we remember which word we have just checked. 950 ;; FIXME: This should be asynchronous!
951 ;; this will be used next time we will check a word 951 (flyspell-word)
952 ;; to compare the next current word with the word 952 ;; we remember which word we have just checked.
953 ;; that as been registered in the pre-command-hook 953 ;; this will be used next time we will check a word
954 ;; that is these variables are used within the predicate 954 ;; to compare the next current word with the word
955 ;; FLYSPELL-CHECK-PRE-WORD-P 955 ;; that as been registered in the pre-command-hook
956 (setq flyspell-pre-pre-buffer (current-buffer)) 956 ;; that is these variables are used within the predicate
957 (setq flyspell-pre-pre-point (point))) 957 ;; FLYSPELL-CHECK-PRE-WORD-P
958 (progn 958 (setq flyspell-pre-pre-buffer (current-buffer))
959 (setq flyspell-pre-pre-buffer nil) 959 (setq flyspell-pre-pre-point (point)))
960 (setq flyspell-pre-pre-point nil) 960 (progn
961 ;; when a word is not checked because of a delayed command 961 (setq flyspell-pre-pre-buffer nil)
962 ;; we do not disable the ispell cache. 962 (setq flyspell-pre-pre-point nil)
963 (if (and (symbolp this-command) (get this-command 'flyspell-delayed)) 963 ;; when a word is not checked because of a delayed command
964 (progn 964 ;; we do not disable the ispell cache.
965 (setq flyspell-word-cache-end -1) 965 (if (and (symbolp this-command)
966 (setq flyspell-word-cache-result '_))))) 966 (get this-command 'flyspell-delayed))
967 (while (and (not (input-pending-p)) (consp flyspell-changes)) 967 (progn
968 (let ((start (car (car flyspell-changes))) 968 (setq flyspell-word-cache-end -1)
969 (stop (cdr (car flyspell-changes)))) 969 (setq flyspell-word-cache-result '_)))))
970 (if (flyspell-check-changed-word-p start stop) 970 (while (and (not (input-pending-p)) (consp flyspell-changes))
971 (save-excursion 971 (let ((start (car (car flyspell-changes)))
972 '(flyspell-debug-signal-changed-checked) 972 (stop (cdr (car flyspell-changes))))
973 (goto-char start) 973 (if (flyspell-check-changed-word-p start stop)
974 (flyspell-word))) 974 (save-excursion
975 (setq flyspell-changes (cdr flyspell-changes)))) 975 '(flyspell-debug-signal-changed-checked)
976 (setq flyspell-previous-command command)))) 976 (goto-char start)
977 (flyspell-word)))
978 (setq flyspell-changes (cdr flyspell-changes))))
979 (setq flyspell-previous-command command)))))
977 980
978;;*---------------------------------------------------------------------*/ 981;;*---------------------------------------------------------------------*/
979;;* flyspell-notify-misspell ... */ 982;;* flyspell-notify-misspell ... */
@@ -1100,14 +1103,10 @@ misspelling and skips redundant spell-checking step."
1100 ;; we mark the ispell process so it can be killed 1103 ;; we mark the ispell process so it can be killed
1101 ;; when emacs is exited without query 1104 ;; when emacs is exited without query
1102 (set-process-query-on-exit-flag ispell-process nil) 1105 (set-process-query-on-exit-flag ispell-process nil)
1103 ;; Wait until ispell has processed word. Since this 1106 ;; Wait until ispell has processed word.
1104 ;; code is often executed from post-command-hook but 1107 (while (progn
1105 ;; the ispell process may not be responsive, it's 1108 (accept-process-output ispell-process)
1106 ;; important to make sure we re-enable C-g. 1109 (not (string= "" (car ispell-filter)))))
1107 (with-local-quit
1108 (while (progn
1109 (accept-process-output ispell-process)
1110 (not (string= "" (car ispell-filter))))))
1111 ;; (ispell-send-string "!\n") 1110 ;; (ispell-send-string "!\n")
1112 ;; back to terse mode. 1111 ;; back to terse mode.
1113 ;; Remove leading empty element 1112 ;; 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."
666 (funcall log-operation 666 (funcall log-operation
667 log-fileset 667 log-fileset
668 log-entry)) 668 log-entry))
669 ;; Remove checkin window (after the checkin so that if that fails 669
670 ;; we don't zap the log buffer and the typing therein). 670 ;; Quit windows on logbuf.
671 ;; -- IMO this should be replaced with quit-window 671 (cond
672 (cond ((and logbuf vc-delete-logbuf-window) 672 ((not logbuf))
673 (delete-windows-on logbuf (selected-frame)) 673 (vc-delete-logbuf-window
674 ;; Kill buffer and delete any other dedicated windows/frames. 674 (quit-windows-on logbuf t (selected-frame)))
675 (kill-buffer logbuf)) 675 (t
676 (logbuf 676 (quit-windows-on logbuf nil 0)))
677 (with-selected-window (or (get-buffer-window logbuf 0) 677
678 (selected-window))
679 (with-current-buffer logbuf
680 (bury-buffer)))))
681 ;; Now make sure we see the expanded headers 678 ;; Now make sure we see the expanded headers
682 (when log-fileset 679 (when log-fileset
683 (mapc 680 (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)."
2302 (if (= nfiles 1) "" "s")))))) 2302 (if (= nfiles 1) "" "s"))))))
2303 (error "Revert canceled"))) 2303 (error "Revert canceled")))
2304 (when diff-buffer 2304 (when diff-buffer
2305 (delete-windows-on diff-buffer) 2305 (quit-windows-on diff-buffer t)))
2306 (kill-buffer diff-buffer)))
2307 (dolist (file files) 2306 (dolist (file files)
2308 (message "Reverting %s..." (vc-delistify files)) 2307 (message "Reverting %s..." (vc-delistify files))
2309 (vc-revert-file file) 2308 (vc-revert-file file)
@@ -2349,8 +2348,7 @@ depending on the underlying version-control system."
2349 ;; Display changes 2348 ;; Display changes
2350 (unless (yes-or-no-p "Discard these revisions? ") 2349 (unless (yes-or-no-p "Discard these revisions? ")
2351 (error "Rollback canceled")) 2350 (error "Rollback canceled"))
2352 (delete-windows-on "*vc-diff*") 2351 (quit-windows-on "*vc-diff*" t)
2353 (kill-buffer"*vc-diff*")
2354 ;; Do the actual reversions 2352 ;; Do the actual reversions
2355 (message "Rolling back %s..." (vc-delistify files)) 2353 (message "Rolling back %s..." (vc-delistify files))
2356 (with-vc-properties 2354 (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'."
2772 (const :tag "Do nothing" ignore) 2772 (const :tag "Do nothing" ignore)
2773 function) 2773 function)
2774 :group 'windows 2774 :group 'windows
2775 :group 'frames) 2775 :group 'frames
2776 :version "24.1")
2776 2777
2777(defun window--delete (&optional window dedicated-only kill) 2778(defun window--delete (&optional window dedicated-only kill)
2778 "Delete WINDOW if possible. 2779 "Delete WINDOW if possible.
@@ -2780,7 +2781,7 @@ WINDOW must be a live window and defaults to the selected one.
2780Optional argument DEDICATED-ONLY non-nil means to delete WINDOW 2781Optional argument DEDICATED-ONLY non-nil means to delete WINDOW
2781only if it's dedicated to its buffer. Optional argument KILL 2782only if it's dedicated to its buffer. Optional argument KILL
2782means the buffer shown in window will be killed. Return non-nil 2783means the buffer shown in window will be killed. Return non-nil
2783if WINDOW gets deleted." 2784if WINDOW gets deleted or its frame is auto-hidden."
2784 (setq window (window-normalize-live-window window)) 2785 (setq window (window-normalize-live-window window))
2785 (unless (and dedicated-only (not (window-dedicated-p window))) 2786 (unless (and dedicated-only (not (window-dedicated-p window)))
2786 (let* ((buffer (window-buffer window)) 2787 (let* ((buffer (window-buffer window))
@@ -2788,8 +2789,11 @@ if WINDOW gets deleted."
2788 (cond 2789 (cond
2789 ((eq deletable 'frame) 2790 ((eq deletable 'frame)
2790 (let ((frame (window-frame window))) 2791 (let ((frame (window-frame window)))
2791 (when (functionp frame-auto-hide-function) 2792 (cond
2792 (funcall frame-auto-hide-function frame))) 2793 (kill
2794 (delete-frame frame))
2795 ((functionp frame-auto-hide-function)
2796 (funcall frame-auto-hide-function frame))))
2793 'frame) 2797 'frame)
2794 (deletable 2798 (deletable
2795 (delete-window window) 2799 (delete-window window)
@@ -2980,6 +2984,27 @@ one. If non-nil, reset `quit-restore' parameter to nil."
2980 (if kill 2984 (if kill
2981 (kill-buffer buffer) 2985 (kill-buffer buffer)
2982 (bury-buffer-internal buffer)))) 2986 (bury-buffer-internal buffer))))
2987
2988(defun quit-windows-on (&optional buffer-or-name kill frame)
2989 "Quit all windows showing BUFFER-OR-NAME.
2990BUFFER-OR-NAME may be a buffer or the name of an existing buffer
2991and defaults to the current buffer. Optional argument KILL
2992non-nil means to kill BUFFER-OR-NAME. KILL nil means to bury
2993BUFFER-OR-NAME. Optional argument FRAME is handled as by
2994`delete-windows-on'.
2995
2996This function calls `quit-window' on all candidate windows
2997showing BUFFER-OR-NAME."
2998 (interactive "BQuit windows on (buffer):\nP")
2999 (let ((buffer (window-normalize-buffer buffer-or-name))
3000 ;; Handle the "inverted" meaning of the FRAME argument wrt other
3001 ;; `window-list-1' based function.
3002 (all-frames (cond ((not frame) t) ((eq frame t) nil) (t frame))))
3003 (dolist (window (window-list-1 nil nil all-frames))
3004 (if (eq (window-buffer window) buffer)
3005 (quit-window kill window)
3006 ;; If a window doesn't show BUFFER, unrecord BUFFER in it.
3007 (unrecord-window-buffer window buffer)))))
2983 3008
2984;;; Splitting windows. 3009;;; Splitting windows.
2985(defsubst window-split-min-size (&optional horizontal) 3010(defsubst window-split-min-size (&optional horizontal)
@@ -3955,12 +3980,10 @@ Finally, an element of this list can be also specified as
3955\(BUFFER-NAME FUNCTION OTHER-ARGS). In that case, 3980\(BUFFER-NAME FUNCTION OTHER-ARGS). In that case,
3956`special-display-popup-frame' will call FUNCTION with the buffer 3981`special-display-popup-frame' will call FUNCTION with the buffer
3957named BUFFER-NAME as first argument, and OTHER-ARGS as the 3982named BUFFER-NAME as first argument, and OTHER-ARGS as the
3958second. If `special-display-function' specifies some other 3983second.
3959function, that function is called with the buffer named 3984
3960BUFFER-NAME as first, and the element's cdr as second argument. 3985Any alternative function specified here is responsible for
3961In any case, that function is responsible for setting the value 3986setting up the quit-restore parameter of the window used.
3962The function specified here is responsible for setting the
3963quit-restore and help-setup parameters of the window used.
3964 3987
3965If this variable appears \"not to work\", because you added a 3988If this variable appears \"not to work\", because you added a
3966name to it but the corresponding buffer is displayed in the 3989name to it but the corresponding buffer is displayed in the
@@ -4025,10 +4048,10 @@ as second argument.
4025Finally, an element of this list can be also specified as 4048Finally, an element of this list can be also specified as
4026\(REGEXP FUNCTION OTHER-ARGS). `special-display-popup-frame' 4049\(REGEXP FUNCTION OTHER-ARGS). `special-display-popup-frame'
4027will then call FUNCTION with the buffer whose name matched 4050will then call FUNCTION with the buffer whose name matched
4028REGEXP as first, and OTHER-ARGS as second argument. If 4051REGEXP as first, and OTHER-ARGS as second argument.
4029`special-display-function' specifies some other function, that 4052
4030function is called with the buffer whose name matched REGEXP 4053Any alternative function specified here is responsible for
4031as first, and the element's cdr as second argument. 4054setting up the quit-restore parameter of the window used.
4032 4055
4033If this variable appears \"not to work\", because you added a 4056If this variable appears \"not to work\", because you added a
4034name to it but the corresponding buffer is displayed in the 4057name to it but the corresponding buffer is displayed in the
@@ -4974,7 +4997,7 @@ one.
4974If FORCE-SAME-WINDOW is non-nil, BUFFER-OR-NAME must be displayed 4997If FORCE-SAME-WINDOW is non-nil, BUFFER-OR-NAME must be displayed
4975in the selected window; signal an error if that is 4998in the selected window; signal an error if that is
4976impossible (e.g. if the selected window is minibuffer-only). If 4999impossible (e.g. if the selected window is minibuffer-only). If
4977non-nil, BUFFER-OR-NAME may be displayed in another window. 5000nil, BUFFER-OR-NAME may be displayed in another window.
4978 5001
4979Return the buffer switched to." 5002Return the buffer switched to."
4980 (interactive 5003 (interactive
diff --git a/src/ChangeLog b/src/ChangeLog
index 00845a4c188..c2cf656b101 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,6 +1,6 @@
12011-10-11 Paul Eggert <eggert@cs.ucla.edu> 12011-10-12 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Fix integer width and related issues. 3 Fix integer width and related bugs.
4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): 4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
5 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE) 5 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6 (string_bytes, check_sblock, allocate_string_data): 6 (string_bytes, check_sblock, allocate_string_data):
@@ -784,6 +784,53 @@
784 rather than rolling our own approximation. 784 rather than rolling our own approximation.
785 (SCROLL_BAR_VEC_SIZE): Remove; not used. 785 (SCROLL_BAR_VEC_SIZE): Remove; not used.
786 786
7872011-10-12 Eli Zaretskii <eliz@gnu.org>
788
789 * bidi.c (bidi_level_of_next_char):
790 * xdisp.c (get_visually_first_element): Remove old incorrect
791 comments regarding the Unicode Line Separator character.
792
793 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
794
7952011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
796
797 * alloc.c (Fgc_status): Do not access beyond zombies array
798 boundary if nzombies > MAX_ZOMBIES.
799 * alloc.c (dump_zombies): Add missing format specifier.
800
8012011-10-12 Paul Eggert <eggert@cs.ucla.edu>
802
803 * xdisp.c (set_cursor_from_row): Simplify conditionals,
804 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
805
806 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
807 Some packages use them to denote characters with modifiers.
808
8092011-10-11 Andreas Schwab <schwab@linux-m68k.org>
810
811 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
812 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
813 matching a pp-number. Rename parameter var to var1.
814
8152011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
816
817 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
818
8192011-10-08 Glenn Morris <rgm@gnu.org>
820
821 * callint.c (Fcall_interactively): Give a more explicit error for the
822 'c' case with a non-character input. (Bug#8479)
823
8242011-10-08 Eli Zaretskii <eliz@gnu.org>
825
826 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
827 lines.
828 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
829 lines that are hscrolled on the left.
830
831 * dispnew.c (buffer_posn_from_coords): Account for a possible
832 presence of header-line. (Bug#4426)
833
7872011-10-07 Stefan Monnier <monnier@iro.umontreal.ca> 8342011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
788 835
789 * buffer.c (syms_of_buffer) <enable-multibyte-characters>: Don't 836 * 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, "",
4072{ 4072{
4073 Lisp_Object args[8], zombie_list = Qnil; 4073 Lisp_Object args[8], zombie_list = Qnil;
4074 EMACS_INT i; 4074 EMACS_INT i;
4075 for (i = 0; i < nzombies; i++) 4075 for (i = 0; i < min (MAX_ZOMBIES, nzombies); i++)
4076 zombie_list = Fcons (zombies[i], zombie_list); 4076 zombie_list = Fcons (zombies[i], zombie_list);
4077 args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d\nzombies: %S"); 4077 args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d\nzombies: %S");
4078 args[1] = make_number (ngcs); 4078 args[1] = make_number (ngcs);
@@ -4411,7 +4411,7 @@ dump_zombies (void)
4411{ 4411{
4412 int i; 4412 int i;
4413 4413
4414 fprintf (stderr, "\nZombies kept alive = %"pI":\n", nzombies); 4414 fprintf (stderr, "\nZombies kept alive = %"pI"d:\n", nzombies);
4415 for (i = 0; i < min (MAX_ZOMBIES, nzombies); ++i) 4415 for (i = 0; i < min (MAX_ZOMBIES, nzombies); ++i)
4416 { 4416 {
4417 fprintf (stderr, " %d = ", i); 4417 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,
808 bidi_it->nchars = -1; /* to be computed in bidi_resolve_explicit_1 */ 808 bidi_it->nchars = -1; /* to be computed in bidi_resolve_explicit_1 */
809 bidi_it->first_elt = 1; 809 bidi_it->first_elt = 1;
810 bidi_set_paragraph_end (bidi_it); 810 bidi_set_paragraph_end (bidi_it);
811 bidi_it->paragraph_dir = NEUTRAL_DIR;
811 bidi_it->new_paragraph = 1; 812 bidi_it->new_paragraph = 1;
812 bidi_it->separator_limit = -1; 813 bidi_it->separator_limit = -1;
813 bidi_it->type = NEUTRAL_B; 814 bidi_it->type = NEUTRAL_B;
@@ -2127,7 +2128,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it)
2127 do { 2128 do {
2128 ch = bidi_fetch_char (bpos += clen, cpos += nc, &disp_pos, &dpp, &bs, 2129 ch = bidi_fetch_char (bpos += clen, cpos += nc, &disp_pos, &dpp, &bs,
2129 fwp, &clen, &nc); 2130 fwp, &clen, &nc);
2130 if (ch == '\n' || ch == BIDI_EOB /* || ch == LINESEP_CHAR */) 2131 if (ch == '\n' || ch == BIDI_EOB)
2131 chtype = NEUTRAL_B; 2132 chtype = NEUTRAL_B;
2132 else 2133 else
2133 chtype = bidi_get_type (ch, NEUTRAL_DIR); 2134 chtype = bidi_get_type (ch, NEUTRAL_DIR);
@@ -2177,7 +2178,6 @@ bidi_level_of_next_char (struct bidi_it *bidi_it)
2177 else if (bidi_it->orig_type == NEUTRAL_B /* L1 */ 2178 else if (bidi_it->orig_type == NEUTRAL_B /* L1 */
2178 || bidi_it->orig_type == NEUTRAL_S 2179 || bidi_it->orig_type == NEUTRAL_S
2179 || bidi_it->ch == '\n' || bidi_it->ch == BIDI_EOB 2180 || bidi_it->ch == '\n' || bidi_it->ch == BIDI_EOB
2180 /* || bidi_it->ch == LINESEP_CHAR */
2181 || (bidi_it->orig_type == NEUTRAL_WS 2181 || (bidi_it->orig_type == NEUTRAL_WS
2182 && (bidi_it->next_for_ws.type == NEUTRAL_B 2182 && (bidi_it->next_for_ws.type == NEUTRAL_B
2183 || bidi_it->next_for_ws.type == NEUTRAL_S))) 2183 || 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
535 message1_nolog ((char *) 0); 535 message1_nolog ((char *) 0);
536 /* Passing args[i] directly stimulates compiler bug */ 536 /* Passing args[i] directly stimulates compiler bug */
537 teml = args[i]; 537 teml = args[i];
538 /* See bug#8479. */
539 if (! CHARACTERP (teml)) error ("Non-character input-event");
538 visargs[i] = Fchar_to_string (teml); 540 visargs[i] = Fchar_to_string (teml);
539 break; 541 break;
540 542
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
5260 CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); 5260 CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp)));
5261 BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); 5261 BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp)));
5262 start_display (&it, w, startp); 5262 start_display (&it, w, startp);
5263 /* start_display takes into account the header-line row, but IT's
5264 vpos still counts from the glyph row that includes the window's
5265 start position. Adjust for a possible header-line row. */
5266 it.vpos += WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
5263 5267
5264 x0 = *x; 5268 x0 = *x;
5265 5269
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
2275 2275
2276#ifndef DEBUG_GCPRO 2276#ifndef DEBUG_GCPRO
2277 2277
2278#define GCPRO1_VAR(var, gcpro) \ 2278#define GCPRO1_VAR(var1, gcpro) \
2279 {gcpro##1.next = gcprolist; gcpro##1.var = &var; gcpro##1.nvars = 1; \ 2279 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \
2280 gcprolist = &gcpro##1; } 2280 gcprolist = &gcpro##1; }
2281 2281
2282#define GCPRO2_VAR(var1, var2, gcpro) \ 2282#define GCPRO2_VAR(var1, var2, gcpro) \
2283 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ 2283 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \
2284 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ 2284 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \
2285 gcprolist = &gcpro##2; } 2285 gcprolist = &gcpro##2; }
2286 2286
2287#define GCPRO3_VAR(var1, var2, var3, gcpro) \ 2287#define GCPRO3_VAR(var1, var2, var3, gcpro) \
2288 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ 2288 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \
2289 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ 2289 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \
2290 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ 2290 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \
2291 gcprolist = &gcpro##3; } 2291 gcprolist = &gcpro##3; }
2292 2292
2293#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ 2293#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \
2294 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ 2294 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \
2295 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ 2295 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \
2296 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ 2296 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \
2297 gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ 2297 gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \
2298 gcprolist = &gcpro##4; } 2298 gcprolist = &gcpro##4; }
2299 2299
2300#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ 2300#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \
2301 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ 2301 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \
2302 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ 2302 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \
2303 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ 2303 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \
2304 gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ 2304 gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \
2305 gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ 2305 gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \
2306 gcprolist = &gcpro##5; } 2306 gcprolist = &gcpro##5; }
2307 2307
2308#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ 2308#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \
2309 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ 2309 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \
2310 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ 2310 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \
2311 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ 2311 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \
2312 gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ 2312 gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \
2313 gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ 2313 gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \
2314 gcpro##6.next = &gcpro##5; gcpro##6.var = &var6; gcpro##6.nvars = 1; \ 2314 gcpro##6 .next = &gcpro##5; gcpro##6 .var = &var6; gcpro##6 .nvars = 1; \
2315 gcprolist = &gcpro##6; } 2315 gcprolist = &gcpro##6; }
2316 2316
2317#define UNGCPRO_VAR(gcpro) (gcprolist = gcpro##1.next) 2317#define UNGCPRO_VAR(gcpro) (gcprolist = gcpro##1 .next)
2318 2318
2319#else 2319#else
2320 2320
2321extern int gcpro_level; 2321extern int gcpro_level;
2322 2322
2323#define GCPRO1_VAR(var, gcpro) \ 2323#define GCPRO1_VAR(var1, gcpro) \
2324 {gcpro##1.next = gcprolist; gcpro##1.var = &var; gcpro##1.nvars = 1; \ 2324 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \
2325 gcpro##1.level = gcpro_level++; \ 2325 gcpro##1 .level = gcpro_level++; \
2326 gcprolist = &gcpro##1; } 2326 gcprolist = &gcpro##1; }
2327 2327
2328#define GCPRO2_VAR(var1, var2, gcpro) \ 2328#define GCPRO2_VAR(var1, var2, gcpro) \
2329 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ 2329 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \
2330 gcpro##1.level = gcpro_level; \ 2330 gcpro##1 .level = gcpro_level; \
2331 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ 2331 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \
2332 gcpro##2.level = gcpro_level++; \ 2332 gcpro##2 .level = gcpro_level++; \
2333 gcprolist = &gcpro##2; } 2333 gcprolist = &gcpro##2; }
2334 2334
2335#define GCPRO3_VAR(var1, var2, var3, gcpro) \ 2335#define GCPRO3_VAR(var1, var2, var3, gcpro) \
2336 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ 2336 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \
2337 gcpro##1.level = gcpro_level; \ 2337 gcpro##1 .level = gcpro_level; \
2338 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ 2338 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \
2339 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ 2339 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \
2340 gcpro##3.level = gcpro_level++; \ 2340 gcpro##3 .level = gcpro_level++; \
2341 gcprolist = &gcpro##3; } 2341 gcprolist = &gcpro##3; }
2342 2342
2343#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ 2343#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \
2344 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ 2344 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \
2345 gcpro##1.level = gcpro_level; \ 2345 gcpro##1 .level = gcpro_level; \
2346 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ 2346 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \
2347 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ 2347 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \
2348 gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ 2348 gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \
2349 gcpro##4.level = gcpro_level++; \ 2349 gcpro##4 .level = gcpro_level++; \
2350 gcprolist = &gcpro##4; } 2350 gcprolist = &gcpro##4; }
2351 2351
2352#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ 2352#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \
2353 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ 2353 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \
2354 gcpro##1.level = gcpro_level; \ 2354 gcpro##1 .level = gcpro_level; \
2355 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ 2355 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \
2356 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ 2356 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \
2357 gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ 2357 gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \
2358 gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ 2358 gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \
2359 gcpro##5.level = gcpro_level++; \ 2359 gcpro##5 .level = gcpro_level++; \
2360 gcprolist = &gcpro##5; } 2360 gcprolist = &gcpro##5; }
2361 2361
2362#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ 2362#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \
2363 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ 2363 {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \
2364 gcpro##1.level = gcpro_level; \ 2364 gcpro##1 .level = gcpro_level; \
2365 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ 2365 gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \
2366 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ 2366 gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \
2367 gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ 2367 gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \
2368 gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ 2368 gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \
2369 gcpro##6.next = &gcpro##5; gcpro##6.var = &var6; gcpro##6.nvars = 1; \ 2369 gcpro##6 .next = &gcpro##5; gcpro##6 .var = &var6; gcpro##6 .nvars = 1; \
2370 gcpro##6.level = gcpro_level++; \ 2370 gcpro##6 .level = gcpro_level++; \
2371 gcprolist = &gcpro##6; } 2371 gcprolist = &gcpro##6; }
2372 2372
2373#define UNGCPRO_VAR(gcpro) \ 2373#define UNGCPRO_VAR(gcpro) \
2374 ((--gcpro_level != gcpro##1.level) \ 2374 ((--gcpro_level != gcpro##1 .level) \
2375 ? (abort (), 0) \ 2375 ? (abort (), 0) \
2376 : ((gcprolist = gcpro##1.next), 0)) 2376 : ((gcprolist = gcpro##1 .next), 0))
2377 2377
2378#endif /* DEBUG_GCPRO */ 2378#endif /* DEBUG_GCPRO */
2379#endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ 2379#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)
2215 case 'x': 2215 case 'x':
2216 /* A hex escape, as in ANSI C. */ 2216 /* A hex escape, as in ANSI C. */
2217 { 2217 {
2218 int i = 0; 2218 unsigned int i = 0;
2219 int count = 0; 2219 int count = 0;
2220 while (1) 2220 while (1)
2221 { 2221 {
@@ -2239,7 +2239,9 @@ read_escape (Lisp_Object readcharfun, int stringp)
2239 UNREAD (c); 2239 UNREAD (c);
2240 break; 2240 break;
2241 } 2241 }
2242 if (MAX_CHAR < i) 2242 /* Allow hex escapes as large as ?\xfffffff, because some
2243 packages use them to denote characters with modifiers. */
2244 if ((CHAR_META | (CHAR_META - 1)) < i)
2243 error ("Hex character out of range: \\x%x...", i); 2245 error ("Hex character out of range: \\x%x...", i);
2244 count += count < 3; 2246 count += count < 3;
2245 } 2247 }
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',
1859 /* First, look for a non-internal buffer in `res'. */ 1859 /* First, look for a non-internal buffer in `res'. */
1860 while (CONSP (bufs) && SREF (XCAR (bufs), 0) == ' ') 1860 while (CONSP (bufs) && SREF (XCAR (bufs), 0) == ' ')
1861 bufs = XCDR (bufs); 1861 bufs = XCDR (bufs);
1862 if (NILP (bufs) && EQ (Flength (res), Flength (Vbuffer_alist))) 1862 if (NILP (bufs))
1863 /* All bufs are internal, so don't trip them out. */ 1863 return (EQ (Flength (res), Flength (Vbuffer_alist))
1864 return res; 1864 /* If all bufs are internal don't strip them out. */
1865 ? res : bufs);
1865 res = bufs; 1866 res = bufs;
1866 while (CONSP (XCDR (bufs))) 1867 while (CONSP (XCDR (bufs)))
1867 if (SREF (XCAR (XCDR (bufs)), 0) == ' ') 1868 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)
7154 } 7154 }
7155 else if (it->bidi_it.charpos == bob 7155 else if (it->bidi_it.charpos == bob
7156 || (!string_p 7156 || (!string_p
7157 /* FIXME: Should support all Unicode line separators. */
7158 && (FETCH_CHAR (it->bidi_it.bytepos - 1) == '\n' 7157 && (FETCH_CHAR (it->bidi_it.bytepos - 1) == '\n'
7159 || FETCH_CHAR (it->bidi_it.bytepos) == '\n'))) 7158 || FETCH_CHAR (it->bidi_it.bytepos) == '\n')))
7160 { 7159 {
@@ -12072,6 +12071,7 @@ hscroll_window_tree (Lisp_Object window)
12072 = (desired_cursor_row->enabled_p 12071 = (desired_cursor_row->enabled_p
12073 ? desired_cursor_row 12072 ? desired_cursor_row
12074 : current_cursor_row); 12073 : current_cursor_row);
12074 int row_r2l_p = cursor_row->reversed_p;
12075 12075
12076 text_area_width = window_box_width (w, TEXT_AREA); 12076 text_area_width = window_box_width (w, TEXT_AREA);
12077 12077
@@ -12079,11 +12079,31 @@ hscroll_window_tree (Lisp_Object window)
12079 h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); 12079 h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w);
12080 12080
12081 if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer)) 12081 if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer))
12082 && ((XFASTINT (w->hscroll) 12082 /* For left-to-right rows, hscroll when cursor is either
12083 && w->cursor.x <= h_margin) 12083 (i) inside the right hscroll margin, or (ii) if it is
12084 || (cursor_row->enabled_p 12084 inside the left margin and the window is already
12085 && cursor_row->truncated_on_right_p 12085 hscrolled. */
12086 && (w->cursor.x >= text_area_width - h_margin)))) 12086 && ((!row_r2l_p
12087 && ((XFASTINT (w->hscroll)
12088 && w->cursor.x <= h_margin)
12089 || (cursor_row->enabled_p
12090 && cursor_row->truncated_on_right_p
12091 && (w->cursor.x >= text_area_width - h_margin))))
12092 /* For right-to-left rows, the logic is similar,
12093 except that rules for scrolling to left and right
12094 are reversed. E.g., if cursor.x <= h_margin, we
12095 need to hscroll "to the right" unconditionally,
12096 and that will scroll the screen to the left so as
12097 to reveal the next portion of the row. */
12098 || (row_r2l_p
12099 && ((cursor_row->enabled_p
12100 /* FIXME: It is confusing to set the
12101 truncated_on_right_p flag when R2L rows
12102 are actually truncated on the left. */
12103 && cursor_row->truncated_on_right_p
12104 && w->cursor.x <= h_margin)
12105 || (XFASTINT (w->hscroll)
12106 && (w->cursor.x >= text_area_width - h_margin))))))
12087 { 12107 {
12088 struct it it; 12108 struct it it;
12089 ptrdiff_t hscroll; 12109 ptrdiff_t hscroll;
@@ -12118,7 +12138,9 @@ hscroll_window_tree (Lisp_Object window)
12118 ? (text_area_width - 4 * FRAME_COLUMN_WIDTH (it.f)) 12138 ? (text_area_width - 4 * FRAME_COLUMN_WIDTH (it.f))
12119 : (text_area_width / 2)))) 12139 : (text_area_width / 2))))
12120 / FRAME_COLUMN_WIDTH (it.f); 12140 / FRAME_COLUMN_WIDTH (it.f);
12121 else if (w->cursor.x >= text_area_width - h_margin) 12141 else if ((!row_r2l_p
12142 && w->cursor.x >= text_area_width - h_margin)
12143 || (row_r2l_p && w->cursor.x <= h_margin))
12122 { 12144 {
12123 if (hscroll_relative_p) 12145 if (hscroll_relative_p)
12124 wanted_x = text_area_width * (1 - hscroll_step_rel) 12146 wanted_x = text_area_width * (1 - hscroll_step_rel)
@@ -13858,21 +13880,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13858 glyph--; 13880 glyph--;
13859 } 13881 }
13860 } 13882 }
13861 else if (match_with_avoid_cursor 13883 else if (match_with_avoid_cursor)
13862 /* A truncated row may not include PT among its
13863 character positions. Setting the cursor inside the
13864 scroll margin will trigger recalculation of hscroll
13865 in hscroll_window_tree. But if a display string
13866 covers point, defer to the string-handling code
13867 below to figure this out. */
13868 || (!string_seen
13869 && ((row->truncated_on_left_p && pt_old < bpos_min)
13870 || (row->truncated_on_right_p && pt_old > bpos_max)
13871 /* Zero-width characters produce no glyphs. */
13872 || (!empty_line_p
13873 && (row->reversed_p
13874 ? glyph_after > glyphs_end
13875 : glyph_after < glyphs_end)))))
13876 { 13884 {
13877 cursor = glyph_after; 13885 cursor = glyph_after;
13878 x = -1; 13886 x = -1;
@@ -14013,6 +14021,26 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
14013 && row->continued_p) 14021 && row->continued_p)
14014 return 0; 14022 return 0;
14015 } 14023 }
14024 /* A truncated row may not include PT among its character positions.
14025 Setting the cursor inside the scroll margin will trigger
14026 recalculation of hscroll in hscroll_window_tree. But if a
14027 display string covers point, defer to the string-handling
14028 code below to figure this out. */
14029 else if (row->truncated_on_left_p && pt_old < bpos_min)
14030 {
14031 cursor = glyph_before;
14032 x = -1;
14033 }
14034 else if ((row->truncated_on_right_p && pt_old > bpos_max)
14035 /* Zero-width characters produce no glyphs. */
14036 || (!empty_line_p
14037 && (row->reversed_p
14038 ? glyph_after > glyphs_end
14039 : glyph_after < glyphs_end)))
14040 {
14041 cursor = glyph_after;
14042 x = -1;
14043 }
14016 } 14044 }
14017 14045
14018 compute_x: 14046 compute_x: