aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog42
-rw-r--r--src/bidi.c15
-rw-r--r--src/buffer.c32
-rw-r--r--src/chartab.c2
-rw-r--r--src/nsfont.m2
-rw-r--r--src/process.c3
-rw-r--r--src/xdisp.c24
7 files changed, 83 insertions, 37 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1b1a8f67e43..431a515def5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,45 @@
12011-08-25 Chong Yidong <cyd@stupidchicken.com>
2
3 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
4 Change return value to nil.
5 (Frecord_buffer): Delete unused function.
6
72011-08-24 Eli Zaretskii <eliz@gnu.org>
8
9 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10 buffers, return left-to-right.
11 (set_cursor_from_row): Consider candidate row a win if its glyph
12 represents a newline and point is on that newline. Fixes cursor
13 positioning on the newline at EOL of R2L text within L2R
14 paragraph, and vice versa.
15 (try_cursor_movement): Check continued rows, in addition to
16 continuation rows. Fixes unwarranted scroll when point enters a
17 continued line of R2L text within an L2R paragraph, or vice versa.
18 (cursor_row_p): Consider the case of point being equal to
19 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
20 from the end of a short line to the beginning of a continued line
21 of R2L text within L2R paragraph.
22 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
23 composed characters.
24
25 * bidi.c (bidi_check_type): Use xassert.
26 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
27 members.
28
292011-08-23 Eli Zaretskii <eliz@gnu.org>
30
31 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
32 a character.
33
342011-08-23 Chong Yidong <cyd@stupidchicken.com>
35
36 * nsfont.m (ns_otf_to_script): Fix typo.
37
382011-08-22 Kenichi Handa <handa@m17n.org>
39
40 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
41 extra slot even if the purpose is char-code-property-table.
42
12011-08-23 Eli Zaretskii <eliz@gnu.org> 432011-08-23 Eli Zaretskii <eliz@gnu.org>
2 44
3 * xdisp.c (redisplay_window): When computing centering_position, 45 * xdisp.c (redisplay_window): When computing centering_position,
diff --git a/src/bidi.c b/src/bidi.c
index 7517eca5aed..425a0be9578 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -108,8 +108,12 @@ bidi_get_type (int ch, bidi_dir_t override)
108 abort (); 108 abort ();
109 109
110 default_type = (bidi_type_t) XINT (CHAR_TABLE_REF (bidi_type_table, ch)); 110 default_type = (bidi_type_t) XINT (CHAR_TABLE_REF (bidi_type_table, ch));
111 if (default_type == 0) 111 /* Every valid character code, even those that are unassigned by the
112 default_type = STRONG_L; 112 UCD, have some bidi-class property, according to
113 DerivedBidiClass.txt file. Therefore, if we ever get UNKNOWN_BT
114 (= zero) code from CHAR_TABLE_REF, that's a bug. */
115 if (default_type == UNKNOWN_BT)
116 abort ();
113 117
114 if (override == NEUTRAL_DIR) 118 if (override == NEUTRAL_DIR)
115 return default_type; 119 return default_type;
@@ -142,11 +146,10 @@ bidi_get_type (int ch, bidi_dir_t override)
142 } 146 }
143} 147}
144 148
145static void 149static inline void
146bidi_check_type (bidi_type_t type) 150bidi_check_type (bidi_type_t type)
147{ 151{
148 if (type < UNKNOWN_BT || type > NEUTRAL_ON) 152 xassert (UNKNOWN_BT <= type && type <= NEUTRAL_ON);
149 abort ();
150} 153}
151 154
152/* Given a bidi TYPE of a character, return its category. */ 155/* Given a bidi TYPE of a character, return its category. */
@@ -536,6 +539,8 @@ bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved)
536 bidi_cache[idx].next_for_neutral = bidi_it->next_for_neutral; 539 bidi_cache[idx].next_for_neutral = bidi_it->next_for_neutral;
537 bidi_cache[idx].next_for_ws = bidi_it->next_for_ws; 540 bidi_cache[idx].next_for_ws = bidi_it->next_for_ws;
538 bidi_cache[idx].ignore_bn_limit = bidi_it->ignore_bn_limit; 541 bidi_cache[idx].ignore_bn_limit = bidi_it->ignore_bn_limit;
542 bidi_cache[idx].disp_pos = bidi_it->disp_pos;
543 bidi_cache[idx].disp_prop_p = bidi_it->disp_prop_p;
539 } 544 }
540 545
541 bidi_cache_last_idx = idx; 546 bidi_cache_last_idx = idx;
diff --git a/src/buffer.c b/src/buffer.c
index 45d6fa36d04..832044ae6f4 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1698,27 +1698,16 @@ record_buffer (Lisp_Object buffer)
1698 call1 (Vrun_hooks, Qbuffer_list_update_hook); 1698 call1 (Vrun_hooks, Qbuffer_list_update_hook);
1699} 1699}
1700 1700
1701DEFUN ("record-buffer", Frecord_buffer, Srecord_buffer, 1, 1, 0,
1702 doc: /* Move BUFFER to the front of the buffer list.
1703Return BUFFER. */)
1704 (Lisp_Object buffer)
1705{
1706 CHECK_BUFFER (buffer);
1707
1708 record_buffer (buffer);
1709
1710 return buffer;
1711}
1712 1701
1713 /* Move BUFFER to the end of the buffer (a)lists. Do nothing if the 1702/* Move BUFFER to the end of the buffer (a)lists. Do nothing if the
1714 buffer is killed. For the selected frame's buffer list this moves 1703 buffer is killed. For the selected frame's buffer list this moves
1715 BUFFER to its end even if it was never shown in that frame. If 1704 BUFFER to its end even if it was never shown in that frame. If
1716 this happens we have a feature, hence `unrecord-buffer' should be 1705 this happens we have a feature, hence `unrecord-buffer' should be
1717 called only when BUFFER was shown in the selected frame. */ 1706 called only when BUFFER was shown in the selected frame. */
1718 1707
1719DEFUN ("unrecord-buffer", Funrecord_buffer, Sunrecord_buffer, 1, 1, 0, 1708DEFUN ("bury-buffer-internal", Fbury_buffer_internal, Sbury_buffer_internal,
1720 doc: /* Move BUFFER to the end of the buffer list. 1709 1, 1, 0,
1721Return BUFFER. */) 1710 doc: /* Move BUFFER to the end of the buffer list. */)
1722 (Lisp_Object buffer) 1711 (Lisp_Object buffer)
1723{ 1712{
1724 Lisp_Object aelt, aelt_cons, tem; 1713 Lisp_Object aelt, aelt_cons, tem;
@@ -1746,7 +1735,7 @@ Return BUFFER. */)
1746 if (!NILP (Vrun_hooks)) 1735 if (!NILP (Vrun_hooks))
1747 call1 (Vrun_hooks, Qbuffer_list_update_hook); 1736 call1 (Vrun_hooks, Qbuffer_list_update_hook);
1748 1737
1749 return buffer; 1738 return Qnil;
1750} 1739}
1751 1740
1752DEFUN ("set-buffer-major-mode", Fset_buffer_major_mode, Sset_buffer_major_mode, 1, 1, 0, 1741DEFUN ("set-buffer-major-mode", Fset_buffer_major_mode, Sset_buffer_major_mode, 1, 1, 0,
@@ -6034,8 +6023,7 @@ Functions running this hook are `get-buffer-create',
6034 defsubr (&Sother_buffer); 6023 defsubr (&Sother_buffer);
6035 defsubr (&Sbuffer_enable_undo); 6024 defsubr (&Sbuffer_enable_undo);
6036 defsubr (&Skill_buffer); 6025 defsubr (&Skill_buffer);
6037 defsubr (&Srecord_buffer); 6026 defsubr (&Sbury_buffer_internal);
6038 defsubr (&Sunrecord_buffer);
6039 defsubr (&Sset_buffer_major_mode); 6027 defsubr (&Sset_buffer_major_mode);
6040 defsubr (&Scurrent_buffer); 6028 defsubr (&Scurrent_buffer);
6041 defsubr (&Sset_buffer); 6029 defsubr (&Sset_buffer);
diff --git a/src/chartab.c b/src/chartab.c
index 0cabaac4cf5..1d4ac04312a 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -589,8 +589,6 @@ DEFUN ("set-char-table-extra-slot", Fset_char_table_extra_slot,
589 (Lisp_Object char_table, Lisp_Object n, Lisp_Object value) 589 (Lisp_Object char_table, Lisp_Object n, Lisp_Object value)
590{ 590{
591 CHECK_CHAR_TABLE (char_table); 591 CHECK_CHAR_TABLE (char_table);
592 if (EQ (XCHAR_TABLE (char_table)->purpose, Qchar_code_property_table))
593 error ("Can't change extra-slot of char-code-property-table");
594 CHECK_NUMBER (n); 592 CHECK_NUMBER (n);
595 if (XINT (n) < 0 593 if (XINT (n) < 0
596 || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table))) 594 || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table)))
diff --git a/src/nsfont.m b/src/nsfont.m
index 60f8c5321aa..c4d9123faef 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -303,7 +303,7 @@ static NSString
303{ 303{
304 Lisp_Object script = assq_no_quit (XCAR (otf), Votf_script_alist); 304 Lisp_Object script = assq_no_quit (XCAR (otf), Votf_script_alist);
305 return CONSP (script) 305 return CONSP (script)
306 ? [NSString stringWithUTF8String: SDATA (SYMBOL_NAME XCDR ((script)))] 306 ? [NSString stringWithUTF8String: SDATA (SYMBOL_NAME (XCDR ((script))))]
307 : @""; 307 : @"";
308} 308}
309 309
diff --git a/src/process.c b/src/process.c
index 2125478907f..977cfb964e2 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5186,6 +5186,9 @@ read_process_output (Lisp_Object proc, register int channel)
5186 p->decoding_carryover = coding->carryover_bytes; 5186 p->decoding_carryover = coding->carryover_bytes;
5187 } 5187 }
5188 if (SBYTES (text) > 0) 5188 if (SBYTES (text) > 0)
5189 /* FIXME: It's wrong to wrap or not based on debug-on-error, and
5190 sometimes it's simply wrong to wrap (e.g. when called from
5191 accept-process-output). */
5189 internal_condition_case_1 (read_process_output_call, 5192 internal_condition_case_1 (read_process_output_call,
5190 Fcons (outstream, 5193 Fcons (outstream,
5191 Fcons (proc, Fcons (text, Qnil))), 5194 Fcons (proc, Fcons (text, Qnil))),
diff --git a/src/xdisp.c b/src/xdisp.c
index f38c2828b8e..580bd59908b 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13857,7 +13857,14 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13857 && glyph->charpos != pt_old))))) 13857 && glyph->charpos != pt_old)))))
13858 return 0; 13858 return 0;
13859 /* If this candidate gives an exact match, use that. */ 13859 /* If this candidate gives an exact match, use that. */
13860 if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old) 13860 if (!((BUFFERP (glyph->object) && glyph->charpos == pt_old)
13861 /* If this candidate is a glyph created for the
13862 terminating newline of a line, and point is on that
13863 newline, it wins because it's an exact match. */
13864 || (!row->continued_p
13865 && INTEGERP (glyph->object)
13866 && glyph->charpos == 0
13867 && pt_old == MATRIX_ROW_END_CHARPOS (row) - 1))
13861 /* Otherwise, keep the candidate that comes from a row 13868 /* Otherwise, keep the candidate that comes from a row
13862 spanning less buffer positions. This may win when one or 13869 spanning less buffer positions. This may win when one or
13863 both candidate positions are on glyphs that came from 13870 both candidate positions are on glyphs that came from
@@ -14639,7 +14646,8 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
14639 } 14646 }
14640 ++row; 14647 ++row;
14641 } 14648 }
14642 while ((MATRIX_ROW_CONTINUATION_LINE_P (row) 14649 while (((MATRIX_ROW_CONTINUATION_LINE_P (row)
14650 || row->continued_p)
14643 && MATRIX_ROW_BOTTOM_Y (row) <= last_y) 14651 && MATRIX_ROW_BOTTOM_Y (row) <= last_y)
14644 || (MATRIX_ROW_START_CHARPOS (row) == PT 14652 || (MATRIX_ROW_START_CHARPOS (row) == PT
14645 && MATRIX_ROW_BOTTOM_Y (row) < last_y)); 14653 && MATRIX_ROW_BOTTOM_Y (row) < last_y));
@@ -18114,7 +18122,8 @@ cursor_row_p (struct glyph_row *row)
18114{ 18122{
18115 int result = 1; 18123 int result = 1;
18116 18124
18117 if (PT == CHARPOS (row->end.pos)) 18125 if (PT == CHARPOS (row->end.pos)
18126 || PT == MATRIX_ROW_END_CHARPOS (row))
18118 { 18127 {
18119 /* Suppose the row ends on a string. 18128 /* Suppose the row ends on a string.
18120 Unless the row is continued, that means it ends on a newline 18129 Unless the row is continued, that means it ends on a newline
@@ -18509,10 +18518,10 @@ display_line (struct it *it)
18509 min_pos = current_pos; \ 18518 min_pos = current_pos; \
18510 min_bpos = current_bpos; \ 18519 min_bpos = current_bpos; \
18511 } \ 18520 } \
18512 if (current_pos > max_pos) \ 18521 if (IT_CHARPOS (*it) > max_pos) \
18513 { \ 18522 { \
18514 max_pos = current_pos; \ 18523 max_pos = IT_CHARPOS (*it); \
18515 max_bpos = current_bpos; \ 18524 max_bpos = IT_BYTEPOS (*it); \
18516 } \ 18525 } \
18517 } \ 18526 } \
18518 while (0) 18527 while (0)
@@ -19119,7 +19128,8 @@ See also `bidi-paragraph-direction'. */)
19119 buf = XBUFFER (buffer); 19128 buf = XBUFFER (buffer);
19120 } 19129 }
19121 19130
19122 if (NILP (BVAR (buf, bidi_display_reordering))) 19131 if (NILP (BVAR (buf, bidi_display_reordering))
19132 || NILP (BVAR (buf, enable_multibyte_characters)))
19123 return Qleft_to_right; 19133 return Qleft_to_right;
19124 else if (!NILP (BVAR (buf, bidi_paragraph_direction))) 19134 else if (!NILP (BVAR (buf, bidi_paragraph_direction)))
19125 return BVAR (buf, bidi_paragraph_direction); 19135 return BVAR (buf, bidi_paragraph_direction);