diff options
| author | Paul Eggert | 2011-10-12 09:48:12 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-10-12 09:48:12 -0700 |
| commit | 682432fc544c2bb4e0531c2931d43bce085eb16a (patch) | |
| tree | 4bc9e4d78f34e19254382246b89a3462a0186311 /src | |
| parent | d44287d4adc1e268ef9974ea72010f0186f40197 (diff) | |
| parent | 79beb1785aac3f8326f58710462e4b6be7f0449a (diff) | |
| download | emacs-682432fc544c2bb4e0531c2931d43bce085eb16a.tar.gz emacs-682432fc544c2bb4e0531c2931d43bce085eb16a.zip | |
Merge from trunk.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 51 | ||||
| -rw-r--r-- | src/alloc.c | 4 | ||||
| -rw-r--r-- | src/bidi.c | 4 | ||||
| -rw-r--r-- | src/callint.c | 2 | ||||
| -rw-r--r-- | src/dispnew.c | 4 | ||||
| -rw-r--r-- | src/lisp.h | 116 | ||||
| -rw-r--r-- | src/lread.c | 6 | ||||
| -rw-r--r-- | src/minibuf.c | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 72 |
9 files changed, 175 insertions, 91 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 00845a4c188..c2cf656b101 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | 2011-10-11 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-10-12 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Fix integer width and related issues. | 3 | Fix integer width and related bugs. |
| 4 | * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): | 4 | * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): |
| 5 | (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE) | 5 | (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE) |
| 6 | (string_bytes, check_sblock, allocate_string_data): | 6 | (string_bytes, check_sblock, allocate_string_data): |
| @@ -784,6 +784,53 @@ | |||
| 784 | rather than rolling our own approximation. | 784 | rather than rolling our own approximation. |
| 785 | (SCROLL_BAR_VEC_SIZE): Remove; not used. | 785 | (SCROLL_BAR_VEC_SIZE): Remove; not used. |
| 786 | 786 | ||
| 787 | 2011-10-12 Eli Zaretskii <eliz@gnu.org> | ||
| 788 | |||
| 789 | * bidi.c (bidi_level_of_next_char): | ||
| 790 | * xdisp.c (get_visually_first_element): Remove old incorrect | ||
| 791 | comments regarding the Unicode Line Separator character. | ||
| 792 | |||
| 793 | * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR. | ||
| 794 | |||
| 795 | 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 796 | |||
| 797 | * alloc.c (Fgc_status): Do not access beyond zombies array | ||
| 798 | boundary if nzombies > MAX_ZOMBIES. | ||
| 799 | * alloc.c (dump_zombies): Add missing format specifier. | ||
| 800 | |||
| 801 | 2011-10-12 Paul Eggert <eggert@cs.ucla.edu> | ||
| 802 | |||
| 803 | * xdisp.c (set_cursor_from_row): Simplify conditionals, | ||
| 804 | to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow. | ||
| 805 | |||
| 806 | * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff. | ||
| 807 | Some packages use them to denote characters with modifiers. | ||
| 808 | |||
| 809 | 2011-10-11 Andreas Schwab <schwab@linux-m68k.org> | ||
| 810 | |||
| 811 | * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR) | ||
| 812 | (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid | ||
| 813 | matching a pp-number. Rename parameter var to var1. | ||
| 814 | |||
| 815 | 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 816 | |||
| 817 | * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709). | ||
| 818 | |||
| 819 | 2011-10-08 Glenn Morris <rgm@gnu.org> | ||
| 820 | |||
| 821 | * callint.c (Fcall_interactively): Give a more explicit error for the | ||
| 822 | 'c' case with a non-character input. (Bug#8479) | ||
| 823 | |||
| 824 | 2011-10-08 Eli Zaretskii <eliz@gnu.org> | ||
| 825 | |||
| 826 | * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left | ||
| 827 | lines. | ||
| 828 | (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L | ||
| 829 | lines that are hscrolled on the left. | ||
| 830 | |||
| 831 | * dispnew.c (buffer_posn_from_coords): Account for a possible | ||
| 832 | presence of header-line. (Bug#4426) | ||
| 833 | |||
| 787 | 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca> | 834 | 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca> |
| 788 | 835 | ||
| 789 | * buffer.c (syms_of_buffer) <enable-multibyte-characters>: Don't | 836 | * buffer.c (syms_of_buffer) <enable-multibyte-characters>: Don't |
diff --git a/src/alloc.c b/src/alloc.c index ea2fea77e29..ee49a2dfb2e 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -4072,7 +4072,7 @@ DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "", | |||
| 4072 | { | 4072 | { |
| 4073 | Lisp_Object args[8], zombie_list = Qnil; | 4073 | Lisp_Object args[8], zombie_list = Qnil; |
| 4074 | EMACS_INT i; | 4074 | EMACS_INT i; |
| 4075 | for (i = 0; i < nzombies; i++) | 4075 | for (i = 0; i < min (MAX_ZOMBIES, nzombies); i++) |
| 4076 | zombie_list = Fcons (zombies[i], zombie_list); | 4076 | zombie_list = Fcons (zombies[i], zombie_list); |
| 4077 | args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d\nzombies: %S"); | 4077 | args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d\nzombies: %S"); |
| 4078 | args[1] = make_number (ngcs); | 4078 | args[1] = make_number (ngcs); |
| @@ -4411,7 +4411,7 @@ dump_zombies (void) | |||
| 4411 | { | 4411 | { |
| 4412 | int i; | 4412 | int i; |
| 4413 | 4413 | ||
| 4414 | fprintf (stderr, "\nZombies kept alive = %"pI":\n", nzombies); | 4414 | fprintf (stderr, "\nZombies kept alive = %"pI"d:\n", nzombies); |
| 4415 | for (i = 0; i < min (MAX_ZOMBIES, nzombies); ++i) | 4415 | for (i = 0; i < min (MAX_ZOMBIES, nzombies); ++i) |
| 4416 | { | 4416 | { |
| 4417 | fprintf (stderr, " %d = ", i); | 4417 | fprintf (stderr, " %d = ", i); |
diff --git a/src/bidi.c b/src/bidi.c index a43490f4110..e4965ed59ac 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -808,6 +808,7 @@ bidi_init_it (ptrdiff_t charpos, ptrdiff_t bytepos, int frame_window_p, | |||
| 808 | bidi_it->nchars = -1; /* to be computed in bidi_resolve_explicit_1 */ | 808 | bidi_it->nchars = -1; /* to be computed in bidi_resolve_explicit_1 */ |
| 809 | bidi_it->first_elt = 1; | 809 | bidi_it->first_elt = 1; |
| 810 | bidi_set_paragraph_end (bidi_it); | 810 | bidi_set_paragraph_end (bidi_it); |
| 811 | bidi_it->paragraph_dir = NEUTRAL_DIR; | ||
| 811 | bidi_it->new_paragraph = 1; | 812 | bidi_it->new_paragraph = 1; |
| 812 | bidi_it->separator_limit = -1; | 813 | bidi_it->separator_limit = -1; |
| 813 | bidi_it->type = NEUTRAL_B; | 814 | bidi_it->type = NEUTRAL_B; |
| @@ -2127,7 +2128,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) | |||
| 2127 | do { | 2128 | do { |
| 2128 | ch = bidi_fetch_char (bpos += clen, cpos += nc, &disp_pos, &dpp, &bs, | 2129 | ch = bidi_fetch_char (bpos += clen, cpos += nc, &disp_pos, &dpp, &bs, |
| 2129 | fwp, &clen, &nc); | 2130 | fwp, &clen, &nc); |
| 2130 | if (ch == '\n' || ch == BIDI_EOB /* || ch == LINESEP_CHAR */) | 2131 | if (ch == '\n' || ch == BIDI_EOB) |
| 2131 | chtype = NEUTRAL_B; | 2132 | chtype = NEUTRAL_B; |
| 2132 | else | 2133 | else |
| 2133 | chtype = bidi_get_type (ch, NEUTRAL_DIR); | 2134 | chtype = bidi_get_type (ch, NEUTRAL_DIR); |
| @@ -2177,7 +2178,6 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) | |||
| 2177 | else if (bidi_it->orig_type == NEUTRAL_B /* L1 */ | 2178 | else if (bidi_it->orig_type == NEUTRAL_B /* L1 */ |
| 2178 | || bidi_it->orig_type == NEUTRAL_S | 2179 | || bidi_it->orig_type == NEUTRAL_S |
| 2179 | || bidi_it->ch == '\n' || bidi_it->ch == BIDI_EOB | 2180 | || bidi_it->ch == '\n' || bidi_it->ch == BIDI_EOB |
| 2180 | /* || bidi_it->ch == LINESEP_CHAR */ | ||
| 2181 | || (bidi_it->orig_type == NEUTRAL_WS | 2181 | || (bidi_it->orig_type == NEUTRAL_WS |
| 2182 | && (bidi_it->next_for_ws.type == NEUTRAL_B | 2182 | && (bidi_it->next_for_ws.type == NEUTRAL_B |
| 2183 | || bidi_it->next_for_ws.type == NEUTRAL_S))) | 2183 | || bidi_it->next_for_ws.type == NEUTRAL_S))) |
diff --git a/src/callint.c b/src/callint.c index c2a43f0f8f9..5eb824b8c74 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -535,6 +535,8 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 535 | message1_nolog ((char *) 0); | 535 | message1_nolog ((char *) 0); |
| 536 | /* Passing args[i] directly stimulates compiler bug */ | 536 | /* Passing args[i] directly stimulates compiler bug */ |
| 537 | teml = args[i]; | 537 | teml = args[i]; |
| 538 | /* See bug#8479. */ | ||
| 539 | if (! CHARACTERP (teml)) error ("Non-character input-event"); | ||
| 538 | visargs[i] = Fchar_to_string (teml); | 540 | visargs[i] = Fchar_to_string (teml); |
| 539 | break; | 541 | break; |
| 540 | 542 | ||
diff --git a/src/dispnew.c b/src/dispnew.c index 32795a5fed9..93a990cff47 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5260,6 +5260,10 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p | |||
| 5260 | CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); | 5260 | CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); |
| 5261 | BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); | 5261 | BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); |
| 5262 | start_display (&it, w, startp); | 5262 | start_display (&it, w, startp); |
| 5263 | /* start_display takes into account the header-line row, but IT's | ||
| 5264 | vpos still counts from the glyph row that includes the window's | ||
| 5265 | start position. Adjust for a possible header-line row. */ | ||
| 5266 | it.vpos += WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; | ||
| 5263 | 5267 | ||
| 5264 | x0 = *x; | 5268 | x0 = *x; |
| 5265 | 5269 | ||
diff --git a/src/lisp.h b/src/lisp.h index 2c54c9b41ed..17f1705675e 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2275,105 +2275,105 @@ struct gcpro | |||
| 2275 | 2275 | ||
| 2276 | #ifndef DEBUG_GCPRO | 2276 | #ifndef DEBUG_GCPRO |
| 2277 | 2277 | ||
| 2278 | #define GCPRO1_VAR(var, gcpro) \ | 2278 | #define GCPRO1_VAR(var1, gcpro) \ |
| 2279 | {gcpro##1.next = gcprolist; gcpro##1.var = &var; gcpro##1.nvars = 1; \ | 2279 | {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ |
| 2280 | gcprolist = &gcpro##1; } | 2280 | gcprolist = &gcpro##1; } |
| 2281 | 2281 | ||
| 2282 | #define GCPRO2_VAR(var1, var2, gcpro) \ | 2282 | #define GCPRO2_VAR(var1, var2, gcpro) \ |
| 2283 | {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ | 2283 | {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ |
| 2284 | gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ | 2284 | gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ |
| 2285 | gcprolist = &gcpro##2; } | 2285 | gcprolist = &gcpro##2; } |
| 2286 | 2286 | ||
| 2287 | #define GCPRO3_VAR(var1, var2, var3, gcpro) \ | 2287 | #define GCPRO3_VAR(var1, var2, var3, gcpro) \ |
| 2288 | {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ | 2288 | {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ |
| 2289 | gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ | 2289 | gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ |
| 2290 | gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ | 2290 | gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ |
| 2291 | gcprolist = &gcpro##3; } | 2291 | gcprolist = &gcpro##3; } |
| 2292 | 2292 | ||
| 2293 | #define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ | 2293 | #define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ |
| 2294 | {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ | 2294 | {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ |
| 2295 | gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ | 2295 | gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ |
| 2296 | gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ | 2296 | gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ |
| 2297 | gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ | 2297 | gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ |
| 2298 | gcprolist = &gcpro##4; } | 2298 | gcprolist = &gcpro##4; } |
| 2299 | 2299 | ||
| 2300 | #define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ | 2300 | #define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ |
| 2301 | {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ | 2301 | {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ |
| 2302 | gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ | 2302 | gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ |
| 2303 | gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ | 2303 | gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ |
| 2304 | gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ | 2304 | gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ |
| 2305 | gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ | 2305 | gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ |
| 2306 | gcprolist = &gcpro##5; } | 2306 | gcprolist = &gcpro##5; } |
| 2307 | 2307 | ||
| 2308 | #define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ | 2308 | #define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ |
| 2309 | {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ | 2309 | {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ |
| 2310 | gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ | 2310 | gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ |
| 2311 | gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ | 2311 | gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ |
| 2312 | gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ | 2312 | gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ |
| 2313 | gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ | 2313 | gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ |
| 2314 | gcpro##6.next = &gcpro##5; gcpro##6.var = &var6; gcpro##6.nvars = 1; \ | 2314 | gcpro##6 .next = &gcpro##5; gcpro##6 .var = &var6; gcpro##6 .nvars = 1; \ |
| 2315 | gcprolist = &gcpro##6; } | 2315 | gcprolist = &gcpro##6; } |
| 2316 | 2316 | ||
| 2317 | #define UNGCPRO_VAR(gcpro) (gcprolist = gcpro##1.next) | 2317 | #define UNGCPRO_VAR(gcpro) (gcprolist = gcpro##1 .next) |
| 2318 | 2318 | ||
| 2319 | #else | 2319 | #else |
| 2320 | 2320 | ||
| 2321 | extern int gcpro_level; | 2321 | extern int gcpro_level; |
| 2322 | 2322 | ||
| 2323 | #define GCPRO1_VAR(var, gcpro) \ | 2323 | #define GCPRO1_VAR(var1, gcpro) \ |
| 2324 | {gcpro##1.next = gcprolist; gcpro##1.var = &var; gcpro##1.nvars = 1; \ | 2324 | {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ |
| 2325 | gcpro##1.level = gcpro_level++; \ | 2325 | gcpro##1 .level = gcpro_level++; \ |
| 2326 | gcprolist = &gcpro##1; } | 2326 | gcprolist = &gcpro##1; } |
| 2327 | 2327 | ||
| 2328 | #define GCPRO2_VAR(var1, var2, gcpro) \ | 2328 | #define GCPRO2_VAR(var1, var2, gcpro) \ |
| 2329 | {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ | 2329 | {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ |
| 2330 | gcpro##1.level = gcpro_level; \ | 2330 | gcpro##1 .level = gcpro_level; \ |
| 2331 | gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ | 2331 | gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ |
| 2332 | gcpro##2.level = gcpro_level++; \ | 2332 | gcpro##2 .level = gcpro_level++; \ |
| 2333 | gcprolist = &gcpro##2; } | 2333 | gcprolist = &gcpro##2; } |
| 2334 | 2334 | ||
| 2335 | #define GCPRO3_VAR(var1, var2, var3, gcpro) \ | 2335 | #define GCPRO3_VAR(var1, var2, var3, gcpro) \ |
| 2336 | {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ | 2336 | {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ |
| 2337 | gcpro##1.level = gcpro_level; \ | 2337 | gcpro##1 .level = gcpro_level; \ |
| 2338 | gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ | 2338 | gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ |
| 2339 | gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ | 2339 | gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ |
| 2340 | gcpro##3.level = gcpro_level++; \ | 2340 | gcpro##3 .level = gcpro_level++; \ |
| 2341 | gcprolist = &gcpro##3; } | 2341 | gcprolist = &gcpro##3; } |
| 2342 | 2342 | ||
| 2343 | #define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ | 2343 | #define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ |
| 2344 | {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ | 2344 | {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ |
| 2345 | gcpro##1.level = gcpro_level; \ | 2345 | gcpro##1 .level = gcpro_level; \ |
| 2346 | gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ | 2346 | gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ |
| 2347 | gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ | 2347 | gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ |
| 2348 | gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ | 2348 | gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ |
| 2349 | gcpro##4.level = gcpro_level++; \ | 2349 | gcpro##4 .level = gcpro_level++; \ |
| 2350 | gcprolist = &gcpro##4; } | 2350 | gcprolist = &gcpro##4; } |
| 2351 | 2351 | ||
| 2352 | #define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ | 2352 | #define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ |
| 2353 | {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ | 2353 | {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ |
| 2354 | gcpro##1.level = gcpro_level; \ | 2354 | gcpro##1 .level = gcpro_level; \ |
| 2355 | gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ | 2355 | gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ |
| 2356 | gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ | 2356 | gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ |
| 2357 | gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ | 2357 | gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ |
| 2358 | gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ | 2358 | gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ |
| 2359 | gcpro##5.level = gcpro_level++; \ | 2359 | gcpro##5 .level = gcpro_level++; \ |
| 2360 | gcprolist = &gcpro##5; } | 2360 | gcprolist = &gcpro##5; } |
| 2361 | 2361 | ||
| 2362 | #define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ | 2362 | #define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ |
| 2363 | {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ | 2363 | {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ |
| 2364 | gcpro##1.level = gcpro_level; \ | 2364 | gcpro##1 .level = gcpro_level; \ |
| 2365 | gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ | 2365 | gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ |
| 2366 | gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ | 2366 | gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ |
| 2367 | gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ | 2367 | gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ |
| 2368 | gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ | 2368 | gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ |
| 2369 | gcpro##6.next = &gcpro##5; gcpro##6.var = &var6; gcpro##6.nvars = 1; \ | 2369 | gcpro##6 .next = &gcpro##5; gcpro##6 .var = &var6; gcpro##6 .nvars = 1; \ |
| 2370 | gcpro##6.level = gcpro_level++; \ | 2370 | gcpro##6 .level = gcpro_level++; \ |
| 2371 | gcprolist = &gcpro##6; } | 2371 | gcprolist = &gcpro##6; } |
| 2372 | 2372 | ||
| 2373 | #define UNGCPRO_VAR(gcpro) \ | 2373 | #define UNGCPRO_VAR(gcpro) \ |
| 2374 | ((--gcpro_level != gcpro##1.level) \ | 2374 | ((--gcpro_level != gcpro##1 .level) \ |
| 2375 | ? (abort (), 0) \ | 2375 | ? (abort (), 0) \ |
| 2376 | : ((gcprolist = gcpro##1.next), 0)) | 2376 | : ((gcprolist = gcpro##1 .next), 0)) |
| 2377 | 2377 | ||
| 2378 | #endif /* DEBUG_GCPRO */ | 2378 | #endif /* DEBUG_GCPRO */ |
| 2379 | #endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ | 2379 | #endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ |
diff --git a/src/lread.c b/src/lread.c index 91195a88e63..75d05a2b2f3 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -2215,7 +2215,7 @@ read_escape (Lisp_Object readcharfun, int stringp) | |||
| 2215 | case 'x': | 2215 | case 'x': |
| 2216 | /* A hex escape, as in ANSI C. */ | 2216 | /* A hex escape, as in ANSI C. */ |
| 2217 | { | 2217 | { |
| 2218 | int i = 0; | 2218 | unsigned int i = 0; |
| 2219 | int count = 0; | 2219 | int count = 0; |
| 2220 | while (1) | 2220 | while (1) |
| 2221 | { | 2221 | { |
| @@ -2239,7 +2239,9 @@ read_escape (Lisp_Object readcharfun, int stringp) | |||
| 2239 | UNREAD (c); | 2239 | UNREAD (c); |
| 2240 | break; | 2240 | break; |
| 2241 | } | 2241 | } |
| 2242 | if (MAX_CHAR < i) | 2242 | /* Allow hex escapes as large as ?\xfffffff, because some |
| 2243 | packages use them to denote characters with modifiers. */ | ||
| 2244 | if ((CHAR_META | (CHAR_META - 1)) < i) | ||
| 2243 | error ("Hex character out of range: \\x%x...", i); | 2245 | error ("Hex character out of range: \\x%x...", i); |
| 2244 | count += count < 3; | 2246 | count += count < 3; |
| 2245 | } | 2247 | } |
diff --git a/src/minibuf.c b/src/minibuf.c index 9b905f748bb..0d2bc7234eb 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -1859,9 +1859,10 @@ The arguments STRING and PREDICATE are as in `try-completion', | |||
| 1859 | /* First, look for a non-internal buffer in `res'. */ | 1859 | /* First, look for a non-internal buffer in `res'. */ |
| 1860 | while (CONSP (bufs) && SREF (XCAR (bufs), 0) == ' ') | 1860 | while (CONSP (bufs) && SREF (XCAR (bufs), 0) == ' ') |
| 1861 | bufs = XCDR (bufs); | 1861 | bufs = XCDR (bufs); |
| 1862 | if (NILP (bufs) && EQ (Flength (res), Flength (Vbuffer_alist))) | 1862 | if (NILP (bufs)) |
| 1863 | /* All bufs are internal, so don't trip them out. */ | 1863 | return (EQ (Flength (res), Flength (Vbuffer_alist)) |
| 1864 | return res; | 1864 | /* If all bufs are internal don't strip them out. */ |
| 1865 | ? res : bufs); | ||
| 1865 | res = bufs; | 1866 | res = bufs; |
| 1866 | while (CONSP (XCDR (bufs))) | 1867 | while (CONSP (XCDR (bufs))) |
| 1867 | if (SREF (XCAR (XCDR (bufs)), 0) == ' ') | 1868 | if (SREF (XCAR (XCDR (bufs)), 0) == ' ') |
diff --git a/src/xdisp.c b/src/xdisp.c index ce240922010..0be1c68780d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -7154,7 +7154,6 @@ get_visually_first_element (struct it *it) | |||
| 7154 | } | 7154 | } |
| 7155 | else if (it->bidi_it.charpos == bob | 7155 | else if (it->bidi_it.charpos == bob |
| 7156 | || (!string_p | 7156 | || (!string_p |
| 7157 | /* FIXME: Should support all Unicode line separators. */ | ||
| 7158 | && (FETCH_CHAR (it->bidi_it.bytepos - 1) == '\n' | 7157 | && (FETCH_CHAR (it->bidi_it.bytepos - 1) == '\n' |
| 7159 | || FETCH_CHAR (it->bidi_it.bytepos) == '\n'))) | 7158 | || FETCH_CHAR (it->bidi_it.bytepos) == '\n'))) |
| 7160 | { | 7159 | { |
| @@ -12072,6 +12071,7 @@ hscroll_window_tree (Lisp_Object window) | |||
| 12072 | = (desired_cursor_row->enabled_p | 12071 | = (desired_cursor_row->enabled_p |
| 12073 | ? desired_cursor_row | 12072 | ? desired_cursor_row |
| 12074 | : current_cursor_row); | 12073 | : current_cursor_row); |
| 12074 | int row_r2l_p = cursor_row->reversed_p; | ||
| 12075 | 12075 | ||
| 12076 | text_area_width = window_box_width (w, TEXT_AREA); | 12076 | text_area_width = window_box_width (w, TEXT_AREA); |
| 12077 | 12077 | ||
| @@ -12079,11 +12079,31 @@ hscroll_window_tree (Lisp_Object window) | |||
| 12079 | h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); | 12079 | h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); |
| 12080 | 12080 | ||
| 12081 | if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer)) | 12081 | if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer)) |
| 12082 | && ((XFASTINT (w->hscroll) | 12082 | /* For left-to-right rows, hscroll when cursor is either |
| 12083 | && w->cursor.x <= h_margin) | 12083 | (i) inside the right hscroll margin, or (ii) if it is |
| 12084 | || (cursor_row->enabled_p | 12084 | inside the left margin and the window is already |
| 12085 | && cursor_row->truncated_on_right_p | 12085 | hscrolled. */ |
| 12086 | && (w->cursor.x >= text_area_width - h_margin)))) | 12086 | && ((!row_r2l_p |
| 12087 | && ((XFASTINT (w->hscroll) | ||
| 12088 | && w->cursor.x <= h_margin) | ||
| 12089 | || (cursor_row->enabled_p | ||
| 12090 | && cursor_row->truncated_on_right_p | ||
| 12091 | && (w->cursor.x >= text_area_width - h_margin)))) | ||
| 12092 | /* For right-to-left rows, the logic is similar, | ||
| 12093 | except that rules for scrolling to left and right | ||
| 12094 | are reversed. E.g., if cursor.x <= h_margin, we | ||
| 12095 | need to hscroll "to the right" unconditionally, | ||
| 12096 | and that will scroll the screen to the left so as | ||
| 12097 | to reveal the next portion of the row. */ | ||
| 12098 | || (row_r2l_p | ||
| 12099 | && ((cursor_row->enabled_p | ||
| 12100 | /* FIXME: It is confusing to set the | ||
| 12101 | truncated_on_right_p flag when R2L rows | ||
| 12102 | are actually truncated on the left. */ | ||
| 12103 | && cursor_row->truncated_on_right_p | ||
| 12104 | && w->cursor.x <= h_margin) | ||
| 12105 | || (XFASTINT (w->hscroll) | ||
| 12106 | && (w->cursor.x >= text_area_width - h_margin)))))) | ||
| 12087 | { | 12107 | { |
| 12088 | struct it it; | 12108 | struct it it; |
| 12089 | ptrdiff_t hscroll; | 12109 | ptrdiff_t hscroll; |
| @@ -12118,7 +12138,9 @@ hscroll_window_tree (Lisp_Object window) | |||
| 12118 | ? (text_area_width - 4 * FRAME_COLUMN_WIDTH (it.f)) | 12138 | ? (text_area_width - 4 * FRAME_COLUMN_WIDTH (it.f)) |
| 12119 | : (text_area_width / 2)))) | 12139 | : (text_area_width / 2)))) |
| 12120 | / FRAME_COLUMN_WIDTH (it.f); | 12140 | / FRAME_COLUMN_WIDTH (it.f); |
| 12121 | else if (w->cursor.x >= text_area_width - h_margin) | 12141 | else if ((!row_r2l_p |
| 12142 | && w->cursor.x >= text_area_width - h_margin) | ||
| 12143 | || (row_r2l_p && w->cursor.x <= h_margin)) | ||
| 12122 | { | 12144 | { |
| 12123 | if (hscroll_relative_p) | 12145 | if (hscroll_relative_p) |
| 12124 | wanted_x = text_area_width * (1 - hscroll_step_rel) | 12146 | wanted_x = text_area_width * (1 - hscroll_step_rel) |
| @@ -13858,21 +13880,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 13858 | glyph--; | 13880 | glyph--; |
| 13859 | } | 13881 | } |
| 13860 | } | 13882 | } |
| 13861 | else if (match_with_avoid_cursor | 13883 | else if (match_with_avoid_cursor) |
| 13862 | /* A truncated row may not include PT among its | ||
| 13863 | character positions. Setting the cursor inside the | ||
| 13864 | scroll margin will trigger recalculation of hscroll | ||
| 13865 | in hscroll_window_tree. But if a display string | ||
| 13866 | covers point, defer to the string-handling code | ||
| 13867 | below to figure this out. */ | ||
| 13868 | || (!string_seen | ||
| 13869 | && ((row->truncated_on_left_p && pt_old < bpos_min) | ||
| 13870 | || (row->truncated_on_right_p && pt_old > bpos_max) | ||
| 13871 | /* Zero-width characters produce no glyphs. */ | ||
| 13872 | || (!empty_line_p | ||
| 13873 | && (row->reversed_p | ||
| 13874 | ? glyph_after > glyphs_end | ||
| 13875 | : glyph_after < glyphs_end))))) | ||
| 13876 | { | 13884 | { |
| 13877 | cursor = glyph_after; | 13885 | cursor = glyph_after; |
| 13878 | x = -1; | 13886 | x = -1; |
| @@ -14013,6 +14021,26 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 14013 | && row->continued_p) | 14021 | && row->continued_p) |
| 14014 | return 0; | 14022 | return 0; |
| 14015 | } | 14023 | } |
| 14024 | /* A truncated row may not include PT among its character positions. | ||
| 14025 | Setting the cursor inside the scroll margin will trigger | ||
| 14026 | recalculation of hscroll in hscroll_window_tree. But if a | ||
| 14027 | display string covers point, defer to the string-handling | ||
| 14028 | code below to figure this out. */ | ||
| 14029 | else if (row->truncated_on_left_p && pt_old < bpos_min) | ||
| 14030 | { | ||
| 14031 | cursor = glyph_before; | ||
| 14032 | x = -1; | ||
| 14033 | } | ||
| 14034 | else if ((row->truncated_on_right_p && pt_old > bpos_max) | ||
| 14035 | /* Zero-width characters produce no glyphs. */ | ||
| 14036 | || (!empty_line_p | ||
| 14037 | && (row->reversed_p | ||
| 14038 | ? glyph_after > glyphs_end | ||
| 14039 | : glyph_after < glyphs_end))) | ||
| 14040 | { | ||
| 14041 | cursor = glyph_after; | ||
| 14042 | x = -1; | ||
| 14043 | } | ||
| 14016 | } | 14044 | } |
| 14017 | 14045 | ||
| 14018 | compute_x: | 14046 | compute_x: |