aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2012-03-13 08:23:14 +0100
committerJoakim Verona2012-03-13 08:23:14 +0100
commit4b2cea2874f3a699ebe96349ef34fb7206cc0fa5 (patch)
treebbd39cf660d9b79b2cff9e39ef6209af4cf9fb8b
parent1de331c486475093aa6b75ef6c259f7164e7620c (diff)
parent6ea7151ba66df966974060711512b49b9059566e (diff)
downloademacs-4b2cea2874f3a699ebe96349ef34fb7206cc0fa5.tar.gz
emacs-4b2cea2874f3a699ebe96349ef34fb7206cc0fa5.zip
upstream
-rw-r--r--admin/FOR-RELEASE4
-rw-r--r--doc/lispref/ChangeLog38
-rw-r--r--doc/lispref/display.texi4
-rw-r--r--doc/lispref/elisp.texi3
-rw-r--r--doc/lispref/eval.texi6
-rw-r--r--doc/lispref/internals.texi2
-rw-r--r--doc/lispref/keymaps.texi37
-rw-r--r--doc/lispref/loading.texi33
-rw-r--r--doc/lispref/nonascii.texi15
-rw-r--r--doc/lispref/sequences.texi5
-rw-r--r--doc/lispref/strings.texi4
-rw-r--r--doc/lispref/text.texi297
-rw-r--r--doc/lispref/vol1.texi3
-rw-r--r--doc/lispref/vol2.texi3
-rw-r--r--doc/lispref/windows.texi4
-rw-r--r--doc/misc/ChangeLog12
-rw-r--r--doc/misc/flymake.texi34
-rw-r--r--doc/misc/info.texi1
-rw-r--r--etc/NEWS21
-rw-r--r--etc/PROBLEMS6
-rw-r--r--leim/ChangeLog14
-rw-r--r--leim/quail/cyrillic.el73
-rw-r--r--leim/quail/persian.el380
-rw-r--r--lib-src/ChangeLog18
-rw-r--r--lib-src/emacsclient.c231
-rw-r--r--lisp/ChangeLog210
-rw-r--r--lisp/autorevert.el11
-rw-r--r--lisp/calendar/icalendar.el4
-rw-r--r--lisp/cedet/ChangeLog12
-rw-r--r--lisp/cedet/semantic/db-find.el6
-rw-r--r--lisp/cedet/semantic/wisent/javascript.el4
-rw-r--r--lisp/dabbrev.el157
-rw-r--r--lisp/dired.el110
-rw-r--r--lisp/emacs-lisp/package.el23
-rw-r--r--lisp/emulation/cua-base.el1
-rw-r--r--lisp/emulation/cua-rect.el1
-rw-r--r--lisp/emulation/ws-mode.el2
-rw-r--r--lisp/epa-mail.el4
-rw-r--r--lisp/faces.el2
-rw-r--r--lisp/files.el55
-rw-r--r--lisp/gnus/ChangeLog10
-rw-r--r--lisp/gnus/gnus-int.el2
-rw-r--r--lisp/gnus/mm-uu.el8
-rw-r--r--lisp/ibuffer.el16
-rw-r--r--lisp/international/fontset.el1
-rw-r--r--lisp/international/quail.el32
-rw-r--r--lisp/mail/mail-utils.el8
-rw-r--r--lisp/mail/rmail.el12
-rw-r--r--lisp/mail/sendmail.el4
-rw-r--r--lisp/mail/smtpmail.el5
-rw-r--r--lisp/minibuffer.el13
-rw-r--r--lisp/net/dbus.el3
-rw-r--r--lisp/net/mairix.el22
-rw-r--r--lisp/nxml/nxml-mode.el26
-rw-r--r--lisp/progmodes/cc-cmds.el27
-rw-r--r--lisp/progmodes/cc-engine.el4
-rw-r--r--lisp/progmodes/gdb-mi.el16
-rw-r--r--lisp/replace.el6
-rw-r--r--lisp/savehist.el4
-rw-r--r--lisp/server.el107
-rw-r--r--lisp/simple.el31
-rw-r--r--lisp/sort.el2
-rw-r--r--lisp/speedbar.el10
-rw-r--r--lisp/subr.el13
-rw-r--r--lisp/url/ChangeLog11
-rw-r--r--lisp/url/url-http.el83
-rw-r--r--lisp/window.el39
-rw-r--r--src/ChangeLog50
-rw-r--r--src/buffer.c6
-rw-r--r--src/editfns.c7
-rw-r--r--src/eval.c8
-rw-r--r--src/frame.c49
-rw-r--r--src/gtkutil.c5
-rw-r--r--src/keymap.c5
-rw-r--r--src/lisp.h1
-rw-r--r--src/window.c7
-rw-r--r--src/window.h4
-rw-r--r--src/xfns.c7
78 files changed, 1688 insertions, 826 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index bfe831fa07f..fe3bab7feb0 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -214,7 +214,7 @@ maps.texi rgm
214markers.texi rgm 214markers.texi rgm
215minibuf.texi 215minibuf.texi
216modes.texi cyd 216modes.texi cyd
217nonascii.texi 217nonascii.texi cyd
218numbers.texi cyd 218numbers.texi cyd
219objects.texi cyd 219objects.texi cyd
220os.texi 220os.texi
@@ -227,7 +227,7 @@ streams.texi cyd
227strings.texi cyd 227strings.texi cyd
228symbols.texi cyd 228symbols.texi cyd
229syntax.texi cyd 229syntax.texi cyd
230text.texi 230text.texi cyd
231tips.texi rgm 231tips.texi rgm
232variables.texi cyd 232variables.texi cyd
233windows.texi 233windows.texi
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 42ec24fac5f..3584c89d5fe 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,41 @@
12012-03-11 Chong Yidong <cyd@gnu.org>
2
3 * windows.texi (Window Configurations): save-window-excursion is
4 now a macro.
5
6 * display.texi (Temporary Displays): with-output-to-temp-buffer is
7 now a macro.
8
9 * text.texi (Fields): Minor copyedit.
10
112012-03-10 Eli Zaretskii <eliz@gnu.org>
12
13 * strings.texi (String Basics):
14 * sequences.texi (Sequence Functions): Mention that `length' is
15 not appropriate for computing the string width on display; add a
16 cross-reference to the description of `string-width'. (Bug#10978)
17
18 * eval.texi (Autoloading): Minor change of wording.
19
202012-03-10 Chong Yidong <cyd@gnu.org>
21
22 * loading.texi (Autoload): Explicitly state which forms are
23 processed specially (Bug#7783).
24
25 * keymaps.texi (Mouse Menus): Describe non-toolkit behavior as the
26 non-default situation. Describe one-submenu exception (Bug#7695).
27
28 * nonascii.texi (Character Properties): Copyedits.
29
302012-03-08 Chong Yidong <cyd@gnu.org>
31
32 * text.texi (Mode-Specific Indent): Document new behavior of
33 indent-for-tab-command. Document tab-always-indent.
34 (Special Properties): Copyedits.
35 (Checksum/Hash): Improve secure-hash doc. Do not recommend MD5.
36 (Parsing HTML/XML): Rename from Parsing HTML. Update doc of
37 libxml-parse-html-region.
38
12012-03-07 Glenn Morris <rgm@gnu.org> 392012-03-07 Glenn Morris <rgm@gnu.org>
2 40
3 * markers.texi (The Region): Briefly mention use-empty-active-region 41 * markers.texi (The Region): Briefly mention use-empty-active-region
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 281ddda9cec..c70418be52b 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -1031,7 +1031,7 @@ You can use a display table to substitute other text for the ellipsis
1031buffer and then present it to the user for perusal rather than for 1031buffer and then present it to the user for perusal rather than for
1032editing. Many help commands use this feature. 1032editing. Many help commands use this feature.
1033 1033
1034@defspec with-output-to-temp-buffer buffer-name forms@dots{} 1034@defmac with-output-to-temp-buffer buffer-name forms@dots{}
1035This function executes @var{forms} while arranging to insert any output 1035This function executes @var{forms} while arranging to insert any output
1036they print into the buffer named @var{buffer-name}, which is first 1036they print into the buffer named @var{buffer-name}, which is first
1037created if necessary, and put into Help mode. Finally, the buffer is 1037created if necessary, and put into Help mode. Finally, the buffer is
@@ -1083,7 +1083,7 @@ The value of the last form in @var{forms} is returned.
1083---------- Buffer: foo ---------- 1083---------- Buffer: foo ----------
1084@end group 1084@end group
1085@end example 1085@end example
1086@end defspec 1086@end defmac
1087 1087
1088@defopt temp-buffer-show-function 1088@defopt temp-buffer-show-function
1089If this variable is non-@code{nil}, @code{with-output-to-temp-buffer} 1089If this variable is non-@code{nil}, @code{with-output-to-temp-buffer}
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 7a444ee4039..ea304292497 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -1054,7 +1054,8 @@ Text
1054* Registers:: How registers are implemented. Accessing 1054* Registers:: How registers are implemented. Accessing
1055 the text or position stored in a register. 1055 the text or position stored in a register.
1056* Base 64:: Conversion to or from base 64 encoding. 1056* Base 64:: Conversion to or from base 64 encoding.
1057* Checksum/Hash:: Computing "message digests"/"checksums"/"hashes". 1057* Checksum/Hash:: Computing cryptographic hashes.
1058* Parsing HTML/XML:: Parsing HTML and XML.
1058* Atomic Changes:: Installing several buffer changes "atomically". 1059* Atomic Changes:: Installing several buffer changes "atomically".
1059* Change Hooks:: Supplying functions to be run when text is changed. 1060* Change Hooks:: Supplying functions to be run when text is changed.
1060 1061
diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi
index cb3a4c54fac..429d999a2c8 100644
--- a/doc/lispref/eval.texi
+++ b/doc/lispref/eval.texi
@@ -521,8 +521,10 @@ values).@refill
521whose function definition has not yet been loaded into Emacs. It 521whose function definition has not yet been loaded into Emacs. It
522specifies which file contains the definition. When an autoload object 522specifies which file contains the definition. When an autoload object
523appears as a symbol's function definition, calling that symbol as a 523appears as a symbol's function definition, calling that symbol as a
524function automatically loads the specified file; then it calls the real 524function automatically loads the specified file; then it calls the
525definition loaded from that file. @xref{Autoload}. 525real definition loaded from that file. The way to arrange for an
526autoload object to appear as a symbol's function definition is
527described in @ref{Autoload}.
526 528
527@node Quoting 529@node Quoting
528@section Quoting 530@section Quoting
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 83bbc140b13..55b18edf2ec 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -134,7 +134,7 @@ in a different location since it was dumped.
134This function delays the initialization of @var{symbol} to the next 134This function delays the initialization of @var{symbol} to the next
135Emacs start. You normally use this function by specifying it as the 135Emacs start. You normally use this function by specifying it as the
136@code{:initialize} property of a customizable variable. (The argument 136@code{:initialize} property of a customizable variable. (The argument
137@var{value} is unused, and is provided only for compatiblity with the 137@var{value} is unused, and is provided only for compatibility with the
138form Custom expects.) 138form Custom expects.)
139@end defun 139@end defun
140 140
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index 669f058ef13..5dd57ccb4ac 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -2345,24 +2345,25 @@ multiple levels or comes from the menu bar.)
2345 It's often best to use a button-down event to trigger the menu. Then 2345 It's often best to use a button-down event to trigger the menu. Then
2346the user can select a menu item by releasing the button. 2346the user can select a menu item by releasing the button.
2347 2347
2348 A single keymap can appear as multiple menu panes, if you explicitly 2348@cindex submenu
2349arrange for this. The way to do this is to make a keymap for each pane, 2349 If the menu keymap contains a binding to a nested keymap, the nested
2350then create a binding for each of those maps in the main keymap of the 2350keymap specifies a @dfn{submenu}. There will be a menu item, labeled
2351menu. Give each of these bindings an item string that starts with 2351by the nested keymap's item string, and clicking on this item
2352@samp{@@}. The rest of the item string becomes the name of the pane. 2352automatically pops up the specified submenu. As a special exception,
2353See the file @file{lisp/mouse.el} for an example of this. Any ordinary 2353if the menu keymap contains a single nested keymap and no other menu
2354bindings with @samp{@@}-less item strings are grouped into one pane, 2354items, the menu shows the contents of the nested keymap directly, not
2355which appears along with the other panes explicitly created for the 2355as a submenu.
2356submaps. 2356
2357 2357 However, if Emacs is compiled without X toolkit support, submenus
2358 X toolkit menus don't have panes; instead, they can have submenus. 2358are not supported. Each nested keymap is shown as a menu item, but
2359Every nested keymap becomes a submenu, whether the item string starts 2359clicking on it does not automatically pop up the submenu. If you wish
2360with @samp{@@} or not. In a toolkit version of Emacs, the only thing 2360to imitate the effect of submenus, you can do that by giving a nested
2361special about @samp{@@} at the beginning of an item string is that the 2361keymap an item string which starts with @samp{@@}. This causes Emacs
2362@samp{@@} doesn't appear in the menu item. 2362to display the nested keymap using a separate @dfn{menu pane}; the
2363 2363rest of the item string after the @samp{@@} is the pane label. If
2364 Multiple keymaps that define the same menu prefix key produce 2364Emacs is compiled without X toolkit support, menu panes are not used;
2365separate panes or separate submenus. 2365in that case, a @samp{@@} at the beginning of an item string is
2366omitted when the menu label is displayed, and has no other effect.
2366 2367
2367@node Keyboard Menus 2368@node Keyboard Menus
2368@subsection Menus and the Keyboard 2369@subsection Menus and the Keyboard
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index 3c2fa60248e..47a2a39ed63 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -500,14 +500,31 @@ Building Emacs loads @file{loaddefs.el} and thus calls @code{autoload}.
500autoloads for all files in the current directory. 500autoloads for all files in the current directory.
501 501
502 The same magic comment can copy any kind of form into 502 The same magic comment can copy any kind of form into
503@file{loaddefs.el}. If the form following the magic comment is not a 503@file{loaddefs.el}. The form following the magic comment is copied
504function-defining form or a @code{defcustom} form, it is copied 504verbatim, @emph{except} if it is one of the forms which the autoload
505verbatim. ``Function-defining forms'' include @code{define-skeleton}, 505facility handles specially (e.g.@: by conversion into an
506@code{define-derived-mode}, @code{define-generic-mode} and 506@code{autoload} call). The forms which are not copied verbatim are
507@code{define-minor-mode} as well as @code{defun} and 507the following:
508@code{defmacro}. To save space, a @code{defcustom} form is converted to 508
509a @code{defvar} in @file{loaddefs.el}, with some additional information 509@table @asis
510if it uses @code{:require}. 510@item Definitions for function or function-like objects:
511@code{defun} and @code{defmacro}; also @code{defun*} and
512@code{defmacro*} (@pxref{Argument Lists,,,cl,CL Manual}), and
513@code{define-overloadable-function} (see the commentary in
514@file{mode-local.el}).
515
516@item Definitions for major or minor modes:
517@code{define-derived-mode}, @code{define-minor-mode},
518@code{define-compilation-mode}, @code{define-generic-mode},
519@code{easy-mmode-define-global-mode}, @code{define-global-minor-mode},
520@code{define-globalized-minor-mode}, and
521@code{easy-mmode-define-minor-mode}.
522
523@item Other definition types:
524@code{defcustom}, @code{defgroup}, @code{defclass}
525(@pxref{Top,EIEIO,,eieio,EIEIO}), and @code{define-skeleton} (see the
526commentary in @file{skeleton.el}).
527@end table
511 528
512 You can also use a magic comment to execute a form at build time 529 You can also use a magic comment to execute a form at build time
513@emph{without} executing it when the file itself is loaded. To do this, 530@emph{without} executing it when the file itself is loaded. To do this,
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 19c72981174..c97cd099328 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -412,14 +412,13 @@ or @code{R} (strong R).
412Corresponds to the Unicode @code{Decomposition_Type} and 412Corresponds to the Unicode @code{Decomposition_Type} and
413@code{Decomposition_Value} properties. The value is a list, whose 413@code{Decomposition_Value} properties. The value is a list, whose
414first element may be a symbol representing a compatibility formatting 414first element may be a symbol representing a compatibility formatting
415tag, such as @code{small}@footnote{ 415tag, such as @code{small}@footnote{The Unicode specification writes
416Note that the Unicode spec writes these tag names inside 416these tag names inside @samp{<..>} brackets, but the tag names in
417@samp{<..>} brackets. The tag names in Emacs do not include the 417Emacs do not include the brackets; e.g.@: Unicode specifies
418brackets; e.g., Unicode specifies @samp{<small>} where Emacs uses 418@samp{<small>} where Emacs uses @samp{small}. }; the other elements
419@samp{small}. 419are characters that give the compatibility decomposition sequence of
420}; the other elements are characters that give the compatibility 420this character. For unassigned codepoints, the value is the character
421decomposition sequence of this character. For unassigned codepoints, 421itself.
422the value is the character itself.
423 422
424@item decimal-digit-value 423@item decimal-digit-value
425Corresponds to the Unicode @code{Numeric_Value} property for 424Corresponds to the Unicode @code{Numeric_Value} property for
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index 94f1bf666d2..50f75da2de8 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -108,6 +108,11 @@ Emacs character code.
108@noindent 108@noindent
109See also @code{string-bytes}, in @ref{Text Representations}. 109See also @code{string-bytes}, in @ref{Text Representations}.
110 110
111If you need to compute the width of a string on display, you should
112use @code{string-width} (@pxref{Width}), not @code{length}, since
113@code{length} only counts the number of characters, but does not
114account for the display width of each character.
115
111@defun elt sequence index 116@defun elt sequence index
112@cindex elements of sequences 117@cindex elements of sequences
113This function returns the element of @var{sequence} indexed by 118This function returns the element of @var{sequence} indexed by
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index bbb75f1474d..64d0986493a 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -51,7 +51,9 @@ C are terminated by a character with @acronym{ASCII} code 0.)
51operate on them with the general array and sequence functions. 51operate on them with the general array and sequence functions.
52(@xref{Sequences Arrays Vectors}.) For example, you can access or 52(@xref{Sequences Arrays Vectors}.) For example, you can access or
53change individual characters in a string using the functions @code{aref} 53change individual characters in a string using the functions @code{aref}
54and @code{aset} (@pxref{Array Functions}). 54and @code{aset} (@pxref{Array Functions}). However, note that
55@code{length} should @emph{not} be used for computing the width of a
56string on display; use @code{string-width} (@pxref{Width}) instead.
55 57
56 There are two text representations for non-@acronym{ASCII} characters in 58 There are two text representations for non-@acronym{ASCII} characters in
57Emacs strings (and in buffers): unibyte and multibyte (@pxref{Text 59Emacs strings (and in buffers): unibyte and multibyte (@pxref{Text
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 88cb6a157f8..1ba0cae43b6 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -56,8 +56,8 @@ the character after point.
56* Registers:: How registers are implemented. Accessing the text or 56* Registers:: How registers are implemented. Accessing the text or
57 position stored in a register. 57 position stored in a register.
58* Base 64:: Conversion to or from base 64 encoding. 58* Base 64:: Conversion to or from base 64 encoding.
59* Checksum/Hash:: Computing "message digests"/"checksums"/"hashes". 59* Checksum/Hash:: Computing cryptographic hashes.
60* Parsing HTML:: Parsing HTML and XML. 60* Parsing HTML/XML:: Parsing HTML and XML.
61* Atomic Changes:: Installing several buffer changes "atomically". 61* Atomic Changes:: Installing several buffer changes "atomically".
62* Change Hooks:: Supplying functions to be run when text is changed. 62* Change Hooks:: Supplying functions to be run when text is changed.
63@end menu 63@end menu
@@ -2203,14 +2203,48 @@ key to indent properly for the language being edited. This section
2203describes the mechanism of the @key{TAB} key and how to control it. 2203describes the mechanism of the @key{TAB} key and how to control it.
2204The functions in this section return unpredictable values. 2204The functions in this section return unpredictable values.
2205 2205
2206@defvar indent-line-function 2206@deffn Command indent-for-tab-command &optional rigid
2207This variable's value is the function to be used by @key{TAB} (and 2207This is the command bound to @key{TAB} in most editing modes. Its
2208various commands) to indent the current line. The command 2208usual action is to indent the current line, but it can alternatively
2209@code{indent-according-to-mode} does little more than call this function. 2209insert a tab character or indent a region.
2210
2211Here is what it does:
2210 2212
2211In Lisp mode, the value is the symbol @code{lisp-indent-line}; in C 2213@itemize
2212mode, @code{c-indent-line}; in Fortran mode, @code{fortran-indent-line}. 2214@item
2213The default value is @code{indent-relative}. @xref{Auto-Indentation}. 2215First, it checks whether Transient Mark mode is enabled and the region
2216is active. If so, it called @code{indent-region} to indent all the
2217text in the region (@pxref{Region Indent}).
2218
2219@item
2220Otherwise, if the indentation function in @code{indent-line-function}
2221is @code{indent-to-left-margin} (a trivial command that inserts a tab
2222character), or if the variable @code{tab-always-indent} specifies that
2223a tab character ought to be inserted (see below), then it inserts a
2224tab character.
2225
2226@item
2227Otherwise, it indents the current line; this is done by calling the
2228function in @code{indent-line-function}. If the line is already
2229indented, and the value of @code{tab-always-indent} is @code{complete}
2230(see below), it tries completing the text at point.
2231@end itemize
2232
2233If @var{rigid} is non-@code{nil} (interactively, with a prefix
2234argument), then after this command indents a line or inserts a tab, it
2235also rigidly indents the entire balanced expression which starts at
2236the beginning of the current line, in order to reflect the new
2237indentation. This argument is ignored if the command indents the
2238region.
2239@end deffn
2240
2241@defvar indent-line-function
2242This variable's value is the function to be used by
2243@code{indent-for-tab-command}, and various other indentation commands,
2244to indent the current line. It is usually assigned by the major mode;
2245for instance, Lisp mode sets it to @code{lisp-indent-line}, C mode
2246sets it to @code{c-indent-line}, and so on. The default value is
2247@code{indent-relative}. @xref{Auto-Indentation}.
2214@end defvar 2248@end defvar
2215 2249
2216@deffn Command indent-according-to-mode 2250@deffn Command indent-according-to-mode
@@ -2218,41 +2252,31 @@ This command calls the function in @code{indent-line-function} to
2218indent the current line in a way appropriate for the current major mode. 2252indent the current line in a way appropriate for the current major mode.
2219@end deffn 2253@end deffn
2220 2254
2221@deffn Command indent-for-tab-command &optional rigid
2222This command calls the function in @code{indent-line-function} to
2223indent the current line; however, if that function is
2224@code{indent-to-left-margin}, @code{insert-tab} is called instead.
2225(That is a trivial command that inserts a tab character.) If
2226@var{rigid} is non-@code{nil}, this function also rigidly indents the
2227entire balanced expression that starts at the beginning of the current
2228line, to reflect change in indentation of the current line.
2229@end deffn
2230
2231@deffn Command newline-and-indent 2255@deffn Command newline-and-indent
2232This function inserts a newline, then indents the new line (the one 2256This function inserts a newline, then indents the new line (the one
2233following the newline just inserted) according to the major mode. 2257following the newline just inserted) according to the major mode. It
2234 2258does indentation by calling @code{indent-according-to-mode}.
2235It does indentation by calling the current @code{indent-line-function}.
2236In programming language modes, this is the same thing @key{TAB} does,
2237but in some text modes, where @key{TAB} inserts a tab,
2238@code{newline-and-indent} indents to the column specified by
2239@code{left-margin}.
2240@end deffn 2259@end deffn
2241 2260
2242@deffn Command reindent-then-newline-and-indent 2261@deffn Command reindent-then-newline-and-indent
2243@comment !!SourceFile simple.el
2244This command reindents the current line, inserts a newline at point, 2262This command reindents the current line, inserts a newline at point,
2245and then indents the new line (the one following the newline just 2263and then indents the new line (the one following the newline just
2246inserted). 2264inserted). It does indentation on both lines by calling
2247 2265@code{indent-according-to-mode}.
2248This command does indentation on both lines according to the current
2249major mode, by calling the current value of @code{indent-line-function}.
2250In programming language modes, this is the same thing @key{TAB} does,
2251but in some text modes, where @key{TAB} inserts a tab,
2252@code{reindent-then-newline-and-indent} indents to the column specified
2253by @code{left-margin}.
2254@end deffn 2266@end deffn
2255 2267
2268@defopt tab-always-indent
2269This variable can be used to customize the behavior of the @key{TAB}
2270(@code{indent-for-tab-command}) command. If the value is @code{t}
2271(the default), the command normally just indents the current line. If
2272the value is @code{nil}, the command indents the current line only if
2273point is at the left margin or in the line's indentation; otherwise,
2274it inserts a tab character. If the value is @code{complete}, the
2275command first tries to indent the current line, and if the line was
2276already indented, it calls @code{completion-at-point} to complete the
2277text at point (@pxref{Completion in Buffers}).
2278@end defopt
2279
2256@node Region Indent 2280@node Region Indent
2257@subsection Indenting an Entire Region 2281@subsection Indenting an Entire Region
2258 2282
@@ -2827,7 +2851,7 @@ faster to process chunks of text that have the same property value.
2827comparing property values. In all cases, @var{object} defaults to the 2851comparing property values. In all cases, @var{object} defaults to the
2828current buffer. 2852current buffer.
2829 2853
2830 For high performance, it's very important to use the @var{limit} 2854 For good performance, it's very important to use the @var{limit}
2831argument to these functions, especially the ones that search for a 2855argument to these functions, especially the ones that search for a
2832single property---otherwise, they may spend a long time scanning to the 2856single property---otherwise, they may spend a long time scanning to the
2833end of the buffer, if the property you are interested in does not change. 2857end of the buffer, if the property you are interested in does not change.
@@ -2839,15 +2863,15 @@ different properties.
2839 2863
2840@defun next-property-change pos &optional object limit 2864@defun next-property-change pos &optional object limit
2841The function scans the text forward from position @var{pos} in the 2865The function scans the text forward from position @var{pos} in the
2842string or buffer @var{object} till it finds a change in some text 2866string or buffer @var{object} until it finds a change in some text
2843property, then returns the position of the change. In other words, it 2867property, then returns the position of the change. In other words, it
2844returns the position of the first character beyond @var{pos} whose 2868returns the position of the first character beyond @var{pos} whose
2845properties are not identical to those of the character just after 2869properties are not identical to those of the character just after
2846@var{pos}. 2870@var{pos}.
2847 2871
2848If @var{limit} is non-@code{nil}, then the scan ends at position 2872If @var{limit} is non-@code{nil}, then the scan ends at position
2849@var{limit}. If there is no property change before that point, 2873@var{limit}. If there is no property change before that point, this
2850@code{next-property-change} returns @var{limit}. 2874function returns @var{limit}.
2851 2875
2852The value is @code{nil} if the properties remain unchanged all the way 2876The value is @code{nil} if the properties remain unchanged all the way
2853to the end of @var{object} and @var{limit} is @code{nil}. If the value 2877to the end of @var{object} and @var{limit} is @code{nil}. If the value
@@ -2980,10 +3004,9 @@ character.
2980@item face 3004@item face
2981@cindex face codes of text 3005@cindex face codes of text
2982@kindex face @r{(text property)} 3006@kindex face @r{(text property)}
2983You can use the property @code{face} to control the font and color of 3007The @code{face} property controls the appearance of the character,
2984text. @xref{Faces}, for more information. 3008such as its font and color. @xref{Faces}. The value of the property
2985 3009can be the following:
2986@code{face} can be the following:
2987 3010
2988@itemize @bullet 3011@itemize @bullet
2989@item 3012@item
@@ -2996,10 +3019,10 @@ face attribute name and @var{value} is a meaningful value for that
2996attribute. With this feature, you do not need to create a face each 3019attribute. With this feature, you do not need to create a face each
2997time you want to specify a particular attribute for certain text. 3020time you want to specify a particular attribute for certain text.
2998@xref{Face Attributes}. 3021@xref{Face Attributes}.
2999@end itemize
3000 3022
3001@code{face} can also be a list, where each element uses one of the 3023@item
3002forms listed above. 3024A list, where each element uses one of the two forms listed above.
3025@end itemize
3003 3026
3004Font Lock mode (@pxref{Font Lock Mode}) works in most buffers by 3027Font Lock mode (@pxref{Font Lock Mode}) works in most buffers by
3005dynamically updating the @code{face} property of characters based on 3028dynamically updating the @code{face} property of characters based on
@@ -3354,15 +3377,15 @@ of the text.
3354 Self-inserting characters normally take on the same properties as the 3377 Self-inserting characters normally take on the same properties as the
3355preceding character. This is called @dfn{inheritance} of properties. 3378preceding character. This is called @dfn{inheritance} of properties.
3356 3379
3357 In a Lisp program, you can do insertion with inheritance or without, 3380 A Lisp program can do insertion with inheritance or without,
3358depending on your choice of insertion primitive. The ordinary text 3381depending on the choice of insertion primitive. The ordinary text
3359insertion functions such as @code{insert} do not inherit any properties. 3382insertion functions, such as @code{insert}, do not inherit any
3360They insert text with precisely the properties of the string being 3383properties. They insert text with precisely the properties of the
3361inserted, and no others. This is correct for programs that copy text 3384string being inserted, and no others. This is correct for programs
3362from one context to another---for example, into or out of the kill ring. 3385that copy text from one context to another---for example, into or out
3363To insert with inheritance, use the special primitives described in this 3386of the kill ring. To insert with inheritance, use the special
3364section. Self-inserting characters inherit properties because they work 3387primitives described in this section. Self-inserting characters
3365using these primitives. 3388inherit properties because they work using these primitives.
3366 3389
3367 When you do insertion with inheritance, @emph{which} properties are 3390 When you do insertion with inheritance, @emph{which} properties are
3368inherited, and from where, depends on which properties are @dfn{sticky}. 3391inherited, and from where, depends on which properties are @dfn{sticky}.
@@ -3754,7 +3777,7 @@ closest to @var{new-pos} that is in the same field as @var{old-pos}.
3754 3777
3755If @var{new-pos} is @code{nil}, then @code{constrain-to-field} uses 3778If @var{new-pos} is @code{nil}, then @code{constrain-to-field} uses
3756the value of point instead, and moves point to the resulting position 3779the value of point instead, and moves point to the resulting position
3757as well as returning it. 3780in addition to returning that position.
3758 3781
3759If @var{old-pos} is at the boundary of two fields, then the acceptable 3782If @var{old-pos} is at the boundary of two fields, then the acceptable
3760final positions depend on the argument @var{escape-from-edge}. If 3783final positions depend on the argument @var{escape-from-edge}. If
@@ -4063,46 +4086,64 @@ The decoding functions ignore newline characters in the encoded text.
4063@node Checksum/Hash 4086@node Checksum/Hash
4064@section Checksum/Hash 4087@section Checksum/Hash
4065@cindex MD5 checksum 4088@cindex MD5 checksum
4066@cindex hashing, secure 4089@cindex SHA hash
4067@cindex SHA-1 4090@cindex hash, cryptographic
4068@cindex message digest computation 4091@cindex cryptographic hash
4069 4092
4070 MD5 cryptographic checksums, or @dfn{message digests}, are 128-bit 4093 Emacs has built-in support for computing @dfn{cryptographic hashes}.
4071``fingerprints'' of a document or program. They are used to verify 4094A cryptographic hash, or @dfn{checksum}, is a digital ``fingerprint''
4072that you have an exact and unaltered copy of the data. The algorithm 4095of a piece of data (e.g.@: a block of text) which can be used to check
4073to calculate the MD5 message digest is defined in Internet 4096that you have an unaltered copy of that data.
4074RFC@footnote{ 4097
4075For an explanation of what is an RFC, see the footnote in @ref{Base 4098@cindex message digest
407664}. 4099 Emacs supports several common cryptographic hash algorithms: MD5,
4077}1321. This section describes the Emacs facilities for computing 4100SHA-1, SHA-2, SHA-224, SHA-256, SHA-384 and SHA-512. MD5 is the
4078message digests and other forms of ``secure hash''. 4101oldest of these algorithms, and is commonly used in @dfn{message
4102digests} to check the integrity of messages transmitted over a
4103network. MD5 is not ``collision resistant'' (i.e.@: it is possible to
4104deliberately design different pieces of data which have the same MD5
4105hash), so you should not used it for anything security-related. A
4106similar theoretical weakness also exists in SHA-1. Therefore, for
4107security-related applications you should use the other hash types,
4108such as SHA-2.
4079 4109
4080@defun md5 object &optional start end coding-system noerror 4110@defun secure-hash algorithm object &optional start end binary
4081This function returns the MD5 message digest of @var{object}, which 4111This function returns a hash for @var{object}. The argument
4082should be a buffer or a string. 4112@var{algorithm} is a symbol stating which hash to compute: one of
4113@code{md5}, @code{sha1}, @code{sha224}, @code{sha256}, @code{sha384}
4114or @code{sha512}. The argument @var{object} should be a buffer or a
4115string.
4083 4116
4084The two optional arguments @var{start} and @var{end} are character 4117The optional arguments @var{start} and @var{end} are character
4085positions specifying the portion of @var{object} to compute the 4118positions specifying the portion of @var{object} to compute the
4086message digest for. If they are @code{nil} or omitted, the digest is 4119message digest for. If they are @code{nil} or omitted, the hash is
4087computed for the whole of @var{object}. 4120computed for the whole of @var{object}.
4088 4121
4089The function @code{md5} does not compute the message digest directly 4122If the argument @var{binary} is omitted or @code{nil}, the function
4090from the internal Emacs representation of the text (@pxref{Text 4123returns the @dfn{text form} of the hash, as an ordinary Lisp string.
4091Representations}). Instead, it encodes the text using a coding 4124If @var{binary} is non-@code{nil}, it returns the hash in @dfn{binary
4092system, and computes the message digest from the encoded text. The 4125form}, as a sequence of bytes stored in a unibyte string.
4093optional fourth argument @var{coding-system} specifies which coding 4126
4094system to use for encoding the text. It should be the same coding 4127This function does not compute the hash directly from the internal
4095system that you used to read the text, or that you used or will use 4128representation of @var{object}'s text (@pxref{Text Representations}).
4096when saving or sending the text. @xref{Coding Systems}, for more 4129Instead, it encodes the text using a coding system (@pxref{Coding
4097information about coding systems. 4130Systems}), and computes the hash from that encoded text. If
4098 4131@var{object} is a buffer, the coding system used is the one which
4099If @var{coding-system} is @code{nil} or omitted, the default depends 4132would be chosen by default for writing the text into a file. If
4100on @var{object}. If @var{object} is a buffer, the default for 4133@var{object} is a string, the user's preferred coding system is used
4101@var{coding-system} is whatever coding system would be chosen by 4134(@pxref{Recognize Coding,,, emacs, GNU Emacs Manual}).
4102default for writing this text into a file. If @var{object} is a 4135@end defun
4103string, the user's most preferred coding system (@pxref{Recognize 4136
4104Coding, prefer-coding-system, the description of 4137@defun md5 object &optional start end coding-system noerror
4105@code{prefer-coding-system}, emacs, GNU Emacs Manual}) is used. 4138This function returns an MD5 hash. It is semi-obsolete, since for
4139most purposes it is equivalent to calling @code{secure-hash} with
4140@code{md5} as the @var{algorithm} argument. The @var{object},
4141@var{start} and @var{end} arguments have the same meanings as in
4142@code{secure-hash}.
4143
4144If @var{coding-system} is non-@code{nil}, it specifies a coding system
4145to use to encode the text; if omitted or @code{nil}, the default
4146coding system is used, like in @code{secure-hash}.
4106 4147
4107Normally, @code{md5} signals an error if the text can't be encoded 4148Normally, @code{md5} signals an error if the text can't be encoded
4108using the specified or chosen coding system. However, if 4149using the specified or chosen coding system. However, if
@@ -4110,65 +4151,53 @@ using the specified or chosen coding system. However, if
4110coding instead. 4151coding instead.
4111@end defun 4152@end defun
4112 4153
4113@defun secure-hash algorithm object &optional start end binary 4154@node Parsing HTML/XML
4114This function provides a general interface to a variety of secure 4155@section Parsing HTML and XML
4115hashing algorithms. As well as the MD5 algorithm, it supports SHA-1,
4116SHA-2, SHA-224, SHA-256, SHA-384 and SHA-512. The argument
4117@var{algorithm} is a symbol stating which hash to compute. The
4118arguments @var{object}, @var{start}, and @var{end} are as for the
4119@code{md5} function. If the optional argument @var{binary} is
4120non-@code{nil}, returns a string in binary form.
4121@end defun
4122
4123@node Parsing HTML
4124@section Parsing HTML
4125@cindex parsing html 4156@cindex parsing html
4126 4157
4158When Emacs is compiled with libxml2 support, the following functions
4159are available to parse HTML or XML text into Lisp object trees.
4160
4127@defun libxml-parse-html-region start end &optional base-url 4161@defun libxml-parse-html-region start end &optional base-url
4128This function provides HTML parsing via the @code{libxml2} library. 4162This function parses the text between @var{start} and @var{end} as
4129It parses ``real world'' HTML and tries to return a sensible parse tree 4163HTML, and returns a list representing the HTML @dfn{parse tree}. It
4130regardless. 4164attempts to handle ``real world'' HTML by robustly coping with syntax
4165mistakes.
4131 4166
4132In addition to @var{start} and @var{end} (specifying the start and end 4167The optional argument @var{base-url}, if non-@code{nil}, should be a
4133of the region to act on), it takes an optional parameter, 4168string specifying the base URL for relative URLs occurring in links.
4134@var{base-url}, which is used to expand relative URLs in the document,
4135if any.
4136 4169
4137Here's an example demonstrating the structure of the parsed data you 4170In the parse tree, each HTML node is represented by a list in which
4138get out. Given this HTML document: 4171the first element is a symbol representing the node name, the second
4172element is an alist of node attributes, and the remaining elements are
4173the subnodes.
4174
4175The following example demonstrates this. Given this (malformed) HTML
4176document:
4139 4177
4140@example 4178@example
4141<html><hEad></head><body width=101><div class=thing>Foo<div>Yes 4179<html><head></head><body width=101><div class=thing>Foo<div>Yes
4142@end example 4180@end example
4143 4181
4144You get this parse tree: 4182@noindent
4183A call to @code{libxml-parse-html-region} returns this:
4145 4184
4146@example 4185@example
4147(html 4186(html ()
4148 (head) 4187 (head ())
4149 (body 4188 (body ((width . "101"))
4150 (:width . "101") 4189 (div ((class . "thing"))
4151 (div 4190 "Foo"
4152 (:class . "thing") 4191 (div ()
4153 (text . "Foo") 4192 "Yes"))))
4154 (div
4155 (text . "Yes\n")))))
4156@end example 4193@end example
4157
4158It's a simple tree structure, where the @code{car} for each node is
4159the name of the node, and the @code{cdr} is the value, or the list of
4160values.
4161
4162Attributes are coded the same way as child nodes, but with @samp{:} as
4163the first character.
4164@end defun 4194@end defun
4165 4195
4166@cindex parsing xml 4196@cindex parsing xml
4167@defun libxml-parse-xml-region start end &optional base-url 4197@defun libxml-parse-xml-region start end &optional base-url
4168 4198This function is the same as @code{libxml-parse-html-region}, except
4169This is much the same as @code{libxml-parse-html-region} above, but 4199that it parses the text as XML rather than HTML (so it is stricter
4170operates on XML instead of HTML, and is correspondingly stricter about 4200about syntax).
4171syntax.
4172@end defun 4201@end defun
4173 4202
4174@node Atomic Changes 4203@node Atomic Changes
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi
index a92a807b747..58092f23157 100644
--- a/doc/lispref/vol1.texi
+++ b/doc/lispref/vol1.texi
@@ -1076,7 +1076,8 @@ Text
1076* Registers:: How registers are implemented. Accessing 1076* Registers:: How registers are implemented. Accessing
1077 the text or position stored in a register. 1077 the text or position stored in a register.
1078* Base 64:: Conversion to or from base 64 encoding. 1078* Base 64:: Conversion to or from base 64 encoding.
1079* Checksum/Hash:: Computing "message digests"/"checksums"/"hashes". 1079* Checksum/Hash:: Computing cryptographic hashes.
1080* Parsing HTML/XML:: Parsing HTML and XML.
1080* Atomic Changes:: Installing several buffer changes "atomically". 1081* Atomic Changes:: Installing several buffer changes "atomically".
1081* Change Hooks:: Supplying functions to be run when text is changed. 1082* Change Hooks:: Supplying functions to be run when text is changed.
1082 1083
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi
index 97b21aba10b..a42b70d77a4 100644
--- a/doc/lispref/vol2.texi
+++ b/doc/lispref/vol2.texi
@@ -1075,7 +1075,8 @@ Text
1075* Registers:: How registers are implemented. Accessing 1075* Registers:: How registers are implemented. Accessing
1076 the text or position stored in a register. 1076 the text or position stored in a register.
1077* Base 64:: Conversion to or from base 64 encoding. 1077* Base 64:: Conversion to or from base 64 encoding.
1078* Checksum/Hash:: Computing "message digests"/"checksums"/"hashes". 1078* Checksum/Hash:: Computing cryptographic hashes.
1079* Parsing HTML/XML:: Parsing HTML and XML.
1079* Atomic Changes:: Installing several buffer changes "atomically". 1080* Atomic Changes:: Installing several buffer changes "atomically".
1080* Change Hooks:: Supplying functions to be run when text is changed. 1081* Change Hooks:: Supplying functions to be run when text is changed.
1081 1082
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 07be7fa9079..b541b2419c8 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -3142,7 +3142,7 @@ as @code{save-window-excursion}:
3142@end example 3142@end example
3143@end defun 3143@end defun
3144 3144
3145@defspec save-window-excursion forms@dots{} 3145@defmac save-window-excursion forms@dots{}
3146This special form records the window configuration, executes @var{forms} 3146This special form records the window configuration, executes @var{forms}
3147in sequence, then restores the earlier window configuration. The window 3147in sequence, then restores the earlier window configuration. The window
3148configuration includes, for each window, the value of point and the 3148configuration includes, for each window, the value of point and the
@@ -3179,7 +3179,7 @@ For example:
3179 ;; @r{The screen is now split again.} 3179 ;; @r{The screen is now split again.}
3180@end group 3180@end group
3181@end example 3181@end example
3182@end defspec 3182@end defmac
3183 3183
3184@defun window-configuration-p object 3184@defun window-configuration-p object
3185This function returns @code{t} if @var{object} is a window configuration. 3185This function returns @code{t} if @var{object} is a window configuration.
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 1691c979fb6..c95aaa9b15d 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,15 @@
12012-03-10 Eli Zaretskii <eliz@gnu.org>
2
3 * info.texi (Expert Info): Move the index entry for "Texinfo" from
4 "Getting Started" to this node. (Bug#10450)
5
62012-03-10 Chong Yidong <cyd@gnu.org>
7
8 * flymake.texi (Example -- Configuring a tool called via make):
9 Mention the Automake COMPILE variable (Bug#8715).
10
11 * info.texi (Getting Started): Add an index entry (Bug#10450).
12
12012-03-02 Michael Albinus <michael.albinus@gmx.de> 132012-03-02 Michael Albinus <michael.albinus@gmx.de>
2 14
3 * dbus.texi (Signals): Known names will be mapped onto unique 15 * dbus.texi (Signals): Known names will be mapped onto unique
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index 687a2f7b4d4..28fb7864f06 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -449,10 +449,10 @@ Finally, we add an entry to @code{flymake-err-line-patterns}:
449@cindex Adding support for C (gcc+make) 449@cindex Adding support for C (gcc+make)
450 450
451In this example we will add support for C files syntax checked by 451In this example we will add support for C files syntax checked by
452@code{gcc} called via @code{make}. 452@command{gcc} called via @command{make}.
453 453
454We're not required to write any new functions, as Flymake already has 454We're not required to write any new functions, as Flymake already has
455functions for @code{make}. We just add a new entry to the 455functions for @command{make}. We just add a new entry to the
456@code{flymake-allowed-file-name-masks}: 456@code{flymake-allowed-file-name-masks}:
457 457
458@lisp 458@lisp
@@ -464,7 +464,7 @@ functions for @code{make}. We just add a new entry to the
464 flymake-allowed-file-name-masks)) 464 flymake-allowed-file-name-masks))
465@end lisp 465@end lisp
466 466
467@code{flymake-simple-make-init} builds the following @code{make} 467@code{flymake-simple-make-init} builds the following @command{make}
468command line: 468command line:
469 469
470@lisp 470@lisp
@@ -486,9 +486,17 @@ check-syntax:
486 gcc -o /dev/null -S ${CHK_SOURCES} 486 gcc -o /dev/null -S ${CHK_SOURCES}
487@end verbatim 487@end verbatim
488 488
489The format of error messages reported by @code{gcc} is already 489@noindent
490The format of error messages reported by @command{gcc} is already
490supported by Flymake, so we don't have to add a new entry to 491supported by Flymake, so we don't have to add a new entry to
491@code{flymake-err-line-patterns}. 492@code{flymake-err-line-patterns}. Note that if you are using
493Automake, you may want to replace @code{gcc} with the standard
494Automake variable @code{COMPILE}:
495
496@verbatim
497check-syntax:
498 $(COMPILE) -o /dev/null -S ${CHK_SOURCES}
499@end verbatim
492 500
493@node Flymake Implementation 501@node Flymake Implementation
494@chapter Flymake Implementation 502@chapter Flymake Implementation
@@ -548,9 +556,9 @@ These modes are handled inside init/cleanup/getfname functions, see
548@ref{Adding support for a new syntax check tool}. 556@ref{Adding support for a new syntax check tool}.
549 557
550Flymake contains implementations of all functionality required to 558Flymake contains implementations of all functionality required to
551support different syntax check modes described above (making 559support different syntax check modes described above (making temporary
552temporary copies, finding master files, etc.), as well as some 560copies, finding master files, etc.), as well as some tool-specific
553tool-specific (routines for @code{make}, @code{Ant}, etc.) code. 561(routines for Make, Ant, etc.) code.
554 562
555 563
556@node Making a temporary copy 564@node Making a temporary copy
@@ -626,8 +634,8 @@ Therefore, a customizable variable
626way to implement the desired behavior. 634way to implement the desired behavior.
627 635
628The default implementation, @code{flymake-get-project-include-dirs-imp}, 636The default implementation, @code{flymake-get-project-include-dirs-imp},
629uses a @code{make} call. This requires a correct base directory, that is, a 637uses a @command{make} call. This requires a correct base directory, that is, a
630directory containing a correct @code{Makefile}, to be determined. 638directory containing a correct @file{Makefile}, to be determined.
631 639
632As obtaining the project include directories might be a costly operation, its 640As obtaining the project include directories might be a costly operation, its
633return value is cached in the hash table. The cache is cleared in the beginning 641return value is cached in the hash table. The cache is cleared in the beginning
@@ -641,16 +649,16 @@ of every syntax check attempt.
641 649
642Flymake can be configured to use different tools for performing syntax 650Flymake can be configured to use different tools for performing syntax
643checks. For example, it can use direct compiler call to syntax check a perl 651checks. For example, it can use direct compiler call to syntax check a perl
644script or a call to @code{make} for a more complicated case of a 652script or a call to @command{make} for a more complicated case of a
645@code{C/C++} source. The general idea is that simple files, like perl 653@code{C/C++} source. The general idea is that simple files, like perl
646scripts and html pages, can be checked by directly invoking a 654scripts and html pages, can be checked by directly invoking a
647corresponding tool. Files that are usually more complex and generally 655corresponding tool. Files that are usually more complex and generally
648used as part of larger projects, might require non-trivial options to 656used as part of larger projects, might require non-trivial options to
649be passed to the syntax check tool, like include directories for 657be passed to the syntax check tool, like include directories for
650C++. The latter files are syntax checked using some build tool, like 658C++. The latter files are syntax checked using some build tool, like
651@code{make} or @code{Ant}. 659Make or Ant.
652 660
653All @code{make} configuration data is usually stored in a file called 661All Make configuration data is usually stored in a file called
654@code{Makefile}. To allow for future extensions, flymake uses a notion of 662@code{Makefile}. To allow for future extensions, flymake uses a notion of
655buildfile to reference the 'project configuration' file. 663buildfile to reference the 'project configuration' file.
656 664
diff --git a/doc/misc/info.texi b/doc/misc/info.texi
index ed00e8da028..8952bfb9122 100644
--- a/doc/misc/info.texi
+++ b/doc/misc/info.texi
@@ -1235,6 +1235,7 @@ this:
1235 1235
1236@node Expert Info 1236@node Expert Info
1237@chapter Info for Experts 1237@chapter Info for Experts
1238@cindex Texinfo
1238 1239
1239 This chapter explains how to write an Info file by hand. However, 1240 This chapter explains how to write an Info file by hand. However,
1240in most cases, writing a Texinfo file is better, since you can use it 1241in most cases, writing a Texinfo file is better, since you can use it
diff --git a/etc/NEWS b/etc/NEWS
index fd4f7afa863..1d56a0044c6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -251,7 +251,8 @@ On character terminals, these methods are used for characters that
251cannot be encoded by the `terminal-coding-system'. 251cannot be encoded by the `terminal-coding-system'.
252 252
253--- 253---
254*** New input methods for Farsi: farsi and farsi-translit. 254*** New input methods for Farsi: farsi and farsi-translit;
255and for Bulgarian: bulgarian-alt-phonetic.
255 256
256+++ 257+++
257*** `nobreak-char-display' now also highlights Unicode hyphen chars 258*** `nobreak-char-display' now also highlights Unicode hyphen chars
@@ -771,6 +772,11 @@ See MH-E-NEWS for details.
771--- 772---
772** mpc.el: Can use pseudo tags of the form tag1|tag2 as a union of two tags. 773** mpc.el: Can use pseudo tags of the form tag1|tag2 as a union of two tags.
773 774
775** nXML mode no longer binds C-RET to `nxml-complete'.
776Completion is now performed via `completion-at-point', bound to M-TAB.
777If `nxml-bind-meta-tab-to-complete-flag' is non-nil (the default),
778this performs tag completion.
779
774--- 780---
775** Prolog mode has been completely revamped, with lots of additional 781** Prolog mode has been completely revamped, with lots of additional
776functionality such as more intelligent indentation, electricity, support for 782functionality such as more intelligent indentation, electricity, support for
@@ -1025,7 +1031,7 @@ for buffers with dead inferior processes has been generalized.
1025** The return value of `backup-buffer' has changed. 1031** The return value of `backup-buffer' has changed.
1026It is now a list of three elements, where the second element is a list 1032It is now a list of three elements, where the second element is a list
1027describing the original file's SELinux context. If Emacs or the 1033describing the original file's SELinux context. If Emacs or the
1028system lacks SELinux cupport, the context list is (nil nil nil nil). 1034system lacks SELinux support, the context list is (nil nil nil nil).
1029See the "Basic SELinux support" entry under "Changes in Emacs 24.1", 1035See the "Basic SELinux support" entry under "Changes in Emacs 24.1",
1030above. 1036above.
1031 1037
@@ -1482,13 +1488,12 @@ These require Emacs to be built with ImageMagick support.
1482image-transform-fit-to-height, image-transform-fit-to-width, 1488image-transform-fit-to-height, image-transform-fit-to-width,
1483image-transform-set-rotation, image-transform-set-scale. 1489image-transform-set-rotation, image-transform-set-scale.
1484 1490
1491+++
1485** XML and HTML parsing 1492** XML and HTML parsing
1486If Emacs is compiled with libxml2 support, there are two new functions: 1493If Emacs is compiled with libxml2 support, there are two new
1487`libxml-parse-html-region' (which parses "real world" HTML) and 1494functions: `libxml-parse-html-region' (which parses "real world" HTML)
1488`libxml-parse-xml-region' (which parses XML). Both return an Emacs 1495and `libxml-parse-xml-region' (which parses XML). Both return an
1489Lisp parse tree. 1496Emacs Lisp parse tree.
1490
1491FIXME: These should be front-ended by xml.el.
1492 1497
1493** GnuTLS 1498** GnuTLS
1494 1499
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 75627f084cd..ae3f49868b2 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -302,6 +302,12 @@ Help mode due to setting `temp-buffer-show-hook' rather than using
302 302
303** Keyboard problems 303** Keyboard problems
304 304
305*** Unable to enter the M-| key on some German keyboards.
306Some users have reported that M-| suffers from "keyboard ghosting".
307This can't be fixed by Emacs, as the keypress never gets passed to it
308at all (as can be verified using "xev"). You can work around this by
309typing `ESC |' instead.
310
305*** "Compose Character" key does strange things when used as a Meta key. 311*** "Compose Character" key does strange things when used as a Meta key.
306 312
307If you define one key to serve as both Meta and Compose Character, you 313If you define one key to serve as both Meta and Compose Character, you
diff --git a/leim/ChangeLog b/leim/ChangeLog
index 39ba53201da..40e570c99c1 100644
--- a/leim/ChangeLog
+++ b/leim/ChangeLog
@@ -1,3 +1,17 @@
12012-03-13 Йордан Миладинов <jordanmiladinov@gmail.com> (tiny change)
2
3 * quail/cyrillic.el (bulgarian-alt-phonetic):
4 New input method. (Bug#10893)
5
62012-03-09 Mohsen BANAN <libre@mohsen.1.banan.byname.net>
7
8 * quail/persian.el: Update which includes: (1) full compliance to
9 ISIRI-6219, forbidden characters were eliminated and missing
10 characters were added; (2) layer 3 of ISIRI-9147 is now
11 implemented with a '\' prefix; (3) double entry of characters
12 which were postfixed with 'h' is now supported; (4) lots of
13 comment and additional pointers have been added.
14
12011-12-15 Kenichi Handa <handa@m17n.org> 152011-12-15 Kenichi Handa <handa@m17n.org>
2 16
3 * quail/ethiopic.el ("ethiopic"): Do not refer to 17 * quail/ethiopic.el ("ethiopic"): Do not refer to
diff --git a/leim/quail/cyrillic.el b/leim/quail/cyrillic.el
index 0c2f64e3d69..0e5fb0cdb83 100644
--- a/leim/quail/cyrillic.el
+++ b/leim/quail/cyrillic.el
@@ -1236,6 +1236,79 @@ Unicode based."
1236 ("." ?$,1(n(B) 1236 ("." ?$,1(n(B)
1237 ("/" ?.)) 1237 ("/" ?.))
1238 1238
1239(quail-define-package
1240 "bulgarian-alt-phonetic" "Bulgarian" "$,1(1(=(D(B"
1241 nil
1242 "Bulgarian alternative Phonetic keyboard layout, producing Unicode.
1243
1244This phonetic layout replaces all the Latin letters with Bulgarian
1245\(Cyrillic\) letters based on similarities in their pronunciation or look.
1246
1247Note that, since the letters ',Li(B', ',Ll(B', ',Ln(B' and ',Lo(B' are attached to the
1248']', '\', '`' and '[' keys respectively, Caps Lock does not affect them."
1249nil t t t t nil nil nil nil nil t)
1250
1251;; $,1(N(B 1! 2@ 3$,1uV(B 4$ 5% 6$,1tL(B 7,A'(B 8* 9( 0) -$,1rs(B =+ $,1(l(}(B
1252;; $,1(G(B $,1(H(B $,1(5(B $,1(@(B $,1(B(B $,1(J(B $,1(C(B $,1(8(B $,1(>(B $,1(?(B $,1(O(B $,1(I(B
1253;; ,L0(B $,1(A(B $,1(4(B $,1(D(B $,1(3(B $,1(E(B $,1(9(B $,1(:(B $,1(;(B :; '"
1254;; $,1(7(B $,1(6(B $,1(F(B $,1(2(B $,1(1(B $,1(=(B $,1(<(B ,$,1r~(B .$,1r|(B /?
1255
1256(quail-define-rules
1257 ("#" ?,Lp(B)
1258 ("&" ?,A'(B)
1259 ("/#" ?#)
1260 ("/&" ?&)
1261 ("/<" ?<)
1262 ("/>" ?>)
1263 ("/[" ?\[)
1264 ("/\\" ?\\)
1265 ("/]" ?\])
1266 ("/^" ?^)
1267 ("/_" ?_)
1268 ("/`" ?`)
1269 ("/{" ?{)
1270 ("/|" ?|)
1271 ("/}" ?})
1272 ("/~" ?~)
1273 ("<" ?$,1r~(B)
1274 (">" ?$,1r|(B)
1275 ("A" ?$,1(0(B) ("a" ?$,1(P(B)
1276 ("B" ?$,1(1(B) ("b" ?$,1(Q(B)
1277 ("C" ?$,1(F(B) ("c" ?$,1(f(B)
1278 ("D" ?$,1(4(B) ("d" ?$,1(T(B)
1279 ("E" ?$,1(5(B) ("e" ?$,1(U(B)
1280 ("F" ?$,1(D(B) ("f" ?$,1(d(B)
1281 ("G" ?$,1(3(B) ("g" ?$,1(S(B)
1282 ("H" ?$,1(E(B) ("h" ?$,1(e(B)
1283 ("I" ?$,1(8(B) ("i" ?$,1(X(B)
1284 ("J" ?$,1(9(B) ("j" ?$,1(Y(B)
1285 ("K" ?$,1(:(B) ("k" ?$,1(Z(B)
1286 ("L" ?$,1(;(B) ("l" ?$,1([(B)
1287 ("M" ?$,1(<(B) ("m" ?$,1(\(B)
1288 ("N" ?$,1(=(B) ("n" ?$,1(](B)
1289 ("O" ?$,1(>(B) ("o" ?$,1(^(B)
1290 ("P" ?$,1(?(B) ("p" ?$,1(_(B)
1291 ("Q" ?$,1(G(B) ("q" ?$,1(g(B)
1292 ("R" ?$,1(@(B) ("r" ?$,1(`(B)
1293 ("S" ?$,1(A(B) ("s" ?$,1(a(B)
1294 ("T" ?$,1(B(B) ("t" ?$,1(b(B)
1295 ("U" ?$,1(C(B) ("u" ?$,1(c(B)
1296 ("V" ?$,1(2(B) ("v" ?$,1(R(B)
1297 ("W" ?$,1(H(B) ("w" ?$,1(h(B)
1298 ("X" ?$,1(6(B) ("x" ?$,1(V(B)
1299 ("Y" ?$,1(J(B) ("y" ?$,1(j(B)
1300 ("Z" ?$,1(7(B) ("z" ?$,1(W(B)
1301 ("[" ?$,1(o(B)
1302 ("\\" ?$,1(l(B)
1303 ("]" ?$,1(i(B)
1304 ("^" ?$,1tL(B)
1305 ("_" ?$,1rs(B)
1306 ("`" ?$,1(n(B)
1307 ("{" ?$,1(O(B)
1308 ("|" ?$,1(}(B)
1309 ("}" ?$,1(I(B)
1310 ("~" ?$,1(N(B))
1311
1239;; From `Bulgarian-PHO.kmap for Yudit', Alexander Shopov 1312;; From `Bulgarian-PHO.kmap for Yudit', Alexander Shopov
1240;; <al_shopov@web.bg>. 1313;; <al_shopov@web.bg>.
1241 1314
diff --git a/leim/quail/persian.el b/leim/quail/persian.el
index d006e83aa71..70e2d380329 100644
--- a/leim/quail/persian.el
+++ b/leim/quail/persian.el
@@ -2,8 +2,8 @@
2 2
3;; Copyright (C) 2011-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2011-2012 Free Software Foundation, Inc.
4 4
5;; Author: Mohsen BANAN <libre@mohsen.banan.1.byname.net> 5;; Author: Mohsen BANAN <libre@mohsen.1.banan.byname.net>
6;; http://mohsen.banan.1.byname.net/contact 6;; http://mohsen.1.banan.byname.net/contact
7 7
8;; Keywords: multilingual, input method, Farsi, Persian, keyboard 8;; Keywords: multilingual, input method, Farsi, Persian, keyboard
9 9
@@ -27,12 +27,15 @@
27;;; Commentary: 27;;; Commentary:
28;; 28;;
29;; This file contains a collection of input methods for 29;; This file contains a collection of input methods for
30;; Persian languages - Farsi, Urdu, Pashto (Afghani), ... 30;; Persian languages (Farsi, Urdu, Pashto/Afghanic, ...)
31;; 31;;
32;; At this time, the following input methods are specified: 32;; At this time, the following input methods are specified:
33;; 33;;
34;; - (farsi) Persian Keyboard based on Islamic Republic of Iran's ISIR-9147 34;; - (farsi-isiri-9149) Persian Keyboard based on Islamic Republic of Iran's ISIR-9147
35;; - (farsi-translit) Intuitive transliteration keyboard layout for Persian 35;; - (farsi-transliterate-banan) An intuitive transliteration keyboard for Farsi
36;;
37;; Additional documentation for these input methods can be found at:
38;; http://www.persoarabic.org/PLPC/120036
36;; 39;;
37 40
38;;; Code: 41;;; Code:
@@ -42,42 +45,71 @@
42;; 45;;
43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
44;; 47;;
45;; farsi 48;; farsi-isiri-9147
46;; 49;;
47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
48;; 51;;
49;; The keyboard mapping defined here is based on: 52;; The keyboard mapping defined here is based on:
50;; 53;;
51;; Institute of Standards and Industrial Research of Iran 54;; Institute of Standards and Industrial Research of Iran
52;; Information Technology – Layout of Persian Letters and Symbols on Computer Keyboards 55;; Information Technology – Layout of Persian Letters and Symbols
53;; ISIRI 9147 -- 1st edition 56;; on Computer Keyboards
54;; http://www.isiri.org/UserStd/DownloadStd.aspx?id=9147 57;; ISIRI 9147 -- 1st edition
58;; http://www.isiri.org/UserStd/DownloadStd.aspx?id=9147
59;;
60;; The specification is also republished at
61;; http://www.farsiweb.ir/wiki/Image:Isiri-9147.pdf
62;; and various other sites.
63;;
64;; ISIRI-6219 is also relevant.
65;;
66;; Layers 1, 2 and 3 of ISIRI-9147 are fully implemented with the
67;; exception of the Backslash, Alt-Backslash, Shift-Space and
68;; Alt-Space keys.
69;;
70;; The Backslash key is used to replace کلید با دگر ساز راست‌ -- the Alt or
71;; Meta key.
55;; 72;;
56;; Only layers 1 and 2 of ISIRI-9147 are applicable to emacs. 73;; Layer 3 is then entered with the Backslash key and Layer 3 is
74;; implemented as two letter keys as specified in ISIRI-9147.
57;; 75;;
58;; This input method was built using the Farsi table in X Keyboard Configuration Data Base. 76;; The character corresponding to Backslash is entered with Backslash-Backslash.
77;; Alt-Backslash has been moved to Backslash-r.
78;; Alt-Space has been moved to Backslash-t.
79;; Shift-Space has been moved to Backslash-y.
59;; 80;;
60;; 0) Selected gnome keyboard "USA" 81;; With these modifications, farsi-isiri-9147 is a full implementation
61;; 1) Created a list of all keys 82;; of ISIRI-9147. Additionally, these modifications allow for this
62;; 2) Selected gnome keyboard "Iran" 83;; implementation to be ascii input stream based -- in addition to
63;; 3) For each key just press it and get the mapped persian character 84;; being a keyboard layout.
85;;
86;; If a key on Layer 1 was reserved to replace دگر ساز راست‌ (the Alt
87;; or Meta key), then farsi-isiri-9147 could have claimed full
88;; compliance -- without the need for the above description. Perhaps
89;; this can be considered a flaw in the base ISIRI-9147 specification
90;; to be addressed in the next revision.
64;; 91;;
65 92
66 93
67(quail-define-package 94(quail-define-package
68 "farsi" "Farsi" " Ù" nil "Farsi input method. 95 "farsi-isiri-9147" "Farsi" " Ù" nil "Farsi input method.
69 96
70Based on ISIRI-9149 Layout of Persian Letters and Symbols on Computer Keyboards. 97Based on ISIRI-9147 Layout of Persian Letters and Symbols on Computer Keyboards.
71" nil t t t t nil nil nil nil nil t) 98" nil t t t t nil nil nil nil nil t)
72 99
100;; Note: the rows of keys below are enclosed in Left-To-Right Override
101;; embedding, to prevent them from being reordered by the Emacs
102;; display engine.
103
104
73;; +----------------------------------------------------------------+ 105;; +----------------------------------------------------------------+
74;; | ۱! | ۲٬ | ۳٫ | ۴﷼ | ۵٪ | ۶× | ۷، | ۸* | ۹) | ۰( | -ـ | =+ | `÷ | 106;; ‭| ۱! | ۲٬ | ۳٫ | ۴﷼ | ۵٪ | ۶× | ۷، | ۸* | ۹( | ۰) | -ـ | =+ | `÷ |‬
75;; +----------------------------------------------------------------+ 107;; +----------------------------------------------------------------+
76;; | ضْ| صٌ| Ø«Ù| قً| ÙÙ| غÙ| عَ| هّ| Ø®] | Ø­[ | ج} | Ú†{ | 108;; ‭| ضْ| صٌ| Ø«Ù| قً| ÙÙ| غÙ| عَ| هّ| Ø®] | Ø­[ | ج{ | Ú†} |‬
77;; +------------------------------------------------------------+ 109;; +------------------------------------------------------------+
78;; | شؤ | سئ | یي | بإ | لأ | اآ | تة | ن» | م« | ک: | گ؛ | \| | 110;; ‭| ش‌ؤ | س‌ئ | ی‌ي | ب‌إ | لأ | اآ | ت‌ة | ن« | م» | ک: | گ؛ | \| |‬
79;; +-----------------------------------------------------------+ 111;; +-----------------------------------------------------------+
80;; | ظك | طٓ| زژ | رٰ| ذB | دٔ| پء | و> | .< | /؟ | 112;; ‭| ظ‌ك | طٓ| زژ | رٰ| ذB | دٔ| پء | و< | .> | /؟ |‬
81;; +-------------------------------------------+ 113;; +-------------------------------------------+
82 114
83(quail-define-rules 115(quail-define-rules
@@ -93,7 +125,7 @@ Based on ISIRI-9149 Layout of Persian Letters and Symbols on Computer Keyboards.
93 ("0" ?Û°) 125 ("0" ?Û°)
94 ("-" ?-) 126 ("-" ?-)
95 ("=" ?=) 127 ("=" ?=)
96 ;;("`" ?â€\)) ;; اتصال مجازى 128 ("`" ?\u200D) ;; ZWJ -- ZERO WIDTH JOINER اتصال مجازى
97 ("q" ?ض) 129 ("q" ?ض)
98 ("w" ?ص) 130 ("w" ?ص)
99 ("e" ?Ø«) 131 ("e" ?Ø«)
@@ -117,7 +149,7 @@ Based on ISIRI-9149 Layout of Persian Letters and Symbols on Computer Keyboards.
117 ("l" ?Ù…) 149 ("l" ?Ù…)
118 (";" ?Ú©) 150 (";" ?Ú©)
119 ("'" ?Ú¯) 151 ("'" ?Ú¯)
120 ("\\" ?\\) ;; خط اريب وارو 152
121 ("z" ?ظ) 153 ("z" ?ظ)
122 ("x" ?Ø·) 154 ("x" ?Ø·)
123 ("c" ?ز) 155 ("c" ?ز)
@@ -170,93 +202,204 @@ Based on ISIRI-9149 Layout of Persian Letters and Symbols on Computer Keyboards.
170 ("X" ?Ù“) 202 ("X" ?Ù“)
171 ("C" ?Ú˜) 203 ("C" ?Ú˜)
172 ("V" ?Ù°) 204 ("V" ?Ù°)
173 ;; ("B" ?‌‌) ;; ÙØ§ØµÙ„ه٠مجازى 205 ("B" ?\u200C) ;; ZWNJ -- ZERO WIDTH NON-JOINER ÙØ§ØµÙ„ه٠مجازى
174 ("N" ?Ù”) ;; همزه ÙØ§Ø±Ø³Ù‰ بالا 206 ("N" ?Ù”) ;; همزه ÙØ§Ø±Ø³Ù‰ بالا
175 ("M" ?Ø¡) ;; harf farsi hamzeh 207 ("M" ?Ø¡) ;; harf farsi hamzeh
176 ("<" ?>) 208 ("<" ?>)
177 (">" ?<) 209 (">" ?<)
178 ("?" ?ØŸ) 210 ("?" ?ØŸ)
211
212 ;; Level 3 Entered with \
213 ;;
214 ("\\" ?\\) ;; خط اريب وارو
215 ("\\\\" ?\\)
216 ("\\~" ?\u007E)
217 ("\\1" ?\u0060)
218 ("\\2" ?\u0040)
219 ("\\3" ?\u0023)
220 ("\\4" ?\u0024)
221 ("\\5" ?\u0025)
222 ("\\6" ?\u005E)
223 ("\\7" ?\u0026)
224 ("\\8" ?\u2022)
225 ("\\9" ?\u200E)
226 ("\\0" ?\u200F)
227 ("\\-" ?\u005F)
228 ("\\+" ?\u2212)
229 ("\\q" ?\u00B0)
230 ;;\\w" ?\u0000)
231 ("\\e" ?\u20AC)
232 ("\\r" ?\u2010) ;; replacement for Alt-BSL
233 ("\\t" ?\u00A0) ;; replacement for ALT-SPC
234 ("\\y" ?\u200C) ;; replacement for SHIFT-SPC
235 ;;("\\u" ?\u0000)
236 ("\\i" ?\u202D)
237 ("\\o" ?\u202E)
238 ("\\p" ?\u202C)
239 ("\\[" ?\u202A)
240 ("\\]" ?\u202B)
241 ;;("\\a" ?\u0000)
242 ;;("\\s" ?\u0000)
243 ("\\d" ?\u0649)
244 ;;("\\f" ?\u0000)
245 ;;("\\g" ?\u0000)
246 ("\\h" ?\u0671)
247 ;;("\\j" ?\u0000)
248 ("\\k" ?\uFD3E)
249 ("\\l" ?\uFD3F)
250 ("\\;" ?\u003B)
251 ("\\'" ?\u0022)
252 ;;("\\z" ?\u0000)
253 ;;("\\x" ?\u0000)
254 ;;("\\c" ?\u0000)
255 ("\\v" ?\u0656)
256 ("\\b" ?\u200D)
257 ("\\n" ?\u0655)
258 ("\\m" ?\u2026)
259 ("\\," ?\u002C)
260 ("\\." ?\u0027)
261 ("\\?" ?\u003F)
262 ;;("\\\\" ?\u2010) ;; Moved to backslash r to leave room for BSL-BSL
179 ) 263 )
180 264
181;; 265;;
182;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 266;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
183;; 267;;
184;; farsi-translit 268;; farsi-transliterate-banan
269;;
270;; Given a Qwerty keyboard, use Persian-to-Latin transliteration knowledge
271;; to reverse transliterate in persian
185;; 272;;
186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 273;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
187;;; 274;;;
188;;; This is a persian/farsi transliteration keyboard designed 275;;; See http://www.persoarabic.org/PLPC/120036 document for more complete
189;;; for people who: 276;;; documentation of keyboard bindings and usage instructions.
190;;; - Know how to write in farsi
191;;; - Are comfortable with the qwerty keyboard
192;;; - Are familiar with two letter phonetic mapping to persian characters
193;;; (e.g.: gh, kh, ch, sh, zh, hh, lh)
194;;; 277;;;
195;;; This translit keyboard is designed to be intuitive such that 278;;
196;;; mapping are easy and natural to remember for a persian writer. 279;; ISIRI-9147 Persian keyboard is generally not well suited for Iranian-Expatriates
197;;; For some persian characters there are multiple ways of inputting 280;; working/living in the West.
198;;; the same character. 281;;
199;;; 282;; The qwerty keyboard is usually second nature to Persian speaking expatriates and they
200;;; The letter 'h' is used for a number of two character mappings, 283;; don't want to learn/adapt to ISIRI-9147. They expect software to adapt to them.
201;;; this means that some character sequence inputs need to be repeated 284;;
202;;; followed by a backspace followed by the 'h'. 285;; That is what the ``Banan Multi-Character (Reverse) Transliteration Persian Input Method'' does.
203;;; For example: سحر = 's' 's' '<bs>' 'h' 'h' 'r' 286;;
204;;; In practice such sequences are rare. 287;; The typical profile of the user is assumed to be one who:
205;;; 288;;
206 289;; - can write in farsi (not just speak it).
290;; - is fully comfortable with a qwerty latin keyboard.
291;; - is not familiar with isir-9147 and does not wish to be trained.
292;; - communicates and writes in a mixed globish/persian -- not pure persian.
293;; - is intuitively familiar with transliteration of farsi/persian into latin based on two letter
294;; phonetic mapping to persian characters (e.g., gh Ù‚ -- kh Ø® -- sh Ø´ -- ch Ú† -- zh Ú˜.
295;;
296;; This transliteration keyboard is designed to be intuitive such that
297;; mapping are easy and natural to remember for a persian writer.
298;; It is designed to be equivalent in capability to farsi-isiri-9147
299;; and provide for inputting all characters enumerated in ISIRI-6219.
300;;
301;; farsi-transliterate-banan is of course phonetic oriented. But it is very different from
302;; pinglish. Pinglish is word oriented where you sound out the word with latin letters --
303;; including the vowels. farsi-transliterate-banan is letter oriented where you enter the
304;; latin letter/letters closest to the persian letter. And usually omit vowels.
305;;
306;; For some persian characters there are multiple ways of inputting
307;; the same character. For example both ``i'' and ``y'' produce ی.
308;; For یک ``yk'', ``y'' is more natural and for این ``ain'', ``i'' is more natural.
309;;
310;; The more frequently used keys are mapped to lower case. The less frequently used letter moves to
311;; upper case. For example: ``s'' is س and ``S'' is ص. ``h'' is ح and ``H''
312;; is Ù‡.
313;;
314;; Multi-character input is based on \, &, and / prefix
315;; characters. The letter 'h' is used as a postfix for the following two character mappings:
316;; gh Ù‚ -- kh Ø® -- sh Ø´ -- ch Ú† -- zh Ú˜ -- Th Ø© -- Yh Ù‰.
317;;
318;;
319;; Prefix letter \ is used for two character inputs when an alternate form of a letter
320;; is desired for example \% is: ‌÷ when % is: ٪.
321;;
322;; Prefix letter & is used for multi-character inputs when special characters are
323;; desired based on their abbreviate name. For example you can enter &lrm; to enter the
324;; ``LEFT-TO-RIGHT MARK'' character.
325;;
326;; Prefix letter / is used to provide two characters. / is: ``ZERO WIDTH NON-JOINER''
327;; and // is /.
328;;
329;; The letter 'h' is used in a number of two character postfix mappings,
330;; for example ``sh'' Ø´. So if you need the sequence of ``s'' and ``h'' you
331;; need to repeat the ``s''. For example: سحر = 's' 's' 'h' 'r'.
332;;
207 333
208 334
209(quail-define-package 335(quail-define-package
210 "farsi-translit" "Farsi" "پ" t 336 "farsi-transliterate-banan" "Farsi" "ب" t
211 "Intuitive transliteration keyboard layout for persian/farsi. 337 "Intuitive transliteration keyboard layout for persian/farsi.
212" nil t t t t nil nil nil nil nil t) 338" nil t t t t nil nil nil nil nil t)
213 339
214 340
215(quail-define-rules 341(quail-define-rules
216 ("a" ?ا) 342;;;;;;;;;;; isiri-6219 Table 5 -- جدول Ûµ - حروÙÙÙ Ø§ØµÙ„ÛŒÙ ÙØ§Ø±Ø³ÛŒ
217 ("A" ?Ø¢) ;; alef madde 343 ("W" ?Ø¡) ;; hamzeh
218 ("b" ?ب) 344 ("A" ?آ) ;; U+0622 & ARABIC LETTER ALEF WITH MADDA ABOVE & ال٠با کلاه
219 ("p" ?Ù¾) 345 ("a" ?ا) ;; U+0627 & ARABIC LETTER ALEF & الÙ
346 ("\\a" ?Ø£)
347 ("b" ?ب) ;; U+0628 & ARABIC LETTER BEH &
348 ("p" ?Ù¾) ;; U+067e & ARABIC LETTER PEH &
220 ("t" ?ت) 349 ("t" ?ت)
350 ("tt" ?ت)
221 ("c" ?Ø«) 351 ("c" ?Ø«)
352 ("cc" ?Ø«)
222 ("j" ?ج) 353 ("j" ?ج)
223 ("ch" ?Ú†) 354 ("ch" ?Ú†)
224 ("hh" ?Ø­) 355 ("h" ?Ø­)
225 ("kh" ?Ø®) 356 ("kh" ?Ø®)
226 ("d" ?د) 357 ("d" ?د)
227 ("Z" ?ذ) 358 ("Z" ?ذ)
228 ("r" ?ر) 359 ("r" ?ر)
229 ("z" ?ز) 360 ("z" ?ز)
361 ("zz" ?ز)
230 ("zh" ?Ú˜) 362 ("zh" ?Ú˜)
231 ("s" ?س) 363 ("s" ?س)
364 ("ss" ?س)
232 ("sh" ?Ø´) 365 ("sh" ?Ø´)
233 ("S" ?ص) 366 ("S" ?ص)
234 ("x" ?ض) 367 ("x" ?ض)
235 ("T" ?Ø·) 368 ("T" ?Ø·)
369 ("TT" ?Ø·)
236 ("X" ?ظ) 370 ("X" ?ظ)
237 ("w" ?ع) 371 ("w" ?ع)
238 ("Q" ?غ) 372 ("q" ?غ)
239 ("f" ?Ù) 373 ("f" ?Ù)
240 ("q" ?Ù‚) 374 ("Q" ?Ù‚)
241 ("gh" ?Ù‚) 375 ("gh" ?Ù‚)
242 ("k" ?Ú©) 376 ("k" ?Ú©)
243 ("K" ?Ùƒ) ;; Arabic kaf 377 ("kk" ?Ú©)
244 ("g" ?Ú¯) 378 ("g" ?Ú¯)
379 ("gg" ?Ú¯)
245 ("l" ?Ù„) 380 ("l" ?Ù„)
246 ("lh" ?ï»»)
247 ("m" ?Ù…) 381 ("m" ?Ù…)
248 ("n" ?Ù†) 382 ("n" ?Ù†)
249 ("v" ?Ùˆ) 383 ("v" ?Ùˆ)
250 ("V" ?ؤ)
251 ("u" ?Ùˆ) 384 ("u" ?Ùˆ)
385 ("V" ?ؤ)
252 ("H" ?Ù‡) 386 ("H" ?Ù‡)
253 ("h" ?ه) 387 ("y" ?ی)
254 ("th" ?ة) ;; ta marbuteh 388 ("i" ?ی)
255 ("yh" ?Û€) ;; he ye
256 ("y" ?Ù‰)
257 ("i" ?ÙŠ)
258 ("I" ?ئ) 389 ("I" ?ئ)
259 390
391
392;;;;;;;;;;; isiri-6219 Table 6 -- جدول Û¶ - حروÙÙ٠عربی
393 ("F" ?Ø¥)
394 ("D" ?\u0671) ;; (ucs-insert #x0671)Ù± named: حرÙ٠الÙ٠وصل
395 ("K" ?Ùƒ) ;; Arabic kaf
396 ("Th" ?Ø©) ;; ta marbuteh
397 ("Y" ?ÙŠ)
398 ("YY" ?ÙŠ)
399 ("Yh" ?Ù‰)
400
401;;;;;;;;;;; isiri-6219 Table 4 -- جدول ۴ - ارقام و علائم ریاضی
402 ("0" ?Û°)
260 ("1" ?Û±) 403 ("1" ?Û±)
261 ("2" ?Û²) 404 ("2" ?Û²)
262 ("3" ?Û³) 405 ("3" ?Û³)
@@ -266,31 +409,106 @@ Based on ISIRI-9149 Layout of Persian Letters and Symbols on Computer Keyboards.
266 ("7" ?Û·) 409 ("7" ?Û·)
267 ("8" ?Û¸) 410 ("8" ?Û¸)
268 ("9" ?Û¹) 411 ("9" ?Û¹)
269 ("0" ?Û°)
270 412
271 ("F" ?Ø¥) 413 ("\\/" ?\u066B) ;; (ucs-insert #x066B)Ù« named: Ù…Ù…ÛŒØ²Ù ÙØ§Ø±Ø³ÛŒ
272 ("G" ?Ø£) 414 ("\\," ?\u066C) ;; (ucs-insert #x066C)Ù¬ named: جداکننده‌ی هزارهای ÙØ§Ø±Ø³ÛŒ
415 ("%" ?\u066A) ;; (ucs-insert #x066A)Ùª named: Ø¯Ø±ØµØ¯Ù ÙØ§Ø±Ø³ÛŒ
416 ("+" ?\u002B) ;; (ucs-insert #x002B)+ named: علامت٠به‌اضاÙÙ‡
417 ("-" ?\u2212) ;; (ucs-insert #x2212)− named: علامت٠منها
418 ("\\*" ?\u00D7) ;; (ucs-insert #x00D7)× named: علامت٠ضرب
419 ("\\%" ?\u007F) ;; (ucs-insert #x00F7)÷ named: علامت٠تقسیم
420 ("<" ?\u003C) ;; (ucs-insert #x003C)< named: علامت٠کوچکتر
421 ("=" ?\u003D) ;; (ucs-insert #x003D)= named: علامت٠مساوی
422 (">" ?\u003E) ;; (ucs-insert #x003E)> named: علامت٠بزرگتر
273 423
274 ("~" ?Ù‘) ;; tashdid ;; تشديد ÙØ§Ø±Ø³Ù‰ 424
275 ("`" ?ٓ) 425;;;;;;;;;;; isiri-6219 Table 2 -- جدول ۲ - علائم نقطه گذاری٠مشترک
276 ("e" ?Ù) ;; zir زير ÙØ§Ø±Ø³Ù‰ -- ÙØªØ­Ù‡ 426 ;;; Space
277 ("E" ?Ù) ;; eizan ;; دو زير ÙØ§Ø±Ø³Ù‰ -- تنوين جر
278 ("#" ?Ù‹) ;; Ù‹ tanvin nasb ;; دو زبر ÙØ§Ø±Ø³Ù‰ -- تنوين نصب
279 ("@" ?Ù’) ;; ساکن ÙØ§Ø±Ø³Ù‰
280 ("^" ?ÙŽ) ;; zbar ;; زبر ÙØ§Ø±Ø³Ù‰ -- ÙØªØ­Ù‡
281 ("o" ?Ù) ;; peesh ;; پيش ÙØ§Ø±Ø³Ù‰ -- ضمه
282 ("O" ?ÙŒ) ;; دو پيش ÙØ§Ø±Ø³Ù‰ -- تنوين Ø±ÙØ¹
283 ("?" ?ØŸ) ;; alamat soal
284 ("&" ?Ù”) ;; همزه ÙØ§Ø±Ø³Ù‰ بالا
285 ("$" ?Ø¡) ;; hamzeh
286 ("%" ?÷) ;;
287 ("*" ?×) ;;
288 (";" ?Ø›) ;;
289 (",h" ?،) ;; farsi
290 (",h" ?,) ;; latin
291 ("." ?.) ;; 427 ("." ?.) ;;
428 (":" ?\u003A) ;; (ucs-insert #x003A): named:
429 ("!" ?\u0021) ;; (ucs-insert #x0021)! named:
430 ("\\." ?\u2026) ;; (ucs-insert #x2026)… named:
431 ("\\-" ?\u2010) ;; (ucs-insert #x2010)†named:
432 ("-" ?\u002D) ;; (ucs-insert #x002D)- named:
433 ("|" ?|)
434 ;;("\\\\" ?\)
435 ("//" ?/)
436 ("*" ?\u002A) ;; (ucs-insert #x002A)* named:
437 ("(" ?\u0028) ;; (ucs-insert #x0028)( named:
438 (")" ?\u0029) ;; (ucs-insert #x0029)) named:
439 ("[" ?\u005B) ;; (ucs-insert #x005B)[ named:
440 ("[" ?\u005D) ;; (ucs-insert #x005D)] named:
441 ("{" ?\u007B) ;; (ucs-insert #x007B){ named:
442 ("}" ?\u007D) ;; (ucs-insert #x007D)} named:
443 ("\\<" ?\u00AB) ;; (ucs-insert #x00AB)« named:
444 ("\\>" ?\u00BB) ;; (ucs-insert #x00BB)» named:
445
446
447;;;;;;;;;;; isiri-6219 Table 3 -- جدول Û³ - علائم نقطه Ú¯Ø°Ø§Ø±ÛŒÙ ÙØ§Ø±Ø³ÛŒ
448 ("," ?،) ;; farsi
449 (";" ?Ø›) ;;
450 ("?" ?ØŸ) ;; alamat soal
292 ("_" ?Ù€) ;; 451 ("_" ?Ù€) ;;
293)
294 452
295 453
454;;;;;;;;;;; isiri-6219 Table 1 -- جدول ۱ - نویسه‌های کنترلی
455 ;; LF
456 ;; CR
457 ("&zwnj;" ?\u200C) ;; (ucs-insert #x200C)‌ named: ÙØ§ØµÙ„ه‌ی مجازی
458 ("/" ?\u200C) ;;
459 ("&zwj;" ?\u200D) ;; (ucs-insert #x200D)†named: اتصال٠مجازی
460 ("J" ?\u200D) ;;
461 ("&lrm;" ?\u200E) ;; (ucs-insert #x200E)‎ named: نشانه‌ی چپ‌به‌راست
462 ("&rlm;" ?\u200F) ;; (ucs-insert #x200F)†named: نشانه‌ی راست‌به‌چپ
463 ("&ls;" ?\u2028) ;; (ucs-insert #x2028)
 named: جداکننده‌ی سطرها
464 ("&ps;" ?\u2028) ;; (ucs-insert #x2029)
 named: جداکننده‌ی بندها
465 ("&lre;" ?\u202A) ;; (ucs-insert #x202A)‪ named: زیرمتن٠چپ‌به‌راست
466 ("&rle;" ?\u202B) ;; (ucs-insert #x202B) named: زیرمتن٠راست‌به‌چپ
467 ("&pdf;" ?\u202C) ;; (ucs-insert #x202C) named: پایان٠زیرمتن
468 ("&lro;" ?\u202D) ;; (ucs-insert #x202D) named: زیرمتن٠اکیداً چپ‌به‌راست
469 ("&rlo;" ?\u202D) ;; (ucs-insert #x202E) named: زیرمتن٠اکیداً راست‌به‌چپ
470 ("&bom;" ?\uFEFF) ;; (ucs-insert #xFEFF) named: نشانه‌ی ترتیب٠بایت‌ها
471
472
473;;;;;;;;;;; isiri-6219 Table 7 -- جدول Û· - Ù†Ø´Ø§Ù†Ù‡â€ŒÙ‡Ø§ÛŒÙ ÙØ§Ø±Ø³ÛŒ
474 ("^" ?ÙŽ) ;; zbar ;; زبر ÙØ§Ø±Ø³Ù‰
475 ("e" ?Ù) ;; zir زير ÙØ§Ø±Ø³Ù‰
476 ("o" ?Ù) ;; peesh ;; پيش ÙØ§Ø±Ø³Ù‰ -- ضمه
477 ("E" ?Ù) ;; eizan ;; دو زير ÙØ§Ø±Ø³Ù‰ -- تنوين جر
478 ("#" ?ً) ;; دو زبر
479 ("O" ?ÙŒ) ;; دو پيش ÙØ§Ø±Ø³Ù‰ -- تنوين Ø±ÙØ¹
480 ("~" ?Ù‘) ;; tashdid ;; تشديد ÙØ§Ø±Ø³Ù‰
481 ("@" ?Ù’) ;; ساکن ÙØ§Ø±Ø³Ù‰
482 ("U" ?\u0653) ;; (ucs-insert #x0653)Ù“ named: Ù…Ø¯Ù ÙØ§Ø±Ø³ÛŒ
483 ("`" ?Ù”) ;; همزه ÙØ§Ø±Ø³Ù‰ بالا
484 ("C" ?\u0655) ;; (ucs-insert #x0655)Ù• named: همزه ÙØ§Ø±Ø³Ù‰ پایین
485 ("$" ?\u0670) ;; (ucs-insert #x0670)Ù° named: الÙ٠مقصوره‌ی ÙØ§Ø±Ø³ÛŒ
486
487
488;;;;;;;;;;; isiri-6219 Table 8 - Forbidden Characters -- جدول ۸ - نویسه‌های٠ممنوع
489;; ;; he ye (ucs-insert 1728) kills emacs-24.0.90
490;; arabic digits 0-9
491
492
493;;;;;;; Latin Extensions
494 ("\\" ?\\) ;; خط اريب وارو
495 ("\\\\" ?\\)
496 ("\\~" ?~)
497 ("\\@" ?@)
498 ("\\#" ?#)
499 ("\\$" ?\uFDFC) ;; (ucs-insert #xFDFC)ï·¼ named:
500 ("\\^" ?^)
501 ("\\1" ?1)
502 ("\\2" ?2)
503 ("\\3" ?3)
504 ("\\4" ?4)
505 ("\\5" ?5)
506 ("\\6" ?6)
507 ("\\7" ?7)
508 ("\\8" ?8)
509 ("\\9" ?9)
510 ("\\0" ?0)
511
512)
513
296;;; persian.el ends here 514;;; persian.el ends here
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 32054e68db2..2384599caf2 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,21 @@
12012-03-11 Andreas Schwab <schwab@linux-m68k.org>
2
3 * emacsclient.c (main): Handle -print-nonl command.
4
5 * emacsclient.c (main): Handle multiple messages in a single
6 datagram.
7
8 * emacsclient.c (socket_name): Add const.
9 (get_server_config): Add parameter config_file, use it instead of
10 global server_file.
11 (set_tcp_socket): Add parameter local_server_file, pass it down to
12 get_server_config.
13 (set_local_socket): Add parameter local_socket_name, use it
14 instead of global socket_name.
15 (set_socket): Adjust calls to set_local_socket and set_tcp_socket.
16 Don't clobber global server_file or socket_name.
17 (main): No longer reset server_file or socket_name.
18
12012-01-05 Glenn Morris <rgm@gnu.org> 192012-01-05 Glenn Morris <rgm@gnu.org>
2 20
3 * ebrowse.c (version) <emacs_copyright>: 21 * ebrowse.c (version) <emacs_copyright>:
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 11eba2792d6..049886ed2ba 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -152,7 +152,7 @@ int tty = 0;
152const char *alternate_editor = NULL; 152const char *alternate_editor = NULL;
153 153
154/* If non-NULL, the filename of the UNIX socket. */ 154/* If non-NULL, the filename of the UNIX socket. */
155char *socket_name = NULL; 155const char *socket_name = NULL;
156 156
157/* If non-NULL, the filename of the authentication file. */ 157/* If non-NULL, the filename of the authentication file. */
158const char *server_file = NULL; 158const char *server_file = NULL;
@@ -955,36 +955,37 @@ initialize_sockets (void)
955 * the Emacs server: host, port, and authentication string. 955 * the Emacs server: host, port, and authentication string.
956 */ 956 */
957static int 957static int
958get_server_config (struct sockaddr_in *server, char *authentication) 958get_server_config (const char *config_file, struct sockaddr_in *server,
959 char *authentication)
959{ 960{
960 char dotted[32]; 961 char dotted[32];
961 char *port; 962 char *port;
962 FILE *config = NULL; 963 FILE *config = NULL;
963 964
964 if (file_name_absolute_p (server_file)) 965 if (file_name_absolute_p (config_file))
965 config = fopen (server_file, "rb"); 966 config = fopen (config_file, "rb");
966 else 967 else
967 { 968 {
968 const char *home = egetenv ("HOME"); 969 const char *home = egetenv ("HOME");
969 970
970 if (home) 971 if (home)
971 { 972 {
972 char *path = xmalloc (strlen (home) + strlen (server_file) 973 char *path = xmalloc (strlen (home) + strlen (config_file)
973 + EXTRA_SPACE); 974 + EXTRA_SPACE);
974 strcpy (path, home); 975 strcpy (path, home);
975 strcat (path, "/.emacs.d/server/"); 976 strcat (path, "/.emacs.d/server/");
976 strcat (path, server_file); 977 strcat (path, config_file);
977 config = fopen (path, "rb"); 978 config = fopen (path, "rb");
978 free (path); 979 free (path);
979 } 980 }
980#ifdef WINDOWSNT 981#ifdef WINDOWSNT
981 if (!config && (home = egetenv ("APPDATA"))) 982 if (!config && (home = egetenv ("APPDATA")))
982 { 983 {
983 char *path = xmalloc (strlen (home) + strlen (server_file) 984 char *path = xmalloc (strlen (home) + strlen (config_file)
984 + EXTRA_SPACE); 985 + EXTRA_SPACE);
985 strcpy (path, home); 986 strcpy (path, home);
986 strcat (path, "/.emacs.d/server/"); 987 strcat (path, "/.emacs.d/server/");
987 strcat (path, server_file); 988 strcat (path, config_file);
988 config = fopen (path, "rb"); 989 config = fopen (path, "rb");
989 free (path); 990 free (path);
990 } 991 }
@@ -1019,14 +1020,14 @@ get_server_config (struct sockaddr_in *server, char *authentication)
1019} 1020}
1020 1021
1021static HSOCKET 1022static HSOCKET
1022set_tcp_socket (void) 1023set_tcp_socket (const char *local_server_file)
1023{ 1024{
1024 HSOCKET s; 1025 HSOCKET s;
1025 struct sockaddr_in server; 1026 struct sockaddr_in server;
1026 struct linger l_arg = {1, 1}; 1027 struct linger l_arg = {1, 1};
1027 char auth_string[AUTH_KEY_LENGTH + 1]; 1028 char auth_string[AUTH_KEY_LENGTH + 1];
1028 1029
1029 if (! get_server_config (&server, auth_string)) 1030 if (! get_server_config (local_server_file, &server, auth_string))
1030 return INVALID_SOCKET; 1031 return INVALID_SOCKET;
1031 1032
1032 if (server.sin_addr.s_addr != inet_addr ("127.0.0.1") && !quiet) 1033 if (server.sin_addr.s_addr != inet_addr ("127.0.0.1") && !quiet)
@@ -1236,7 +1237,7 @@ init_signals (void)
1236 1237
1237 1238
1238static HSOCKET 1239static HSOCKET
1239set_local_socket (void) 1240set_local_socket (const char *local_socket_name)
1240{ 1241{
1241 HSOCKET s; 1242 HSOCKET s;
1242 struct sockaddr_un server; 1243 struct sockaddr_un server;
@@ -1254,27 +1255,20 @@ set_local_socket (void)
1254 server.sun_family = AF_UNIX; 1255 server.sun_family = AF_UNIX;
1255 1256
1256 { 1257 {
1257 int sock_status = 0; 1258 int sock_status;
1258 int default_sock = !socket_name; 1259 int use_tmpdir = 0;
1259 int saved_errno = 0; 1260 int saved_errno;
1260 const char *server_name = "server"; 1261 const char *server_name = local_socket_name;
1261 const char *tmpdir IF_LINT ( = NULL); 1262 const char *tmpdir IF_LINT ( = NULL);
1262 char *tmpdir_storage = NULL; 1263 char *tmpdir_storage = NULL;
1263 char *socket_name_storage = NULL; 1264 char *socket_name_storage = NULL;
1264 1265
1265 if (socket_name && !strchr (socket_name, '/') 1266 if (!strchr (local_socket_name, '/') && !strchr (local_socket_name, '\\'))
1266 && !strchr (socket_name, '\\'))
1267 { 1267 {
1268 /* socket_name is a file name component. */ 1268 /* socket_name is a file name component. */
1269 server_name = socket_name;
1270 socket_name = NULL;
1271 default_sock = 1; /* Try both UIDs. */
1272 }
1273
1274 if (default_sock)
1275 {
1276 long uid = geteuid (); 1269 long uid = geteuid ();
1277 ptrdiff_t tmpdirlen; 1270 ptrdiff_t tmpdirlen;
1271 use_tmpdir = 1;
1278 tmpdir = egetenv ("TMPDIR"); 1272 tmpdir = egetenv ("TMPDIR");
1279 if (!tmpdir) 1273 if (!tmpdir)
1280 { 1274 {
@@ -1293,26 +1287,27 @@ set_local_socket (void)
1293 tmpdir = "/tmp"; 1287 tmpdir = "/tmp";
1294 } 1288 }
1295 tmpdirlen = strlen (tmpdir); 1289 tmpdirlen = strlen (tmpdir);
1296 socket_name = socket_name_storage = 1290 socket_name_storage =
1297 xmalloc (tmpdirlen + strlen (server_name) + EXTRA_SPACE); 1291 xmalloc (tmpdirlen + strlen (server_name) + EXTRA_SPACE);
1298 strcpy (socket_name, tmpdir); 1292 strcpy (socket_name_storage, tmpdir);
1299 sprintf (socket_name + tmpdirlen, "/emacs%ld/", uid); 1293 sprintf (socket_name_storage + tmpdirlen, "/emacs%ld/", uid);
1300 strcat (socket_name + tmpdirlen, server_name); 1294 strcat (socket_name_storage + tmpdirlen, server_name);
1295 local_socket_name = socket_name_storage;
1301 } 1296 }
1302 1297
1303 if (strlen (socket_name) < sizeof (server.sun_path)) 1298 if (strlen (local_socket_name) < sizeof (server.sun_path))
1304 strcpy (server.sun_path, socket_name); 1299 strcpy (server.sun_path, local_socket_name);
1305 else 1300 else
1306 { 1301 {
1307 message (TRUE, "%s: socket-name %s too long\n", 1302 message (TRUE, "%s: socket-name %s too long\n",
1308 progname, socket_name); 1303 progname, local_socket_name);
1309 fail (); 1304 fail ();
1310 } 1305 }
1311 1306
1312 /* See if the socket exists, and if it's owned by us. */ 1307 /* See if the socket exists, and if it's owned by us. */
1313 sock_status = socket_status (server.sun_path); 1308 sock_status = socket_status (server.sun_path);
1314 saved_errno = errno; 1309 saved_errno = errno;
1315 if (sock_status && default_sock) 1310 if (sock_status && use_tmpdir)
1316 { 1311 {
1317 /* Failing that, see if LOGNAME or USER exist and differ from 1312 /* Failing that, see if LOGNAME or USER exist and differ from
1318 our euid. If so, look for a socket based on the UID 1313 our euid. If so, look for a socket based on the UID
@@ -1333,21 +1328,21 @@ set_local_socket (void)
1333 /* We're running under su, apparently. */ 1328 /* We're running under su, apparently. */
1334 long uid = pw->pw_uid; 1329 long uid = pw->pw_uid;
1335 ptrdiff_t tmpdirlen = strlen (tmpdir); 1330 ptrdiff_t tmpdirlen = strlen (tmpdir);
1336 socket_name = xmalloc (tmpdirlen + strlen (server_name) 1331 char *user_socket_name
1337 + EXTRA_SPACE); 1332 = xmalloc (tmpdirlen + strlen (server_name) + EXTRA_SPACE);
1338 strcpy (socket_name, tmpdir); 1333 strcpy (user_socket_name, tmpdir);
1339 sprintf (socket_name + tmpdirlen, "/emacs%ld/", uid); 1334 sprintf (user_socket_name + tmpdirlen, "/emacs%ld/", uid);
1340 strcat (socket_name + tmpdirlen, server_name); 1335 strcat (user_socket_name + tmpdirlen, server_name);
1341 1336
1342 if (strlen (socket_name) < sizeof (server.sun_path)) 1337 if (strlen (user_socket_name) < sizeof (server.sun_path))
1343 strcpy (server.sun_path, socket_name); 1338 strcpy (server.sun_path, user_socket_name);
1344 else 1339 else
1345 { 1340 {
1346 message (TRUE, "%s: socket-name %s too long\n", 1341 message (TRUE, "%s: socket-name %s too long\n",
1347 progname, socket_name); 1342 progname, user_socket_name);
1348 exit (EXIT_FAILURE); 1343 exit (EXIT_FAILURE);
1349 } 1344 }
1350 free (socket_name); 1345 free (user_socket_name);
1351 1346
1352 sock_status = socket_status (server.sun_path); 1347 sock_status = socket_status (server.sun_path);
1353 saved_errno = errno; 1348 saved_errno = errno;
@@ -1401,6 +1396,7 @@ static HSOCKET
1401set_socket (int no_exit_if_error) 1396set_socket (int no_exit_if_error)
1402{ 1397{
1403 HSOCKET s; 1398 HSOCKET s;
1399 const char *local_server_file = server_file;
1404 1400
1405 INITIALIZE (); 1401 INITIALIZE ();
1406 1402
@@ -1408,7 +1404,7 @@ set_socket (int no_exit_if_error)
1408 /* Explicit --socket-name argument. */ 1404 /* Explicit --socket-name argument. */
1409 if (socket_name) 1405 if (socket_name)
1410 { 1406 {
1411 s = set_local_socket (); 1407 s = set_local_socket (socket_name);
1412 if ((s != INVALID_SOCKET) || no_exit_if_error) 1408 if ((s != INVALID_SOCKET) || no_exit_if_error)
1413 return s; 1409 return s;
1414 message (TRUE, "%s: error accessing socket \"%s\"\n", 1410 message (TRUE, "%s: error accessing socket \"%s\"\n",
@@ -1418,30 +1414,29 @@ set_socket (int no_exit_if_error)
1418#endif 1414#endif
1419 1415
1420 /* Explicit --server-file arg or EMACS_SERVER_FILE variable. */ 1416 /* Explicit --server-file arg or EMACS_SERVER_FILE variable. */
1421 if (!server_file) 1417 if (!local_server_file)
1422 server_file = egetenv ("EMACS_SERVER_FILE"); 1418 local_server_file = egetenv ("EMACS_SERVER_FILE");
1423 1419
1424 if (server_file) 1420 if (local_server_file)
1425 { 1421 {
1426 s = set_tcp_socket (); 1422 s = set_tcp_socket (local_server_file);
1427 if ((s != INVALID_SOCKET) || no_exit_if_error) 1423 if ((s != INVALID_SOCKET) || no_exit_if_error)
1428 return s; 1424 return s;
1429 1425
1430 message (TRUE, "%s: error accessing server file \"%s\"\n", 1426 message (TRUE, "%s: error accessing server file \"%s\"\n",
1431 progname, server_file); 1427 progname, local_server_file);
1432 exit (EXIT_FAILURE); 1428 exit (EXIT_FAILURE);
1433 } 1429 }
1434 1430
1435#ifndef NO_SOCKETS_IN_FILE_SYSTEM 1431#ifndef NO_SOCKETS_IN_FILE_SYSTEM
1436 /* Implicit local socket. */ 1432 /* Implicit local socket. */
1437 s = set_local_socket (); 1433 s = set_local_socket ("server");
1438 if (s != INVALID_SOCKET) 1434 if (s != INVALID_SOCKET)
1439 return s; 1435 return s;
1440#endif 1436#endif
1441 1437
1442 /* Implicit server file. */ 1438 /* Implicit server file. */
1443 server_file = "server"; 1439 s = set_tcp_socket ("server");
1444 s = set_tcp_socket ();
1445 if ((s != INVALID_SOCKET) || no_exit_if_error) 1440 if ((s != INVALID_SOCKET) || no_exit_if_error)
1446 return s; 1441 return s;
1447 1442
@@ -1573,8 +1568,6 @@ main (int argc, char **argv)
1573 int rl = 0, needlf = 0; 1568 int rl = 0, needlf = 0;
1574 char *cwd, *str; 1569 char *cwd, *str;
1575 char string[BUFSIZ+1]; 1570 char string[BUFSIZ+1];
1576 int null_socket_name IF_LINT ( = 0);
1577 int null_server_file IF_LINT ( = 0);
1578 int start_daemon_if_needed; 1571 int start_daemon_if_needed;
1579 int exit_status = EXIT_SUCCESS; 1572 int exit_status = EXIT_SUCCESS;
1580 1573
@@ -1602,14 +1595,6 @@ main (int argc, char **argv)
1602 in case of failure to connect. */ 1595 in case of failure to connect. */
1603 start_daemon_if_needed = (alternate_editor 1596 start_daemon_if_needed = (alternate_editor
1604 && (alternate_editor[0] == '\0')); 1597 && (alternate_editor[0] == '\0'));
1605 if (start_daemon_if_needed)
1606 {
1607 /* set_socket changes the values for socket_name and
1608 server_file, we need to reset them, if they were NULL before
1609 for the second call to set_socket. */
1610 null_socket_name = (socket_name == NULL);
1611 null_server_file = (server_file == NULL);
1612 }
1613 1598
1614 emacs_socket = set_socket (alternate_editor || start_daemon_if_needed); 1599 emacs_socket = set_socket (alternate_editor || start_daemon_if_needed);
1615 if (emacs_socket == INVALID_SOCKET) 1600 if (emacs_socket == INVALID_SOCKET)
@@ -1617,13 +1602,6 @@ main (int argc, char **argv)
1617 if (! start_daemon_if_needed) 1602 if (! start_daemon_if_needed)
1618 fail (); 1603 fail ();
1619 1604
1620 /* Reset socket_name and server_file if they were NULL
1621 before the set_socket call. */
1622 if (null_socket_name)
1623 socket_name = NULL;
1624 if (null_server_file)
1625 server_file = NULL;
1626
1627 start_daemon_and_retry_set_socket (); 1605 start_daemon_and_retry_set_socket ();
1628 } 1606 }
1629 1607
@@ -1790,7 +1768,7 @@ main (int argc, char **argv)
1790 /* Now, wait for an answer and print any messages. */ 1768 /* Now, wait for an answer and print any messages. */
1791 while (exit_status == EXIT_SUCCESS) 1769 while (exit_status == EXIT_SUCCESS)
1792 { 1770 {
1793 char *p; 1771 char *p, *end_p;
1794 do 1772 do
1795 { 1773 {
1796 errno = 0; 1774 errno = 0;
@@ -1805,61 +1783,72 @@ main (int argc, char **argv)
1805 1783
1806 string[rl] = '\0'; 1784 string[rl] = '\0';
1807 1785
1808 p = string + strlen (string) - 1; 1786 /* Loop over all NL-terminated messages. */
1809 while (p > string && *p == '\n') 1787 for (end_p = p = string; end_p != NULL && *end_p != '\0'; p = end_p)
1810 *p-- = 0; 1788 {
1789 end_p = strchr (p, '\n');
1790 if (end_p != NULL)
1791 *end_p++ = '\0';
1811 1792
1812 if (strprefix ("-emacs-pid ", string)) 1793 if (strprefix ("-emacs-pid ", p))
1813 { 1794 {
1814 /* -emacs-pid PID: The process id of the Emacs process. */ 1795 /* -emacs-pid PID: The process id of the Emacs process. */
1815 emacs_pid = strtol (string + strlen ("-emacs-pid"), NULL, 10); 1796 emacs_pid = strtol (p + strlen ("-emacs-pid"), NULL, 10);
1816 } 1797 }
1817 else if (strprefix ("-window-system-unsupported ", string)) 1798 else if (strprefix ("-window-system-unsupported ", p))
1818 { 1799 {
1819 /* -window-system-unsupported: Emacs was compiled without X 1800 /* -window-system-unsupported: Emacs was compiled without X
1820 support. Try again on the terminal. */ 1801 support. Try again on the terminal. */
1821 nowait = 0; 1802 nowait = 0;
1822 tty = 1; 1803 tty = 1;
1823 goto retry; 1804 goto retry;
1824 } 1805 }
1825 else if (strprefix ("-print ", string)) 1806 else if (strprefix ("-print ", p))
1826 { 1807 {
1827 /* -print STRING: Print STRING on the terminal. */ 1808 /* -print STRING: Print STRING on the terminal. */
1828 str = unquote_argument (string + strlen ("-print ")); 1809 str = unquote_argument (p + strlen ("-print "));
1829 if (needlf) 1810 if (needlf)
1830 printf ("\n"); 1811 printf ("\n");
1831 printf ("%s", str); 1812 printf ("%s", str);
1832 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; 1813 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
1833 } 1814 }
1834 else if (strprefix ("-error ", string)) 1815 else if (strprefix ("-print-nonl ", p))
1835 { 1816 {
1836 /* -error DESCRIPTION: Signal an error on the terminal. */ 1817 /* -print-nonl STRING: Print STRING on the terminal.
1837 str = unquote_argument (string + strlen ("-error ")); 1818 Used to continue a preceding -print command. */
1838 if (needlf) 1819 str = unquote_argument (p + strlen ("-print-nonl "));
1839 printf ("\n"); 1820 printf ("%s", str);
1840 fprintf (stderr, "*ERROR*: %s", str); 1821 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
1841 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; 1822 }
1842 exit_status = EXIT_FAILURE; 1823 else if (strprefix ("-error ", p))
1843 } 1824 {
1825 /* -error DESCRIPTION: Signal an error on the terminal. */
1826 str = unquote_argument (p + strlen ("-error "));
1827 if (needlf)
1828 printf ("\n");
1829 fprintf (stderr, "*ERROR*: %s", str);
1830 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
1831 exit_status = EXIT_FAILURE;
1832 }
1844#ifdef SIGSTOP 1833#ifdef SIGSTOP
1845 else if (strprefix ("-suspend ", string)) 1834 else if (strprefix ("-suspend ", p))
1846 { 1835 {
1847 /* -suspend: Suspend this terminal, i.e., stop the process. */ 1836 /* -suspend: Suspend this terminal, i.e., stop the process. */
1848 if (needlf) 1837 if (needlf)
1849 printf ("\n"); 1838 printf ("\n");
1850 needlf = 0; 1839 needlf = 0;
1851 kill (0, SIGSTOP); 1840 kill (0, SIGSTOP);
1852 } 1841 }
1853#endif 1842#endif
1854 else 1843 else
1855 { 1844 {
1856 /* Unknown command. */ 1845 /* Unknown command. */
1857 if (needlf) 1846 if (needlf)
1858 printf ("\n"); 1847 printf ("\n");
1859 printf ("*ERROR*: Unknown message: %s", string); 1848 needlf = 0;
1860 needlf = string[0] 1849 printf ("*ERROR*: Unknown message: %s\n", p);
1861 == '\0' ? needlf : string[strlen (string) - 1] != '\n'; 1850 }
1862 } 1851 }
1863 } 1852 }
1864 1853
1865 if (needlf) 1854 if (needlf)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 68b48f5047e..bd0e6f865cd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,11 +1,203 @@
12012-03-13 Kaushik Srenevasan <ksrenevasan@gmail.com> (tiny change)
2
3 * progmodes/gdb-mi.el (gdb-invalidate-disassembly):
4 For dynamically generated code, follow $PC.
5 (gdb-disassembly-handler-custom): Handle no function name case.
6
72012-03-13 Tim Landscheidt <tim@tim-landscheidt.de> (tiny change)
8
9 * calendar/icalendar.el (icalendar-export-file, icalendar-import-file):
10 * emulation/ws-mode.el (ws-query-replace):
11 * sort.el (sort-regexp-fields):
12 Fix missing trailing whitespace in interactive prompts. (Bug#11002)
13
142012-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
15
16 * dabbrev.el: Fix cycle completion order (bug#10963).
17 (dabbrev--last-obarray, dabbrev--last-completion-buffer): Remove.
18 (dabbrev-completion): Don't use an obarray; provide
19 a cycle-sort-function.
20
212012-03-12 Leo Liu <sdl.web@gmail.com>
22
23 * simple.el (kill-new): Use equal-including-properties for
24 comparison.
25 (kill-do-not-save-duplicates): Doc fix.
26
272012-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
28
29 * dabbrev.el: Fix cycle completion (bug#10963).
30 Use lexical binding and wrap to 80 columns.
31 (dabbrev-completion): Delay computing the list of completions.
32
332012-03-12 Kenichi Handa <handa@m17n.org>
34
35 * international/quail.el (quail-insert-kbd-layout): Surround each
36 row by LRO and PDF instead of inserting many LRMs. Pad the left
37 and right of each non-spacing marks. Insert invisible space
38 between lower and upper characters to prevent composition.
39
402012-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
41
42 * minibuffer.el (minibuffer-complete): Don't get confused when the
43 function is run twice via different commands (bug#10958).
44 (complete-with-action): Fix docstring.
45
462012-03-12 Chong Yidong <cyd@gnu.org>
47
48 * nxml/nxml-mode.el (nxml-mode-map): Do not bind C-RET (Bug#6776).
49 (nxml-completion-at-point-function): New function.
50 (nxml-mode): Use it.
51 (nxml-bind-meta-tab-to-complete-flag): Default to t.
52
53 * emacs-lisp/package.el (package-unpack, package-unpack-single):
54 Load generated autoloads file before byte compiling (Bug#10970).
55 (package--make-autoloads-and-compile): New helper fun.
56
572012-03-12 Christopher Schmidt <christopher@ch.ristopher.com>
58
59 * ibuffer.el (ibuffer-redisplay): Remove another gratuitous error.
60
612012-03-11 Michael Albinus <michael.albinus@gmx.de>
62
63 * autorevert.el (auto-revert-handler): Ensure, that
64 file-readable-p is applied only for local files or in
65 auto-revert-tail-mode.
66
672012-03-11 Andreas Schwab <schwab@linux-m68k.org>
68
69 * server.el (server-eval-at): Handle non-tcp connections.
70 Decode result string.
71
72 * server.el (server-msg-size): New constant.
73 (server-reply-print): New function.
74 (server-eval-and-print): Use it.
75 (server-eval-at): Use server-quote-arg and server-unquote-arg.
76 Handle -print-nonl.
77
782012-03-11 Christopher Schmidt <christopher@ch.ristopher.com>
79
80 * ibuffer.el (ibuffer-redisplay): Remove gratuitous error
81 (Bug#10987).
82
832012-03-11 Chong Yidong <cyd@gnu.org>
84
85 * simple.el (goto-line): Doc fix (Bug#9938).
86
87 * subr.el (save-window-excursion): Doc fix (Bug#9979).
88
89 * dabbrev.el (dabbrev--find-expansion): Update progress reporter
90 when finished (Bug#10963).
91
922012-03-11 Martin Rudalics <rudalics@gmx.at>
93
94 * window.el (split-window-below): Fix bug in case where
95 split-window-keep-point is nil (Bug#10971).
96
972012-03-11 Juri Linkov <juri@jurta.org>
98
99 * replace.el (replace-highlight): Set isearch-word to nil
100 unconditionally. (Bug#10887)
101
1022012-03-10 Eli Zaretskii <eliz@gnu.org>
103
104 * net/mairix.el (mairix-replace-invalid-chars): Rename from
105 mairix-replace-illegal-chars; all callers changed. Don't remove
106 ^, ~, and = characters: they are meaningful in mairix search
107 specs.
108 (mairix-widget-create-query): Add usage information about mairix
109 search forms: negating words, searching for substrings, etc.
110
1112012-03-10 Jae-hyeon Park <jae-hyeon.park@desy.de> (tiny change)
112
113 * international/fontset.el (font-encoding-alist): Add an entry for
114 ksx1001 (Bug#5667).
115
1162012-03-10 Richard Stallman <rms@gnu.org>
117
118 * mail/sendmail.el (mail-encode-header):
119 Set rfc2047-encode-encoded-words.
120
121 * mail/mail-utils.el (mail-quote-printable): Quote multibyte chars.
122
123 * mail/rmail.el (rmail-buffers-swapped-p): Don't assume dead
124 view buffer means not swapped.
125 (rmail-view-buffer-kill-buffer-hook): Give buf name in error msg.
126 (rmail-write-region-annotate): Error if real text has disappeared.
127
128 * epa-mail.el (epa-mail-encrypt): Bind inhibit-read-only.
129
1302012-03-10 Chong Yidong <cyd@gnu.org>
131
132 * emulation/cua-rect.el (cua--init-rectangles):
133 * emulation/cua-base.el (cua--init-keymaps):
134 Add delete-forward-char to remappings (Bug#9666).
135
1362012-03-10 Martin Rudalics <rudalics@gmx.at>
137
138 * speedbar.el (speedbar-unhighlight-one-tag-line):
139 Avoid unhighlighting due to frame switching (Bug#10275).
140
1412012-03-10 Chong Yidong <cyd@gnu.org>
142
143 * minibuffer.el (completion-in-region, completion-help-at-point):
144 Give the completion field overlay a high priority (Bug#6830).
145
146 * dired.el (dired-goto-file): Recognize absolute file name
147 listings (Bug#7126).
148 (dired-goto-file-1): New helper function.
149 (dired-toggle-read-only): Inhibit warnings.
150
1512012-03-09 Michael Albinus <michael.albinus@gmx.de>
152
153 * net/dbus.el: (dbus-property-handler): Return empty array if
154 there are no properties.
155
1562012-03-09 Leo Liu <sdl.web@gmail.com>
157
158 * savehist.el (savehist-printable): Stricter check for string
159 value (Bug#10937).
160
1612012-03-09 Eli Zaretskii <eliz@gnu.org>
162
163 * mail/smtpmail.el (smtpmail-send-it):
164 Bind coding-system-for-write to *-unix, so that FCC files are kept in
165 valid mbox format.
166
1672012-03-09 Glenn Morris <rgm@gnu.org>
168
169 * files.el (dir-locals-find-file):
170 Don't check result is regular, readable.
171 (dir-locals-read-from-file): Demote errors.
172
1732012-03-08 Eli Zaretskii <eliz@gnu.org>
174
175 * international/quail.el (quail-insert-kbd-layout):
176 Insert invisible LRM characters before each character in a keyboard
177 layout cell, to prevent their reordering by bidi display engine.
178 For details, see the discussion in
179 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00085.html.
180
1812012-03-08 Alan Mackenzie <acm@muc.de>
182
183 * progmodes/cc-cmds.el (c-mark-function): Make it leave a mark at
184 the starting position; make it extend the marked region when
185 invoked repeatedly - all under appropriate circumstances.
186 Fixes bugs #5525, #10906.
187
1882012-03-08 Glenn Morris <rgm@gnu.org>
189
190 * files.el (locate-dominating-file, dir-locals-find-file):
191 Undo 2012-03-06 change.
192
12012-03-07 Eli Zaretskii <eliz@gnu.org> 1932012-03-07 Eli Zaretskii <eliz@gnu.org>
2 194
3 * international/quail.el (quail-help): Force 195 * international/quail.el (quail-help):
4 bidi-paragraph-direction be left-to-right. See discussion in 196 Force bidi-paragraph-direction be left-to-right. See discussion in
5 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00062.html 197 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00062.html
6 for the reason. 198 for the reason.
7 199
82012-03-07 Michael Albinus <Michael.Albinus@alcatel-lucent.com> 2002012-03-07 Michael Albinus <michael.albinus@gmx.de>
9 201
10 Avoid superfluous registering of signals. (Bug#10807) 202 Avoid superfluous registering of signals. (Bug#10807)
11 203
@@ -133,16 +325,16 @@
133 New variables for... 325 New variables for...
134 (c-state-semi-safe-place): New function. Here, in a macro is "safe". 326 (c-state-semi-safe-place): New function. Here, in a macro is "safe".
135 (c-invalidate-state-cache-1): New stuff for c-state-semi-safe-place. 327 (c-invalidate-state-cache-1): New stuff for c-state-semi-safe-place.
136 (c-in-literal, c-literal-limits, c-determine-limit-get-base): Use 328 (c-in-literal, c-literal-limits, c-determine-limit-get-base):
137 c-state-semi-safe-place. 329 Use c-state-semi-safe-place.
138 330
139 * progmodes/cc-langs.el (c-get-state-before-change-functions): Add 331 * progmodes/cc-langs.el (c-get-state-before-change-functions):
140 c-invalidate-macro-cache to the C, C++, Obj entries. 332 Add c-invalidate-macro-cache to the C, C++, Obj entries.
141 333
1422012-03-02 Michael Albinus <michael.albinus@gmx.de> 3342012-03-02 Michael Albinus <michael.albinus@gmx.de>
143 335
144 * jka-compr.el (jka-compr-call-process): Apply 336 * jka-compr.el (jka-compr-call-process):
145 `file-accessible-directory-p' only when the default directory is 337 Apply `file-accessible-directory-p' only when the default directory is
146 not remote. 338 not remote.
147 339
1482012-03-01 Michael Albinus <michael.albinus@gmx.de> 3402012-03-01 Michael Albinus <michael.albinus@gmx.de>
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index c0a77bd5935..e0bde7c6dc5 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -439,17 +439,18 @@ This is an internal function used by Auto-Revert Mode."
439 (let* ((buffer (current-buffer)) size 439 (let* ((buffer (current-buffer)) size
440 (revert 440 (revert
441 (or (and buffer-file-name 441 (or (and buffer-file-name
442 (file-readable-p buffer-file-name)
443 (if auto-revert-tail-mode 442 (if auto-revert-tail-mode
444 ;; Tramp caches the file attributes. Setting 443 ;; Tramp caches the file attributes. Setting
445 ;; `remote-file-name-inhibit-cache' forces Tramp 444 ;; `remote-file-name-inhibit-cache' forces Tramp
446 ;; to reread the values. 445 ;; to reread the values.
447 (let ((remote-file-name-inhibit-cache t)) 446 (let ((remote-file-name-inhibit-cache t))
448 (/= auto-revert-tail-pos 447 (and (file-readable-p buffer-file-name)
449 (setq size 448 (/= auto-revert-tail-pos
450 (nth 7 (file-attributes 449 (setq size
451 buffer-file-name))))) 450 (nth 7 (file-attributes
451 buffer-file-name))))))
452 (and (not (file-remote-p buffer-file-name)) 452 (and (not (file-remote-p buffer-file-name))
453 (file-readable-p buffer-file-name)
453 (not (verify-visited-file-modtime buffer))))) 454 (not (verify-visited-file-modtime buffer)))))
454 (and (or auto-revert-mode 455 (and (or auto-revert-mode
455 global-auto-revert-non-file-buffers) 456 global-auto-revert-non-file-buffers)
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index 83bda94fefe..f1549ec20b1 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -915,7 +915,7 @@ would be \"pm\"."
915 "Export diary file to iCalendar format. 915 "Export diary file to iCalendar format.
916All diary entries in the file DIARY-FILENAME are converted to iCalendar 916All diary entries in the file DIARY-FILENAME are converted to iCalendar
917format. The result is appended to the file ICAL-FILENAME." 917format. The result is appended to the file ICAL-FILENAME."
918 (interactive "FExport diary data from file: 918 (interactive "FExport diary data from file: \n\
919Finto iCalendar file: ") 919Finto iCalendar file: ")
920 (save-current-buffer 920 (save-current-buffer
921 (set-buffer (find-file diary-filename)) 921 (set-buffer (find-file diary-filename))
@@ -1794,7 +1794,7 @@ Argument ICAL-FILENAME output iCalendar file.
1794Argument DIARY-FILENAME input `diary-file'. 1794Argument DIARY-FILENAME input `diary-file'.
1795Optional argument NON-MARKING determines whether events are created as 1795Optional argument NON-MARKING determines whether events are created as
1796non-marking or not." 1796non-marking or not."
1797 (interactive "fImport iCalendar data from file: 1797 (interactive "fImport iCalendar data from file: \n\
1798Finto diary file: 1798Finto diary file:
1799p") 1799p")
1800 ;; clean up the diary file 1800 ;; clean up the diary file
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 4dc5fe4df21..f185c457ee2 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,15 @@
12012-03-12 David Engster <deng@randomsample.de>
2
3 * semantic/db-find.el
4 (semanticdb-find-translate-path-brutish-default): If we don't yet
5 have a proper table for PATH, use `semanticdb-current-database'
6 instead (bug #10343).
7
82012-03-11 David Engster <deng@randomsample.de>
9
10 * semantic/wisent/javascript.el (js-mode): Define `js-mode' as
11 child-mode of `javascript-mode' (bug #8445).
12
12012-02-28 Glenn Morris <rgm@gnu.org> 132012-02-28 Glenn Morris <rgm@gnu.org>
2 14
3 * semantic/db.el (semanticdb-search-results-table): 15 * semantic/db.el (semanticdb-search-results-table):
diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el
index ca6a8fbf5ca..15ef3b09238 100644
--- a/lisp/cedet/semantic/db-find.el
+++ b/lisp/cedet/semantic/db-find.el
@@ -325,8 +325,10 @@ Default action as described in `semanticdb-find-translate-path'."
325 (cond ((null path) semanticdb-current-database) 325 (cond ((null path) semanticdb-current-database)
326 ((semanticdb-table-p path) (oref path parent-db)) 326 ((semanticdb-table-p path) (oref path parent-db))
327 (t (let ((tt (semantic-something-to-tag-table path))) 327 (t (let ((tt (semantic-something-to-tag-table path)))
328 ;; @todo - What does this DO ??!?! 328 (if tt
329 (with-current-buffer (semantic-tag-buffer (car tt)) 329 ;; @todo - What does this DO ??!?!
330 (with-current-buffer (semantic-tag-buffer (car tt))
331 semanticdb-current-database)
330 semanticdb-current-database)))))) 332 semanticdb-current-database))))))
331 (apply 333 (apply
332 #'nconc 334 #'nconc
diff --git a/lisp/cedet/semantic/wisent/javascript.el b/lisp/cedet/semantic/wisent/javascript.el
index 33644414b30..8ed83e87bce 100644
--- a/lisp/cedet/semantic/wisent/javascript.el
+++ b/lisp/cedet/semantic/wisent/javascript.el
@@ -75,6 +75,10 @@ This function overrides `get-local-variables'."
75;; 75;;
76;; This sets up the javascript parser 76;; This sets up the javascript parser
77 77
78;; Since javascript-mode is an alias for js-mode, let it inherit all
79;; the overrides.
80(define-child-mode js-mode javascript-mode)
81
78;; In semantic-imenu.el, not part of Emacs. 82;; In semantic-imenu.el, not part of Emacs.
79(defvar semantic-imenu-summary-function) 83(defvar semantic-imenu-summary-function)
80 84
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 7b94b53e6c7..c5b370bfa61 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -1,4 +1,4 @@
1;;; dabbrev.el --- dynamic abbreviation package 1;;; dabbrev.el --- dynamic abbreviation package -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1985-1986, 1992, 1994, 1996-1997, 2000-2012 3;; Copyright (C) 1985-1986, 1992, 1994, 1996-1997, 2000-2012
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
@@ -291,9 +291,6 @@ this list."
291;; Internal variables 291;; Internal variables
292;;---------------------------------------------------------------- 292;;----------------------------------------------------------------
293 293
294;; Last obarray of completions in `dabbrev-completion'
295(defvar dabbrev--last-obarray nil)
296
297;; Table of expansions seen so far 294;; Table of expansions seen so far
298(defvar dabbrev--last-table nil) 295(defvar dabbrev--last-table nil)
299 296
@@ -321,9 +318,6 @@ this list."
321;; The buffer we found the expansion last time. 318;; The buffer we found the expansion last time.
322(defvar dabbrev--last-buffer-found nil) 319(defvar dabbrev--last-buffer-found nil)
323 320
324;; The buffer we last did a completion in.
325(defvar dabbrev--last-completion-buffer nil)
326
327;; If non-nil, a function to use when copying successive words. 321;; If non-nil, a function to use when copying successive words.
328;; It should be `upcase' or `downcase'. 322;; It should be `upcase' or `downcase'.
329(defvar dabbrev--last-case-pattern nil) 323(defvar dabbrev--last-case-pattern nil)
@@ -387,49 +381,46 @@ then it searches *all* buffers."
387 (abbrev (dabbrev--abbrev-at-point)) 381 (abbrev (dabbrev--abbrev-at-point))
388 (beg (progn (search-backward abbrev) (point))) 382 (beg (progn (search-backward abbrev) (point)))
389 (end (progn (search-forward abbrev) (point))) 383 (end (progn (search-forward abbrev) (point)))
390 (ignore-case-p (and (if (eq dabbrev-case-fold-search 'case-fold-search) 384 (ignore-case-p
391 case-fold-search 385 (and (if (eq dabbrev-case-fold-search 'case-fold-search)
392 dabbrev-case-fold-search) 386 case-fold-search
393 (or (not dabbrev-upcase-means-case-search) 387 dabbrev-case-fold-search)
394 (string= abbrev (downcase abbrev))))) 388 (or (not dabbrev-upcase-means-case-search)
395 (my-obarray dabbrev--last-obarray)) 389 (string= abbrev (downcase abbrev)))))
396 (save-excursion 390 (list 'uninitialized)
397 ;;-------------------------------- 391 (table
398 ;; New abbreviation to expand. 392 (lambda (s p a)
399 ;;-------------------------------- 393 (if (eq a 'metadata)
400 (setq dabbrev--last-abbreviation abbrev) 394 `(metadata (cycle-sort-function . ,#'identity)
401 ;; Find all expansion 395 (category . dabbrev))
402 (let ((completion-list 396 (when (eq list 'uninitialized)
403 (dabbrev--find-all-expansions abbrev ignore-case-p)) 397 (save-excursion
404 (completion-ignore-case ignore-case-p)) 398 ;;--------------------------------
405 ;; Make an obarray with all expansions 399 ;; New abbreviation to expand.
406 (setq my-obarray (make-vector (length completion-list) 0)) 400 ;;--------------------------------
407 (or (> (length my-obarray) 0) 401 (setq dabbrev--last-abbreviation abbrev)
408 (error "No dynamic expansion for \"%s\" found%s" 402 ;; Find all expansion
409 abbrev 403 (let ((completion-list
410 (if dabbrev--check-other-buffers "" " in this-buffer"))) 404 (dabbrev--find-all-expansions abbrev ignore-case-p))
411 (cond 405 (completion-ignore-case ignore-case-p))
412 ((or (not ignore-case-p) 406 (or (consp completion-list)
413 (not dabbrev-case-replace)) 407 (error "No dynamic expansion for \"%s\" found%s"
414 (mapc (function (lambda (string) 408 abbrev
415 (intern string my-obarray))) 409 (if dabbrev--check-other-buffers
416 completion-list)) 410 "" " in this-buffer")))
417 ((string= abbrev (upcase abbrev)) 411 (setq list
418 (mapc (function (lambda (string) 412 (cond
419 (intern (upcase string) my-obarray))) 413 ((not (and ignore-case-p dabbrev-case-replace))
420 completion-list)) 414 completion-list)
421 ((string= (substring abbrev 0 1) 415 ((string= abbrev (upcase abbrev))
422 (upcase (substring abbrev 0 1))) 416 (mapcar #'upcase completion-list))
423 (mapc (function (lambda (string) 417 ((string= (substring abbrev 0 1)
424 (intern (capitalize string) my-obarray))) 418 (upcase (substring abbrev 0 1)))
425 completion-list)) 419 (mapcar #'capitalize completion-list))
426 (t 420 (t
427 (mapc (function (lambda (string) 421 (mapcar #'downcase completion-list)))))))
428 (intern (downcase string) my-obarray))) 422 (complete-with-action a list s p)))))
429 completion-list))) 423 (completion-in-region beg end table)))
430 (setq dabbrev--last-obarray my-obarray)
431 (setq dabbrev--last-completion-buffer (current-buffer))))
432 (completion-in-region beg end my-obarray)))
433 424
434;;;###autoload 425;;;###autoload
435(defun dabbrev-expand (arg) 426(defun dabbrev-expand (arg)
@@ -521,12 +512,13 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]."
521 ;;-------------------------------- 512 ;;--------------------------------
522 (or expansion 513 (or expansion
523 (setq expansion 514 (setq expansion
524 (dabbrev--find-expansion abbrev direction 515 (dabbrev--find-expansion
525 (and (if (eq dabbrev-case-fold-search 'case-fold-search) 516 abbrev direction
526 case-fold-search 517 (and (if (eq dabbrev-case-fold-search 'case-fold-search)
527 dabbrev-case-fold-search) 518 case-fold-search
528 (or (not dabbrev-upcase-means-case-search) 519 dabbrev-case-fold-search)
529 (string= abbrev (downcase abbrev)))))))) 520 (or (not dabbrev-upcase-means-case-search)
521 (string= abbrev (downcase abbrev))))))))
530 (cond 522 (cond
531 ((not expansion) 523 ((not expansion)
532 (dabbrev--reset-global-variables) 524 (dabbrev--reset-global-variables)
@@ -621,8 +613,6 @@ all skip characters."
621 613
622(defun dabbrev--reset-global-variables () 614(defun dabbrev--reset-global-variables ()
623 "Initialize all global variables." 615 "Initialize all global variables."
624 ;; dabbrev--last-obarray and dabbrev--last-completion-buffer
625 ;; must not be reset here.
626 (setq dabbrev--last-table nil 616 (setq dabbrev--last-table nil
627 dabbrev--last-abbreviation nil 617 dabbrev--last-abbreviation nil
628 dabbrev--last-abbrev-location nil 618 dabbrev--last-abbrev-location nil
@@ -667,13 +657,13 @@ of the expansion in `dabbrev--last-expansion-location'."
667 (let ((case-fold-search ignore-case) 657 (let ((case-fold-search ignore-case)
668 (count n)) 658 (count n))
669 (while (and (> count 0) 659 (while (and (> count 0)
670 (setq expansion (dabbrev--search abbrev 660 (setq expansion (dabbrev--search
671 reverse 661 abbrev reverse
672 (and ignore-case 662 (and ignore-case
673 (if (eq dabbrev-case-distinction 'case-replace) 663 (if (eq dabbrev-case-distinction
674 case-replace 664 'case-replace)
675 dabbrev-case-distinction)) 665 case-replace
676 ))) 666 dabbrev-case-distinction)))))
677 (setq count (1- count)))) 667 (setq count (1- count))))
678 (and expansion 668 (and expansion
679 (setq dabbrev--last-expansion-location (point))) 669 (setq dabbrev--last-expansion-location (point)))
@@ -763,6 +753,7 @@ of the start of the occurrence."
763 (- (length dabbrev--friend-buffer-list))) 753 (- (length dabbrev--friend-buffer-list)))
764 (setq dabbrev--last-expansion-location (point-min)) 754 (setq dabbrev--last-expansion-location (point-min))
765 (setq expansion (dabbrev--try-find abbrev nil 1 ignore-case))) 755 (setq expansion (dabbrev--try-find abbrev nil 1 ignore-case)))
756 (progress-reporter-done dabbrev--progress-reporter)
766 expansion))))) 757 expansion)))))
767 758
768;; Compute the list of buffers to scan. 759;; Compute the list of buffers to scan.
@@ -828,14 +819,15 @@ EXPANSION is the expansion substring to be used this time.
828RECORD-CASE-PATTERN, if non-nil, means set `dabbrev--last-case-pattern' 819RECORD-CASE-PATTERN, if non-nil, means set `dabbrev--last-case-pattern'
829to record whether we upcased the expansion, downcased it, or did neither." 820to record whether we upcased the expansion, downcased it, or did neither."
830 ;;(undo-boundary) 821 ;;(undo-boundary)
831 (let ((use-case-replace (and (if (eq dabbrev-case-fold-search 'case-fold-search) 822 (let ((use-case-replace
832 case-fold-search 823 (and (if (eq dabbrev-case-fold-search 'case-fold-search)
833 dabbrev-case-fold-search) 824 case-fold-search
834 (or (not dabbrev-upcase-means-case-search) 825 dabbrev-case-fold-search)
835 (string= abbrev (downcase abbrev))) 826 (or (not dabbrev-upcase-means-case-search)
836 (if (eq dabbrev-case-replace 'case-replace) 827 (string= abbrev (downcase abbrev)))
837 case-replace 828 (if (eq dabbrev-case-replace 'case-replace)
838 dabbrev-case-replace)))) 829 case-replace
830 dabbrev-case-replace))))
839 831
840 ;; If we upcased or downcased the original expansion, 832 ;; If we upcased or downcased the original expansion,
841 ;; do likewise for the subsequent words when we copy them. 833 ;; do likewise for the subsequent words when we copy them.
@@ -861,12 +853,13 @@ to record whether we upcased the expansion, downcased it, or did neither."
861 (let ((expansion-rest (substring expansion 1)) 853 (let ((expansion-rest (substring expansion 1))
862 (first-letter-position (string-match "[[:alpha:]]" abbrev))) 854 (first-letter-position (string-match "[[:alpha:]]" abbrev)))
863 (if (or (null first-letter-position) 855 (if (or (null first-letter-position)
864 (and (not (and (or (string= expansion-rest (downcase expansion-rest)) 856 (and (not
865 (string= expansion-rest (upcase expansion-rest))) 857 (and (or (string= expansion-rest (downcase expansion-rest))
866 (or (string= abbrev (downcase abbrev)) 858 (string= expansion-rest (upcase expansion-rest)))
867 (and (string= abbrev (upcase abbrev)) 859 (or (string= abbrev (downcase abbrev))
868 (> (- (length abbrev) first-letter-position) 860 (and (string= abbrev (upcase abbrev))
869 1))))) 861 (> (- (length abbrev) first-letter-position)
862 1)))))
870 (string= abbrev 863 (string= abbrev
871 (substring expansion 0 (length abbrev))))) 864 (substring expansion 0 (length abbrev)))))
872 (setq use-case-replace nil))) 865 (setq use-case-replace nil)))
@@ -950,9 +943,9 @@ Leaves point at the location of the start of the expansion."
950 ;; Limited search. 943 ;; Limited search.
951 (save-restriction 944 (save-restriction
952 (and dabbrev-limit 945 (and dabbrev-limit
953 (narrow-to-region dabbrev--last-expansion-location 946 (narrow-to-region
954 (+ (point) 947 dabbrev--last-expansion-location
955 (if reverse (- dabbrev-limit) dabbrev-limit)))) 948 (+ (point) (if reverse (- dabbrev-limit) dabbrev-limit))))
956 ;;-------------------------------- 949 ;;--------------------------------
957 ;; Look for a distinct expansion, using dabbrev--last-table. 950 ;; Look for a distinct expansion, using dabbrev--last-table.
958 ;;-------------------------------- 951 ;;--------------------------------
diff --git a/lisp/dired.el b/lisp/dired.el
index 57bf3c88322..d26e7004cc3 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1964,7 +1964,8 @@ Otherwise, for buffers inheriting from dired-mode, call `toggle-read-only'."
1964 (interactive) 1964 (interactive)
1965 (if (eq major-mode 'dired-mode) 1965 (if (eq major-mode 'dired-mode)
1966 (wdired-change-to-wdired-mode) 1966 (wdired-change-to-wdired-mode)
1967 (toggle-read-only))) 1967 (with-no-warnings
1968 (toggle-read-only))))
1968 1969
1969(defun dired-next-line (arg) 1970(defun dired-next-line (arg)
1970 "Move down lines then position at filename. 1971 "Move down lines then position at filename.
@@ -2622,58 +2623,61 @@ instead of `dired-actual-switches'."
2622 (read-file-name "Goto file: " 2623 (read-file-name "Goto file: "
2623 (dired-current-directory)))) 2624 (dired-current-directory))))
2624 (push-mark))) 2625 (push-mark)))
2625 (setq file (directory-file-name file)) ; does no harm if no directory 2626 (unless (file-name-absolute-p file)
2626 (let (found case-fold-search dir) 2627 (error "File name `%s' is not absolute" file))
2627 (setq dir (or (file-name-directory file) 2628 (setq file (directory-file-name file)) ; does no harm if not a directory
2628 (error "File name `%s' is not absolute" file))) 2629 (let* ((case-fold-search nil)
2629 (save-excursion 2630 (dir (file-name-directory file))
2630 ;; The hair here is to get the result of dired-goto-subdir 2631 (found (or
2631 ;; without really calling it if we don't have any subdirs. 2632 ;; First, look for a listing under the absolute name.
2632 (if (if (string= dir (expand-file-name default-directory)) 2633 (save-excursion
2633 (goto-char (point-min)) 2634 (goto-char (point-min))
2634 (and (cdr dired-subdir-alist) 2635 (dired-goto-file-1 file file (point-max)))
2635 (dired-goto-subdir dir))) 2636 ;; Otherwise, look for it as a relative name. The
2636 (let ((base (file-name-nondirectory file)) 2637 ;; hair is to get the result of `dired-goto-subdir'
2637 search-string 2638 ;; without calling it if we don't have any subdirs.
2638 (boundary (dired-subdir-max))) 2639 (save-excursion
2639 (setq search-string 2640 (when (if (string= dir (expand-file-name default-directory))
2640 (replace-regexp-in-string "\^m" "\\^m" base nil t)) 2641 (goto-char (point-min))
2641 (setq search-string 2642 (and (cdr dired-subdir-alist)
2642 (replace-regexp-in-string "\\\\" "\\\\" search-string nil t)) 2643 (dired-goto-subdir dir)))
2643 (and (dired-switches-escape-p dired-actual-switches) 2644 (dired-goto-file-1 (file-name-nondirectory file)
2644 (string-match "[ \t\n]" search-string) 2645 file
2645 ;; FIXME to fix this for all possible file names 2646 (dired-subdir-max)))))))
2646 ;; (embedded control characters etc), we need to 2647 ;; Return buffer position, if found.
2647 ;; escape everything that `ls -b' does. 2648 (if found
2648 (setq search-string 2649 (goto-char found))))
2649 (replace-regexp-in-string " " "\\ " 2650
2650 search-string nil t) 2651(defun dired-goto-file-1 (file full-name limit)
2651 search-string 2652 "Advance to the Dired listing labeled by FILE; return its position.
2652 (replace-regexp-in-string "\t" "\\t" 2653Return nil if the listing is not found. If FILE contains
2653 search-string nil t) 2654characters that would not appear in a Dired buffer, search using
2654 search-string 2655the quoted forms of those characters.
2655 (replace-regexp-in-string "\n" "\\n" 2656
2656 search-string nil t))) 2657FULL-NAME specifies the actual file name the listing must have,
2657 (while (and (not found) 2658as returned by `dired-get-filename'. LIMIT is the search limit."
2658 ;; filenames are preceded by SPC, this makes 2659 (let (str)
2659 ;; the search faster (e.g. for the filename "-"!). 2660 (setq str (replace-regexp-in-string "\^m" "\\^m" file nil t))
2660 (search-forward (concat " " search-string) 2661 (setq str (replace-regexp-in-string "\\\\" "\\\\" str nil t))
2661 boundary 'move)) 2662 (and (dired-switches-escape-p dired-actual-switches)
2662 ;; Match could have BASE just as initial substring or 2663 (string-match "[ \t\n]" str)
2663 ;; or in permission bits or date or 2664 ;; FIXME: to fix this for embedded control characters etc, we
2664 ;; not be a proper filename at all: 2665 ;; should escape everything that `ls -b' does.
2665 (if (equal base (dired-get-filename 'no-dir t)) 2666 (setq str (replace-regexp-in-string " " "\\ " str nil t)
2666 ;; Must move to filename since an (actually 2667 str (replace-regexp-in-string "\t" "\\t" str nil t)
2667 ;; correct) match could have been elsewhere on the 2668 str (replace-regexp-in-string "\n" "\\n" str nil t)))
2668 ;; ;; line (e.g. "-" would match somewhere in the 2669 (let ((found nil)
2669 ;; permission bits). 2670 ;; filenames are preceded by SPC, this makes the search faster
2670 (setq found (dired-move-to-filename)) 2671 ;; (e.g. for the filename "-").
2671 ;; If this isn't the right line, move forward to avoid 2672 (search-string (concat " " str)))
2672 ;; trying this line again. 2673 (while (and (not found)
2673 (forward-line 1)))))) 2674 (search-forward search-string limit 'move))
2674 (and found 2675 ;; Check that we are in the right place. Match could have
2675 ;; return value of point (i.e., FOUND): 2676 ;; BASE just as initial substring or in permission bits etc.
2676 (goto-char found)))) 2677 (if (equal full-name (dired-get-filename nil t))
2678 (setq found (dired-move-to-filename))
2679 (forward-line 1)))
2680 found)))
2677 2681
2678(defvar dired-find-subdir) 2682(defvar dired-find-subdir)
2679 2683
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index fd0eb029fc3..5b158eb994f 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -607,16 +607,25 @@ untar into a directory named DIR; otherwise, signal an error."
607 (error "Package does not untar cleanly into directory %s/" dir)))) 607 (error "Package does not untar cleanly into directory %s/" dir))))
608 (tar-untar-buffer)) 608 (tar-untar-buffer))
609 609
610(defun package-unpack (name version) 610(defun package-unpack (package version)
611 (let* ((dirname (concat (symbol-name name) "-" version)) 611 (let* ((name (symbol-name package))
612 (dirname (concat name "-" version))
612 (pkg-dir (expand-file-name dirname package-user-dir))) 613 (pkg-dir (expand-file-name dirname package-user-dir)))
613 (make-directory package-user-dir t) 614 (make-directory package-user-dir t)
614 ;; FIXME: should we delete PKG-DIR if it exists? 615 ;; FIXME: should we delete PKG-DIR if it exists?
615 (let* ((default-directory (file-name-as-directory package-user-dir))) 616 (let* ((default-directory (file-name-as-directory package-user-dir)))
616 (package-untar-buffer dirname) 617 (package-untar-buffer dirname)
617 (package-generate-autoloads (symbol-name name) pkg-dir) 618 (package--make-autoloads-and-compile name pkg-dir))))
618 (let ((load-path (cons pkg-dir load-path))) 619
619 (byte-recompile-directory pkg-dir 0 t))))) 620(defun package--make-autoloads-and-compile (name pkg-dir)
621 "Generate autoloads and do byte-compilation for package named NAME.
622PKG-DIR is the name of the package directory."
623 (package-generate-autoloads name pkg-dir)
624 (let ((load-path (cons pkg-dir load-path)))
625 ;; We must load the autoloads file before byte compiling, in
626 ;; case there are magic cookies to set up non-trivial paths.
627 (load (expand-file-name (concat name "-autoloads") pkg-dir) nil t)
628 (byte-recompile-directory pkg-dir 0 t)))
620 629
621(defun package--write-file-no-coding (file-name) 630(defun package--write-file-no-coding (file-name)
622 (let ((buffer-file-coding-system 'no-conversion)) 631 (let ((buffer-file-coding-system 'no-conversion))
@@ -656,9 +665,7 @@ untar into a directory named DIR; otherwise, signal an error."
656 nil 665 nil
657 pkg-file 666 pkg-file
658 nil nil nil 'excl)) 667 nil nil nil 'excl))
659 (package-generate-autoloads file-name pkg-dir) 668 (package--make-autoloads-and-compile file-name pkg-dir))))
660 (let ((load-path (cons pkg-dir load-path)))
661 (byte-recompile-directory pkg-dir 0 t)))))
662 669
663(defmacro package--with-work-buffer (location file &rest body) 670(defmacro package--with-work-buffer (location file &rest body)
664 "Run BODY in a buffer containing the contents of FILE at LOCATION. 671 "Run BODY in a buffer containing the contents of FILE at LOCATION.
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 9e7be0f670d..a918f298a4e 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -1478,6 +1478,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1478 (define-key cua--region-keymap [remap backward-delete-char] 'cua-delete-region) 1478 (define-key cua--region-keymap [remap backward-delete-char] 'cua-delete-region)
1479 (define-key cua--region-keymap [remap backward-delete-char-untabify] 'cua-delete-region) 1479 (define-key cua--region-keymap [remap backward-delete-char-untabify] 'cua-delete-region)
1480 (define-key cua--region-keymap [remap delete-char] 'cua-delete-region) 1480 (define-key cua--region-keymap [remap delete-char] 'cua-delete-region)
1481 (define-key cua--region-keymap [remap delete-forward-char] 'cua-delete-region)
1481 ;; kill region 1482 ;; kill region
1482 (define-key cua--region-keymap [remap kill-region] 'cua-cut-region) 1483 (define-key cua--region-keymap [remap kill-region] 'cua-cut-region)
1483 (define-key cua--region-keymap [remap clipboard-kill-region] 'cua-cut-region) 1484 (define-key cua--region-keymap [remap clipboard-kill-region] 'cua-cut-region)
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index 95b77a697f1..e3aade760dc 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -1420,6 +1420,7 @@ With prefix arg, indent to that column."
1420 (define-key cua--rectangle-keymap [remap kill-ring-save] 'cua-copy-rectangle) 1420 (define-key cua--rectangle-keymap [remap kill-ring-save] 'cua-copy-rectangle)
1421 (define-key cua--rectangle-keymap [remap kill-region] 'cua-cut-rectangle) 1421 (define-key cua--rectangle-keymap [remap kill-region] 'cua-cut-rectangle)
1422 (define-key cua--rectangle-keymap [remap delete-char] 'cua-delete-rectangle) 1422 (define-key cua--rectangle-keymap [remap delete-char] 'cua-delete-rectangle)
1423 (define-key cua--rectangle-keymap [remap delete-forward-char] 'cua-delete-rectangle)
1423 (define-key cua--rectangle-keymap [remap set-mark-command] 'cua-toggle-rectangle-mark) 1424 (define-key cua--rectangle-keymap [remap set-mark-command] 'cua-toggle-rectangle-mark)
1424 1425
1425 (define-key cua--rectangle-keymap [remap forward-char] 'cua-resize-rectangle-right) 1426 (define-key cua--rectangle-keymap [remap forward-char] 'cua-resize-rectangle-right)
diff --git a/lisp/emulation/ws-mode.el b/lisp/emulation/ws-mode.el
index aa8d647ec11..0c7be145751 100644
--- a/lisp/emulation/ws-mode.el
+++ b/lisp/emulation/ws-mode.el
@@ -716,7 +716,7 @@ This will only work for errors raised by WordStar mode functions."
716 716
717(defun ws-query-replace (from to) 717(defun ws-query-replace (from to)
718 "In WordStar mode: Search string, remember string for repetition." 718 "In WordStar mode: Search string, remember string for repetition."
719 (interactive "sReplace: 719 (interactive "sReplace: \n\
720sWith: " ) 720sWith: " )
721 (setq ws-search-string from) 721 (setq ws-search-string from)
722 (setq ws-search-direction t) 722 (setq ws-search-direction t)
diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el
index 22bfe03cab0..be5b849651c 100644
--- a/lisp/epa-mail.el
+++ b/lisp/epa-mail.el
@@ -192,7 +192,9 @@ If no one is selected, symmetric encryption will be performed. "
192 (if sign 192 (if sign
193 (epa-select-keys context 193 (epa-select-keys context
194 "Select keys for signing. ")))))) 194 "Select keys for signing. "))))))
195 (epa-encrypt-region start end recipients sign signers)) 195 ;; Don't let some read-only text stop us from encrypting.
196 (let ((inhibit-read-only t))
197 (epa-encrypt-region start end recipients sign signers)))
196 198
197;;;###autoload 199;;;###autoload
198(defun epa-mail-import-keys () 200(defun epa-mail-import-keys ()
diff --git a/lisp/faces.el b/lisp/faces.el
index 0011e0357a1..bdac3a1bb6a 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1516,7 +1516,7 @@ If SPEC is nil, return nil."
1516 (apply 'set-face-attribute face frame 1516 (apply 'set-face-attribute face frame
1517 (if (eq face 'default) 1517 (if (eq face 'default)
1518 ;; For the default face, avoid making any attribute 1518 ;; For the default face, avoid making any attribute
1519 ;; unspecifed. Instead, set attributes to default values 1519 ;; unspecified. Instead, set attributes to default values
1520 ;; (see also realize_default_face in xfaces.c). 1520 ;; (see also realize_default_face in xfaces.c).
1521 (append 1521 (append
1522 '(:underline nil :overline nil :strike-through nil 1522 '(:underline nil :overline nil :strike-through nil
diff --git a/lisp/files.el b/lisp/files.el
index 1d54ef81869..cde15c5d0b1 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -877,14 +877,13 @@ or mount points potentially requiring authentication as a different user.")
877;; (setq dir nil)))) 877;; (setq dir nil))))
878;; nil))) 878;; nil)))
879 879
880(defun locate-dominating-file (file name &optional predicate) 880(defun locate-dominating-file (file name)
881 "Look up the directory hierarchy from FILE for a file named NAME. 881 "Look up the directory hierarchy from FILE for a file named NAME.
882Stop at the first parent directory containing a file NAME, 882Stop at the first parent directory containing a file NAME,
883and return the directory. Return nil if not found. 883and return the directory. Return nil if not found.
884 884
885Optional argument PREDICATE is a function of one argument, a file. 885This function only tests if FILE exists. If you care about whether
886It should return non-nil if the file is acceptable. The default is 886it is readable, regular, etc., you should test the result."
887`file-exists-p'; you might, e.g., want to use `file-readable-p' instead."
888 ;; We used to use the above locate-dominating-files code, but the 887 ;; We used to use the above locate-dominating-files code, but the
889 ;; directory-files call is very costly, so we're much better off doing 888 ;; directory-files call is very costly, so we're much better off doing
890 ;; multiple calls using the code in here. 889 ;; multiple calls using the code in here.
@@ -911,8 +910,11 @@ It should return non-nil if the file is acceptable. The default is
911 ;; (setq user (nth 2 (file-attributes file))) 910 ;; (setq user (nth 2 (file-attributes file)))
912 ;; (and prev-user (not (equal user prev-user)))) 911 ;; (and prev-user (not (equal user prev-user))))
913 (string-match locate-dominating-stop-dir-regexp file))) 912 (string-match locate-dominating-stop-dir-regexp file)))
914 (setq try (funcall (or predicate 'file-exists-p) 913 ;; FIXME? maybe this function should (optionally?)
915 (expand-file-name name file))) 914 ;; use file-readable-p instead. In many cases, an unreadable
915 ;; FILE is no better than a non-existent one.
916 ;; See eg dir-locals-find-file.
917 (setq try (file-exists-p (expand-file-name name file)))
916 (cond (try (setq root file)) 918 (cond (try (setq root file))
917 ((equal file (setq file (file-name-directory 919 ((equal file (setq file (file-name-directory
918 (directory-file-name file)))) 920 (directory-file-name file))))
@@ -3550,7 +3552,7 @@ across different environments and users.")
3550 "Find the directory-local variables for FILE. 3552 "Find the directory-local variables for FILE.
3551This searches upward in the directory tree from FILE. 3553This searches upward in the directory tree from FILE.
3552It stops at the first directory that has been registered in 3554It stops at the first directory that has been registered in
3553`dir-locals-directory-cache' or contains a readable `dir-locals-file'. 3555`dir-locals-directory-cache' or contains a `dir-locals-file'.
3554If it finds an entry in the cache, it checks that it is valid. 3556If it finds an entry in the cache, it checks that it is valid.
3555A cache entry with no modification time element (normally, one that 3557A cache entry with no modification time element (normally, one that
3556has been assigned directly using `dir-locals-set-directory-class', not 3558has been assigned directly using `dir-locals-set-directory-class', not
@@ -3568,15 +3570,18 @@ of no valid cache entry."
3568 (if (eq system-type 'ms-dos) 3570 (if (eq system-type 'ms-dos)
3569 (dosified-file-name dir-locals-file) 3571 (dosified-file-name dir-locals-file)
3570 dir-locals-file)) 3572 dir-locals-file))
3571 ;; FIXME? Is it right to silently ignore unreadable files? 3573 (locals-file (locate-dominating-file file dir-locals-file-name))
3572 (locals-file (locate-dominating-file file dir-locals-file-name
3573 (lambda (file)
3574 (and (file-readable-p file)
3575 (file-regular-p file)))))
3576 (dir-elt nil)) 3574 (dir-elt nil))
3577 ;; `locate-dominating-file' may have abbreviated the name. 3575 ;; `locate-dominating-file' may have abbreviated the name.
3578 (if locals-file 3576 (and locals-file
3579 (setq locals-file (expand-file-name dir-locals-file-name locals-file))) 3577 (setq locals-file (expand-file-name dir-locals-file-name locals-file)))
3578 ;; Let dir-locals-read-from-file inform us via demoted-errors
3579 ;; about unreadable files, etc.
3580 ;; Maybe we'd want to keep searching though - that is
3581 ;; a locate-dominating-file issue.
3582;;; (or (not (file-readable-p locals-file))
3583;;; (not (file-regular-p locals-file)))
3584;;; (setq locals-file nil))
3580 ;; Find the best cached value in `dir-locals-directory-cache'. 3585 ;; Find the best cached value in `dir-locals-directory-cache'.
3581 (dolist (elt dir-locals-directory-cache) 3586 (dolist (elt dir-locals-directory-cache)
3582 (when (and (eq t (compare-strings file nil (length (car elt)) 3587 (when (and (eq t (compare-strings file nil (length (car elt))
@@ -3618,15 +3623,19 @@ FILE is the name of the file holding the variables to apply.
3618The new class name is the same as the directory in which FILE 3623The new class name is the same as the directory in which FILE
3619is found. Returns the new class name." 3624is found. Returns the new class name."
3620 (with-temp-buffer 3625 (with-temp-buffer
3621 (insert-file-contents file) 3626 ;; Errors reading the file are not very informative.
3622 (let* ((dir-name (file-name-directory file)) 3627 ;; Eg just "Error: (end-of-file)" does not give any clue that the
3623 (class-name (intern dir-name)) 3628 ;; problem is related to dir-locals.
3624 (variables (let ((read-circle nil)) 3629 (with-demoted-errors
3625 (read (current-buffer))))) 3630 (insert-file-contents file)
3626 (dir-locals-set-class-variables class-name variables) 3631 (let* ((dir-name (file-name-directory file))
3627 (dir-locals-set-directory-class dir-name class-name 3632 (class-name (intern dir-name))
3628 (nth 5 (file-attributes file))) 3633 (variables (let ((read-circle nil))
3629 class-name))) 3634 (read (current-buffer)))))
3635 (dir-locals-set-class-variables class-name variables)
3636 (dir-locals-set-directory-class dir-name class-name
3637 (nth 5 (file-attributes file)))
3638 class-name))))
3630 3639
3631(defun hack-dir-local-variables () 3640(defun hack-dir-local-variables ()
3632 "Read per-directory local variables for the current buffer. 3641 "Read per-directory local variables for the current buffer.
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index a4c1513926d..1e787642664 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,13 @@
12012-03-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * gnus-int.el (gnus-backend-trace): Flip default to nil before Emacs
4 24.1 release.
5
62012-03-10 David Edmondson <dme@dme.org>
7
8 * mm-uu.el (mm-uu-forward-extract): Allow for blank lines between the
9 'Forwarded Message' header and the start of the message.
10
12012-03-04 Thierry Volpiatto <thierry.volpiatto@gmail.com> 112012-03-04 Thierry Volpiatto <thierry.volpiatto@gmail.com>
2 12
3 * gnus-msg.el (gnus-msg-mail): Call `message-mail' correctly when Gnus 13 * gnus-msg.el (gnus-msg-mail): Call `message-mail' correctly when Gnus
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index 8dc691ffe42..1190d79f778 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -247,7 +247,7 @@ If it is down, start it up (again)."
247 (eq (nth 1 (assoc method gnus-opened-servers)) 247 (eq (nth 1 (assoc method gnus-opened-servers))
248 'denied)) 248 'denied))
249 249
250(defvar gnus-backend-trace t) 250(defvar gnus-backend-trace nil)
251 251
252(defun gnus-open-server (gnus-command-method) 252(defun gnus-open-server (gnus-command-method)
253 "Open a connection to GNUS-COMMAND-METHOD." 253 "Open a connection to GNUS-COMMAND-METHOD."
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index 327665bdbbf..0cf3730d095 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -187,7 +187,7 @@ This can be either \"inline\" or \"attachment\".")
187 nil) 187 nil)
188 (verbatim-marks 188 (verbatim-marks
189 ;; slrn-style verbatim marks, see 189 ;; slrn-style verbatim marks, see
190 ;; http://www.slrn.org/manual/slrn-manual-6.html#ss6.81 190 ;; http://slrn.sourceforge.net/docs/slrn-manual-6.html#process_verbatim_marks
191 "^#v\\+" 191 "^#v\\+"
192 "^#v\\-$" 192 "^#v\\-$"
193 (lambda () (mm-uu-verbatim-marks-extract 0 0)) 193 (lambda () (mm-uu-verbatim-marks-extract 0 0))
@@ -430,7 +430,11 @@ apply the face `mm-uu-extract'."
430 430
431(defun mm-uu-forward-extract () 431(defun mm-uu-forward-extract ()
432 (mm-make-handle (mm-uu-copy-to-buffer 432 (mm-make-handle (mm-uu-copy-to-buffer
433 (progn (goto-char start-point) (forward-line) (point)) 433 (progn
434 (goto-char start-point)
435 (forward-line)
436 (skip-chars-forward "\n")
437 (point))
434 (progn (goto-char end-point) (forward-line -1) (point))) 438 (progn (goto-char end-point) (forward-line -1) (point)))
435 '("message/rfc822" (charset . gnus-decoded)))) 439 '("message/rfc822" (charset . gnus-decoded))))
436 440
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 17be5534138..536992f5bc8 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -2140,11 +2140,10 @@ If optional arg SILENT is non-nil, do not display progress messages."
2140 (unless silent 2140 (unless silent
2141 (message "Redisplaying current buffer list...")) 2141 (message "Redisplaying current buffer list..."))
2142 (let ((blist (ibuffer-current-state-list))) 2142 (let ((blist (ibuffer-current-state-list)))
2143 (when (null blist) 2143 (when (and (null blist)
2144 (if (and (featurep 'ibuf-ext) 2144 (featurep 'ibuf-ext)
2145 (or ibuffer-filtering-qualifiers ibuffer-hidden-filter-groups)) 2145 (or ibuffer-filtering-qualifiers ibuffer-hidden-filter-groups))
2146 (message "No buffers! (note: filtering in effect)") 2146 (message "No buffers! (note: filtering in effect)"))
2147 (error "No buffers!")))
2148 (ibuffer-redisplay-engine blist t) 2147 (ibuffer-redisplay-engine blist t)
2149 (unless silent 2148 (unless silent
2150 (message "Redisplaying current buffer list...done")) 2149 (message "Redisplaying current buffer list...done"))
@@ -2174,11 +2173,10 @@ If optional arg SILENT is non-nil, do not display progress messages."
2174 (cadr bufs)) 2173 (cadr bufs))
2175 (ibuffer-current-buffers-with-marks bufs) 2174 (ibuffer-current-buffers-with-marks bufs)
2176 ibuffer-display-maybe-show-predicates))) 2175 ibuffer-display-maybe-show-predicates)))
2177 (when (null blist) 2176 (and (null blist)
2178 (if (and (featurep 'ibuf-ext) 2177 (featurep 'ibuf-ext)
2179 ibuffer-filtering-qualifiers) 2178 ibuffer-filtering-qualifiers
2180 (message "No buffers! (note: filtering in effect)") 2179 (message "No buffers! (note: filtering in effect)"))
2181 (error "No buffers!")))
2182 (unless silent 2180 (unless silent
2183 (message "Updating buffer list...")) 2181 (message "Updating buffer list..."))
2184 (ibuffer-redisplay-engine blist arg) 2182 (ibuffer-redisplay-engine blist arg)
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index 561194d710c..7e893a3d751 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -58,6 +58,7 @@
58 ("jisx0208" . japanese-jisx0208) 58 ("jisx0208" . japanese-jisx0208)
59 ("jisx0201" . jisx0201) 59 ("jisx0201" . jisx0201)
60 ("jisx0212" . japanese-jisx0212) 60 ("jisx0212" . japanese-jisx0212)
61 ("ksx1001" . korean-ksc5601)
61 ("ksc5601.1987" . korean-ksc5601) 62 ("ksc5601.1987" . korean-ksc5601)
62 ("cns11643.1992.*1" . chinese-cns11643-1) 63 ("cns11643.1992.*1" . chinese-cns11643-1)
63 ("cns11643.1992.*2" . chinese-cns11643-2) 64 ("cns11643.1992.*2" . chinese-cns11643-2)
diff --git a/lisp/international/quail.el b/lisp/international/quail.el
index 48aa013c674..e0e6bfd465b 100644
--- a/lisp/international/quail.el
+++ b/lisp/international/quail.el
@@ -825,20 +825,35 @@ The format of KBD-LAYOUT is the same as `quail-keyboard-layout'."
825 (setq i 0) 825 (setq i 0)
826 (while (< i quail-keyboard-layout-len) 826 (while (< i quail-keyboard-layout-len)
827 (when (= (% i 30) 0) 827 (when (= (% i 30) 0)
828 ;; Insert LRO to avoid bidi-reordering of keyboard cells.
829 (insert (propertize (string ?\x202d) 'invisible t))
828 (setq row (/ i 30)) 830 (setq row (/ i 30))
829 (if (> row 1) 831 (if (> row 1)
830 (insert-char 32 (+ row (/ (- row 2) 2))))) 832 (insert-char 32 (+ row (/ (- row 2) 2)))))
831 (setq lower (aref layout i) 833 (setq lower (aref layout i)
832 upper (aref layout (1+ i))) 834 upper (aref layout (1+ i)))
833 (insert bar) 835 (insert bar)
834 (if (= (if (stringp lower) (string-width lower) (char-width lower)) 1) 836 (if (< (if (stringp lower) (string-width lower) (char-width lower)) 2)
835 (insert " ")) 837 (insert " "))
836 (insert lower upper) 838 (if (and (characterp lower)
837 (if (= (if (stringp upper) (string-width upper) (char-width upper)) 1) 839 (eq (get-char-code-property lower 'general-category) 'Mn))
840 ;; Pad the left and right of non-spacing characters.
841 (setq lower (compose-string (string lower) 0 1
842 (format "\t%c\t" lower))))
843 (if (and (characterp upper)
844 (eq (get-char-code-property upper 'general-category) 'Mn))
845 ;; Pad the left and right of non-spacing characters.
846 (setq upper (compose-string (string upper) 0 1
847 (format "\t%c\t" upper))))
848 (insert lower (propertize " " 'invisible t) upper)
849 (if (< (if (stringp upper) (string-width upper) (char-width upper)) 2)
838 (insert " ")) 850 (insert " "))
839 (setq i (+ i 2)) 851 (setq i (+ i 2))
840 (if (= (% i 30) 0) 852 (if (= (% i 30) 0)
841 (insert bar "\n"))) 853 (insert bar
854 ;; Insert PDF to deny the previously inserted LRO.
855 (propertize (string ?\x202c) 'invisible t)
856 "\n")))
842 ;; Insert horizontal lines while deleting blank key columns at the 857 ;; Insert horizontal lines while deleting blank key columns at the
843 ;; beginning and end of each line. 858 ;; beginning and end of each line.
844 (save-restriction 859 (save-restriction
@@ -849,20 +864,21 @@ The format of KBD-LAYOUT is the same as `quail-keyboard-layout'."
849 ;;(delete-region pos (point))) 864 ;;(delete-region pos (point)))
850 (let ((from1 100) (to1 0) from2 to2) 865 (let ((from1 100) (to1 0) from2 to2)
851 (while (not (eobp)) 866 (while (not (eobp))
852 (if (looking-at "[| ]*$") 867 (if (looking-at "[| \u202c\u202d]*$")
853 ;; The entire row is blank. 868 ;; The entire row is blank.
854 (delete-region (point) (match-end 0)) 869 (delete-region (point) (match-end 0))
855 ;; Delete blank key columns at the head. 870 ;; Delete blank key columns at the head.
856 (if (looking-at " *\\(| \\)+") 871 (if (looking-at "\u202d? *\\(| \\)+")
857 (subst-char-in-region (point) (match-end 0) ?| ? )) 872 (subst-char-in-region (point) (match-end 0) ?| ? ))
858 ;; Delete blank key columns at the tail. 873 ;; Delete blank key columns at the tail.
859 (if (re-search-forward "\\( |\\)+$" (line-end-position) t) 874 (if (re-search-forward "\\( |\\)+\u202c?$"
875 (line-end-position) t)
860 (delete-region (match-beginning 0) (point))) 876 (delete-region (match-beginning 0) (point)))
861 (beginning-of-line)) 877 (beginning-of-line))
862 ;; Calculate the start and end columns of a horizontal line. 878 ;; Calculate the start and end columns of a horizontal line.
863 (if (eolp) 879 (if (eolp)
864 (setq from2 from1 to2 to1) 880 (setq from2 from1 to2 to1)
865 (skip-chars-forward " ") 881 (skip-chars-forward " \u202d")
866 (setq from2 (current-column)) 882 (setq from2 (current-column))
867 (end-of-line) 883 (end-of-line)
868 (setq to2 (current-column)) 884 (setq to2 (current-column))
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index a20201fb529..9059da817b6 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -63,12 +63,16 @@ from START (inclusive) to END (exclusive)."
63 63
64;;;###autoload 64;;;###autoload
65(defun mail-quote-printable (string &optional wrapper) 65(defun mail-quote-printable (string &optional wrapper)
66 "Convert a string to the \"quoted printable\" Q encoding. 66 "Convert a string to the \"quoted printable\" Q encoding if necessary.
67If the string contains only ASCII characters and no troublesome ones,
68we return it unconverted.
69
67If the optional argument WRAPPER is non-nil, 70If the optional argument WRAPPER is non-nil,
68we add the wrapper characters =?ISO-8859-1?Q?....?=." 71we add the wrapper characters =?ISO-8859-1?Q?....?=."
69 (let ((i 0) (result "")) 72 (let ((i 0) (result ""))
70 (save-match-data 73 (save-match-data
71 (while (string-match "[?=\"\200-\377]" string i) 74 (while (or (string-match "[?=\"]" string i)
75 (string-match "[^\000-\177]" string i))
72 (setq result 76 (setq result
73 (concat result (substring string i (match-beginning 0)) 77 (concat result (substring string i (match-beginning 0))
74 (upcase (format "=%02x" 78 (upcase (format "=%02x"
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 2d327c7a0f0..3a9ba8122ab 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1363,8 +1363,7 @@ sets the current buffer's `buffer-file-coding-system' to that of
1363(defun rmail-buffers-swapped-p () 1363(defun rmail-buffers-swapped-p ()
1364 "Return non-nil if the message collection is in `rmail-view-buffer'." 1364 "Return non-nil if the message collection is in `rmail-view-buffer'."
1365 ;; This is analogous to tar-data-swapped-p in tar-mode.el. 1365 ;; This is analogous to tar-data-swapped-p in tar-mode.el.
1366 (and (buffer-live-p rmail-view-buffer) 1366 rmail-buffer-swapped)
1367 rmail-buffer-swapped))
1368 1367
1369(defun rmail-change-major-mode-hook () 1368(defun rmail-change-major-mode-hook ()
1370 ;; Bring the actual Rmail messages back into the main buffer. 1369 ;; Bring the actual Rmail messages back into the main buffer.
@@ -1406,7 +1405,8 @@ If so restore the actual mbox message collection."
1406 (kill-buffer rmail-view-buffer)))) 1405 (kill-buffer rmail-view-buffer))))
1407 1406
1408(defun rmail-view-buffer-kill-buffer-hook () 1407(defun rmail-view-buffer-kill-buffer-hook ()
1409 (error "Can't kill message view buffer by itself")) 1408 (error "Can't kill Rmail view buffer `%s' by itself"
1409 (buffer-name (current-buffer))))
1410 1410
1411;; Set up the permanent locals associated with an Rmail file. 1411;; Set up the permanent locals associated with an Rmail file.
1412(defun rmail-perm-variables () 1412(defun rmail-perm-variables ()
@@ -4472,7 +4472,11 @@ encoded string (and the same mask) will decode the string."
4472 4472
4473;; Used in `write-region-annotate-functions' to write rmail files. 4473;; Used in `write-region-annotate-functions' to write rmail files.
4474(defun rmail-write-region-annotate (start end) 4474(defun rmail-write-region-annotate (start end)
4475 (when (and (null start) (rmail-buffers-swapped-p)) 4475 (when (and (null start) rmail-buffer-swapped)
4476 (unless (buffer-live-p rmail-view-buffer)
4477 (error "Buffer `%s' with real text of `%s' has disappeared"
4478 (buffer-name rmail-view-buffer)
4479 (buffer-name (current-buffer))))
4476 (setq rmail-message-encoding buffer-file-coding-system) 4480 (setq rmail-message-encoding buffer-file-coding-system)
4477 (set-buffer rmail-view-buffer) 4481 (set-buffer rmail-view-buffer)
4478 (widen) 4482 (widen)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 91e0b183a68..f4dfcfcf647 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1085,7 +1085,9 @@ Return non-nil if and only if some part of the header is encoded."
1085 (cons selected mm-coding-system-priorities) 1085 (cons selected mm-coding-system-priorities)
1086 mm-coding-system-priorities)) 1086 mm-coding-system-priorities))
1087 (tick (buffer-chars-modified-tick)) 1087 (tick (buffer-chars-modified-tick))
1088 (rfc2047-encode-encoded-words nil)) 1088 ;; rms: this proved necessary, but I don't recall why.
1089 ;; Can anyone determine why, and state it here?
1090 (rfc2047-encode-encoded-words t))
1089 (rfc2047-encode-message-header) 1091 (rfc2047-encode-message-header)
1090 (= tick (buffer-chars-modified-tick))))) 1092 (= tick (buffer-chars-modified-tick)))))
1091 1093
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 3233cff2768..8e96e2c9438 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -324,7 +324,10 @@ The list is in preference order.")
324 (if (re-search-forward "^FCC:" delimline t) 324 (if (re-search-forward "^FCC:" delimline t)
325 ;; Force `mail-do-fcc' to use the encoding of the mail 325 ;; Force `mail-do-fcc' to use the encoding of the mail
326 ;; buffer to encode outgoing messages on FCC files. 326 ;; buffer to encode outgoing messages on FCC files.
327 (let ((coding-system-for-write smtpmail-code-conv-from)) 327 (let ((coding-system-for-write
328 ;; mbox files must have Unix EOLs.
329 (coding-system-change-eol-conversion
330 smtpmail-code-conv-from 'unix)))
328 (mail-do-fcc delimline))) 331 (mail-do-fcc delimline)))
329 (if mail-interactive 332 (if mail-interactive
330 (with-current-buffer errbuf 333 (with-current-buffer errbuf
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 1fdf33bf610..6a6bba13523 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -162,7 +162,7 @@ Like CL's `some'."
162(defun complete-with-action (action table string pred) 162(defun complete-with-action (action table string pred)
163 "Perform completion ACTION. 163 "Perform completion ACTION.
164STRING is the string to complete. 164STRING is the string to complete.
165TABLE is the completion table, which should not be a function. 165TABLE is the completion table.
166PRED is a completion predicate. 166PRED is a completion predicate.
167ACTION can be one of nil, t or `lambda'." 167ACTION can be one of nil, t or `lambda'."
168 (cond 168 (cond
@@ -776,7 +776,8 @@ scroll the window of possible completions."
776 (interactive) 776 (interactive)
777 ;; If the previous command was not this, 777 ;; If the previous command was not this,
778 ;; mark the completion buffer obsolete. 778 ;; mark the completion buffer obsolete.
779 (unless (eq this-command last-command) 779 (setq this-command 'completion-at-point)
780 (unless (eq 'completion-at-point last-command)
780 (completion--flush-all-sorted-completions) 781 (completion--flush-all-sorted-completions)
781 (setq minibuffer-scroll-window nil)) 782 (setq minibuffer-scroll-window nil))
782 783
@@ -1483,10 +1484,13 @@ exit."
1483 (minibuffer-completion-predicate predicate) 1484 (minibuffer-completion-predicate predicate)
1484 (ol (make-overlay start end nil nil t))) 1485 (ol (make-overlay start end nil nil t)))
1485 (overlay-put ol 'field 'completion) 1486 (overlay-put ol 'field 'completion)
1487 ;; HACK: if the text we are completing is already in a field, we
1488 ;; want the completion field to take priority (e.g. Bug#6830).
1489 (overlay-put ol 'priority 100)
1486 (when completion-in-region-mode-predicate 1490 (when completion-in-region-mode-predicate
1487 (completion-in-region-mode 1) 1491 (completion-in-region-mode 1)
1488 (setq completion-in-region--data 1492 (setq completion-in-region--data
1489 (list (current-buffer) start end collection))) 1493 (list (current-buffer) start end collection)))
1490 (unwind-protect 1494 (unwind-protect
1491 (call-interactively 'minibuffer-complete) 1495 (call-interactively 'minibuffer-complete)
1492 (delete-overlay ol))))) 1496 (delete-overlay ol)))))
@@ -1653,9 +1657,10 @@ The completion method is determined by `completion-at-point-functions'."
1653 ;; introduce a corresponding hook (plus another for word-completion, 1657 ;; introduce a corresponding hook (plus another for word-completion,
1654 ;; and another for force-completion, maybe?). 1658 ;; and another for force-completion, maybe?).
1655 (overlay-put ol 'field 'completion) 1659 (overlay-put ol 'field 'completion)
1660 (overlay-put ol 'priority 100)
1656 (completion-in-region-mode 1) 1661 (completion-in-region-mode 1)
1657 (setq completion-in-region--data 1662 (setq completion-in-region--data
1658 (list (current-buffer) start end collection)) 1663 (list (current-buffer) start end collection))
1659 (unwind-protect 1664 (unwind-protect
1660 (call-interactively 'minibuffer-completion-help) 1665 (call-interactively 'minibuffer-completion-help)
1661 (delete-overlay ol)))) 1666 (delete-overlay ol))))
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index fbc83bf1df0..feef78a305f 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -1039,7 +1039,8 @@ It will be registered for all objects created by `dbus-register-object'."
1039 (car (last key)) 1039 (car (last key))
1040 (list :variant (cdar (last (car val)))))))) 1040 (list :variant (cdar (last (car val))))))))
1041 dbus-registered-objects-table) 1041 dbus-registered-objects-table)
1042 (list result)))))) 1042 ;; Return the result, or an empty array.
1043 (list :array (or result '(:signature "{sv}"))))))))
1043 1044
1044 1045
1045;; Initialize :system and :session buses. This adds their file 1046;; Initialize :system and :session buses. This adds their file
diff --git a/lisp/net/mairix.el b/lisp/net/mairix.el
index 84343b7de00..a8e969a18c5 100644
--- a/lisp/net/mairix.el
+++ b/lisp/net/mairix.el
@@ -570,10 +570,10 @@ whole threads. Function returns t if messages were found."
570 mairix-output-buffer))) 570 mairix-output-buffer)))
571 (zerop rval))) 571 (zerop rval)))
572 572
573(defun mairix-replace-illegal-chars (header) 573(defun mairix-replace-invalid-chars (header)
574 "Replace illegal characters in HEADER for mairix query." 574 "Replace invalid characters in HEADER for mairix query."
575 (when header 575 (when header
576 (while (string-match "[^-.@/,& [:alnum:]]" header) 576 (while (string-match "[^-.@/,^=~& [:alnum:]]" header)
577 (setq header (replace-match "" t t header))) 577 (setq header (replace-match "" t t header)))
578 (while (string-match "[& ]" header) 578 (while (string-match "[& ]" header)
579 (setq header (replace-match "," t t header))) 579 (setq header (replace-match "," t t header)))
@@ -620,7 +620,7 @@ See %s for details" mairix-output-buffer)))
620 (concat 620 (concat
621 (nth 1 cur) 621 (nth 1 cur)
622 ":" 622 ":"
623 (mairix-replace-illegal-chars 623 (mairix-replace-invalid-chars
624 (widget-value 624 (widget-value
625 (cadr (assoc (concat "e" (car (cddr cur))) widgets))))) 625 (cadr (assoc (concat "e" (car (cddr cur))) widgets)))))
626 query))) 626 query)))
@@ -652,9 +652,17 @@ Fill in VALUES if based on an article."
652 (kill-all-local-variables) 652 (kill-all-local-variables)
653 (erase-buffer) 653 (erase-buffer)
654 (widget-insert 654 (widget-insert
655 "Specify your query for Mairix (check boxes for activating fields):\n\n") 655 "Specify your query for Mairix using check boxes for activating fields.\n\n")
656 (widget-insert 656 (widget-insert
657 "(Whitespaces will be converted to ',' (i.e. AND). Use '/' for OR.)\n\n") 657 (concat "Use ~word to match messages "
658 (propertize "not" 'face 'italic)
659 " containing the word)\n"
660 " substring= to match words containing the substring\n"
661 " substring=N to match words containing the substring, allowing\n"
662 " up to N errors(missing/extra/different letters)\n"
663 " ^substring= to match the substring at the beginning of a word.\n"))
664 (widget-insert
665 "Whitespace will be converted to ',' (i.e. AND). Use '/' for OR.\n\n")
658 (setq mairix-widgets (mairix-widget-build-editable-fields values)) 666 (setq mairix-widgets (mairix-widget-build-editable-fields values))
659 (when (member 'flags mairix-widget-other) 667 (when (member 'flags mairix-widget-other)
660 (widget-insert "\nFlags:\n Seen: ") 668 (widget-insert "\nFlags:\n Seen: ")
@@ -935,7 +943,7 @@ Use cursor keys or C-n,C-p to select next/previous search.\n\n")
935 (lambda (field) 943 (lambda (field)
936 (list (car (cddr field)) 944 (list (car (cddr field))
937 (if (car field) 945 (if (car field)
938 (mairix-replace-illegal-chars 946 (mairix-replace-invalid-chars
939 (funcall get-mail-header (car field))) 947 (funcall get-mail-header (car field)))
940 nil)))) 948 nil))))
941 mairix-widget-fields-list))) 949 mairix-widget-fields-list)))
diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index a22288e7d4e..f9122e7245e 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -86,18 +86,9 @@ as the first attribute on the previous line."
86 :group 'nxml 86 :group 'nxml
87 :type 'integer) 87 :type 'integer)
88 88
89(defcustom nxml-bind-meta-tab-to-complete-flag (not window-system) 89(defcustom nxml-bind-meta-tab-to-complete-flag t
90 "Non-nil means bind M-TAB in `nxml-mode-map' to `nxml-complete'. 90 "Non-nil means to use nXML completion in \\[completion-at-point]."
91C-return will be bound to `nxml-complete' in any case.
92M-TAB gets swallowed by many window systems/managers, and
93`documentation' will show M-TAB rather than C-return as the
94binding for `nxml-complete' when both are bound. So it's better
95to bind M-TAB only when it will work."
96 :group 'nxml 91 :group 'nxml
97 :set (lambda (sym flag)
98 (set-default sym flag)
99 (when (and (boundp 'nxml-mode-map) nxml-mode-map)
100 (define-key nxml-mode-map "\M-\t" (and flag 'nxml-complete))))
101 :type 'boolean) 92 :type 'boolean)
102 93
103(defcustom nxml-prefer-utf-16-to-utf-8-flag nil 94(defcustom nxml-prefer-utf-16-to-utf-8-flag nil
@@ -418,9 +409,7 @@ reference.")
418 (define-key map "\C-c\C-o" nxml-outline-prefix-map) 409 (define-key map "\C-c\C-o" nxml-outline-prefix-map)
419 (define-key map [S-mouse-2] 'nxml-mouse-hide-direct-text-content) 410 (define-key map [S-mouse-2] 'nxml-mouse-hide-direct-text-content)
420 (define-key map "/" 'nxml-electric-slash) 411 (define-key map "/" 'nxml-electric-slash)
421 (define-key map [C-return] 'nxml-complete) 412 (define-key map "\M-\t" 'completion-at-point)
422 (when nxml-bind-meta-tab-to-complete-flag
423 (define-key map "\M-\t" 'nxml-complete))
424 map) 413 map)
425 "Keymap for nxml-mode.") 414 "Keymap for nxml-mode.")
426 415
@@ -479,7 +468,7 @@ the start-tag, point, and end-tag are all left on separate lines.
479If `nxml-slash-auto-complete-flag' is non-nil, then inserting a `</' 468If `nxml-slash-auto-complete-flag' is non-nil, then inserting a `</'
480automatically inserts the rest of the end-tag. 469automatically inserts the rest of the end-tag.
481 470
482\\[nxml-complete] performs completion on the symbol preceding point. 471\\[completion-at-point] performs completion on the symbol preceding point.
483 472
484\\[nxml-dynamic-markup-word] uses the contents of the current buffer 473\\[nxml-dynamic-markup-word] uses the contents of the current buffer
485to choose a tag to put around the word preceding point. 474to choose a tag to put around the word preceding point.
@@ -555,6 +544,8 @@ Many aspects this mode can be customized using
555 (nxml-clear-inside (point-min) (point-max)) 544 (nxml-clear-inside (point-min) (point-max))
556 (nxml-with-invisible-motion 545 (nxml-with-invisible-motion
557 (nxml-scan-prolog))))) 546 (nxml-scan-prolog)))))
547 (add-hook 'completion-at-point-functions
548 #'nxml-completion-at-point-function nil t)
558 (add-hook 'after-change-functions 'nxml-after-change nil t) 549 (add-hook 'after-change-functions 'nxml-after-change nil t)
559 (add-hook 'change-major-mode-hook 'nxml-cleanup nil t) 550 (add-hook 'change-major-mode-hook 'nxml-cleanup nil t)
560 551
@@ -1654,6 +1645,11 @@ depend on `nxml-completion-hook'."
1654 (ding) 1645 (ding)
1655 (message "Cannot complete in this context"))) 1646 (message "Cannot complete in this context")))
1656 1647
1648(defun nxml-completion-at-point-function ()
1649 "Call `nxml-complete' to perform completion at point."
1650 (when nxml-bind-meta-tab-to-complete-flag
1651 #'nxml-complete))
1652
1657;;; Movement 1653;;; Movement
1658 1654
1659(defun nxml-forward-balanced-item (&optional arg) 1655(defun nxml-forward-balanced-item (&optional arg)
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 509bb203f78..55ab6c9981c 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1958,7 +1958,12 @@ with a brace block."
1958 1958
1959(defun c-mark-function () 1959(defun c-mark-function ()
1960 "Put mark at end of the current top-level declaration or macro, point at beginning. 1960 "Put mark at end of the current top-level declaration or macro, point at beginning.
1961If point is not inside any then the closest following one is chosen. 1961If point is not inside any then the closest following one is
1962chosen. Each successive call of this command extends the marked
1963region by one function.
1964
1965A mark is left where the command started, unless the region is already active
1966\(in Transient Mark mode).
1962 1967
1963As opposed to \\[c-beginning-of-defun] and \\[c-end-of-defun], this 1968As opposed to \\[c-beginning-of-defun] and \\[c-end-of-defun], this
1964function does not require the declaration to contain a brace block." 1969function does not require the declaration to contain a brace block."
@@ -1974,8 +1979,24 @@ function does not require the declaration to contain a brace block."
1974 1979
1975 (if (not decl-limits) 1980 (if (not decl-limits)
1976 (error "Cannot find any declaration") 1981 (error "Cannot find any declaration")
1977 (goto-char (car decl-limits)) 1982 (let* ((extend-region-p
1978 (push-mark (cdr decl-limits) nil t)))) 1983 (and (eq this-command 'c-mark-function)
1984 (eq last-command 'c-mark-function)))
1985 (push-mark-p (and (eq this-command 'c-mark-function)
1986 (not extend-region-p)
1987 (not (and transient-mark-mode mark-active)))))
1988 (if push-mark-p (push-mark (point)))
1989 (if extend-region-p
1990 (progn
1991 (exchange-point-and-mark)
1992 (setq decl-limits (c-declaration-limits t))
1993 (when (not decl-limits)
1994 (exchange-point-and-mark)
1995 (error "Cannot find any declaration"))
1996 (goto-char (cdr decl-limits))
1997 (exchange-point-and-mark))
1998 (goto-char (car decl-limits))
1999 (push-mark (cdr decl-limits) nil t))))))
1979 2000
1980(defun c-cpp-define-name () 2001(defun c-cpp-define-name ()
1981 "Return the name of the current CPP macro, or NIL if we're not in one." 2002 "Return the name of the current CPP macro, or NIL if we're not in one."
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 3b33ac894f2..f392971e7d1 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -236,7 +236,7 @@
236 236
237(defun c-invalidate-macro-cache (beg end) 237(defun c-invalidate-macro-cache (beg end)
238 ;; Called from a before-change function. If the change region is before or 238 ;; Called from a before-change function. If the change region is before or
239 ;; in the macro characterised by `c-macro-cache' etc., nullify it 239 ;; in the macro characterized by `c-macro-cache' etc., nullify it
240 ;; appropriately. BEG and END are the standard before-change-functions 240 ;; appropriately. BEG and END are the standard before-change-functions
241 ;; parameters. END isn't used. 241 ;; parameters. END isn't used.
242 (cond 242 (cond
@@ -2163,7 +2163,7 @@ comment at the start of cc-engine.el for more info."
2163(make-variable-buffer-local 'c-state-semi-nonlit-pos-cache-limit) 2163(make-variable-buffer-local 'c-state-semi-nonlit-pos-cache-limit)
2164;; An upper limit on valid entries in `c-state-semi-nonlit-pos-cache'. This is 2164;; An upper limit on valid entries in `c-state-semi-nonlit-pos-cache'. This is
2165;; reduced by buffer changes, and increased by invocations of 2165;; reduced by buffer changes, and increased by invocations of
2166;; `c-state-literal-at'. FIMXE!!! 2166;; `c-state-literal-at'. FIXME!!!
2167 2167
2168(defsubst c-state-pp-to-literal (from to) 2168(defsubst c-state-pp-to-literal (from to)
2169 ;; Do a parse-partial-sexp from FROM to TO, returning either 2169 ;; Do a parse-partial-sexp from FROM to TO, returning either
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 8ea255e49dd..89450cd2276 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -3269,8 +3269,12 @@ DOC is an optional documentation string."
3269 (let* ((frame (gdb-current-buffer-frame)) 3269 (let* ((frame (gdb-current-buffer-frame))
3270 (file (bindat-get-field frame 'fullname)) 3270 (file (bindat-get-field frame 'fullname))
3271 (line (bindat-get-field frame 'line))) 3271 (line (bindat-get-field frame 'line)))
3272 (when file 3272 (if file
3273 (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line))) 3273 (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line)
3274 ;; If we're unable to get a file name / line for $PC, simply
3275 ;; follow $PC, disassembling the next 10 (x ~15 (on IA) ==
3276 ;; 150 bytes) instructions.
3277 "-data-disassemble -s $pc -e \"$pc + 150\" -- 0"))
3274 gdb-disassembly-handler 3278 gdb-disassembly-handler
3275 ;; We update disassembly only after we have actual frame information 3279 ;; We update disassembly only after we have actual frame information
3276 ;; about all threads, so no there's `update' signal in this list 3280 ;; about all threads, so no there's `update' signal in this list
@@ -3329,8 +3333,12 @@ DOC is an optional documentation string."
3329 (gdb-table-add-row table 3333 (gdb-table-add-row table
3330 (list 3334 (list
3331 (bindat-get-field instr 'address) 3335 (bindat-get-field instr 'address)
3332 (apply #'format "<%s+%s>:" 3336 (let
3333 (gdb-get-many-fields instr 'func-name 'offset)) 3337 ((func-name (bindat-get-field instr 'func-name))
3338 (offset (bindat-get-field instr 'offset)))
3339 (if func-name
3340 (format "<%s+%s>:" func-name offset)
3341 ""))
3334 (bindat-get-field instr 'inst))) 3342 (bindat-get-field instr 'inst)))
3335 (when (string-equal (bindat-get-field instr 'address) 3343 (when (string-equal (bindat-get-field instr 'address)
3336 address) 3344 address)
diff --git a/lisp/replace.el b/lisp/replace.el
index 349e63d4201..9fbaa279079 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2116,13 +2116,13 @@ make, or the user didn't cancel the call."
2116 (if query-replace-lazy-highlight 2116 (if query-replace-lazy-highlight
2117 (let ((isearch-string string) 2117 (let ((isearch-string string)
2118 (isearch-regexp regexp) 2118 (isearch-regexp regexp)
2119 ;; Set isearch-word to nil because word-replace is regexp-based,
2120 ;; so `isearch-search-fun' should not use `word-search-forward'.
2121 (isearch-word nil)
2119 (search-whitespace-regexp nil) 2122 (search-whitespace-regexp nil)
2120 (isearch-case-fold-search case-fold) 2123 (isearch-case-fold-search case-fold)
2121 (isearch-forward t) 2124 (isearch-forward t)
2122 (isearch-error nil)) 2125 (isearch-error nil))
2123 ;; Set isearch-word to nil because word-replace is regexp-based,
2124 ;; so `isearch-search-fun' should not use `word-search-forward'.
2125 (if (and isearch-word isearch-regexp) (setq isearch-word nil))
2126 (isearch-lazy-highlight-new-loop range-beg range-end)))) 2126 (isearch-lazy-highlight-new-loop range-beg range-end))))
2127 2127
2128(defun replace-dehighlight () 2128(defun replace-dehighlight ()
diff --git a/lisp/savehist.el b/lisp/savehist.el
index c1515fa48ce..a65906a1676 100644
--- a/lisp/savehist.el
+++ b/lisp/savehist.el
@@ -369,9 +369,11 @@ trimming of history lists to `history-length' items."
369 "Return non-nil if VALUE is printable." 369 "Return non-nil if VALUE is printable."
370 (cond 370 (cond
371 ;; Quick response for oft-encountered types known to be printable. 371 ;; Quick response for oft-encountered types known to be printable.
372 ((stringp value))
373 ((numberp value)) 372 ((numberp value))
374 ((symbolp value)) 373 ((symbolp value))
374 ;; String without properties
375 ((and (stringp value)
376 (equal-including-properties value (substring-no-properties value))))
375 (t 377 (t
376 ;; For others, check explicitly. 378 ;; For others, check explicitly.
377 (with-temp-buffer 379 (with-temp-buffer
diff --git a/lisp/server.el b/lisp/server.el
index 34ac5d7ba23..ed83225eccd 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -706,9 +706,29 @@ Server mode runs a process that accepts commands from the
706 (pp v) 706 (pp v)
707 (let ((text (buffer-substring-no-properties 707 (let ((text (buffer-substring-no-properties
708 (point-min) (point-max)))) 708 (point-min) (point-max))))
709 (server-send-string 709 (server-reply-print (server-quote-arg text) proc)))))))
710 proc (format "-print %s\n" 710
711 (server-quote-arg text))))))))) 711(defconst server-msg-size 1024
712 "Maximum size of a message sent to a client.")
713
714(defun server-reply-print (qtext proc)
715 "Send a `-print QTEXT' command to client PROC.
716QTEXT must be already quoted.
717This handles splitting the command if it would be bigger than
718`server-msg-size'."
719 (let ((prefix "-print ")
720 part)
721 (while (> (+ (length qtext) (length prefix) 1) server-msg-size)
722 ;; We have to split the string
723 (setq part (substring qtext 0 (- server-msg-size (length prefix) 1)))
724 ;; Don't split in the middle of a quote sequence
725 (if (string-match "\\(^\\|[^&]\\)\\(&&\\)+$" part)
726 ;; There is an uneven number of & at the end
727 (setq part (substring part 0 -1)))
728 (setq qtext (substring qtext (length part)))
729 (server-send-string proc (concat prefix part "\n"))
730 (setq prefix "-print-nonl "))
731 (server-send-string proc (concat prefix qtext "\n"))))
712 732
713(defun server-create-tty-frame (tty type proc) 733(defun server-create-tty-frame (tty type proc)
714 (unless tty 734 (unless tty
@@ -911,6 +931,11 @@ The following commands are accepted by the client:
911 Print STRING on stdout. Used to send values 931 Print STRING on stdout. Used to send values
912 returned by -eval. 932 returned by -eval.
913 933
934`-print-nonl STRING'
935 Print STRING on stdout. Used to continue a
936 preceding -print command that would be too big to send
937 in a single message.
938
914`-error DESCRIPTION' 939`-error DESCRIPTION'
915 Signal an error and delete process PROC. 940 Signal an error and delete process PROC.
916 941
@@ -1534,46 +1559,54 @@ only these files will be asked to be saved."
1534Returns the result of the evaluation, or signals an error if it 1559Returns the result of the evaluation, or signals an error if it
1535cannot contact the specified server. For example: 1560cannot contact the specified server. For example:
1536 \(server-eval-at \"server\" '(emacs-pid)) 1561 \(server-eval-at \"server\" '(emacs-pid))
1537returns the process ID of the Emacs instance running \"server\". 1562returns the process ID of the Emacs instance running \"server\"."
1538This function requires the use of TCP sockets. " 1563 (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))
1539 (or server-use-tcp 1564 (server-file (expand-file-name server server-dir))
1540 (error "This function requires TCP sockets")) 1565 (coding-system-for-read 'binary)
1541 (let ((auth-file (expand-file-name server server-auth-dir)) 1566 (coding-system-for-write 'binary)
1542 (coding-system-for-read 'binary) 1567 address port secret process)
1543 (coding-system-for-write 'binary) 1568 (unless (file-exists-p server-file)
1544 address port secret process) 1569 (error "No such server: %s" server))
1545 (unless (file-exists-p auth-file)
1546 (error "No such server definition: %s" auth-file))
1547 (with-temp-buffer 1570 (with-temp-buffer
1548 (insert-file-contents auth-file) 1571 (when server-use-tcp
1549 (unless (looking-at "\\([0-9.]+\\):\\([0-9]+\\)") 1572 (let ((coding-system-for-read 'no-conversion))
1550 (error "Invalid auth file")) 1573 (insert-file-contents server-file)
1551 (setq address (match-string 1) 1574 (unless (looking-at "\\([0-9.]+\\):\\([0-9]+\\)")
1552 port (string-to-number (match-string 2))) 1575 (error "Invalid auth file"))
1553 (forward-line 1) 1576 (setq address (match-string 1)
1554 (setq secret (buffer-substring (point) (line-end-position))) 1577 port (string-to-number (match-string 2)))
1555 (erase-buffer) 1578 (forward-line 1)
1556 (unless (setq process (open-network-stream "eval-at" (current-buffer) 1579 (setq secret (buffer-substring (point) (line-end-position)))
1557 address port)) 1580 (erase-buffer)))
1558 (error "Unable to contact the server")) 1581 (unless (setq process (make-network-process
1559 (set-process-query-on-exit-flag process nil) 1582 :name "eval-at"
1560 (process-send-string 1583 :buffer (current-buffer)
1561 process 1584 :host address
1562 (concat "-auth " secret " -eval " 1585 :service (if server-use-tcp port server-file)
1563 (replace-regexp-in-string 1586 :family (if server-use-tcp 'ipv4 'local)
1564 " " "&_" (format "%S" form)) 1587 :noquery t))
1565 "\n")) 1588 (error "Unable to contact the server"))
1589 (if server-use-tcp
1590 (process-send-string process (concat "-auth " secret "\n")))
1591 (process-send-string process
1592 (concat "-eval "
1593 (server-quote-arg (format "%S" form))
1594 "\n"))
1566 (while (memq (process-status process) '(open run)) 1595 (while (memq (process-status process) '(open run))
1567 (accept-process-output process 0 10)) 1596 (accept-process-output process 0 10))
1568 (goto-char (point-min)) 1597 (goto-char (point-min))
1569 ;; If the result is nil, there's nothing in the buffer. If the 1598 ;; If the result is nil, there's nothing in the buffer. If the
1570 ;; result is non-nil, it's after "-print ". 1599 ;; result is non-nil, it's after "-print ".
1571 (when (search-forward "\n-print" nil t) 1600 (let ((answer ""))
1572 (let ((start (point))) 1601 (while (re-search-forward "\n-print\\(-nonl\\)? " nil t)
1573 (while (search-forward "&_" nil t) 1602 (setq answer
1574 (replace-match " " t t)) 1603 (concat answer
1575 (goto-char start) 1604 (buffer-substring (point)
1576 (read (current-buffer))))))) 1605 (progn (skip-chars-forward "^\n")
1606 (point))))))
1607 (if (not (equal answer ""))
1608 (read (decode-coding-string (server-unquote-arg answer)
1609 'emacs-internal)))))))
1577 1610
1578 1611
1579(provide 'server) 1612(provide 'server)
diff --git a/lisp/simple.el b/lisp/simple.el
index 45daf99f614..936037f5caa 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -893,16 +893,23 @@ that uses or sets the mark."
893;; Counting lines, one way or another. 893;; Counting lines, one way or another.
894 894
895(defun goto-line (line &optional buffer) 895(defun goto-line (line &optional buffer)
896 "Goto LINE, counting from line 1 at beginning of buffer. 896 "Go to LINE, counting from line 1 at beginning of buffer.
897Normally, move point in the current buffer, and leave mark at the 897If called interactively, a numeric prefix argument specifies
898previous position. With just \\[universal-argument] as argument, 898LINE; without a numeric prefix argument, read LINE from the
899move point in the most recently selected other buffer, and switch to it. 899minibuffer.
900
901If optional argument BUFFER is non-nil, switch to that buffer and
902move to line LINE there. If called interactively with \\[universal-argument]
903as argument, BUFFER is the most recently selected other buffer.
900 904
901If there's a number in the buffer at point, it is the default for LINE. 905Prior to moving point, this function sets the mark (without
906activating it), unless Transient Mark mode is enabled and the
907mark is already active.
902 908
903This function is usually the wrong thing to use in a Lisp program. 909This function is usually the wrong thing to use in a Lisp program.
904What you probably want instead is something like: 910What you probably want instead is something like:
905 (goto-char (point-min)) (forward-line (1- N)) 911 (goto-char (point-min))
912 (forward-line (1- N))
906If at all possible, an even better solution is to use char counts 913If at all possible, an even better solution is to use char counts
907rather than line counts." 914rather than line counts."
908 (interactive 915 (interactive
@@ -3062,7 +3069,8 @@ before the Emacs kill and one can still paste it using \\[yank] \\[yank-pop]."
3062 :version "23.2") 3069 :version "23.2")
3063 3070
3064(defcustom kill-do-not-save-duplicates nil 3071(defcustom kill-do-not-save-duplicates nil
3065 "Do not add a new string to `kill-ring' when it is the same as the last one." 3072 "Do not add a new string to `kill-ring' if it duplicates the last one.
3073The comparison is done using `equal-including-properties'."
3066 :type 'boolean 3074 :type 'boolean
3067 :group 'killing 3075 :group 'killing
3068 :version "23.2") 3076 :version "23.2")
@@ -3090,7 +3098,10 @@ argument should still be a \"useful\" string for such uses."
3090 (signal 'args-out-of-range 3098 (signal 'args-out-of-range
3091 (list string "yank-handler specified for empty string")))) 3099 (list string "yank-handler specified for empty string"))))
3092 (unless (and kill-do-not-save-duplicates 3100 (unless (and kill-do-not-save-duplicates
3093 (equal string (car kill-ring))) 3101 ;; Due to text properties such as 'yank-handler that
3102 ;; can alter the contents to yank, comparison using
3103 ;; `equal' is unsafe.
3104 (equal-including-properties string (car kill-ring)))
3094 (if (fboundp 'menu-bar-update-yank-menu) 3105 (if (fboundp 'menu-bar-update-yank-menu)
3095 (menu-bar-update-yank-menu string (and replace (car kill-ring))))) 3106 (menu-bar-update-yank-menu string (and replace (car kill-ring)))))
3096 (when save-interprogram-paste-before-kill 3107 (when save-interprogram-paste-before-kill
@@ -3101,10 +3112,10 @@ argument should still be a \"useful\" string for such uses."
3101 (nreverse interprogram-paste) 3112 (nreverse interprogram-paste)
3102 (list interprogram-paste))) 3113 (list interprogram-paste)))
3103 (unless (and kill-do-not-save-duplicates 3114 (unless (and kill-do-not-save-duplicates
3104 (equal s (car kill-ring))) 3115 (equal-including-properties s (car kill-ring)))
3105 (push s kill-ring)))))) 3116 (push s kill-ring))))))
3106 (unless (and kill-do-not-save-duplicates 3117 (unless (and kill-do-not-save-duplicates
3107 (equal string (car kill-ring))) 3118 (equal-including-properties string (car kill-ring)))
3108 (if (and replace kill-ring) 3119 (if (and replace kill-ring)
3109 (setcar kill-ring string) 3120 (setcar kill-ring string)
3110 (push string kill-ring) 3121 (push string kill-ring)
diff --git a/lisp/sort.el b/lisp/sort.el
index d38e475fd39..8cfe69f9458 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -423,7 +423,7 @@ For example: to sort lines in the region by the first word on each line
423 ;; using negative prefix arg to mean "reverse" is now inconsistent with 423 ;; using negative prefix arg to mean "reverse" is now inconsistent with
424 ;; other sort-.*fields functions but then again this was before, since it 424 ;; other sort-.*fields functions but then again this was before, since it
425 ;; didn't use the magnitude of the arg to specify anything. 425 ;; didn't use the magnitude of the arg to specify anything.
426 (interactive "P\nsRegexp specifying records to sort: 426 (interactive "P\nsRegexp specifying records to sort: \n\
427sRegexp specifying key within record: \nr") 427sRegexp specifying key within record: \nr")
428 (cond ((or (equal key-regexp "") (equal key-regexp "\\&")) 428 (cond ((or (equal key-regexp "") (equal key-regexp "\\&"))
429 (setq key-regexp 0)) 429 (setq key-regexp 0))
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 89211b2b86e..bb1debb4552 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -3987,11 +3987,11 @@ TEXT is the buffer's name, TOKEN and INDENT are unused."
3987 3987
3988(defun speedbar-unhighlight-one-tag-line () 3988(defun speedbar-unhighlight-one-tag-line ()
3989 "Unhighlight the currently highlighted line." 3989 "Unhighlight the currently highlighted line."
3990 (if speedbar-highlight-one-tag-line 3990 (when (and speedbar-highlight-one-tag-line
3991 (progn 3991 (not (eq this-command 'handle-switch-frame)))
3992 (speedbar-delete-overlay speedbar-highlight-one-tag-line) 3992 (speedbar-delete-overlay speedbar-highlight-one-tag-line)
3993 (setq speedbar-highlight-one-tag-line nil))) 3993 (setq speedbar-highlight-one-tag-line nil)
3994 (remove-hook 'pre-command-hook 'speedbar-unhighlight-one-tag-line)) 3994 (remove-hook 'pre-command-hook 'speedbar-unhighlight-one-tag-line)))
3995 3995
3996(defun speedbar-recenter-to-top () 3996(defun speedbar-recenter-to-top ()
3997 "Recenter the current buffer so point is on the top of the window." 3997 "Recenter the current buffer so point is on the top of the window."
diff --git a/lisp/subr.el b/lisp/subr.el
index 00a030c744c..e0b099dd16b 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3026,13 +3026,12 @@ the buffer list."
3026 (set-buffer ,old-buffer)))))) 3026 (set-buffer ,old-buffer))))))
3027 3027
3028(defmacro save-window-excursion (&rest body) 3028(defmacro save-window-excursion (&rest body)
3029 "Execute BODY, preserving window sizes and contents. 3029 "Execute BODY, then restore previous window configuration.
3030Return the value of the last form in BODY. 3030This macro saves the window configuration on the selected frame,
3031Restore which buffer appears in which window, where display starts, 3031executes BODY, then calls `set-window-configuration' to restore
3032and the value of point and mark for each window. 3032the saved window configuration. The return value is the last
3033Also restore the choice of selected window. 3033form in BODY. The window configuration is also restored if BODY
3034Also restore which buffer is current. 3034exits nonlocally.
3035Does not restore the value of point in current buffer.
3036 3035
3037BEWARE: Most uses of this macro introduce bugs. 3036BEWARE: Most uses of this macro introduce bugs.
3038E.g. it should not be used to try and prevent some code from opening 3037E.g. it should not be used to try and prevent some code from opening
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 55aa9194904..960649bdbc9 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,14 @@
12012-03-11 Chong Yidong <cyd@gnu.org>
2
3 * url-http.el (url-http-end-of-document-sentinel): Handle
4 keepalive expiry by calling url-http again (Bug#10223).
5 (url-http): New arg, for the above.
6
72012-03-11 Devon Sean McCullough <emacs-hacker2012@jovi.net>
8
9 * url-http.el (url-http-find-free-connection): Don't pass a nil
10 argument to url-http-mark-connection-as-busy (bug#10891).
11
12012-02-20 Lars Ingebrigtsen <larsi@gnus.org> 122012-02-20 Lars Ingebrigtsen <larsi@gnus.org>
2 13
3 * url-queue.el (url-queue-kill-job): Delete the process sentinel 14 * url-queue.el (url-queue-kill-job): Delete the process sentinel
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 0c911260ca5..a4726489814 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -27,6 +27,7 @@
27(eval-when-compile (require 'cl)) 27(eval-when-compile (require 'cl))
28(defvar url-http-extra-headers) 28(defvar url-http-extra-headers)
29(defvar url-http-target-url) 29(defvar url-http-target-url)
30(defvar url-http-no-retry)
30(defvar url-http-proxy) 31(defvar url-http-proxy)
31(defvar url-http-connection-opened) 32(defvar url-http-connection-opened)
32(require 'url-gw) 33(require 'url-gw)
@@ -153,38 +154,40 @@ request.")
153 154
154(defun url-http-find-free-connection (host port) 155(defun url-http-find-free-connection (host port)
155 (let ((conns (gethash (cons host port) url-http-open-connections)) 156 (let ((conns (gethash (cons host port) url-http-open-connections))
156 (found nil)) 157 (connection nil))
157 (while (and conns (not found)) 158 (while (and conns (not connection))
158 (if (not (memq (process-status (car conns)) '(run open connect))) 159 (if (not (memq (process-status (car conns)) '(run open connect)))
159 (progn 160 (progn
160 (url-http-debug "Cleaning up dead process: %s:%d %S" 161 (url-http-debug "Cleaning up dead process: %s:%d %S"
161 host port (car conns)) 162 host port (car conns))
162 (url-http-idle-sentinel (car conns) nil)) 163 (url-http-idle-sentinel (car conns) nil))
163 (setq found (car conns)) 164 (setq connection (car conns))
164 (url-http-debug "Found existing connection: %s:%d %S" host port found)) 165 (url-http-debug "Found existing connection: %s:%d %S" host port connection))
165 (pop conns)) 166 (pop conns))
166 (if found 167 (if connection
167 (url-http-debug "Reusing existing connection: %s:%d" host port) 168 (url-http-debug "Reusing existing connection: %s:%d" host port)
168 (url-http-debug "Contacting host: %s:%d" host port)) 169 (url-http-debug "Contacting host: %s:%d" host port))
169 (url-lazy-message "Contacting host: %s:%d" host port) 170 (url-lazy-message "Contacting host: %s:%d" host port)
170 (url-http-mark-connection-as-busy 171
171 host port 172 (unless connection
172 (or found 173 (let ((buf (generate-new-buffer " *url-http-temp*")))
173 (let ((buf (generate-new-buffer " *url-http-temp*"))) 174 ;; `url-open-stream' needs a buffer in which to do things
174 ;; `url-open-stream' needs a buffer in which to do things 175 ;; like authentication. But we use another buffer afterwards.
175 ;; like authentication. But we use another buffer afterwards. 176 (unwind-protect
176 (unwind-protect 177 (let ((proc (url-open-stream host buf host port)))
177 (let ((proc (url-open-stream host buf host port))) 178 ;; url-open-stream might return nil.
178 ;; url-open-stream might return nil. 179 (when (processp proc)
179 (when (processp proc) 180 ;; Drop the temp buffer link before killing the buffer.
180 ;; Drop the temp buffer link before killing the buffer. 181 (set-process-buffer proc nil)
181 (set-process-buffer proc nil)) 182 (setq connection proc)))
182 proc) 183 ;; If there was an error on connect, make sure we don't
183 ;; If there was an error on connect, make sure we don't 184 ;; get queried.
184 ;; get queried. 185 (when (get-buffer-process buf)
185 (when (get-buffer-process buf) 186 (set-process-query-on-exit-flag (get-buffer-process buf) nil))
186 (set-process-query-on-exit-flag (get-buffer-process buf) nil)) 187 (kill-buffer buf))))
187 (kill-buffer buf))))))) 188
189 (if connection
190 (url-http-mark-connection-as-busy host port connection))))
188 191
189;; Building an HTTP request 192;; Building an HTTP request
190(defun url-http-user-agent-string () 193(defun url-http-user-agent-string ()
@@ -873,19 +876,26 @@ should be shown to the user."
873 url-http-open-connections)) 876 url-http-open-connections))
874 877
875(defun url-http-end-of-document-sentinel (proc why) 878(defun url-http-end-of-document-sentinel (proc why)
876 ;; Sentinel used for old HTTP/0.9 or connections we know are going 879 ;; Sentinel used to handle (i) terminated old HTTP/0.9 connections,
877 ;; to die as the 'end of document' notifier. 880 ;; and (ii) closed connection due to reusing a HTTP connection which
881 ;; we believed was still alive, but which the server closed on us.
882 ;; We handle case (ii) by calling `url-http' again.
878 (url-http-debug "url-http-end-of-document-sentinel in buffer (%s)" 883 (url-http-debug "url-http-end-of-document-sentinel in buffer (%s)"
879 (process-buffer proc)) 884 (process-buffer proc))
880 (url-http-idle-sentinel proc why) 885 (url-http-idle-sentinel proc why)
881 (when (buffer-name (process-buffer proc)) 886 (when (buffer-name (process-buffer proc))
882 (with-current-buffer (process-buffer proc) 887 (with-current-buffer (process-buffer proc)
883 (goto-char (point-min)) 888 (goto-char (point-min))
884 (if (not (looking-at "HTTP/")) 889 (cond ((not (looking-at "HTTP/"))
885 ;; HTTP/0.9 just gets passed back no matter what 890 (if url-http-no-retry
886 (url-http-activate-callback) 891 ;; HTTP/0.9 just gets passed back no matter what
887 (if (url-http-parse-headers) 892 (url-http-activate-callback)
888 (url-http-activate-callback)))))) 893 ;; Call `url-http' again if our connection expired.
894 (erase-buffer)
895 (url-http url-current-object url-callback-function
896 url-callback-arguments (current-buffer))))
897 ((url-http-parse-headers)
898 (url-http-activate-callback))))))
889 899
890(defun url-http-simple-after-change-function (st nd length) 900(defun url-http-simple-after-change-function (st nd length)
891 ;; Function used when we do NOT know how long the document is going to be 901 ;; Function used when we do NOT know how long the document is going to be
@@ -1163,11 +1173,14 @@ the end of the document."
1163 (goto-char (point-max))))) 1173 (goto-char (point-max)))))
1164 1174
1165;;;###autoload 1175;;;###autoload
1166(defun url-http (url callback cbargs) 1176(defun url-http (url callback cbargs &optional retry-buffer)
1167 "Retrieve URL via HTTP asynchronously. 1177 "Retrieve URL via HTTP asynchronously.
1168URL must be a parsed URL. See `url-generic-parse-url' for details. 1178URL must be a parsed URL. See `url-generic-parse-url' for details.
1169When retrieval is completed, the function CALLBACK is executed with 1179When retrieval is completed, the function CALLBACK is executed with
1170CBARGS as the arguments." 1180CBARGS as the arguments.
1181
1182Optional arg RETRY-BUFFER, if non-nil, specifies the buffer of a
1183previous `url-http' call, which is being re-attempted."
1171 (check-type url vector "Need a pre-parsed URL.") 1184 (check-type url vector "Need a pre-parsed URL.")
1172 (declare (special url-current-object 1185 (declare (special url-current-object
1173 url-http-end-of-headers 1186 url-http-end-of-headers
@@ -1188,7 +1201,8 @@ CBARGS as the arguments."
1188 (let* ((host (url-host (or url-using-proxy url))) 1201 (let* ((host (url-host (or url-using-proxy url)))
1189 (port (url-port (or url-using-proxy url))) 1202 (port (url-port (or url-using-proxy url)))
1190 (connection (url-http-find-free-connection host port)) 1203 (connection (url-http-find-free-connection host port))
1191 (buffer (generate-new-buffer (format " *http %s:%d*" host port)))) 1204 (buffer (or retry-buffer
1205 (generate-new-buffer (format " *http %s:%d*" host port)))))
1192 (if (not connection) 1206 (if (not connection)
1193 ;; Failed to open the connection for some reason 1207 ;; Failed to open the connection for some reason
1194 (progn 1208 (progn
@@ -1218,6 +1232,7 @@ CBARGS as the arguments."
1218 url-http-extra-headers 1232 url-http-extra-headers
1219 url-http-data 1233 url-http-data
1220 url-http-target-url 1234 url-http-target-url
1235 url-http-no-retry
1221 url-http-connection-opened 1236 url-http-connection-opened
1222 url-http-proxy)) 1237 url-http-proxy))
1223 (set (make-local-variable var) nil)) 1238 (set (make-local-variable var) nil))
@@ -1233,6 +1248,7 @@ CBARGS as the arguments."
1233 url-callback-arguments cbargs 1248 url-callback-arguments cbargs
1234 url-http-after-change-function 'url-http-wait-for-headers-change-function 1249 url-http-after-change-function 'url-http-wait-for-headers-change-function
1235 url-http-target-url url-current-object 1250 url-http-target-url url-current-object
1251 url-http-no-retry retry-buffer
1236 url-http-connection-opened nil 1252 url-http-connection-opened nil
1237 url-http-proxy url-using-proxy) 1253 url-http-proxy url-using-proxy)
1238 1254
@@ -1259,6 +1275,7 @@ CBARGS as the arguments."
1259 (with-current-buffer (process-buffer proc) 1275 (with-current-buffer (process-buffer proc)
1260 (cond 1276 (cond
1261 (url-http-connection-opened 1277 (url-http-connection-opened
1278 (setq url-http-no-retry t)
1262 (url-http-end-of-document-sentinel proc why)) 1279 (url-http-end-of-document-sentinel proc why))
1263 ((string= (substring why 0 4) "open") 1280 ((string= (substring why 0 4) "open")
1264 (setq url-http-connection-opened t) 1281 (setq url-http-connection-opened t)
diff --git a/lisp/window.el b/lisp/window.el
index edd8a113876..f79041e0e6c 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -3273,7 +3273,7 @@ Otherwise, the window starts are chosen so as to minimize the
3273amount of redisplay; this is convenient on slow terminals." 3273amount of redisplay; this is convenient on slow terminals."
3274 (interactive "P") 3274 (interactive "P")
3275 (let ((old-window (selected-window)) 3275 (let ((old-window (selected-window))
3276 (old-point (point)) 3276 (old-point (window-point-1))
3277 (size (and size (prefix-numeric-value size))) 3277 (size (and size (prefix-numeric-value size)))
3278 moved-by-window-height moved new-window bottom) 3278 moved-by-window-height moved new-window bottom)
3279 (when (and size (< size 0) (< (- size) window-min-height)) 3279 (when (and size (< size 0) (< (- size) window-min-height))
@@ -3282,22 +3282,27 @@ amount of redisplay; this is convenient on slow terminals."
3282 (setq new-window (split-window nil size)) 3282 (setq new-window (split-window nil size))
3283 (unless split-window-keep-point 3283 (unless split-window-keep-point
3284 (with-current-buffer (window-buffer) 3284 (with-current-buffer (window-buffer)
3285 (goto-char (window-start)) 3285 ;; Use `save-excursion' around vertical movements below
3286 (setq moved (vertical-motion (window-height))) 3286 ;; (Bug#10971). Note: When the selected window's buffer has a
3287 (set-window-start new-window (point)) 3287 ;; header line, up to two lines of the buffer may not show up
3288 (when (> (point) (window-point new-window)) 3288 ;; in the resulting configuration.
3289 (set-window-point new-window (point))) 3289 (save-excursion
3290 (when (= moved (window-height)) 3290 (goto-char (window-start))
3291 (setq moved-by-window-height t) 3291 (setq moved (vertical-motion (window-height)))
3292 (vertical-motion -1)) 3292 (set-window-start new-window (point))
3293 (setq bottom (point))) 3293 (when (> (point) (window-point new-window))
3294 (and moved-by-window-height 3294 (set-window-point new-window (point)))
3295 (<= bottom (point)) 3295 (when (= moved (window-height))
3296 (set-window-point old-window (1- bottom))) 3296 (setq moved-by-window-height t)
3297 (and moved-by-window-height 3297 (vertical-motion -1))
3298 (<= (window-start new-window) old-point) 3298 (setq bottom (point)))
3299 (set-window-point new-window old-point) 3299 (and moved-by-window-height
3300 (select-window new-window))) 3300 (<= bottom (point))
3301 (set-window-point-1 old-window (1- bottom)))
3302 (and moved-by-window-height
3303 (<= (window-start new-window) old-point)
3304 (set-window-point new-window old-point)
3305 (select-window new-window))))
3301 ;; Always copy quit-restore parameter in interactive use. 3306 ;; Always copy quit-restore parameter in interactive use.
3302 (let ((quit-restore (window-parameter old-window 'quit-restore))) 3307 (let ((quit-restore (window-parameter old-window 'quit-restore)))
3303 (when quit-restore 3308 (when quit-restore
diff --git a/src/ChangeLog b/src/ChangeLog
index ef57223b9ca..1ec148b30c8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,37 @@
12012-03-12 Paul Eggert <eggert@cs.ucla.edu>
2
3 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
4
52012-03-12 Chong Yidong <cyd@gnu.org>
6
7 * eval.c (inhibit_lisp_code): Rename from
8 inhibit_window_configuration_change_hook; move from window.c.
9
10 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11 * window.c (run_window_configuration_change_hook)
12 (syms_of_window): Callers changed.
13
142012-03-11 Chong Yidong <cyd@gnu.org>
15
16 * keymap.c (Fkey_description): Doc fix (Bug#9700).
17
18 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
19
202012-03-10 Chong Yidong <cyd@gnu.org>
21
22 * frame.c (other_visible_frames): Don't assume the selected frame
23 is visible (Bug#10955).
24
252012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
26
27 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
28
292012-03-08 Jan Djärv <jan.h.d@swipnet.se>
30
31 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
32 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
33 zero (Bug#10954).
34
12012-03-03 Glenn Morris <rgm@gnu.org> 352012-03-03 Glenn Morris <rgm@gnu.org>
2 36
3 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes. 37 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
@@ -195,8 +229,8 @@
195 229
1962012-02-04 Eli Zaretskii <eliz@gnu.org> 2302012-02-04 Eli Zaretskii <eliz@gnu.org>
197 231
198 * w32.c (get_emacs_configuration_options): Include 232 * w32.c (get_emacs_configuration_options):
199 --enable-checking, if specified, in the return value. 233 Include --enable-checking, if specified, in the return value.
200 234
2012012-02-04 Martin Rudalics <rudalics@gmx.at> 2352012-02-04 Martin Rudalics <rudalics@gmx.at>
202 236
@@ -302,8 +336,8 @@
3022012-01-19 Martin Rudalics <rudalics@gmx.at> 3362012-01-19 Martin Rudalics <rudalics@gmx.at>
303 337
304 * window.c (save_window_save, Fcurrent_window_configuration) 338 * window.c (save_window_save, Fcurrent_window_configuration)
305 (Vwindow_persistent_parameters): Do not use Qstate. Rewrite 339 (Vwindow_persistent_parameters): Do not use Qstate.
306 doc-strings. 340 Rewrite doc-strings.
307 341
3082012-01-19 Kenichi Handa <handa@m17n.org> 3422012-01-19 Kenichi Handa <handa@m17n.org>
309 343
@@ -477,9 +511,9 @@
477 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define. 511 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
478 (symbol_to_nsstring): Fix indentation. 512 (symbol_to_nsstring): Fix indentation.
479 (ns_symbol_to_pb): New function. 513 (ns_symbol_to_pb): New function.
480 (Fns_get_selection_internal): Renamed from Fns_get_cut_buffer_internal. 514 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
481 (Fns_rotate_cut_buffers_internal): Removed. 515 (Fns_rotate_cut_buffers_internal): Remove.
482 (Fns_store_selection_internal): Renamed from 516 (Fns_store_selection_internal): Rename from
483 Fns_store_cut_buffer_internal. 517 Fns_store_cut_buffer_internal.
484 (ns_get_foreign_selection, Fx_own_selection_internal) 518 (ns_get_foreign_selection, Fx_own_selection_internal)
485 (Fx_disown_selection_internal, Fx_selection_exists_p) 519 (Fx_disown_selection_internal, Fx_selection_exists_p)
@@ -620,7 +654,7 @@
620 (coding_set_destination): Return how many bytes 654 (coding_set_destination): Return how many bytes
621 coding->destination was relocated. 655 coding->destination was relocated.
622 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET) 656 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
623 (CODING_CHAR_CHARSET_P): Adjusted for the avove changes. 657 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
624 658
6252011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change) 6592011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
626 660
diff --git a/src/buffer.c b/src/buffer.c
index 1577254d92a..1fea19b0d65 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2864,6 +2864,12 @@ compare_overlays (const void *v1, const void *v2)
2864 return s1->beg < s2->beg ? -1 : 1; 2864 return s1->beg < s2->beg ? -1 : 1;
2865 if (s1->end != s2->end) 2865 if (s1->end != s2->end)
2866 return s2->end < s1->end ? -1 : 1; 2866 return s2->end < s1->end ? -1 : 1;
2867 /* Avoid the non-determinism of qsort by choosing an arbitrary ordering
2868 between "equal" overlays. The result can still change between
2869 invocations of Emacs, but it won't change in the middle of
2870 `find_field' (bug#6830). */
2871 if (XHASH (s1->overlay) != XHASH (s2->overlay))
2872 return XHASH (s1->overlay) < XHASH (s2->overlay) ? -1 : 1;
2867 return 0; 2873 return 0;
2868} 2874}
2869 2875
diff --git a/src/editfns.c b/src/editfns.c
index bbeb5033664..a41565d8588 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -663,10 +663,11 @@ is after LIMIT, then LIMIT will be returned instead. */)
663 663
664DEFUN ("constrain-to-field", Fconstrain_to_field, Sconstrain_to_field, 2, 5, 0, 664DEFUN ("constrain-to-field", Fconstrain_to_field, Sconstrain_to_field, 2, 5, 0,
665 doc: /* Return the position closest to NEW-POS that is in the same field as OLD-POS. 665 doc: /* Return the position closest to NEW-POS that is in the same field as OLD-POS.
666
667A field is a region of text with the same `field' property. 666A field is a region of text with the same `field' property.
668If NEW-POS is nil, then the current point is used instead, and set to the 667
669constrained position if that is different. 668If NEW-POS is nil, then use the current point instead, and move point
669to the resulting constrained position, in addition to returning that
670position.
670 671
671If OLD-POS is at the boundary of two fields, then the allowable 672If OLD-POS is at the boundary of two fields, then the allowable
672positions for NEW-POS depends on the value of the optional argument 673positions for NEW-POS depends on the value of the optional argument
diff --git a/src/eval.c b/src/eval.c
index 344228741cb..4a3f5083b3b 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -124,6 +124,12 @@ Lisp_Object Vsignaling_function;
124 124
125int handling_signal; 125int handling_signal;
126 126
127/* If non-nil, Lisp code must not be run since some part of Emacs is
128 in an inconsistent state. Currently, x-create-frame uses this to
129 avoid triggering window-configuration-change-hook while the new
130 frame is half-initialized. */
131Lisp_Object inhibit_lisp_code;
132
127static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *); 133static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *);
128static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN; 134static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN;
129static int interactive_p (int); 135static int interactive_p (int);
@@ -3766,6 +3772,8 @@ alist of active lexical bindings. */);
3766 staticpro (&Vsignaling_function); 3772 staticpro (&Vsignaling_function);
3767 Vsignaling_function = Qnil; 3773 Vsignaling_function = Qnil;
3768 3774
3775 inhibit_lisp_code = Qnil;
3776
3769 defsubr (&Sor); 3777 defsubr (&Sor);
3770 defsubr (&Sand); 3778 defsubr (&Sand);
3771 defsubr (&Sif); 3779 defsubr (&Sif);
diff --git a/src/frame.c b/src/frame.c
index 8505398a260..1db24cc80e7 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1118,41 +1118,32 @@ Otherwise, include all frames. */)
1118static int 1118static int
1119other_visible_frames (FRAME_PTR f) 1119other_visible_frames (FRAME_PTR f)
1120{ 1120{
1121 /* We know the selected frame is visible, 1121 Lisp_Object frames;
1122 so if F is some other frame, it can't be the sole visible one. */
1123 if (f == SELECTED_FRAME ())
1124 {
1125 Lisp_Object frames;
1126 int count = 0;
1127 1122
1128 for (frames = Vframe_list; 1123 for (frames = Vframe_list; CONSP (frames); frames = XCDR (frames))
1129 CONSP (frames); 1124 {
1130 frames = XCDR (frames)) 1125 Lisp_Object this = XCAR (frames);
1131 { 1126 if (f == XFRAME (this))
1132 Lisp_Object this; 1127 continue;
1133 1128
1134 this = XCAR (frames); 1129 /* Verify that we can still talk to the frame's X window,
1135 /* Verify that the frame's window still exists 1130 and note any recent change in visibility. */
1136 and we can still talk to it. And note any recent change
1137 in visibility. */
1138#ifdef HAVE_WINDOW_SYSTEM 1131#ifdef HAVE_WINDOW_SYSTEM
1139 if (FRAME_WINDOW_P (XFRAME (this))) 1132 if (FRAME_WINDOW_P (XFRAME (this)))
1140 { 1133 {
1141 x_sync (XFRAME (this)); 1134 x_sync (XFRAME (this));
1142 FRAME_SAMPLE_VISIBILITY (XFRAME (this)); 1135 FRAME_SAMPLE_VISIBILITY (XFRAME (this));
1143 } 1136 }
1144#endif 1137#endif
1145 1138
1146 if (FRAME_VISIBLE_P (XFRAME (this)) 1139 if (FRAME_VISIBLE_P (XFRAME (this))
1147 || FRAME_ICONIFIED_P (XFRAME (this)) 1140 || FRAME_ICONIFIED_P (XFRAME (this))
1148 /* Allow deleting the terminal frame when at least 1141 /* Allow deleting the terminal frame when at least one X
1149 one X frame exists! */ 1142 frame exists. */
1150 || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f))) 1143 || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f)))
1151 count++; 1144 return 1;
1152 }
1153 return count > 1;
1154 } 1145 }
1155 return 1; 1146 return 0;
1156} 1147}
1157 1148
1158/* Delete FRAME. When FORCE equals Qnoelisp, delete FRAME 1149/* Delete FRAME. When FORCE equals Qnoelisp, delete FRAME
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 1ed5833bd5c..4dbef65dedf 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1304,10 +1304,13 @@ x_wm_set_size_hint (FRAME_PTR f, long int flags, int user_position)
1304 1304
1305 hint_flags |= GDK_HINT_BASE_SIZE; 1305 hint_flags |= GDK_HINT_BASE_SIZE;
1306 base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0) + FRAME_TOOLBAR_WIDTH (f); 1306 base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0) + FRAME_TOOLBAR_WIDTH (f);
1307 base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0) 1307 /* Use one row here so base_height does not become zero.
1308 Gtk+ and/or Unity on Ubuntu 12.04 can't handle it. */
1309 base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 1)
1308 + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); 1310 + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
1309 1311
1310 check_frame_size (f, &min_rows, &min_cols); 1312 check_frame_size (f, &min_rows, &min_cols);
1313 if (min_rows > 0) --min_rows; /* We used one row in base_height = ... 1); */
1311 1314
1312 size_hints.base_width = base_width; 1315 size_hints.base_width = base_width;
1313 size_hints.base_height = base_height; 1316 size_hints.base_height = base_height;
diff --git a/src/keymap.c b/src/keymap.c
index 0ae055213c3..ecaeb32896e 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2043,8 +2043,9 @@ static Lisp_Object Qsingle_key_description, Qkey_description;
2043DEFUN ("key-description", Fkey_description, Skey_description, 1, 2, 0, 2043DEFUN ("key-description", Fkey_description, Skey_description, 1, 2, 0,
2044 doc: /* Return a pretty description of key-sequence KEYS. 2044 doc: /* Return a pretty description of key-sequence KEYS.
2045Optional arg PREFIX is the sequence of keys leading up to KEYS. 2045Optional arg PREFIX is the sequence of keys leading up to KEYS.
2046Control characters turn into "C-foo" sequences, meta into "M-foo", 2046For example, [?\C-x ?l] is converted into the string \"C-x l\".
2047spaces are put between sequence elements, etc. */) 2047
2048The `kbd' macro is an approximate inverse of this. */)
2048 (Lisp_Object keys, Lisp_Object prefix) 2049 (Lisp_Object keys, Lisp_Object prefix)
2049{ 2050{
2050 int len = 0; 2051 int len = 0;
diff --git a/src/lisp.h b/src/lisp.h
index f2177ad789d..678c48e8ff3 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2941,6 +2941,7 @@ extern Lisp_Object Qinhibit_quit, Qclosure;
2941extern Lisp_Object Qand_rest; 2941extern Lisp_Object Qand_rest;
2942extern Lisp_Object Vautoload_queue; 2942extern Lisp_Object Vautoload_queue;
2943extern Lisp_Object Vsignaling_function; 2943extern Lisp_Object Vsignaling_function;
2944extern Lisp_Object inhibit_lisp_code;
2944extern int handling_signal; 2945extern int handling_signal;
2945#if BYTE_MARK_STACK 2946#if BYTE_MARK_STACK
2946extern struct catchtag *catchlist; 2947extern struct catchtag *catchlist;
diff --git a/src/window.c b/src/window.c
index df315a2366c..2a9d308b836 100644
--- a/src/window.c
+++ b/src/window.c
@@ -124,9 +124,6 @@ static int window_initialized;
124/* Hook to run when window config changes. */ 124/* Hook to run when window config changes. */
125static Lisp_Object Qwindow_configuration_change_hook; 125static Lisp_Object Qwindow_configuration_change_hook;
126 126
127/* If non-nil, run_window_configuration_change_hook does nothing. */
128Lisp_Object inhibit_window_configuration_change_hook;
129
130/* Used by the function window_scroll_pixel_based */ 127/* Used by the function window_scroll_pixel_based */
131static int window_scroll_pixel_based_preserve_x; 128static int window_scroll_pixel_based_preserve_x;
132static int window_scroll_pixel_based_preserve_y; 129static int window_scroll_pixel_based_preserve_y;
@@ -2899,7 +2896,7 @@ run_window_configuration_change_hook (struct frame *f)
2899 = Fdefault_value (Qwindow_configuration_change_hook); 2896 = Fdefault_value (Qwindow_configuration_change_hook);
2900 XSETFRAME (frame, f); 2897 XSETFRAME (frame, f);
2901 2898
2902 if (NILP (Vrun_hooks) || !NILP (inhibit_window_configuration_change_hook)) 2899 if (NILP (Vrun_hooks) || !NILP (inhibit_lisp_code))
2903 return; 2900 return;
2904 2901
2905 /* Use the right buffer. Matters when running the local hooks. */ 2902 /* Use the right buffer. Matters when running the local hooks. */
@@ -6532,8 +6529,6 @@ syms_of_window (void)
6532 window_scroll_preserve_hpos = -1; 6529 window_scroll_preserve_hpos = -1;
6533 window_scroll_preserve_vpos = -1; 6530 window_scroll_preserve_vpos = -1;
6534 6531
6535 inhibit_window_configuration_change_hook = Qnil;
6536
6537 DEFVAR_LISP ("temp-buffer-show-function", Vtemp_buffer_show_function, 6532 DEFVAR_LISP ("temp-buffer-show-function", Vtemp_buffer_show_function,
6538 doc: /* Non-nil means call as function to display a help buffer. 6533 doc: /* Non-nil means call as function to display a help buffer.
6539The function is called with one argument, the buffer to be displayed. 6534The function is called with one argument, the buffer to be displayed.
diff --git a/src/window.h b/src/window.h
index f4a5f52b9a5..ea127ca95a8 100644
--- a/src/window.h
+++ b/src/window.h
@@ -810,10 +810,6 @@ extern Lisp_Object Vmouse_window;
810 810
811extern Lisp_Object Vmouse_event; 811extern Lisp_Object Vmouse_event;
812 812
813/* If non-nil, run_window_configuration_change_hook does nothing. */
814
815extern Lisp_Object inhibit_window_configuration_change_hook;
816
817EXFUN (Fnext_window, 3); 813EXFUN (Fnext_window, 3);
818EXFUN (Fselect_window, 2); 814EXFUN (Fselect_window, 2);
819EXFUN (Fset_window_buffer, 3); 815EXFUN (Fset_window_buffer, 3);
diff --git a/src/xfns.c b/src/xfns.c
index 6fcd129e4a4..6f08ada1bb9 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2952,7 +2952,7 @@ unwind_create_frame (Lisp_Object frame)
2952static Lisp_Object 2952static Lisp_Object
2953unwind_create_frame_1 (Lisp_Object val) 2953unwind_create_frame_1 (Lisp_Object val)
2954{ 2954{
2955 inhibit_window_configuration_change_hook = val; 2955 inhibit_lisp_code = val;
2956 return Qnil; 2956 return Qnil;
2957} 2957}
2958 2958
@@ -3337,9 +3337,8 @@ This function is an internal primitive--use `make-frame' instead. */)
3337 Vframe_list. */ 3337 Vframe_list. */
3338 { 3338 {
3339 int count2 = SPECPDL_INDEX (); 3339 int count2 = SPECPDL_INDEX ();
3340 record_unwind_protect (unwind_create_frame_1, 3340 record_unwind_protect (unwind_create_frame_1, inhibit_lisp_code);
3341 inhibit_window_configuration_change_hook); 3341 inhibit_lisp_code = Qt;
3342 inhibit_window_configuration_change_hook = Qt;
3343 3342
3344 x_default_parameter (f, parms, Qmenu_bar_lines, 3343 x_default_parameter (f, parms, Qmenu_bar_lines,
3345 NILP (Vmenu_bar_mode) 3344 NILP (Vmenu_bar_mode)