diff options
| author | Joakim Verona | 2011-10-10 13:00:51 +0200 |
|---|---|---|
| committer | Joakim Verona | 2011-10-10 13:00:51 +0200 |
| commit | 0b19c7867f5e647fa0269833fe74e0064b415c08 (patch) | |
| tree | 08a0a4112e94675ffde647160706480e78435818 /src | |
| parent | d4077561a90a24d61e295745d70c0effa655a37c (diff) | |
| parent | 0563dae9a9e3a8c2b6de454693c0cc207e67f05d (diff) | |
| download | emacs-0b19c7867f5e647fa0269833fe74e0064b415c08.tar.gz emacs-0b19c7867f5e647fa0269833fe74e0064b415c08.zip | |
upstream
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 66 | ||||
| -rw-r--r-- | src/alloc.c | 42 | ||||
| -rw-r--r-- | src/buffer.c | 4 | ||||
| -rw-r--r-- | src/callint.c | 2 | ||||
| -rw-r--r-- | src/dispnew.c | 4 | ||||
| -rw-r--r-- | src/keyboard.c | 20 | ||||
| -rw-r--r-- | src/xdisp.c | 41 |
7 files changed, 128 insertions, 51 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bc9ffc8f3fe..9cef045c029 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,41 @@ | |||
| 1 | 2011-10-08 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * callint.c (Fcall_interactively): Give a more explicit error for the | ||
| 4 | 'c' case with a non-character input. (Bug#8479) | ||
| 5 | |||
| 6 | 2011-10-08 Eli Zaretskii <eliz@gnu.org> | ||
| 7 | |||
| 8 | * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left | ||
| 9 | lines. | ||
| 10 | (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L | ||
| 11 | lines that are hscrolled on the left. | ||
| 12 | |||
| 13 | * dispnew.c (buffer_posn_from_coords): Account for a possible | ||
| 14 | presence of header-line. (Bug#4426) | ||
| 15 | |||
| 16 | 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 17 | |||
| 18 | * buffer.c (syms_of_buffer) <enable-multibyte-characters>: Don't | ||
| 19 | advertise functionality which we discourage or doesn't work. | ||
| 20 | |||
| 21 | 2011-10-07 Paul Eggert <eggert@cs.ucla.edu> | ||
| 22 | |||
| 23 | * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__ | ||
| 24 | or sizeof. __alignof__ gives the wrong answer on Fedora x86-64 | ||
| 25 | with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int; | ||
| 26 | this makes Emacs dump core during garbage collection on rare | ||
| 27 | occasions. sizeof is obviously inferior to offsetof here, so | ||
| 28 | stick with offsetof. | ||
| 29 | (GC_POINTER_ALIGNMENT): New macro. | ||
| 30 | (mark_memory): Omit 3rd (offset) arg; caller changed. | ||
| 31 | Don't assume EMACS_INT alignment is the same as pointer alignment. | ||
| 32 | |||
| 33 | 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 34 | |||
| 35 | * keyboard.c (read_key_sequence_remapped): New var. | ||
| 36 | (read_key_sequence): Compute remapping in the right buffer. | ||
| 37 | (command_loop_1): Use read_key_sequence's remapping directly. | ||
| 38 | |||
| 1 | 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca> | 39 | 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 40 | ||
| 3 | * dired.c (file_name_completion): Don't expand file name. | 41 | * dired.c (file_name_completion): Don't expand file name. |
| @@ -124,8 +162,8 @@ | |||
| 124 | 162 | ||
| 125 | 2011-09-24 Eli Zaretskii <eliz@gnu.org> | 163 | 2011-09-24 Eli Zaretskii <eliz@gnu.org> |
| 126 | 164 | ||
| 127 | * dispnew.c (syms_of_display) <redisplay-dont-pause>: Default | 165 | * dispnew.c (syms_of_display) <redisplay-dont-pause>: |
| 128 | value is now t. Doc fix. | 166 | Default value is now t. Doc fix. |
| 129 | 167 | ||
| 130 | * indent.c (Fvertical_motion): Compute and apply the overshoot | 168 | * indent.c (Fvertical_motion): Compute and apply the overshoot |
| 131 | logic when moving up, not only when moving down. Fix the | 169 | logic when moving up, not only when moving down. Fix the |
| @@ -141,8 +179,8 @@ | |||
| 141 | 179 | ||
| 142 | * dbusbind.c (Fdbus_register_signal): Add match rule to | 180 | * dbusbind.c (Fdbus_register_signal): Add match rule to |
| 143 | Vdbus_registered_objects_table. (Bug#9581) | 181 | Vdbus_registered_objects_table. (Bug#9581) |
| 144 | (Fdbus_register_method, Vdbus_registered_objects_table): Fix | 182 | (Fdbus_register_method, Vdbus_registered_objects_table): |
| 145 | docstring. | 183 | Fix docstring. |
| 146 | 184 | ||
| 147 | 2011-09-24 Jim Meyering <meyering@redhat.com> | 185 | 2011-09-24 Jim Meyering <meyering@redhat.com> |
| 148 | 186 | ||
| @@ -622,15 +660,15 @@ | |||
| 622 | * term.c (tty_append_glyph): New function. | 660 | * term.c (tty_append_glyph): New function. |
| 623 | (produce_stretch_glyph): Static function and its prototype deleted. | 661 | (produce_stretch_glyph): Static function and its prototype deleted. |
| 624 | 662 | ||
| 625 | * dispextern.h (produce_stretch_glyph, tty_append_glyph): Add | 663 | * dispextern.h (produce_stretch_glyph, tty_append_glyph): |
| 626 | prototypes. | 664 | Add prototypes. |
| 627 | 665 | ||
| 628 | 2011-08-29 Paul Eggert <eggert@cs.ucla.edu> | 666 | 2011-08-29 Paul Eggert <eggert@cs.ucla.edu> |
| 629 | 667 | ||
| 630 | * image.c (parse_image_spec): Check for nonnegative, not for positive, | 668 | * image.c (parse_image_spec): Check for nonnegative, not for positive, |
| 631 | when checking :margin (Bug#9390). | 669 | when checking :margin (Bug#9390). |
| 632 | (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR): | 670 | (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR): |
| 633 | Renamed from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, | 671 | Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, |
| 634 | so that the name doesn't mislead. All uses changed. | 672 | so that the name doesn't mislead. All uses changed. |
| 635 | 673 | ||
| 636 | 2011-08-28 Johan Bockgård <bojohan@gnu.org> | 674 | 2011-08-28 Johan Bockgård <bojohan@gnu.org> |
| @@ -832,8 +870,8 @@ | |||
| 832 | (read_char_minibuf_menu_prompt, follow_key, read_key_sequence): | 870 | (read_char_minibuf_menu_prompt, follow_key, read_key_sequence): |
| 833 | Use ptrdiff_t, not int, to count maps. | 871 | Use ptrdiff_t, not int, to count maps. |
| 834 | (read_char_minibuf_menu_prompt): Check for overflow in size | 872 | (read_char_minibuf_menu_prompt): Check for overflow in size |
| 835 | calculations. Don't update size until allocation succeeds. Redo | 873 | calculations. Don't update size until allocation succeeds. |
| 836 | calculations to avoid overflow. | 874 | Redo calculations to avoid overflow. |
| 837 | * keyboard.h: Change prototypes to match the above. | 875 | * keyboard.h: Change prototypes to match the above. |
| 838 | 876 | ||
| 839 | * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int, | 877 | * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int, |
| @@ -1002,7 +1040,7 @@ | |||
| 1002 | * indent.c (MULTIBYTE_BYTES_WIDTH): | 1040 | * indent.c (MULTIBYTE_BYTES_WIDTH): |
| 1003 | Use sanitize_char_width to avoid undefined and/or bad behavior | 1041 | Use sanitize_char_width to avoid undefined and/or bad behavior |
| 1004 | with outlandish widths. | 1042 | with outlandish widths. |
| 1005 | * character.h (sanitize_tab_width): Renamed from sanitize_width, | 1043 | * character.h (sanitize_tab_width): Rename from sanitize_width, |
| 1006 | now that we have two such functions. All uses changed. | 1044 | now that we have two such functions. All uses changed. |
| 1007 | (sanitize_char_width): New inline function. | 1045 | (sanitize_char_width): New inline function. |
| 1008 | 1046 | ||
| @@ -1068,8 +1106,8 @@ | |||
| 1068 | (png_load, gif_load, svg_load_image): | 1106 | (png_load, gif_load, svg_load_image): |
| 1069 | Prefer int to unsigned where either will do. | 1107 | Prefer int to unsigned where either will do. |
| 1070 | (tiff_handler): New function, combining the cores of the | 1108 | (tiff_handler): New function, combining the cores of the |
| 1071 | old tiff_error_handler and tiff_warning_handler. This | 1109 | old tiff_error_handler and tiff_warning_handler. |
| 1072 | function is rewritten to use vsnprintf and thereby avoid | 1110 | This function is rewritten to use vsnprintf and thereby avoid |
| 1073 | stack buffer overflows. It uses only the features of vsnprintf | 1111 | stack buffer overflows. It uses only the features of vsnprintf |
| 1074 | that are common to both POSIX and native Microsoft. | 1112 | that are common to both POSIX and native Microsoft. |
| 1075 | (tiff_error_handler, tiff_warning_handler): Use it. | 1113 | (tiff_error_handler, tiff_warning_handler): Use it. |
| @@ -1098,8 +1136,8 @@ | |||
| 1098 | `(space ...)', and specifies display in the text area, return 2 | 1136 | `(space ...)', and specifies display in the text area, return 2 |
| 1099 | rather than 1. | 1137 | rather than 1. |
| 1100 | (try_cursor_movement): Check for the need to scroll more | 1138 | (try_cursor_movement): Check for the need to scroll more |
| 1101 | accurately, and prefer exact match for point under bidi. Don't | 1139 | accurately, and prefer exact match for point under bidi. |
| 1102 | advance `row' beyond the last row of the window. | 1140 | Don't advance `row' beyond the last row of the window. |
| 1103 | 1141 | ||
| 1104 | * dispextern.h (struct bidi_it): Rename the disp_prop_p member | 1142 | * dispextern.h (struct bidi_it): Rename the disp_prop_p member |
| 1105 | into disp_prop; all users changed. | 1143 | into disp_prop; all users changed. |
diff --git a/src/alloc.c b/src/alloc.c index ead5c8a8ca4..09ef4b085df 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -393,7 +393,7 @@ static int live_symbol_p (struct mem_node *, void *); | |||
| 393 | static int live_float_p (struct mem_node *, void *); | 393 | static int live_float_p (struct mem_node *, void *); |
| 394 | static int live_misc_p (struct mem_node *, void *); | 394 | static int live_misc_p (struct mem_node *, void *); |
| 395 | static void mark_maybe_object (Lisp_Object); | 395 | static void mark_maybe_object (Lisp_Object); |
| 396 | static void mark_memory (void *, void *, int); | 396 | static void mark_memory (void *, void *); |
| 397 | static void mem_init (void); | 397 | static void mem_init (void); |
| 398 | static struct mem_node *mem_insert (void *, void *, enum mem_type); | 398 | static struct mem_node *mem_insert (void *, void *, enum mem_type); |
| 399 | static void mem_insert_fixup (struct mem_node *); | 399 | static void mem_insert_fixup (struct mem_node *); |
| @@ -4235,14 +4235,25 @@ mark_maybe_pointer (void *p) | |||
| 4235 | } | 4235 | } |
| 4236 | 4236 | ||
| 4237 | 4237 | ||
| 4238 | /* Alignment of Lisp_Object and pointer values. Use offsetof, as it | ||
| 4239 | sometimes returns a smaller alignment than GCC's __alignof__ and | ||
| 4240 | mark_memory might miss objects if __alignof__ were used. For | ||
| 4241 | example, on x86 with WIDE_EMACS_INT, __alignof__ (Lisp_Object) is 8 | ||
| 4242 | but GC_LISP_OBJECT_ALIGNMENT should be 4. */ | ||
| 4243 | #ifndef GC_LISP_OBJECT_ALIGNMENT | ||
| 4244 | # define GC_LISP_OBJECT_ALIGNMENT offsetof (struct {char a; Lisp_Object b;}, b) | ||
| 4245 | #endif | ||
| 4246 | #define GC_POINTER_ALIGNMENT offsetof (struct {char a; void *b;}, b) | ||
| 4247 | |||
| 4238 | /* Mark Lisp objects referenced from the address range START+OFFSET..END | 4248 | /* Mark Lisp objects referenced from the address range START+OFFSET..END |
| 4239 | or END+OFFSET..START. */ | 4249 | or END+OFFSET..START. */ |
| 4240 | 4250 | ||
| 4241 | static void | 4251 | static void |
| 4242 | mark_memory (void *start, void *end, int offset) | 4252 | mark_memory (void *start, void *end) |
| 4243 | { | 4253 | { |
| 4244 | Lisp_Object *p; | 4254 | Lisp_Object *p; |
| 4245 | void **pp; | 4255 | void **pp; |
| 4256 | int i; | ||
| 4246 | 4257 | ||
| 4247 | #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES | 4258 | #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES |
| 4248 | nzombies = 0; | 4259 | nzombies = 0; |
| @@ -4258,8 +4269,9 @@ mark_memory (void *start, void *end, int offset) | |||
| 4258 | } | 4269 | } |
| 4259 | 4270 | ||
| 4260 | /* Mark Lisp_Objects. */ | 4271 | /* Mark Lisp_Objects. */ |
| 4261 | for (p = (Lisp_Object *) ((char *) start + offset); (void *) p < end; ++p) | 4272 | for (p = start; (void *) p < end; p++) |
| 4262 | mark_maybe_object (*p); | 4273 | for (i = 0; i < sizeof *p; i += GC_LISP_OBJECT_ALIGNMENT) |
| 4274 | mark_maybe_object (*(Lisp_Object *) ((char *) p + i)); | ||
| 4263 | 4275 | ||
| 4264 | /* Mark Lisp data pointed to. This is necessary because, in some | 4276 | /* Mark Lisp data pointed to. This is necessary because, in some |
| 4265 | situations, the C compiler optimizes Lisp objects away, so that | 4277 | situations, the C compiler optimizes Lisp objects away, so that |
| @@ -4279,8 +4291,9 @@ mark_memory (void *start, void *end, int offset) | |||
| 4279 | away. The only reference to the life string is through the | 4291 | away. The only reference to the life string is through the |
| 4280 | pointer `s'. */ | 4292 | pointer `s'. */ |
| 4281 | 4293 | ||
| 4282 | for (pp = (void **) ((char *) start + offset); (void *) pp < end; ++pp) | 4294 | for (pp = start; (void *) pp < end; pp++) |
| 4283 | mark_maybe_pointer (*pp); | 4295 | for (i = 0; i < sizeof *pp; i += GC_POINTER_ALIGNMENT) |
| 4296 | mark_maybe_pointer (*(void **) ((char *) pp + i)); | ||
| 4284 | } | 4297 | } |
| 4285 | 4298 | ||
| 4286 | /* setjmp will work with GCC unless NON_SAVING_SETJMP is defined in | 4299 | /* setjmp will work with GCC unless NON_SAVING_SETJMP is defined in |
| @@ -4454,15 +4467,11 @@ dump_zombies (void) | |||
| 4454 | pass starting at the start of the stack + 2. Likewise, if the | 4467 | pass starting at the start of the stack + 2. Likewise, if the |
| 4455 | minimal alignment of Lisp_Objects on the stack is 1, four passes | 4468 | minimal alignment of Lisp_Objects on the stack is 1, four passes |
| 4456 | would be necessary, each one starting with one byte more offset | 4469 | would be necessary, each one starting with one byte more offset |
| 4457 | from the stack start. | 4470 | from the stack start. */ |
| 4458 | |||
| 4459 | The current code assumes by default that Lisp_Objects are aligned | ||
| 4460 | equally on the stack. */ | ||
| 4461 | 4471 | ||
| 4462 | static void | 4472 | static void |
| 4463 | mark_stack (void) | 4473 | mark_stack (void) |
| 4464 | { | 4474 | { |
| 4465 | int i; | ||
| 4466 | void *end; | 4475 | void *end; |
| 4467 | 4476 | ||
| 4468 | #ifdef HAVE___BUILTIN_UNWIND_INIT | 4477 | #ifdef HAVE___BUILTIN_UNWIND_INIT |
| @@ -4520,15 +4529,8 @@ mark_stack (void) | |||
| 4520 | /* This assumes that the stack is a contiguous region in memory. If | 4529 | /* This assumes that the stack is a contiguous region in memory. If |
| 4521 | that's not the case, something has to be done here to iterate | 4530 | that's not the case, something has to be done here to iterate |
| 4522 | over the stack segments. */ | 4531 | over the stack segments. */ |
| 4523 | #ifndef GC_LISP_OBJECT_ALIGNMENT | 4532 | mark_memory (stack_base, end); |
| 4524 | #ifdef __GNUC__ | 4533 | |
| 4525 | #define GC_LISP_OBJECT_ALIGNMENT __alignof__ (Lisp_Object) | ||
| 4526 | #else | ||
| 4527 | #define GC_LISP_OBJECT_ALIGNMENT sizeof (Lisp_Object) | ||
| 4528 | #endif | ||
| 4529 | #endif | ||
| 4530 | for (i = 0; i < sizeof (Lisp_Object); i += GC_LISP_OBJECT_ALIGNMENT) | ||
| 4531 | mark_memory (stack_base, end, i); | ||
| 4532 | /* Allow for marking a secondary stack, like the register stack on the | 4534 | /* Allow for marking a secondary stack, like the register stack on the |
| 4533 | ia64. */ | 4535 | ia64. */ |
| 4534 | #ifdef GC_MARK_SECONDARY_STACK | 4536 | #ifdef GC_MARK_SECONDARY_STACK |
diff --git a/src/buffer.c b/src/buffer.c index f38c9a739a6..fdf006a41eb 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5448,9 +5448,7 @@ file I/O and the behavior of various editing commands. | |||
| 5448 | 5448 | ||
| 5449 | This variable is buffer-local but you cannot set it directly; | 5449 | This variable is buffer-local but you cannot set it directly; |
| 5450 | use the function `set-buffer-multibyte' to change a buffer's representation. | 5450 | use the function `set-buffer-multibyte' to change a buffer's representation. |
| 5451 | Changing its default value with `setq-default' is supported. | 5451 | See also Info node `(elisp)Text Representations'. */); |
| 5452 | See also variable `default-enable-multibyte-characters' and Info node | ||
| 5453 | `(elisp)Text Representations'. */); | ||
| 5454 | XSYMBOL (intern_c_string ("enable-multibyte-characters"))->constant = 1; | 5452 | XSYMBOL (intern_c_string ("enable-multibyte-characters"))->constant = 1; |
| 5455 | 5453 | ||
| 5456 | DEFVAR_PER_BUFFER ("buffer-file-coding-system", | 5454 | DEFVAR_PER_BUFFER ("buffer-file-coding-system", |
diff --git a/src/callint.c b/src/callint.c index 5cf99495671..61ab4a3963e 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 ccb24c8ceea..879ff88ff14 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5274,6 +5274,10 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p | |||
| 5274 | CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); | 5274 | CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); |
| 5275 | BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); | 5275 | BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); |
| 5276 | start_display (&it, w, startp); | 5276 | start_display (&it, w, startp); |
| 5277 | /* start_display takes into account the header-line row, but IT's | ||
| 5278 | vpos still counts from the glyph row that includes the window's | ||
| 5279 | start position. Adjust for a possible header-line row. */ | ||
| 5280 | it.vpos += WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; | ||
| 5277 | 5281 | ||
| 5278 | x0 = *x; | 5282 | x0 = *x; |
| 5279 | 5283 | ||
diff --git a/src/keyboard.c b/src/keyboard.c index b266da07a42..a21008b9502 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -252,6 +252,7 @@ static Lisp_Object Qtimer_event_handler; | |||
| 252 | /* read_key_sequence stores here the command definition of the | 252 | /* read_key_sequence stores here the command definition of the |
| 253 | key sequence that it reads. */ | 253 | key sequence that it reads. */ |
| 254 | static Lisp_Object read_key_sequence_cmd; | 254 | static Lisp_Object read_key_sequence_cmd; |
| 255 | static Lisp_Object read_key_sequence_remapped; | ||
| 255 | 256 | ||
| 256 | static Lisp_Object Qinput_method_function; | 257 | static Lisp_Object Qinput_method_function; |
| 257 | 258 | ||
| @@ -1517,14 +1518,10 @@ command_loop_1 (void) | |||
| 1517 | reset it before we execute the command. */ | 1518 | reset it before we execute the command. */ |
| 1518 | Vdeactivate_mark = Qnil; | 1519 | Vdeactivate_mark = Qnil; |
| 1519 | 1520 | ||
| 1520 | /* Remap command through active keymaps */ | 1521 | /* Remap command through active keymaps. */ |
| 1521 | Vthis_original_command = cmd; | 1522 | Vthis_original_command = cmd; |
| 1522 | if (SYMBOLP (cmd)) | 1523 | if (!NILP (read_key_sequence_remapped)) |
| 1523 | { | 1524 | cmd = read_key_sequence_remapped; |
| 1524 | Lisp_Object cmd1; | ||
| 1525 | if (cmd1 = Fcommand_remapping (cmd, Qnil, Qnil), !NILP (cmd1)) | ||
| 1526 | cmd = cmd1; | ||
| 1527 | } | ||
| 1528 | 1525 | ||
| 1529 | /* Execute the command. */ | 1526 | /* Execute the command. */ |
| 1530 | 1527 | ||
| @@ -10015,6 +10012,13 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 10015 | read_key_sequence_cmd = (first_binding < nmaps | 10012 | read_key_sequence_cmd = (first_binding < nmaps |
| 10016 | ? defs[first_binding] | 10013 | ? defs[first_binding] |
| 10017 | : Qnil); | 10014 | : Qnil); |
| 10015 | read_key_sequence_remapped | ||
| 10016 | /* Remap command through active keymaps. | ||
| 10017 | Do the remapping here, before the unbind_to so it uses the keymaps | ||
| 10018 | of the appropriate buffer. */ | ||
| 10019 | = SYMBOLP (read_key_sequence_cmd) | ||
| 10020 | ? Fcommand_remapping (read_key_sequence_cmd, Qnil, Qnil) | ||
| 10021 | : Qnil; | ||
| 10018 | 10022 | ||
| 10019 | unread_switch_frame = delayed_switch_frame; | 10023 | unread_switch_frame = delayed_switch_frame; |
| 10020 | unbind_to (count, Qnil); | 10024 | unbind_to (count, Qnil); |
| @@ -11683,6 +11687,8 @@ syms_of_keyboard (void) | |||
| 11683 | 11687 | ||
| 11684 | read_key_sequence_cmd = Qnil; | 11688 | read_key_sequence_cmd = Qnil; |
| 11685 | staticpro (&read_key_sequence_cmd); | 11689 | staticpro (&read_key_sequence_cmd); |
| 11690 | read_key_sequence_remapped = Qnil; | ||
| 11691 | staticpro (&read_key_sequence_remapped); | ||
| 11686 | 11692 | ||
| 11687 | menu_bar_one_keymap_changed_items = Qnil; | 11693 | menu_bar_one_keymap_changed_items = Qnil; |
| 11688 | staticpro (&menu_bar_one_keymap_changed_items); | 11694 | staticpro (&menu_bar_one_keymap_changed_items); |
diff --git a/src/xdisp.c b/src/xdisp.c index 9e26360394c..9ec7463c555 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12119,6 +12119,7 @@ hscroll_window_tree (Lisp_Object window) | |||
| 12119 | = (desired_cursor_row->enabled_p | 12119 | = (desired_cursor_row->enabled_p |
| 12120 | ? desired_cursor_row | 12120 | ? desired_cursor_row |
| 12121 | : current_cursor_row); | 12121 | : current_cursor_row); |
| 12122 | int row_r2l_p = cursor_row->reversed_p; | ||
| 12122 | 12123 | ||
| 12123 | text_area_width = window_box_width (w, TEXT_AREA); | 12124 | text_area_width = window_box_width (w, TEXT_AREA); |
| 12124 | 12125 | ||
| @@ -12126,11 +12127,31 @@ hscroll_window_tree (Lisp_Object window) | |||
| 12126 | h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); | 12127 | h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); |
| 12127 | 12128 | ||
| 12128 | if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer)) | 12129 | if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer)) |
| 12129 | && ((XFASTINT (w->hscroll) | 12130 | /* For left-to-right rows, hscroll when cursor is either |
| 12130 | && w->cursor.x <= h_margin) | 12131 | (i) inside the right hscroll margin, or (ii) if it is |
| 12131 | || (cursor_row->enabled_p | 12132 | inside the left margin and the window is already |
| 12132 | && cursor_row->truncated_on_right_p | 12133 | hscrolled. */ |
| 12133 | && (w->cursor.x >= text_area_width - h_margin)))) | 12134 | && ((!row_r2l_p |
| 12135 | && ((XFASTINT (w->hscroll) | ||
| 12136 | && w->cursor.x <= h_margin) | ||
| 12137 | || (cursor_row->enabled_p | ||
| 12138 | && cursor_row->truncated_on_right_p | ||
| 12139 | && (w->cursor.x >= text_area_width - h_margin)))) | ||
| 12140 | /* For right-to-left rows, the logic is similar, | ||
| 12141 | except that rules for scrolling to left and right | ||
| 12142 | are reversed. E.g., if cursor.x <= h_margin, we | ||
| 12143 | need to hscroll "to the right" unconditionally, | ||
| 12144 | and that will scroll the screen to the left so as | ||
| 12145 | to reveal the next portion of the row. */ | ||
| 12146 | || (row_r2l_p | ||
| 12147 | && ((cursor_row->enabled_p | ||
| 12148 | /* FIXME: It is confusing to set the | ||
| 12149 | truncated_on_right_p flag when R2L rows | ||
| 12150 | are actually truncated on the left. */ | ||
| 12151 | && cursor_row->truncated_on_right_p | ||
| 12152 | && w->cursor.x <= h_margin) | ||
| 12153 | || (XFASTINT (w->hscroll) | ||
| 12154 | && (w->cursor.x >= text_area_width - h_margin)))))) | ||
| 12134 | { | 12155 | { |
| 12135 | struct it it; | 12156 | struct it it; |
| 12136 | int hscroll; | 12157 | int hscroll; |
| @@ -12165,7 +12186,9 @@ hscroll_window_tree (Lisp_Object window) | |||
| 12165 | ? (text_area_width - 4 * FRAME_COLUMN_WIDTH (it.f)) | 12186 | ? (text_area_width - 4 * FRAME_COLUMN_WIDTH (it.f)) |
| 12166 | : (text_area_width / 2)))) | 12187 | : (text_area_width / 2)))) |
| 12167 | / FRAME_COLUMN_WIDTH (it.f); | 12188 | / FRAME_COLUMN_WIDTH (it.f); |
| 12168 | else if (w->cursor.x >= text_area_width - h_margin) | 12189 | else if ((!row_r2l_p |
| 12190 | && w->cursor.x >= text_area_width - h_margin) | ||
| 12191 | || (row_r2l_p && w->cursor.x <= h_margin)) | ||
| 12169 | { | 12192 | { |
| 12170 | if (hscroll_relative_p) | 12193 | if (hscroll_relative_p) |
| 12171 | wanted_x = text_area_width * (1 - hscroll_step_rel) | 12194 | wanted_x = text_area_width * (1 - hscroll_step_rel) |
| @@ -13928,7 +13951,11 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 13928 | ? glyph_after > glyphs_end | 13951 | ? glyph_after > glyphs_end |
| 13929 | : glyph_after < glyphs_end))))) | 13952 | : glyph_after < glyphs_end))))) |
| 13930 | { | 13953 | { |
| 13931 | cursor = glyph_after; | 13954 | if (!match_with_avoid_cursor |
| 13955 | && row->truncated_on_left_p && pt_old < bpos_min) | ||
| 13956 | cursor = glyph_before; | ||
| 13957 | else | ||
| 13958 | cursor = glyph_after; | ||
| 13932 | x = -1; | 13959 | x = -1; |
| 13933 | } | 13960 | } |
| 13934 | else if (string_seen) | 13961 | else if (string_seen) |