]> code.delx.au - gnu-emacs/commitdiff
Merge changes from emacs-23 branch
authorChong Yidong <cyd@stupidchicken.com>
Sun, 8 Aug 2010 21:12:29 +0000 (17:12 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 8 Aug 2010 21:12:29 +0000 (17:12 -0400)
33 files changed:
doc/lispref/ChangeLog
doc/lispref/control.texi
doc/lispref/minibuf.texi
doc/lispref/modes.texi
doc/misc/ChangeLog
etc/ChangeLog
etc/PROBLEMS
lisp/ChangeLog
lisp/align.el
lisp/bindings.el
lisp/dabbrev.el
lisp/emacs-lisp/syntax.el
lisp/emulation/pc-select.el
lisp/eshell/esh-io.el
lisp/international/mule-conf.el
lisp/international/mule.el
lisp/isearch.el
lisp/language/cyrillic.el
lisp/progmodes/which-func.el
lisp/replace.el
lisp/server.el
lisp/simple.el
lisp/term.el
nt/ChangeLog
nt/cmdproxy.c
src/ChangeLog
src/charset.c
src/coding.c
src/dired.c
src/fns.c
src/minibuf.c
src/w32fns.c
src/xfns.c

index f5c66806764d0c1328e10795020e2a2b2fe30195..fe64ca9d8351b11b3113e8177b700c226f72cd3b 100644 (file)
@@ -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.
index 1c4447e9eb517096c73232f702a403454ebe1acc..16564677f324af05f45c571e5d4e982c64dc46db 100644 (file)
@@ -1039,7 +1039,7 @@ to @code{condition-case} whose error condition you want to re-throw.
 @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}.
index 3588704b05486426e911b768375a4d65dfe802cb..9bc6be432ae412c1ee3e0e318190b66f36974e1d 100644 (file)
@@ -1222,10 +1222,11 @@ Buffer name (default foo): @point{}
 @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
index c095a9e195d8e63a1543e570112500e98735dfc7..3953da59b938c8019f402fadaeac69c791c61f87 100644 (file)
@@ -1494,7 +1494,7 @@ See the command \\[hungry-electric-delete]."
  ;; 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 @@ See the command \\[hungry-electric-delete]."
  :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))))
index 566fab45fbf146adeb03f7d45249b7603ede6ea0..56dd6336108f7e4f31aa5739245bd26e17a9ad03 100644 (file)
@@ -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)
index aef2eff221fea68a58fdbc16100d888b1ef84149..b40fc71708f553c6f8e08d0f1ae89db2d6d7452f 100644 (file)
@@ -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.
index 6609f18582583b28403b61b7a933d3d03940f70e..093d815bd81fb5d86a8d37c1c249bfc28c2e5ffa 100644 (file)
@@ -2344,6 +2344,14 @@ files are installed. Then use:
 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:
index 50aa73ad37b33f2af87336c20c7b00fa36ac6736..aebe6b5951e753491cd4dd31ba70190eba148996 100644 (file)
@@ -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.
index 83ed0f4693afb0f0ee344e0ddabfb4c25a988ab6..9d81132702134330e9ac10a65b49789dc1900a64 100644 (file)
   "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 @@ Since each alignment rule can possibly have its own set of alignment
 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 @@ align them so that the opening parentheses would line up:
     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
index 4eab37edf462b2d81de636ebaaf32d99e1386f41..eba6bf7a78a60303645283876cd0d12d73245789 100644 (file)
@@ -1054,6 +1054,9 @@ if `inhibit-field-text-motion' is non-nil."
 ;; 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)
 
index 3ba9d56af168ab1bd08924a74198a21926e796aa..1127181dca2bce1b5ba2f1381891fdf0f7cef7f9 100644 (file)
@@ -377,7 +377,7 @@ With a prefix argument ARG, it searches all buffers accepted by the
 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)
index a3110f8d8c5acbfb21826372a4a8f61cb048444a..5cc89596ef53c0c8c5bf8fd5d2361c21bec3c2f7 100644 (file)
@@ -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
index 857f94cb5f5261883974fe0a5e29471739b22635..fcff6a7eb60dff54499902282c522cf9cf7e561f 100644 (file)
@@ -110,7 +110,7 @@ This gives mostly Emacs-like behavior with only the selection keys enabled."
   :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 @@ association.")
 (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 @@ Don't use this command in Lisp programs!
 ;;;;;;;;;;;;;;;;;;;;
 
 (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 @@ If scan reaches end of buffer, stop there without error."
 
 
 (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 @@ If the buffer is narrowed, this command uses the beginning and size
 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 @@ If the value is non-nil, call the function MODE with an argument of
 
 ;;;###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.
 
index 1bcfe2b46e79277716cba02404feffdcdbeeb3ae..3aa785c7c1ba5da681c5e20f720392e239dc9b16 100644 (file)
@@ -343,8 +343,9 @@ it defaults to `insert'."
        (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)
