changeset 109718:77fb60d4233b

Merge changes from emacs-23 branch.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 08 Aug 2010 17:15:44 -0400
parents 8949aad5e992 (current diff) df8e0cd18128 (diff)
children 472b3dda3de7
files src/ChangeLog src/charset.c src/coding.c src/xfns.c
diffstat 33 files changed, 444 insertions(+), 200 deletions(-) [+]
line wrap: on
line diff
--- a/doc/lispref/ChangeLog	Sun Aug 08 14:03:45 2010 -0700
+++ b/doc/lispref/ChangeLog	Sun Aug 08 17:15:44 2010 -0400
@@ -1,3 +1,17 @@
+2010-08-08  Christoph  <cschol2112@googlemail.com>
+
+	* control.texi (Handling Errors) <error-message-string>: Fix arg name.
+
+2010-08-08  Juanma Barranquero  <lekktu@gmail.com>
+
+	* modes.texi (Defining Minor Modes): Use C-backspace, not C-delete.
+	Suggested by Štěpán Němec <stepnem@gmail.com>.
+
+2010-08-08  Juanma Barranquero  <lekktu@gmail.com>
+
+	* minibuf.texi (High-Level Completion): Document args of
+	`read-buffer-function' (bug#5625).
+
 2010-07-29  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* frames.texi (Layout Parameters): Add doc for tool-bar-position.
--- a/doc/lispref/control.texi	Sun Aug 08 14:03:45 2010 -0700
+++ b/doc/lispref/control.texi	Sun Aug 08 17:15:44 2010 -0400
@@ -1039,7 +1039,7 @@
 @xref{Definition of signal}.
 @end defspec
 
-@defun error-message-string error-description
+@defun error-message-string error-descriptor
 This function returns the error message string for a given error
 descriptor.  It is useful if you want to handle an error by printing the
 usual error message for that error.  @xref{Definition of signal}.
--- a/doc/lispref/minibuf.texi	Sun Aug 08 14:03:45 2010 -0700
+++ b/doc/lispref/minibuf.texi	Sun Aug 08 17:15:44 2010 -0400
@@ -1222,10 +1222,11 @@
 @end defun
 
 @defopt read-buffer-function
-This variable specifies how to read buffer names.  For example, if you
-set this variable to @code{iswitchb-read-buffer}, all Emacs commands
-that call @code{read-buffer} to read a buffer name will actually use the
-@code{iswitchb} package to read it.
+This variable specifies how to read buffer names.  The function is
+called with the arguments passed to @code{read-buffer}.  For example,
+if you set this variable to @code{iswitchb-read-buffer}, all Emacs
+commands that call @code{read-buffer} to read a buffer name will
+actually use the @code{iswitchb} package to read it.
 @end defopt
 
 @defopt read-buffer-completion-ignore-case
--- a/doc/lispref/modes.texi	Sun Aug 08 14:03:45 2010 -0700
+++ b/doc/lispref/modes.texi	Sun Aug 08 17:15:44 2010 -0400
@@ -1494,7 +1494,7 @@
  ;; The indicator for the mode line.
  " Hungry"
  ;; The minor mode bindings.
- '(([C-delete] . hungry-electric-delete))
+ '(([C-backspace] . hungry-electric-delete))
  :group 'hunger)
 @end smallexample
 
@@ -1526,8 +1526,8 @@
  :lighter " Hungry"
  ;; The minor mode bindings.
  :keymap
- '(([C-delete] . hungry-electric-delete)
-   ([C-M-delete]
+ '(([C-backspace] . hungry-electric-delete)
+   ([C-M-backspace]
     . (lambda ()
         (interactive)
         (hungry-electric-delete t))))
--- a/doc/misc/ChangeLog	Sun Aug 08 14:03:45 2010 -0700
+++ b/doc/misc/ChangeLog	Sun Aug 08 17:15:44 2010 -0400
@@ -1,3 +1,7 @@
+2010-08-08  Juanma Barranquero  <lekktu@gmail.com>
+
+	* org.texi (Footnotes, Tables in HTML export): Fix typos.
+
 2010-08-08  Jay Belanger  <jay.p.belanger@gmail.com>
 
 	* calc.texi (Making Selections, Selecting Subformulas)
--- a/etc/ChangeLog	Sun Aug 08 14:03:45 2010 -0700
+++ b/etc/ChangeLog	Sun Aug 08 17:15:44 2010 -0400
@@ -1,3 +1,7 @@
+2010-08-08  Ken Brown  <kbrown@cornell.edu>
+
+	* PROBLEMS: Mention problem with Cygwin 1.5.19.
+
 2010-08-07  Eli Zaretskii  <eliz@gnu.org>
 
 	* NEWS: Mention the Hebrew translation.
--- a/etc/PROBLEMS	Sun Aug 08 14:03:45 2010 -0700
+++ b/etc/PROBLEMS	Sun Aug 08 17:15:44 2010 -0400
@@ -2344,6 +2344,14 @@
 As of Emacs 22.1, there have been stability problems with Cygwin
 builds of Emacs using GCC 3.  Cygwin users are advised to use GCC 4.
 
+*** Building Emacs 23.3 and later will fail under Cygwin 1.5.19
+
+This is a consequence of a change to src/dired.c on 2010-07-27.  The
+issue is that Cygwin 1.5.19 did not have d_ino in 'struct dirent'.
+See
+
+  http://lists.gnu.org/archive/html/emacs-devel/2010-07/msg01266.html
+
 *** Building the native MS-Windows port fails due to unresolved externals
 
 The linker error messages look like this:
--- a/lisp/ChangeLog	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/ChangeLog	Sun Aug 08 17:15:44 2010 -0400
@@ -1,3 +1,93 @@
+2010-08-08  Johan Bockgård  <bojohan@gnu.org>
+
+	* replace.el (replace-highlight): Bind isearch-forward and
+	isearch-error, ensuring that highlighting is updated if the user
+	switches the search direction (Bug#6808).
+
+	* isearch.el (isearch-lazy-highlight-forward): New var.
+	(isearch-lazy-highlight-new-loop, isearch-lazy-highlight-search):
+	(isearch-lazy-highlight-update): Use it.
+
+2010-08-08  Kenichi Handa  <handa@m17n.org>
+
+	* international/mule.el (define-charset): Store NAME as :base
+	property.
+	(ctext-non-standard-encodings-table): Pay attention to charset
+	aliases.
+	(ctext-pre-write-conversion): Sort ctext-standard-encodings by the
+	current priority.  Force using the designation of the specific
+	charset by adding `charset' text property.  Improve the whole
+	algorithm.
+
+2010-08-08  Juanma Barranquero  <lekktu@gmail.com>
+
+	* emulation/pc-select.el (pc-selection-mode-hook)
+	(copy-region-as-kill-nomark, beginning-of-buffer-mark)
+	(pc-selection-mode): Fix typos in docstrings.
+
+2010-08-08  Kenichi Handa  <handa@m17n.org>
+
+	* language/cyrillic.el: Don't add "microsoft-cp1251" to
+	ctext-non-standard-encodings-alist here.
+
+	* international/mule.el (ctext-non-standard-encodings-alist): Add
+	"koi8-r" and "microsoft-cp1251".
+	(ctext-standard-encodings): New variable.
+	(ctext-non-standard-encodings-table): List only elements for
+	non-standard encodings.
+	(ctext-pre-write-conversion): Adjusted for the above change.
+	Check ctext-standard-encodings.
+
+	* international/mule-conf.el (compound-text): Doc fix.
+	(ctext-no-compositions): Doc fix.
+	(compound-text-with-extensions): Doc fix.
+
+2010-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* simple.el (exchange-dot-and-mark): Mark obsolete, finally.
+
+2010-08-03  Juanma Barranquero  <lekktu@gmail.com>
+
+	* progmodes/which-func.el (which-func-format): Split help-echo text
+	into lines, like other mode-line tooltips.
+
+	* server.el (server-start): When using TCP sockets, force IPv4
+	and use a literal 127.0.0.1 for localhost.  (Related to bug#6781.)
+
+2010-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* bindings.el (complete-symbol): Run completion-at-point as a fallback.
+
+2010-08-02  Juanma Barranquero  <lekktu@gmail.com>
+
+	* term.el (term-delimiter-argument-list): Reflow docstring.
+	(term-read-input-ring, term-write-input-ring, term-send-input)
+	(term-bol, term-erase-in-display, serial-supported-or-barf):
+	Fix typos in docstrings.
+
+2010-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* bindings.el (function-key-map): Add a S-tab => backtab fallback.
+
+2010-08-01  Juanma Barranquero  <lekktu@gmail.com>
+
+	* dabbrev.el (dabbrev-completion): Fix typo in docstring.
+
+2010-08-01  MON KEY  <monkey@sandpframing.com>  (tiny change)
+
+	* emacs-lisp/syntax.el (syntax-ppss-toplevel-pos):
+	Fix typo in docstring (bug#6747).
+
+2010-08-08  Leo  <sdl.web@gmail.com>
+
+	* eshell/esh-io.el (eshell-get-target): Better detection of
+	read-only file (Bug#6762).
+
+2010-08-08  Juanma Barranquero  <lekktu@gmail.com>
+
+	* align.el (align-default-spacing): Doc fix.
+	(align-region-heuristic, align-regexp): Fix typos in docstrings.
+
 2010-08-08  Ulf Jasper  <ulf.jasper@web.de>
 
 	* calendar/icalendar.el (icalendar-uid-format): Doc fix.
--- a/lisp/align.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/align.el	Sun Aug 08 17:15:44 2010 -0400
@@ -140,8 +140,8 @@
   "An integer that represents the default amount of padding to use.
 If `align-to-tab-stop' is non-nil, this will represent the number of
 tab stops to use for alignment, rather than the number of spaces.
-Each alignment rule can optionally override both this variable.  See
-`align-mode-alist'."
+Each alignment rule can optionally override both this variable and
+`align-to-tab-stop'.  See `align-rules-list'."
   :type 'integer
   :group 'align)
 
@@ -157,8 +157,8 @@
 sections (whenever `align-region-separate' is non-nil, and not a
 string), this heuristic is used to determine how far before and after
 point we should search in looking for a region separator.  Larger
-values can mean slower perform in large files, although smaller values
-may cause unexpected behavior at times."
+values can mean slower performance in large files, although smaller
+values may cause unexpected behavior at times."
   :type 'integer
   :group 'align)
 
@@ -926,7 +926,7 @@
     Joe (123) 456-7890
 
 There is no predefined rule to handle this, but you could easily do it
-using a REGEXP like \"(\". All you would have to do is to mark the
+using a REGEXP like \"(\".  All you would have to do is to mark the
 region, call `align-regexp' and type in that regular expression."
   (interactive
    (append
--- a/lisp/bindings.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/bindings.el	Sun Aug 08 17:15:44 2010 -0400
@@ -1054,6 +1054,9 @@
 ;; so we can't distinguish those two keys, but usually we consider C-SPC
 ;; (rather than C-@) as the "canonical" binding.
 (define-key function-key-map [?\C-@] [?\C-\s])
+;; Many keyboards don't have a `backtab' key, so by convention the user
+;; can use S-tab instead to access that binding.
+(define-key function-key-map [S-tab] [backtab])
 
 (define-key global-map [mouse-movement] 'ignore)
 
--- a/lisp/dabbrev.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/dabbrev.el	Sun Aug 08 17:15:44 2010 -0400
@@ -377,7 +377,7 @@
 function pointed out by `dabbrev-friend-buffer-function' to find the
 completions.
 
-If the prefix argument is 16 (which comes from \\[prefix-argument] \\[prefix-argument]),
+If the prefix argument is 16 (which comes from \\[universal-argument] \\[universal-argument]),
 then it searches *all* buffers."
   (interactive "*P")
   (dabbrev--reset-global-variables)
--- a/lisp/emacs-lisp/syntax.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/emacs-lisp/syntax.el	Sun Aug 08 17:15:44 2010 -0400
@@ -52,7 +52,7 @@
 
 (defun syntax-ppss-toplevel-pos (ppss)
   "Get the latest syntactically outermost position found in a syntactic scan.
-PPSS is a scan state, as returned by `partial-parse-sexp' or `syntax-ppss'.
+PPSS is a scan state, as returned by `parse-partial-sexp' or `syntax-ppss'.
 An \"outermost position\" means one that it is outside of any syntactic entity:
 outside of any parentheses, comments, or strings encountered in the scan.
 If no such position is recorded in PPSS (because the end of the scan was
--- a/lisp/emulation/pc-select.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/emulation/pc-select.el	Sun Aug 08 17:15:44 2010 -0400
@@ -110,7 +110,7 @@
   :group 'pc-select)
 
 (defcustom pc-selection-mode-hook nil
-  "The hook to run when pc-selection-mode is toggled."
+  "The hook to run when PC Selection mode is toggled."
   :type 'hook
   :group 'pc-select)
 
@@ -261,7 +261,7 @@
 (provide 'pc-select)
 
 (defun copy-region-as-kill-nomark (beg end)
-  "Save the region as if killed; but don't kill it; deactivate mark.
+  "Save the region as if killed, but don't kill it; deactivate mark.
 If `interprogram-cut-function' is non-nil, also save the text for a window
 system cut and paste.
 
@@ -569,7 +569,7 @@
 ;;;;;;;;;;;;;;;;;;;;
 
 (defun backward-char-mark (&optional arg)
-"Ensure mark is active; move point left ARG characters (right if ARG negative).
+  "Ensure mark is active; move point left ARG characters (right if ARG negative).
 On attempt to pass beginning or end of buffer, stop and signal error."
   (interactive "p")
   (pc-select-ensure-mark)
@@ -633,7 +633,7 @@
 
 
 (defun scroll-up-mark (&optional arg)
-"Ensure mark is active; scroll upward ARG lines; or near full screen if no ARG.
+  "Ensure mark is active; scroll upward ARG lines; or near full screen if no ARG.
 A near full screen is `next-screen-context-lines' less than a full screen.
 Negative ARG means scroll downward.
 When calling from a program, supply a number as argument or nil.
@@ -654,7 +654,7 @@
 of the accessible part of the buffer.
 
 Don't use this command in Lisp programs!
-\(goto-char (p\oint-min)) is faster and avoids clobbering the mark."
+\(goto-char (point-min)) is faster and avoids clobbering the mark."
   (interactive "P")
   (pc-select-ensure-mark)
   (let ((size (- (point-max) (point-min))))
@@ -841,7 +841,7 @@
 
 ;;;###autoload
 (define-minor-mode pc-selection-mode
-  "Change mark behavior to emulate Motif, MAC or MS-Windows cut and paste style.
+  "Change mark behavior to emulate Motif, Mac or MS-Windows cut and paste style.
 
 This mode enables Delete Selection mode and Transient Mark mode.
 
--- a/lisp/eshell/esh-io.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/eshell/esh-io.el	Sun Aug 08 17:15:44 2010 -0400
@@ -343,8 +343,9 @@
 	(let* ((exists (get-file-buffer target))
 	       (buf (find-file-noselect target t)))
 	  (with-current-buffer buf
-	    (if buffer-read-only
+	    (if buffer-file-read-only
 		(error "Cannot write to read-only file `%s'" target))
+	    (setq buffer-read-only nil)
 	    (set (make-local-variable 'eshell-output-file-buffer)
 		 (if (eq exists buf) 0 t))
 	    (cond ((eq mode 'overwrite)
--- a/lisp/international/mule-conf.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/international/mule-conf.el	Sun Aug 08 17:15:44 2010 -0400
@@ -1410,9 +1410,10 @@
   :flags '(ascii-at-eol ascii-at-cntl designation single-shift composition))
 
 (define-coding-system 'compound-text
-  "Compound text based generic encoding for decoding unknown messages.
-
-This coding system does not support extended segments of CTEXT."
+  "Compound text based generic encoding.
+This coding system is an extension of X's \"Compound Text Encoding\".
+It encodes many characters using the normal ISO-2022 designation sequences,
+but it doesn't support extended segments of CTEXT."
   :coding-type 'iso-2022
   :mnemonic ?x
   :charset-list 'iso-2022
@@ -1432,7 +1433,7 @@
 ;; not have a mime-charset property, to prevent it from showing up
 ;; close to the beginning of coding systems ordered by priority.
 (define-coding-system 'ctext-no-compositions
- "Compound text based generic encoding for decoding unknown messages.
+ "Compound text based generic encoding.
 
 Like `compound-text', but does not produce escape sequences for compositions."
   :coding-type 'iso-2022
@@ -1445,8 +1446,9 @@
 (define-coding-system 'compound-text-with-extensions
  "Compound text encoding with ICCCM Extended Segment extensions.
 
-See the variable `ctext-non-standard-encodings-alist' for the
-detail about how extended segments are handled.
+See the variables `ctext-standard-encodings' and
+`ctext-non-standard-encodings-alist' for the detail about how
+extended segments are handled.
 
 This coding system should be used only for X selections.  It is inappropriate
 for decoding and encoding files, process I/O, etc."
--- a/lisp/international/mule.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/international/mule.el	Sun Aug 08 17:15:44 2010 -0400
@@ -282,6 +282,7 @@
 	(plist-put props :short-name (symbol-name name)))
     (or (plist-get props :long-name)
 	(plist-put props :long-name (plist-get props :short-name)))
+    (plist-put props :base name)
     ;; We can probably get a worthwhile amount in purespace.
     (setq props
 	  (mapcar (lambda (elt)
@@ -1465,7 +1466,9 @@
   '(("big5-0" big5 2 big5)
     ("ISO8859-14" iso-8859-14 1 latin-iso8859-14)
     ("ISO8859-15" iso-8859-15 1 latin-iso8859-15)
-    ("gbk-0" gbk 2 chinese-gbk)))
+    ("gbk-0" gbk 2 chinese-gbk)
+    ("koi8-r" koi8-r 1 koi8-r)
+    ("microsoft-cp1251" windows-1251 1 windows-1251)))
   "Alist of non-standard encoding names vs the corresponding usages in CTEXT.
 
 It controls how extended segments of a compound text are handled
@@ -1554,6 +1557,20 @@
       (goto-char (point-min))
       (- (point-max) (point)))))
 
+(defvar ctext-standard-encodings
+  '(ascii latin-jisx0201 katakana-jisx0201
+	  latin-iso8859-1 latin-iso8859-2 latin-iso8859-3 latin-iso8859-4
+	  greek-iso8859-7 arabic-iso8859-6 hebrew-iso8859-8 cyrillic-iso8859-5
+	  latin-iso8859-9
+	  chinese-gb2312 japanese-jisx0208 korean-ksc5601)
+  "List of approved standard encodings (i.e. charsets) of X's Compound Text.
+Coding-system `compound-text-with-extensions' encodes a character
+belonging to any of those charsets using the normal ISO2022
+designation sequence unless the current language environment or
+the variable `ctext-non-standard-encodings' decide to use an extended
+segment of CTEXT for that character.  See also the documentation
+of `ctext-non-standard-encodings-alist'.")
+
 ;; Return an alist of CHARSET vs CTEXT-USAGE-INFO generated from
 ;; `ctext-non-standard-encodings' and a list specified by the key
 ;; `ctext-non-standard-encodings' for the currrent language
@@ -1565,115 +1582,94 @@
 ;; is encoded using UTF-8 encoding extention.
 
 (defun ctext-non-standard-encodings-table ()
-  (let (table)
-    ;; Setup charsets specified by the key
-    ;; `ctext-non-standard-encodings' for the current language
-    ;; environment and in `ctext-non-standard-encodings'.
-    (dolist (encoding (append
-			(get-language-info current-language-environment
-					   'ctext-non-standard-encodings)
-			ctext-non-standard-encodings))
-      (let* ((slot (assoc encoding ctext-non-standard-encodings-alist))
+  (let* ((table (append ctext-non-standard-encodings
+			(copy-sequence
+			 (get-language-info current-language-environment
+					    'ctext-non-standard-encodings))))
+	 (tail table)
+	 elt)
+    (while tail
+      (setq elt (car tail))
+      (let* ((slot (assoc elt ctext-non-standard-encodings-alist))
 	     (charset (nth 3 slot)))
 	(if (charsetp charset)
-	    (push (cons charset slot) table)
-	  (dolist (cs charset)
-	    (push (cons cs slot) table)))))
-
-    ;; Next prepend charsets for ISO2022 designation sequence.
-    (dolist (charset charset-list)
-      (let ((final (plist-get (charset-plist charset) :iso-final-char)))
-	(if (and (integerp final)
-		 (>= final #x40) (<= final #x7e)
-		 ;; Exclude ascii and chinese-cns11643-X.
-		 (not (eq charset 'ascii))
-		 (not (string-match "cns11643" (symbol-name charset))))
-	    (push (cons charset nil) table))))
-
-    ;; Returned reversed list so that the charsets specified by the
-    ;; key `ctext-non-standard-encodings' for the current language
-    ;; have the highest priority.
-    (nreverse table)))
+	    (setcar tail
+		    (cons (plist-get (charset-plist charset) :base) slot))
+	  (setcar tail (cons (car charset) slot))
+	  (dolist (cs (cdr charset))
+	    (setcdr tail
+		    (cons (cons (plist-get (charset-plist (car cs)) :base) slot)
+			  (cdr tail)))
+	    (setq tail (cdr tail))))
+	(setq tail (cdr tail))))
+    table))
 
 (defun ctext-pre-write-conversion (from to)
   "Encode characters between FROM and TO as Compound Text w/Extended Segments.
 
-If FROM is a string, or if the current buffer is not the one set up for us
-by `encode-coding-string', generate a new temp buffer, insert the text,
-and convert it in the temporary buffer.  Otherwise, convert in-place."
+If FROM is a string, generate a new temp buffer, insert the text,
+and convert it in the temporary buffer.  Otherwise, convert
+in-place."
   (save-match-data
     ;; Setup a working buffer if necessary.
     (when (stringp from)
       (set-buffer (generate-new-buffer " *temp"))
       (set-buffer-multibyte (multibyte-string-p from))
-      (insert from))
-
-    ;; Now we can encode the whole buffer.
-    (let ((encoding-table (ctext-non-standard-encodings-table))
-	  last-coding-system-used
-	  last-pos last-encoding-info
-	  encoding-info end-pos ch)
-      (goto-char (setq last-pos (point-min)))
-      (setq end-pos (point-marker))
-      (while (re-search-forward "[^\000-\177]+" nil t)
-	;; Found a sequence of non-ASCII characters.
-	(setq last-pos (match-beginning 0)
-	      ch (char-after last-pos)
-	      last-encoding-info (catch 'tag
-				   (dolist (elt encoding-table)
-				     (if (encode-char ch (car elt))
-					 (throw 'tag (cdr elt))))
-				   'utf-8))
-	(set-marker end-pos (match-end 0))
-	(goto-char (1+ last-pos))
-	(catch 'tag
-	  (while t
-	    (setq encoding-info
-		  (if (< (point) end-pos)
-		      (catch 'tag
-			(setq ch (following-char))
-			(dolist (elt encoding-table)
-			  (if (encode-char ch (car elt))
-			      (throw 'tag (cdr elt))))
-			'utf-8)))
-	    (unless (eq last-encoding-info encoding-info)
-	      (cond ((consp last-encoding-info)
-		     ;; Encode the previous range using an extended
-		     ;; segment.
-		     (let ((encoding-name (car last-encoding-info))
-			   (coding-system (nth 1 last-encoding-info))
-			   (noctets (nth 2 last-encoding-info))
-			   len)
-		       (encode-coding-region last-pos (point) coding-system)
-		       (setq len (+ (length encoding-name) 1
-				    (- (point) last-pos)))
-		       ;; According to the spec of CTEXT, it is not
-		       ;; necessary to produce this extra designation
-		       ;; sequence, but some buggy application
-		       ;; (e.g. crxvt-gb) requires it.
-		       (insert "\e(B")
-		       (save-excursion
-			 (goto-char last-pos)
-			 (insert (format "\e%%/%d" noctets))
-			 (insert-byte (+ (/ len 128) 128) 1)
-			 (insert-byte (+ (% len 128) 128) 1)
-			 (insert encoding-name)
-			 (insert 2))))
-		    ((eq last-encoding-info 'utf-8)
-		     ;; Encode the previous range using UTF-8 encoding
-		     ;; extention.
-		     (encode-coding-region last-pos (point) 'mule-utf-8)
-		     (save-excursion
-		       (goto-char last-pos)
-		       (insert "\e%G"))
-		     (insert "\e%@")))
-	      (setq last-pos (point)
-		    last-encoding-info encoding-info))
-	    (if (< (point) end-pos)
-		(forward-char 1)
-	      (throw 'tag nil)))))
-      (set-marker end-pos nil)
-      (goto-char (point-min))))
+      (insert from)
+      (setq from 1 to (point-max)))
+    (save-restriction
+      (narrow-to-region from to)
+      (goto-char from)
+      (let ((encoding-table (ctext-non-standard-encodings-table))
+	    (charset-list (sort-charsets
+			   (copy-sequence ctext-standard-encodings)))
+	    (end-pos (make-marker))
+	    last-coding-system-used
+	    last-pos charset encoding-info)
+	(dolist (elt encoding-table)
+	  (push (car elt) charset-list))
+	(setq end-pos (point-marker))
+	(while (re-search-forward "[^\0-\177]+" nil t)
+	  ;; Found a sequence of non-ASCII characters.
+	  (set-marker end-pos (match-end 0))
+	  (goto-char (match-beginning 0))
+	  (setq last-pos (point)
+		charset (char-charset (following-char) charset-list))
+	  (forward-char 1)
+	  (while (and (< (point) end-pos)
+		      (eq charset (char-charset (following-char) charset-list)))
+	    (forward-char 1))
+	  (if charset
+	      (if (setq encoding-info (cdr (assq charset encoding-table)))
+		  ;; Encode this range using an extended segment.
+		  (let ((encoding-name (car encoding-info))
+			(coding-system (nth 1 encoding-info))
+			(noctets (nth 2 encoding-info))
+			len)
+		    (encode-coding-region last-pos (point) coding-system)
+		    (setq len (+ (length encoding-name) 1
+				 (- (point) last-pos)))
+		    ;; According to the spec of CTEXT, it is not
+		    ;; necessary to produce this extra designation
+		    ;; sequence, but some buggy application
+		    ;; (e.g. crxvt-gb) requires it.
+		    (insert "\e(B")
+		    (save-excursion
+		      (goto-char last-pos)
+		      (insert (format "\e%%/%d" noctets))
+		      (insert-byte (+ (/ len 128) 128) 1)
+		      (insert-byte (+ (% len 128) 128) 1)
+		      (insert encoding-name)
+		      (insert 2)))
+		;; Encode this range as characters in CHARSET.
+		(put-text-property last-pos (point) 'charset charset))
+	    ;; Encode this range using UTF-8 encoding extention.
+	    (encode-coding-region last-pos (point) 'mule-utf-8)
+	    (save-excursion
+	      (goto-char last-pos)
+	      (insert "\e%G"))
+	    (insert "\e%@")))
+	(goto-char (point-min)))))
   ;; Must return nil, as build_annotations_2 expects that.
   nil)
 
--- a/lisp/isearch.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/isearch.el	Sun Aug 08 17:15:44 2010 -0400
@@ -2581,6 +2581,7 @@
 (defvar isearch-lazy-highlight-case-fold-search nil)
 (defvar isearch-lazy-highlight-regexp nil)
 (defvar isearch-lazy-highlight-space-regexp nil)
+(defvar isearch-lazy-highlight-forward nil)
 
 (defun lazy-highlight-cleanup (&optional force)
   "Stop lazy highlighting and remove extra highlighting from current buffer.
@@ -2620,7 +2621,9 @@
                  (not (= (window-start)
                          isearch-lazy-highlight-window-start))
                  (not (= (window-end)   ; Window may have been split/joined.
-                         isearch-lazy-highlight-window-end))))
+			 isearch-lazy-highlight-window-end))
+		 (not (eq isearch-forward
+			  isearch-lazy-highlight-forward))))
     ;; something important did indeed change
     (lazy-highlight-cleanup t) ;kill old loop & remove overlays
     (when (not isearch-error)
@@ -2635,7 +2638,8 @@
 	    isearch-lazy-highlight-case-fold-search isearch-case-fold-search
 	    isearch-lazy-highlight-regexp	isearch-regexp
             isearch-lazy-highlight-wrapped      nil
-	    isearch-lazy-highlight-space-regexp search-whitespace-regexp)
+	    isearch-lazy-highlight-space-regexp search-whitespace-regexp
+	    isearch-lazy-highlight-forward      isearch-forward)
       (unless (equal isearch-string "")
 	(setq isearch-lazy-highlight-timer
 	      (run-with-idle-timer lazy-highlight-initial-delay nil
@@ -2651,7 +2655,8 @@
 	    (search-invisible nil)	; don't match invisible text
 	    (retry t)
 	    (success nil)
-	    (bound (if isearch-forward
+	    (isearch-forward isearch-lazy-highlight-forward)
+	    (bound (if isearch-lazy-highlight-forward
 		       (min (or isearch-lazy-highlight-end-limit (point-max))
 			    (if isearch-lazy-highlight-wrapped
 				isearch-lazy-highlight-start
@@ -2687,7 +2692,7 @@
 	    (select-window isearch-lazy-highlight-window))
 	(save-excursion
 	  (save-match-data
-	    (goto-char (if isearch-forward
+	    (goto-char (if isearch-lazy-highlight-forward
 			   isearch-lazy-highlight-end
 			 isearch-lazy-highlight-start))
 	    (while looping
@@ -2700,7 +2705,7 @@
 		    (let ((mb (match-beginning 0))
 			  (me (match-end 0)))
 		      (if (= mb me)	;zero-length match
-			  (if isearch-forward
+			  (if isearch-lazy-highlight-forward
 			      (if (= mb (if isearch-lazy-highlight-wrapped
 					    isearch-lazy-highlight-start
 					  (window-end)))
@@ -2720,7 +2725,7 @@
 			  (overlay-put ov 'priority 1000)
 			  (overlay-put ov 'face lazy-highlight-face)
 			  (overlay-put ov 'window (selected-window))))
-		      (if isearch-forward
+		      (if isearch-lazy-highlight-forward
 			  (setq isearch-lazy-highlight-end (point))
 			(setq isearch-lazy-highlight-start (point)))))
 
@@ -2730,7 +2735,7 @@
 			(setq looping nil
 			      nomore  t)
 		      (setq isearch-lazy-highlight-wrapped t)
-		      (if isearch-forward
+		      (if isearch-lazy-highlight-forward
 			  (progn
 			    (setq isearch-lazy-highlight-end (window-start))
 			    (goto-char (max (or isearch-lazy-highlight-start-limit (point-min))
--- a/lisp/language/cyrillic.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/language/cyrillic.el	Sun Aug 08 17:15:44 2010 -0400
@@ -239,13 +239,6 @@
 	   (documentation . "Support for Tajik using KOI8-T."))
  '("Cyrillic"))
 
-(let ((elt `("microsoft-cp1251" windows-1251 1
-	     ,(get 'encode-windows-1251 'translation-table)))
-      (slot (assoc "microsoft-cp1251" ctext-non-standard-encodings-alist)))
-  (if slot
-      (setcdr slot (cdr elt))
-    (push elt ctext-non-standard-encodings-alist)))
-
 (set-language-info-alist
  "Bulgarian" `((coding-system windows-1251)
 	       (coding-priority windows-1251)
--- a/lisp/progmodes/which-func.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/progmodes/which-func.el	Sun Aug 08 17:15:44 2010 -0400
@@ -145,7 +145,9 @@
 		 local-map ,which-func-keymap
 		 face which-func
 		 ;;mouse-face highlight	; currently not evaluated :-(
-		 help-echo "mouse-1: go to beginning, mouse-2: toggle rest visibility, mouse-3: go to end")
+		 help-echo "mouse-1: go to beginning\n\
+mouse-2: toggle rest visibility\n\
+mouse-3: go to end")
     "]")
   "Format for displaying the function in the mode line."
   :group 'which-func
--- a/lisp/replace.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/replace.el	Sun Aug 08 17:15:44 2010 -0400
@@ -1979,7 +1979,9 @@
       (let ((isearch-string string)
 	    (isearch-regexp regexp)
 	    (search-whitespace-regexp nil)
-	    (isearch-case-fold-search case-fold))
+	    (isearch-case-fold-search case-fold)
+	    (isearch-forward t)
+	    (isearch-error nil))
 	;; Set isearch-word to nil because word-replace is regexp-based,
 	;; so `isearch-search-fun' should not use `word-search-forward'.
 	(if (and isearch-word isearch-regexp) (setq isearch-word nil))
--- a/lisp/server.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/server.el	Sun Aug 08 17:15:44 2010 -0400
@@ -563,9 +563,9 @@
 		       :coding 'raw-text-unix
 		       ;; The other args depend on the kind of socket used.
 		       (if server-use-tcp
-			   (list :family nil
+			   (list :family 'ipv4  ;; We're not ready for IPv6 yet
 				 :service t
-				 :host (or server-host 'local)
+				 :host (or server-host "127.0.0.1") ;; See bug#6781
 				 :plist '(:authenticated nil))
 			 (list :family 'local
 			       :service server-file
--- a/lisp/simple.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/simple.el	Sun Aug 08 17:15:44 2010 -0400
@@ -3941,7 +3941,8 @@
     (setq mark-ring (cdr mark-ring)))
   (deactivate-mark))
 
-(defalias 'exchange-dot-and-mark 'exchange-point-and-mark)
+(define-obsolete-function-alias
+  'exchange-dot-and-mark 'exchange-point-and-mark "23.3")
 (defun exchange-point-and-mark (&optional arg)
   "Put the mark where point is now, and point where the mark is now.
 This command works even when the mark is not active,
--- a/lisp/term.el	Sun Aug 08 14:03:45 2010 -0700
+++ b/lisp/term.el	Sun Aug 08 17:15:44 2010 -0400
@@ -502,8 +502,8 @@
 (defvar term-delimiter-argument-list ()
   "List of characters to recognize as separate arguments in input.
 Strings comprising a character in this list will separate the arguments
-surrounding them, and also be regarded as arguments in their own right (unlike
-whitespace).  See `term-arguments'.
+surrounding them, and also be regarded as arguments in their own right
+\(unlike whitespace).  See `term-arguments'.
 Defaults to the empty list.
 
 For shells, a good value is (?\\| ?& ?< ?> ?\\( ?\\) ?\\;).
@@ -1516,7 +1516,7 @@
 ;; term-replace-by-expanded-history-before-point Workhorse function.
 
 (defun term-read-input-ring (&optional silent)
-  "Sets the buffer's `term-input-ring' from a history file.
+  "Set the buffer's `term-input-ring' from a history file.
 The name of the file is given by the variable `term-input-ring-file-name'.
 The history ring is of size `term-input-ring-size', regardless of file size.
 If `term-input-ring-file-name' is nil this function does nothing.
@@ -1564,7 +1564,7 @@
 		 term-input-ring-index nil)))))
 
 (defun term-write-input-ring ()
-  "Writes the buffer's `term-input-ring' to a history file.
+  "Write the buffer's `term-input-ring' to a history file.
 The name of the file is given by the variable `term-input-ring-file-name'.
 The original contents of the file are lost if `term-input-ring' is not empty.
 If `term-input-ring-file-name' is nil this function does nothing.
@@ -1996,12 +1996,12 @@
   "Send input to process.
 After the process output mark, sends all text from the process mark to
 point as input to the process.  Before the process output mark, calls value
-of variable term-get-old-input to retrieve old input, copies it to the
+of variable `term-get-old-input' to retrieve old input, copies it to the
 process mark, and sends it.  A terminal newline is also inserted into the
 buffer and sent to the process.  The list of function names contained in the
 value of `term-input-filter-functions' is called on the input before sending
 it.  The input is entered into the input history ring, if the value of variable
-term-input-filter returns non-nil when called on the input.
+`term-input-filter' returns non-nil when called on the input.
 
 Any history reference may be expanded depending on the value of the variable
 `term-input-autoexpand'.  The list of function names contained in the value
@@ -2137,7 +2137,7 @@
   (term-send-string proc "\n"))
 
 (defun term-bol (arg)
-  "Goes to the beginning of line, then skips past the prompt, if any.
+  "Go to the beginning of line, then skip past the prompt, if any.
 If a prefix argument is given (\\[universal-argument]), then no prompt skip
 -- go straight to column 0.
 
@@ -3760,7 +3760,7 @@
       (goto-char saved-point))))
 
 (defun term-erase-in-display (kind)
-  "Erases (that is blanks out) part of the window.
+  "Erase (that is blank out) part of the window.
 If KIND is 0, erase from (point) to (point-max);
 if KIND is 1, erase from home to point; else erase from home to point-max."
   (term-handle-deferred-scroll)
@@ -4166,7 +4166,7 @@
 
 ;; I need a make-term that doesn't surround with *s -mm
 (defun term-ansi-make-term (name program &optional startfile &rest switches)
-"Make a term process NAME in a buffer, running PROGRAM.
+  "Make a term process NAME in a buffer, running PROGRAM.
 The name of the buffer is NAME.
 If there is already a running process in that buffer, it is not restarted.
 Optional third arg STARTFILE is the name of a file to send the contents of to
@@ -4267,7 +4267,7 @@
 for special serial ports that cannot be configured.")
 
 (defun serial-supported-or-barf ()
-  "Signal an error if serial processes are not supported"
+  "Signal an error if serial processes are not supported."
   (unless (fboundp 'make-serial-process)
     (error "Serial processes are not supported on this system")))
 
--- a/nt/ChangeLog	Sun Aug 08 14:03:45 2010 -0700
+++ b/nt/ChangeLog	Sun Aug 08 17:15:44 2010 -0400
@@ -1,3 +1,8 @@
+2010-08-08  Óscar Fuentes  <ofv@wanadoo.es>
+
+	* cmdproxy.c (main): Use _snprintf instead of wsprintf,
+	which has a 1024 char limit on Windows (bug#6647).
+
 2010-08-02  Juanma Barranquero  <lekktu@gmail.com>
 
 	* config.nt (TIME_WITH_SYS_TIME): Remove #undef, unused (bug#6754).
--- a/nt/cmdproxy.c	Sun Aug 08 14:03:45 2010 -0700
+++ b/nt/cmdproxy.c	Sun Aug 08 17:15:44 2010 -0400
@@ -35,6 +35,9 @@
 #include <stdlib.h>  /* getenv */
 #include <string.h>  /* strlen */
 
+/* We don't want to include stdio.h because we are already duplicating
+   lots of it here */
+extern int _snprintf (char *buffer, size_t count, const char *format, ...);
 
 /*******  Mock C library routines  *********************************/
 
@@ -604,6 +607,7 @@
     {
       char * p;
       int    extra_arg_space = 0;
+      int    maxlen, remlen;
       int    run_command_dot_com;
 
       progname = getenv ("COMSPEC");
@@ -635,21 +639,27 @@
 	     case path contains spaces (fortunately it can't contain
 	     quotes, since they are illegal in path names).  */
 
-	  buf = p = alloca (strlen (progname) + extra_arg_space +
-			    strlen (cmdline) + 16);
+	  remlen = maxlen =
+	    strlen (progname) + extra_arg_space + strlen (cmdline) + 16;
+	  buf = p = alloca (maxlen + 1);
 
 	  /* Quote progname in case it contains spaces.  */
-	  p += wsprintf (p, "\"%s\"", progname);
+	  p += _snprintf (p, remlen, "\"%s\"", progname);
+	  remlen = maxlen - (p - buf);
 
 	  /* Include pass_through_args verbatim; these are just switches
              so should not need quoting.  */
 	  for (argv = pass_through_args; *argv != NULL; ++argv)
-	    p += wsprintf (p, " %s", *argv);
+	    {
+	      p += _snprintf (p, remlen, " %s", *argv);
+	      remlen = maxlen - (p - buf);
+	    }
 
 	  if (run_command_dot_com)
-	    wsprintf(p, " /e:%d /c %s", envsize, cmdline);
+	    _snprintf (p, remlen, " /e:%d /c %s", envsize, cmdline);
 	  else
-	    wsprintf(p, " /c %s", cmdline);
+	    _snprintf (p, remlen, " /c %s", cmdline);
+	  remlen = maxlen - (p - buf);
 	  cmdline = buf;
 	}
       else
@@ -669,19 +679,27 @@
 	  else
 	    path[0] = '\0';
 
-	  cmdline = p = alloca (strlen (progname) + extra_arg_space +
-				strlen (path) + 13);
+	  remlen = maxlen =
+	    strlen (progname) + extra_arg_space + strlen (path) + 13;
+	  cmdline = p = alloca (maxlen + 1);
 
 	  /* Quote progname in case it contains spaces.  */
-	  p += wsprintf (p, "\"%s\" %s", progname, path);
+	  p += _snprintf (p, remlen, "\"%s\" %s", progname, path);
+	  remlen = maxlen - (p - cmdline);
 
 	  /* Include pass_through_args verbatim; these are just switches
              so should not need quoting.  */
 	  for (argv = pass_through_args; *argv != NULL; ++argv)
-	    p += wsprintf (p, " %s", *argv);
+	    {
+	      p += _snprintf (p, remlen, " %s", *argv);
+	      remlen = maxlen - (p - cmdline);
+	    }
 
 	  if (run_command_dot_com)
-	    wsprintf (p, " /e:%d", envsize);
+	    {
+	      _snprintf (p, remlen, " /e:%d", envsize);
+	      remlen = maxlen - (p - cmdline);
+	    }
 	}
     }
 
--- a/src/ChangeLog	Sun Aug 08 14:03:45 2010 -0700
+++ b/src/ChangeLog	Sun Aug 08 17:15:44 2010 -0400
@@ -1,3 +1,35 @@
+2010-08-08  Kenichi Handa  <handa@m17n.org>
+
+	* charset.c: Include <stdlib.h>
+	(struct charset_sort_data): New struct.
+	(charset_compare): New function.
+	(Fsort_charsets): New funciton.
+	(syms_of_charset): Declare Fsort_charsets as a Lisp function.
+
+	* coding.c (decode_coding_iso_2022): Fix checking of dimension
+	number in CTEXT extended segment.
+
+2010-08-08  Juanma Barranquero  <lekktu@gmail.com>
+
+	* w32fns.c (syms_of_w32fns) <x-max-tooltip-size>: Fix typo in docstring.
+	* xfns.c (syms_of_xfns) <x-max-tooltip-size>: Reflow docstring.
+
+2010-08-08  Juanma Barranquero  <lekktu@gmail.com>
+
+	* fns.c (Fsubstring_no_properties, Fnthcdr, Ffeaturep)
+	(Fhash_table_size): Fix typos in docstrings.
+	(Fmake_hash_table): Doc fix.
+
+2010-08-08  Juanma Barranquero  <lekktu@gmail.com>
+
+	* minibuf.c (syms_of_minibuf) <read-buffer-function>:
+	Doc fix (bug#5625).
+
+2010-08-08  Ken Brown  <kbrown@cornell.edu>
+
+	* dired.c (DIRENTRY_NONEMPTY) [cygwin]: Use d_ino instead of
+	the MSDOS definition.
+
 2010-08-08  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	Use const char* instead of char*.
--- a/src/charset.c	Sun Aug 08 14:03:45 2010 -0700
+++ b/src/charset.c	Sun Aug 08 17:15:44 2010 -0400
@@ -28,6 +28,7 @@
 #include <config.h>
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <ctype.h>
 #include <sys/types.h>
@@ -2071,23 +2072,22 @@
     charset = CHAR_CHARSET (XINT (ch));
   else
     {
-      Lisp_Object charset_list;
-
       if (CONSP (restriction))
 	{
-	  for (charset_list = Qnil; CONSP (restriction);
-	       restriction = XCDR (restriction))
+	  int c = XFASTINT (ch);
+
+	  for (; CONSP (restriction); restriction = XCDR (restriction))
 	    {
-	      int id;
+	      struct charset *charset;
 
-	      CHECK_CHARSET_GET_ID (XCAR (restriction), id);
-	      charset_list = Fcons (make_number (id), charset_list);
+	      CHECK_CHARSET_GET_CHARSET (XCAR (restriction), charset);
+	      if (ENCODE_CHAR (charset, c) != CHARSET_INVALID_CODE (charset))
+		return XCAR (restriction);
 	    }
-	  charset_list = Fnreverse (charset_list);
+	  return Qnil;
 	}
-      else
-	charset_list = coding_system_charset_list (restriction);
-      charset = char_charset (XINT (ch), charset_list, NULL);
+      restriction = coding_system_charset_list (restriction);
+      charset = char_charset (XINT (ch), restriction, NULL);
       if (! charset)
 	return Qnil;
     }
@@ -2238,6 +2238,69 @@
   return make_number (id);
 }
 
+struct charset_sort_data
+{
+  Lisp_Object charset;
+  int id;
+  int priority;
+};
+
+static int
+charset_compare (const void *d1, const void *d2)
+{
+  const struct charset_sort_data *data1 = d1, *data2 = d2;
+  return (data1->priority - data2->priority);
+}
+
+DEFUN ("sort-charsets", Fsort_charsets, Ssort_charsets, 1, 1, 0,
+       doc: /* Sort charset list CHARSETS by a priority of each charset.
+Return the sorted list.  CHARSETS is modified by side effects.
+See also `charset-priority-list' and `set-charset-priority'.  */)
+     (Lisp_Object charsets)
+{
+  Lisp_Object len = Flength (charsets);
+  int n = XFASTINT (len), i, j, done;
+  Lisp_Object tail, elt, attrs;
+  struct charset_sort_data *sort_data;
+  int id, min_id, max_id;
+  USE_SAFE_ALLOCA;
+
+  if (n == 0)
+    return Qnil;
+  SAFE_ALLOCA (sort_data, struct charset_sort_data *, sizeof (*sort_data) * n);
+  for (tail = charsets, i = 0; CONSP (tail); tail = XCDR (tail), i++)
+    {
+      elt = XCAR (tail);
+      CHECK_CHARSET_GET_ATTR (elt, attrs);
+      sort_data[i].charset = elt;
+      sort_data[i].id = id = XINT (CHARSET_ATTR_ID (attrs));
+      if (i == 0)
+	min_id = max_id = id;
+      else if (id < min_id)
+	min_id = id;
+      else if (id > max_id)
+	max_id = id;
+    }
+  for (done = 0, tail = Vcharset_ordered_list, i = 0;
+       done < n && CONSP (tail); tail = XCDR (tail), i++)
+    {
+      elt = XCAR (tail);
+      id = XFASTINT (elt);
+      if (id >= min_id && id <= max_id)
+	for (j = 0; j < n; j++)
+	  if (sort_data[j].id == id)
+	    {
+	      sort_data[j].priority = i;
+	      done++;
+	    }
+    }
+  qsort (sort_data, n, sizeof *sort_data, charset_compare);
+  for (i = 0, tail = charsets; CONSP (tail); tail = XCDR (tail), i++)
+    XSETCAR (tail, sort_data[i].charset);
+  SAFE_FREE ();
+  return charsets;
+}
+
 
 void
 init_charset (void)
@@ -2340,6 +2403,7 @@
   defsubr (&Scharset_priority_list);
   defsubr (&Sset_charset_priority);
   defsubr (&Scharset_id_internal);
+  defsubr (&Ssort_charsets);
 
   DEFVAR_LISP ("charset-map-path", &Vcharset_map_path,
 	       doc: /* *List of directories to search for charset map files.  */);
--- a/src/coding.c	Sun Aug 08 14:03:45 2010 -0700
+++ b/src/coding.c	Sun Aug 08 17:15:44 2010 -0400
@@ -3902,7 +3902,7 @@
 		  int size;
 
 		  ONE_MORE_BYTE (dim);
-		  if (dim < 0 || dim > 4)
+		  if (dim < '0' || dim > '4')
 		    goto invalid_code;
 		  ONE_MORE_BYTE (M);
 		  if (M < 128)
--- a/src/dired.c	Sun Aug 08 14:03:45 2010 -0700
+++ b/src/dired.c	Sun Aug 08 17:15:44 2010 -0400
@@ -65,8 +65,7 @@
 
 #endif /* HAVE_DIRENT_H */
 
-/* Some versions of Cygwin don't have d_ino in `struct dirent'.  */
-#if defined(MSDOS) || defined(__CYGWIN__)
+#ifdef MSDOS
 #define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0)
 #else
 #define DIRENTRY_NONEMPTY(p) ((p)->d_ino)
--- a/src/fns.c	Sun Aug 08 14:03:45 2010 -0700
+++ b/src/fns.c	Sun Aug 08 17:15:44 2010 -0400
@@ -225,9 +225,8 @@
   return Qt;
 }
 
-DEFUN ("compare-strings", Fcompare_strings,
-       Scompare_strings, 6, 7, 0,
-doc: /* Compare the contents of two strings, converting to multibyte if needed.
+DEFUN ("compare-strings", Fcompare_strings, Scompare_strings, 6, 7, 0,
+       doc: /* Compare the contents of two strings, converting to multibyte if needed.
 In string STR1, skip the first START1 characters and stop at END1.
 In string STR2, skip the first START2 characters and stop at END2.
 END1 and END2 default to the full lengths of the respective strings.
@@ -1199,7 +1198,7 @@
 
 DEFUN ("substring-no-properties", Fsubstring_no_properties, Ssubstring_no_properties, 1, 3, 0,
        doc: /* Return a substring of STRING, without text properties.
-It starts at index FROM and ending before TO.
+It starts at index FROM and ends before TO.
 TO may be nil or omitted; then the substring runs to the end of STRING.
 If FROM is nil or omitted, the substring starts at the beginning of STRING.
 If FROM or TO is negative, it counts from the end.
@@ -1291,7 +1290,7 @@
 }
 
 DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0,
-       doc: /* Take cdr N times on LIST, returns the result.  */)
+       doc: /* Take cdr N times on LIST, return the result.  */)
   (Lisp_Object n, Lisp_Object list)
 {
   register int i, num;
@@ -1328,7 +1327,7 @@
 }
 
 DEFUN ("member", Fmember, Smember, 2, 2, 0,
-doc: /* Return non-nil if ELT is an element of LIST.  Comparison done with `equal'.
+       doc: /* Return non-nil if ELT is an element of LIST.  Comparison done with `equal'.
 The value is actually the tail of LIST whose car is ELT.  */)
   (register Lisp_Object elt, Lisp_Object list)
 {
@@ -1346,7 +1345,7 @@
 }
 
 DEFUN ("memq", Fmemq, Smemq, 2, 2, 0,
-doc: /* Return non-nil if ELT is an element of LIST.  Comparison done with `eq'.
+       doc: /* Return non-nil if ELT is an element of LIST.  Comparison done with `eq'.
 The value is actually the tail of LIST whose car is ELT.  */)
   (register Lisp_Object elt, Lisp_Object list)
 {
@@ -1372,7 +1371,7 @@
 }
 
 DEFUN ("memql", Fmemql, Smemql, 2, 2, 0,
-doc: /* Return non-nil if ELT is an element of LIST.  Comparison done with `eql'.
+       doc: /* Return non-nil if ELT is an element of LIST.  Comparison done with `eql'.
 The value is actually the tail of LIST whose car is ELT.  */)
   (register Lisp_Object elt, Lisp_Object list)
 {
@@ -2702,7 +2701,7 @@
 Lisp_Object Vfeatures, Qsubfeatures;
 
 DEFUN ("featurep", Ffeaturep, Sfeaturep, 1, 2, 0,
-       doc: /* Returns t if FEATURE is present in this Emacs.
+       doc: /* Return t if FEATURE is present in this Emacs.
 
 Use this to conditionalize execution of lisp code based on the
 presence or absence of Emacs or environment extensions.
@@ -4425,8 +4424,8 @@
 multiplying the old size with that factor.  Default is 1.5.
 
 :rehash-threshold THRESHOLD -- THRESHOLD must a float > 0, and <= 1.0.
-Resize the hash table when ratio of the number of entries in the
-table.  Default is 0.8.
+Resize the hash table when the ratio (number of entries / table size)
+is greater or equal than THRESHOLD.  Default is 0.8.
 
 :weakness WEAK -- WEAK must be one of nil, t, `key', `value',
 `key-or-value', or `key-and-value'.  If WEAK is not nil, the table
@@ -4549,7 +4548,7 @@
 DEFUN ("hash-table-size", Fhash_table_size, Shash_table_size, 1, 1, 0,
        doc: /* Return the size of TABLE.
 The size can be used as an argument to `make-hash-table' to create
-a hash table than can hold as many elements of TABLE holds
+a hash table than can hold as many elements as TABLE holds
 without need for resizing.  */)
   (Lisp_Object table)
 {
--- a/src/minibuf.c	Sun Aug 08 14:03:45 2010 -0700
+++ b/src/minibuf.c	Sun Aug 08 17:15:44 2010 -0400
@@ -2080,7 +2080,8 @@
   staticpro (&Qread_expression_history);
 
   DEFVAR_LISP ("read-buffer-function", &Vread_buffer_function,
-	       doc: /* If this is non-nil, `read-buffer' does its work by calling this function.  */);
+	       doc: /* If this is non-nil, `read-buffer' does its work by calling this function.
+The function is called with the arguments passed to `read-buffer'.  */);
   Vread_buffer_function = Qnil;
 
   DEFVAR_BOOL ("read-buffer-completion-ignore-case",
--- a/src/w32fns.c	Sun Aug 08 14:03:45 2010 -0700
+++ b/src/w32fns.c	Sun Aug 08 17:15:44 2010 -0400
@@ -7053,7 +7053,7 @@
 
   DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size,
 	       doc: /* Maximum size for tooltips.
-Value is a pair (COLUMNS . ROWS). Text larger than this is clipped.  */);
+Value is a pair (COLUMNS . ROWS).  Text larger than this is clipped.  */);
   Vx_max_tooltip_size = Fcons (make_number (80), make_number (40));
 
   DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager,
--- a/src/xfns.c	Sun Aug 08 14:03:45 2010 -0700
+++ b/src/xfns.c	Sun Aug 08 17:15:44 2010 -0400
@@ -1003,7 +1003,7 @@
 
   if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor == 0)
     FRAME_X_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f);
-  
+
   if (cursor != x->text_cursor
       && x->text_cursor != 0)
     XFreeCursor (dpy, x->text_cursor);
@@ -5598,7 +5598,7 @@
   font_param = Ffont_get (font, intern (":name"));
   if (STRINGP (font_param))
     default_name = xstrdup (SDATA (font_param));
-  else 
+  else
     {
       font_param = Fframe_parameter (frame, Qfont_param);
       if (STRINGP (font_param))
@@ -5609,7 +5609,7 @@
     default_name = xstrdup (x_last_font_name);
 
   /* Convert fontconfig names to Gtk names, i.e. remove - before number */
-  if (default_name) 
+  if (default_name)
     {
       char *p = strrchr (default_name, '-');
       if (p)
@@ -5870,8 +5870,8 @@
   Vx_cursor_fore_pixel = Qnil;
 
   DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size,
-    doc: /* Maximum size for tooltips.  Value is a pair (COLUMNS . ROWS).
-Text larger than this is clipped.  */);
+    doc: /* Maximum size for tooltips.
+Value is a pair (COLUMNS . ROWS).  Text larger than this is clipped.  */);
   Vx_max_tooltip_size = Fcons (make_number (80), make_number (40));
 
   DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager,