aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-08-14 13:59:55 +0300
committerEli Zaretskii2010-08-14 13:59:55 +0300
commit5872c762ed0f6123bc1c45168c0695fcd2e94948 (patch)
tree8ef950275f000437d49b3b3a9deb47aa3d8dae5d /src
parentf5a62bb4a36e413f9f9eb8f30e932b0919eeceaf (diff)
downloademacs-5872c762ed0f6123bc1c45168c0695fcd2e94948.tar.gz
emacs-5872c762ed0f6123bc1c45168c0695fcd2e94948.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/bidi.c1
-rw-r--r--src/xdisp.c11
3 files changed, 16 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 6c9bb832f2b..424913073fb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12010-08-14 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (Fcurrent_bidi_paragraph_direction): Fix paragraph
4 direction when point is inside a run of whitespace characters.
5
6 * bidi.c (bidi_at_paragraph_end): Remove obsolete comment.
7
12010-08-14 Jason Rumney <jasonr@gnu.org> 82010-08-14 Jason Rumney <jasonr@gnu.org>
2 9
3 * keyboard.c (lispy_function_keys): Do not define VK_PACKET (bug#4836) 10 * keyboard.c (lispy_function_keys): Do not define VK_PACKET (bug#4836)
diff --git a/src/bidi.c b/src/bidi.c
index b31de597688..112d9b08b23 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -497,7 +497,6 @@ bidi_peek_at_next_level (struct bidi_it *bidi_it)
497static EMACS_INT 497static EMACS_INT
498bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos) 498bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos)
499{ 499{
500 /* FIXME: Why Fbuffer_local_value rather than just Fsymbol_value? */
501 Lisp_Object sep_re; 500 Lisp_Object sep_re;
502 Lisp_Object start_re; 501 Lisp_Object start_re;
503 EMACS_INT val; 502 EMACS_INT val;
diff --git a/src/xdisp.c b/src/xdisp.c
index 80df99fee48..93c803d8c00 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -17962,16 +17962,22 @@ See also `bidi-paragraph-direction'. */)
17962 struct bidi_it itb; 17962 struct bidi_it itb;
17963 EMACS_INT pos = BUF_PT (buf); 17963 EMACS_INT pos = BUF_PT (buf);
17964 EMACS_INT bytepos = BUF_PT_BYTE (buf); 17964 EMACS_INT bytepos = BUF_PT_BYTE (buf);
17965 int c;
17965 17966
17966 if (buf != current_buffer) 17967 if (buf != current_buffer)
17967 set_buffer_temp (buf); 17968 set_buffer_temp (buf);
17968 /* Find previous non-empty line. */ 17969 /* bidi_paragraph_init finds the base direction of the paragraph
17970 by searching forward from paragraph start. We need the base
17971 direction of the current or _previous_ paragraph, so we need
17972 to make sure we are within that paragraph. To that end, find
17973 the previous non-empty line. */
17969 if (pos >= ZV && pos > BEGV) 17974 if (pos >= ZV && pos > BEGV)
17970 { 17975 {
17971 pos--; 17976 pos--;
17972 bytepos = CHAR_TO_BYTE (pos); 17977 bytepos = CHAR_TO_BYTE (pos);
17973 } 17978 }
17974 while (FETCH_BYTE (bytepos) == '\n') 17979 while ((c = FETCH_BYTE (bytepos)) == '\n'
17980 || c == ' ' || c == '\t' || c == '\f')
17975 { 17981 {
17976 if (bytepos <= BEGV_BYTE) 17982 if (bytepos <= BEGV_BYTE)
17977 break; 17983 break;
@@ -17983,6 +17989,7 @@ See also `bidi-paragraph-direction'. */)
17983 itb.charpos = pos; 17989 itb.charpos = pos;
17984 itb.bytepos = bytepos; 17990 itb.bytepos = bytepos;
17985 itb.first_elt = 1; 17991 itb.first_elt = 1;
17992 itb.separator_limit = -1;
17986 17993
17987 bidi_paragraph_init (NEUTRAL_DIR, &itb); 17994 bidi_paragraph_init (NEUTRAL_DIR, &itb);
17988 if (buf != current_buffer) 17995 if (buf != current_buffer)