index f53b69eed8bb17cdfc6613e0b7d0ce89359d14ea..9ee8d22463a0479f27e8df27ef2ca5e636acacbe 100644 (file)
@@ -1410,9 +1410,10 @@ is treated as a character."
   :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 @@ This coding system does not support extended segments of CTEXT."
 ;; 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 @@ Like `compound-text', but does not produce escape sequences for compositions."
 (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."
index 0569ca4c2687755f415e9b6076a8b3ba5e9a5588..59d6ff42c97837336a034ee6bbc1c7e48dc5eaaa 100644 (file)
@@ -282,6 +282,7 @@ attribute."
        (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 @@ This function is provided for backward compatibility."
   '(("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 @@ Each element must be one of the names listed in the variable
       (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 @@ Each element must be one of the names listed in the variable
 ;; 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)
 
index 89d50d66c76806fbab30e46518083c258d327005..6f89e0ee81708eaeabebacffde2e088d1ca642f7 100644 (file)
@@ -2581,6 +2581,7 @@ since they have special meaning in a regexp."
 (defvar isearch-lazy-highlight-case-fold-search nil)
 (defvar isearch-lazy-highlight-regexp nil)
 (defvar isearch-lazy-highlight-space-regexp nil)
+(defvar isearch-lazy-highlight-forward nil)
 
 (defun lazy-highlight-cleanup (&optional force)
   "Stop lazy highlighting and remove extra highlighting from current buffer.
@@ -2620,7 +2621,9 @@ by other Emacs features."
                  (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 @@ by other Emacs features."
            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 @@ Attempt to do the search exactly the way the pending Isearch would."
            (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 @@ Attempt to do the search exactly the way the pending Isearch would."
            (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 @@ Attempt to do the search exactly the way the pending Isearch would."
                    (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 @@ Attempt to do the search exactly the way the pending Isearch would."
                          (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 @@ Attempt to do the search exactly the way the pending Isearch would."
                        (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))
index 7d2f082579f1054165a505307192b22abd7c8a0e..b293ad1ff0b70def122a42cd69b568cdda8d37c0 100644 (file)
@@ -239,13 +239,6 @@ Support for Russian using koi8-r and the russian-computer input method.")
           (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)
index 6a72c161429fa144152bcbbc73fc0cd520804803..469786e04ddbf8f6408c6af20ac7ffc7a87e911f 100644 (file)
@@ -145,7 +145,9 @@ Zero means compute the Imenu menu regardless of size."
                 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
index d73692ccc200212978c96ab7181dd8162703955c..01d971f76eb050b42c9c2d5f2a0bdf6144d14d42 100644 (file)
@@ -1979,7 +1979,9 @@ make, or the user didn't cancel the call."
       (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))
index b2198caec4c6f2dc641baaf03d2a8daeafa28ca5..b2cb829adf759fcca110c77704a07649a3a85a25 100644 (file)
@@ -563,9 +563,9 @@ server or call `M-x server-force-delete' to forcibly disconnect it.")
                       :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
