changeset 109210:028318d8a060

Merge from mainline.
author Katsumi Yamaoka <katsumi@flagship2>
date Mon, 31 May 2010 11:48:23 +0000
parents 19ee224844a2 (current diff) 91c7e7b1d29a (diff)
children d76ca4f45bff
files
diffstat 6 files changed, 52 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun May 30 11:55:39 2010 +0000
+++ b/lisp/ChangeLog	Mon May 31 11:48:23 2010 +0000
@@ -1,3 +1,19 @@
+2010-05-30  Eli Zaretskii  <eliz@gnu.org>
+
+	* international/mule.el (define-coding-system): Doc fix (bug#6313).
+
+2010-05-30  Juanma Barranquero  <lekktu@gmail.com>
+
+	* emulation/cua-base.el: Recognize also `right-word' and `left-word'.
+	Suggested by Eli Zaretskii <eliz@gnu.org>.
+
+2010-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* minibuffer.el (completion-file-name-table): Don't return a boundary
+	past the end of `string' (bug#6299).
+	(completion--file-name-table): Delegate to completion-file-name-table
+	for the `boundaries' case.
+
 2010-05-30  Juanma Barranquero  <lekktu@gmail.com>
 
 	* emulation/cua-base.el: Recognize `right-char' and `left-char' as
--- a/lisp/emulation/cua-base.el	Sun May 30 11:55:39 2010 +0000
+++ b/lisp/emulation/cua-base.el	Mon May 31 11:48:23 2010 +0000
@@ -1498,6 +1498,7 @@
 (dolist (cmd
  '(forward-char backward-char
    right-char left-char
+   right-word left-word
    next-line previous-line
    forward-word backward-word
    end-of-line beginning-of-line
--- a/lisp/international/mule.el	Sun May 30 11:55:39 2010 +0000
+++ b/lisp/international/mule.el	Mon May 31 11:48:23 2010 +0000
@@ -608,9 +608,8 @@
 VALUE is the EOL (end-of-line) format of the coding system.  It must be
 one of `unix', `dos', `mac'.  The symbol `unix' means Unix-like EOL
 \(i.e. single LF), `dos' means DOS-like EOL \(i.e. sequence of CR LF),
-and `mac' means Mac-like EOL \(i.e. single CR).  If omitted, on
-decoding by the coding system, Emacs automatically detects the EOL
-format of the source text.
+and `mac' means Mac-like EOL \(i.e. single CR).  If omitted, Emacs
+detects the EOL format automatically when decoding.
 
 `:charset-list'
 
@@ -664,13 +663,6 @@
 VALUE non-nil means that visiting a file with the coding system
 results in a unibyte buffer.
 
-`:eol-type'
-
-VALUE must be `unix', `dos', `mac'.  The symbol `unix' means Unix-like
-EOL (LF), `dos' means DOS-like EOL (CRLF), and `mac' means Mac-like
-EOL (CR).  If omitted, on decoding, the coding system detects EOL
-format automatically, and on encoding, uses Unix-like EOL.
-
 `:mime-charset'
 
 VALUE must be a symbol whose name is that of a MIME charset converted
--- a/lisp/minibuffer.el	Sun May 30 11:55:39 2010 +0000
+++ b/lisp/minibuffer.el	Mon May 31 11:48:23 2010 +0000
@@ -1342,12 +1342,19 @@
    ((eq (car-safe action) 'boundaries)
     (let ((start (length (file-name-directory string)))
           (end (string-match-p "/" (cdr action))))
-      (list* 'boundaries start end)))
+      (list* 'boundaries
+             ;; if `string' is "C:" in w32, (file-name-directory string)
+             ;; returns "C:/", so `start' is 3 rather than 2.
+             ;; Not quite sure what is The Right Fix, but clipping it
+             ;; back to 2 will work for this particular case.  We'll
+             ;; see if we can come up with a better fix when we bump
+             ;; into more such problematic cases.
+             (min start (length string)) end)))
 
-     ((eq action 'lambda)
-      (if (zerop (length string))
-          nil    ;Not sure why it's here, but it probably doesn't harm.
-        (funcall (or pred 'file-exists-p) string)))
+   ((eq action 'lambda)
+    (if (zerop (length string))
+        nil    ;Not sure why it's here, but it probably doesn't harm.
+      (funcall (or pred 'file-exists-p) string)))
 
    (t
       (let* ((name (file-name-nondirectory string))
@@ -1395,19 +1402,20 @@
   (cond
    ((eq (car-safe action) 'boundaries)
     ;; For the boundaries, we can't really delegate to
-    ;; completion-file-name-table and then fix them up, because it
-    ;; would require us to track the relationship between `str' and
+    ;; substitute-in-file-name+completion-file-name-table and then fix
+    ;; them up (as we do for the other actions), because it would
+    ;; require us to track the relationship between `str' and
     ;; `string', which is difficult.  And in any case, if
-    ;; substitute-in-file-name turns "fo-$TO-ba" into "fo-o/b-ba", there's
-    ;; no way for us to return proper boundaries info, because the
-    ;; boundary is not (yet) in `string'.
-    ;; FIXME: Actually there is a way to return correct boundaries info,
-    ;; at the condition of modifying the all-completions return accordingly.
-    (let ((start (length (file-name-directory string)))
-          (end (string-match-p "/" (cdr action))))
-      (list* 'boundaries start end)))
+    ;; substitute-in-file-name turns "fo-$TO-ba" into "fo-o/b-ba",
+    ;; there's no way for us to return proper boundaries info, because
+    ;; the boundary is not (yet) in `string'.
+    ;;
+    ;; FIXME: Actually there is a way to return correct boundaries
+    ;; info, at the condition of modifying the all-completions
+    ;; return accordingly. But for now, let's not bother.
+    (completion-file-name-table string pred action))
 
-       (t
+   (t
     (let* ((default-directory
              (if (stringp pred)
                  ;; It used to be that `pred' was abused to pass `dir'
--- a/src/ChangeLog	Sun May 30 11:55:39 2010 +0000
+++ b/src/ChangeLog	Mon May 31 11:48:23 2010 +0000
@@ -1,3 +1,8 @@
+2010-05-30  Eli Zaretskii  <eliz@gnu.org>
+
+	* bidi.c (bidi_move_to_visually_next): Make sure the sentinel
+	state is always cached (bug#6306).
+
 2010-05-29  Eli Zaretskii  <eliz@gnu.org>
 
 	Fix cursor motion in bidi-reordered continued lines.
--- a/src/bidi.c	Sun May 30 11:55:39 2010 +0000
+++ b/src/bidi.c	Mon May 31 11:48:23 2010 +0000
@@ -1907,7 +1907,9 @@
   if (!bidi_it->first_elt && bidi_it->orig_type == NEUTRAL_B)
     bidi_line_init (bidi_it);
 
-  /* Prepare the sentinel iterator state.  */
+  /* Prepare the sentinel iterator state, and cache it.  When we bump
+     into it, scanning backwards, we'll know that the last non-base
+     level is exhausted.  */
   if (bidi_cache_idx == 0)
     {
       bidi_copy_it (&sentinel, bidi_it);
@@ -1918,6 +1920,7 @@
 	  sentinel.ch = '\n';	/* doesn't matter, but why not? */
 	  sentinel.ch_len = 1;
 	}
+      bidi_cache_iterator_state (&sentinel, 1);
     }
 
   old_level = bidi_it->resolved_level;
@@ -1933,11 +1936,6 @@
       int incr = ascending ? 1 : -1;
       int expected_next_level = old_level + incr;
 
-      /* If we don't have anything cached yet, we need to cache the
-	 sentinel state, since we'll need it to record where to jump
-	 when the last non-base level is exhausted.  */
-      if (bidi_cache_idx == 0)
-	bidi_cache_iterator_state (&sentinel, 1);
       /* Jump (or walk) to the other edge of this level.  */
       bidi_find_other_level_edge (bidi_it, level_to_search, !ascending);
       /* Switch scan direction and peek at the next character in the