aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2023-06-05 15:57:05 +0300
committerEli Zaretskii2023-06-05 15:57:05 +0300
commit9a28600a97351bccadb3473b0a7829b09b1bc413 (patch)
tree098074585da73c0d2e0effd0c121be3a56a079b7 /src
parent26ee0ce6f94cdec2b30d9abc9cbd0c7f468a08c1 (diff)
downloademacs-9a28600a97351bccadb3473b0a7829b09b1bc413.tar.gz
emacs-9a28600a97351bccadb3473b0a7829b09b1bc413.zip
Fix bug with point-adjustment after M-x COMMAND
* src/keyboard.c (command_loop_1): Preserve 'last_point_position' across command execution, to avoid bugs in 'adjust_point_for_property' if the command invokes 'recursive-edit'. Reported by Mats Lidell <matsl@gnu.org>.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 14c55666768..a1cddf9d145 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1436,6 +1436,7 @@ command_loop_1 (void)
1436 prev_buffer = current_buffer; 1436 prev_buffer = current_buffer;
1437 prev_modiff = MODIFF; 1437 prev_modiff = MODIFF;
1438 last_point_position = PT; 1438 last_point_position = PT;
1439 ptrdiff_t last_pt = PT;
1439 1440
1440 /* By default, we adjust point to a boundary of a region that 1441 /* By default, we adjust point to a boundary of a region that
1441 has such a property that should be treated intangible 1442 has such a property that should be treated intangible
@@ -1513,6 +1514,9 @@ command_loop_1 (void)
1513 unbind_to (scount, Qnil); 1514 unbind_to (scount, Qnil);
1514#endif 1515#endif
1515 } 1516 }
1517 /* Restore last PT position value, possibly clobbered by
1518 recursive-edit invoked by the command we just executed. */
1519 last_point_position = last_pt;
1516 kset_last_prefix_arg (current_kboard, Vcurrent_prefix_arg); 1520 kset_last_prefix_arg (current_kboard, Vcurrent_prefix_arg);
1517 1521
1518 safe_run_hooks_maybe_narrowed (Qpost_command_hook, 1522 safe_run_hooks_maybe_narrowed (Qpost_command_hook,