emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101078: Fix current-bidi-paragraph-d


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101078: Fix current-bidi-paragraph-direction within whitespace chars.
Date: Sat, 14 Aug 2010 13:59:55 +0300
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101078
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2010-08-14 13:59:55 +0300
message:
  Fix current-bidi-paragraph-direction within whitespace chars.
  
   xdisp.c (Fcurrent_bidi_paragraph_direction): Fix paragraph
   direction when point is inside a run of whitespace characters.
   bidi.c (bidi_at_paragraph_end): Remove obsolete comment.
modified:
  src/ChangeLog
  src/bidi.c
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-08-14 07:35:24 +0000
+++ b/src/ChangeLog     2010-08-14 10:59:55 +0000
@@ -1,3 +1,10 @@
+2010-08-14  Eli Zaretskii  <address@hidden>
+
+       * xdisp.c (Fcurrent_bidi_paragraph_direction): Fix paragraph
+       direction when point is inside a run of whitespace characters.
+
+       * bidi.c (bidi_at_paragraph_end): Remove obsolete comment.
+
 2010-08-14  Jason Rumney  <address@hidden>
 
        * keyboard.c (lispy_function_keys): Do not define VK_PACKET (bug#4836)

=== modified file 'src/bidi.c'
--- a/src/bidi.c        2010-08-06 10:12:41 +0000
+++ b/src/bidi.c        2010-08-14 10:59:55 +0000
@@ -497,7 +497,6 @@
 static EMACS_INT
 bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos)
 {
-  /* FIXME: Why Fbuffer_local_value rather than just Fsymbol_value?  */
   Lisp_Object sep_re;
   Lisp_Object start_re;
   EMACS_INT val;

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2010-08-08 21:03:45 +0000
+++ b/src/xdisp.c       2010-08-14 10:59:55 +0000
@@ -17962,16 +17962,22 @@
       struct bidi_it itb;
       EMACS_INT pos = BUF_PT (buf);
       EMACS_INT bytepos = BUF_PT_BYTE (buf);
+      int c;
 
       if (buf != current_buffer)
        set_buffer_temp (buf);
-      /* Find previous non-empty line.  */
+      /* bidi_paragraph_init finds the base direction of the paragraph
+        by searching forward from paragraph start.  We need the base
+        direction of the current or _previous_ paragraph, so we need
+        to make sure we are within that paragraph.  To that end, find
+        the previous non-empty line.  */
       if (pos >= ZV && pos > BEGV)
        {
          pos--;
          bytepos = CHAR_TO_BYTE (pos);
        }
-      while (FETCH_BYTE (bytepos) == '\n')
+      while ((c = FETCH_BYTE (bytepos)) == '\n'
+            || c == ' ' || c == '\t' || c == '\f')
        {
          if (bytepos <= BEGV_BYTE)
            break;
@@ -17983,6 +17989,7 @@
       itb.charpos = pos;
       itb.bytepos = bytepos;
       itb.first_elt = 1;
+      itb.separator_limit = -1;
 
       bidi_paragraph_init (NEUTRAL_DIR, &itb);
       if (buf != current_buffer)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]