index a3458531bbf59e23a951d21e48f2245335bb5320..0ac199ea2f633b8bf0fb315bba84736208e18a91 100644 (file)
@@ -3941,7 +3941,8 @@ Does not set point.  Does nothing if mark ring is empty."
     (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,
index ea6c48a2b2ab09d72e3aaf54afef6f1dc3ebf886..d5e0d149ae56da242c0e3860f239ad1188fe27df 100644 (file)
@@ -502,8 +502,8 @@ This is a good thing to set in mode hooks.")
 (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 @@ if [ $1 = .. ]; then shift; fi; exec \"$@\""
 ;; 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 @@ See also `term-input-ignoredups' and `term-write-input-ring'."
                 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 @@ Argument 0 is the command name."
   "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 @@ set the hook `term-input-sender'."
   (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 @@ all pending output has been dealt with."))
       (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 @@ Typing SPC flushes the help buffer."
 
 ;; 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 @@ returns nil, which is recognized by `serial-process-configure'
 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")))
 
index 8c699c7758c8c214eb77695e5a9b48e4225e32f1..72920c2b58f8dc45056c3bf1a639803020079b5c 100644 (file)
@@ -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).
index 4f167339b7f83a2492a369953740e358ba8b35b4..0f9bd65112d08a13f57c871726dba1f7c1323fc7 100644 (file)
@@ -35,6 +35,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #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 @@ main (int argc, char ** argv)
     {
       char * p;
       int    extra_arg_space = 0;
+      int    maxlen, remlen;
       int    run_command_dot_com;
 
       progname = getenv ("COMSPEC");
@@ -635,21 +639,27 @@ main (int argc, char ** argv)
             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 @@ main (int argc, char ** argv)
          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);
+           }
        }
     }
 
index 882a4ed093eb24fb78e4cac1e29376b6c3196b47..e931fce093e63800a419a977b1a45a98295c632a 100644 (file)
@@ -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>
 
        * s/freebsd.h (DECLARE_GETPWUID_WITH_UID_T): Remove, unused.
index 7aef84cb0aaa53de9e5c9690794d9aab071bd2cc..0a90fe1f84c6ca43d08276175c2bf8dce53a811d 100644 (file)
@@ -28,6 +28,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <config.h>
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <ctype.h>
 #include <sys/types.h>
@@ -2071,23 +2072,22 @@ that case, find the charset from what supported by that coding system.  */)
     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 charset identification number of CHARSET.  */)
   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;
+}
+
 \f
 void
 init_charset (void)
@@ -2340,6 +2403,7 @@ syms_of_charset (void)
   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.  */);
index 32d1c64afbe9ac05babf40ec3a71db280f9e329c..661918d3fe734f51a826a3f3a3dbd873fce8dce4 100644 (file)
@@ -3902,7 +3902,7 @@ decode_coding_iso_2022 (struct coding_system *coding)
                  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)
index 5bb3f27013c0e1be409c5509e80f3e5bb6d4c66c..d72ea54a5185a9d60c7e3da6613abf64c8c4bba5 100644 (file)
@@ -65,8 +65,7 @@ extern struct direct *readdir (DIR *);
 
 #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)
index 8c49947a127b131ffc882f5685bed6851dd3c30e..501867552f853ac842d95b24488f842a105968ce 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -225,9 +225,8 @@ Symbols are also allowed; their print names are used instead.  */)
   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 @@ value is a new vector that contains the elements between index FROM
 
 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 @@ substring_both (Lisp_Object string, int from, int from_byte, int to, int to_byte
 }
 \f
 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 ("elt", Felt, Selt, 2, 2, 0,
 }
 
 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 @@ The value is actually the tail of LIST whose car is ELT.  */)
 }
 
 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 @@ The value is actually the tail of LIST whose car is ELT.  */)
 }
 
 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 @@ advisable.  */)
 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 @@ is a float, it must be > 1.0, and the new size is computed by
 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-rehash-threshold", Fhash_table_rehash_threshold,
 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)
 {
index 863b7aeee61ced93ba59cba3fb990cdb575be9e7..009d94c36a8832055c78242fc9b89f505a8bb917 100644 (file)
@@ -2080,7 +2080,8 @@ syms_of_minibuf (void)
   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",
index 72830c435e9ffbb1ebf27a875ffef84c8b79f63e..d1f21e8acddfe120750e62a0558837c9d8767092 100644 (file)
@@ -7053,7 +7053,7 @@ or when you set the mouse color.  */);
 
   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,
index ecf7e150b0c9c5a2647bf448931f974de65dd94b..b62e454db6be79e9eff3f91601cea8530751d0ad 100644 (file)
@@ -1003,7 +1003,7 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 
   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 @@ If FRAME is omitted or nil, it defaults to the selected frame. */)
   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 @@ If FRAME is omitted or nil, it defaults to the selected frame. */)
     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 @@ or when you set the mouse color.  */);
   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,