diff options
| author | Stefan Kangas | 2023-02-19 11:38:09 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2023-02-19 11:38:09 +0100 |
| commit | 34f44ae07e0a3ba7ae43d79ab71b03795cb4acf5 (patch) | |
| tree | 4e0cb51e380efd9c6e91e2f6557604e1a554ea79 /src | |
| parent | 750bc57cbb8d081566e671e8fc3e27a82588c197 (diff) | |
| parent | 871cf33a450a34fcace7fe7c5448fe3043697005 (diff) | |
| download | emacs-34f44ae07e0a3ba7ae43d79ab71b03795cb4acf5.tar.gz emacs-34f44ae07e0a3ba7ae43d79ab71b03795cb4acf5.zip | |
Merge from origin/emacs-29
871cf33a450 ; * admin/make-tarball.txt: Minor copyedit.
4faebba2fed Fix invocation of File->Close from the menu bar
cd05fca5f78 ; Improve documentation of 'native-comp-enable-subr-tramp...
c61a30e1601 Update thumbnail buffer's header more
4c49452cdef (treesit-query-validate): Fix reusing the output buffer
d560dc5044a (rust-ts-mode--font-lock-settings): Highlight closure par...
c15bc91e1bf * Fix `native-comp-enable-subr-trampolines' semantic
774051873d5 Fix documentation of 'just-one-space' and 'delete-horizon...
7337f072500 ; Remove NEWS entry about deleted variable.
fb5299ba099 ; Fix wording of last change.
9f508cef85d Fix 'display-buffer-use-least-recent-window'
5190ea6259a Fix point moving when calling python-shell-send-region
6c0d8210175 (project-try-vc): Remove unused defvar/require
4f9862e4356 ; Fix typo
a638c79bc5c Delete redundant question from Gnus FAQ
4a90d67eb68 Slightly improve hashcash documentation
6ea3c105ab1 Fix cursor motion when there's line-prefix and display st...
e985466556c Fix comment in treesit_record_change (bug#61369)
1e5cebc88bb Spell out RPN abbreviation in Calc manual intro
# Conflicts:
# etc/NEWS
# lisp/window.el
Diffstat (limited to 'src')
| -rw-r--r-- | src/treesit.c | 10 | ||||
| -rw-r--r-- | src/window.c | 33 | ||||
| -rw-r--r-- | src/xdisp.c | 4 |
3 files changed, 31 insertions, 16 deletions
diff --git a/src/treesit.c b/src/treesit.c index e1d6f1ef79f..ef0f2407840 100644 --- a/src/treesit.c +++ b/src/treesit.c | |||
| @@ -797,12 +797,10 @@ treesit_record_change (ptrdiff_t start_byte, ptrdiff_t old_end_byte, | |||
| 797 | max (visible_beg, old_end_byte)) | 797 | max (visible_beg, old_end_byte)) |
| 798 | - visible_beg); | 798 | - visible_beg); |
| 799 | /* We don't clip new_end_offset under visible_end, because | 799 | /* We don't clip new_end_offset under visible_end, because |
| 800 | inserting in narrowed region always extends the visible | 800 | otherwise we would miss updating the clipped part. Plus, |
| 801 | region. If we clip new_end_offset here, and re-add the | 801 | when inserting in narrowed region, the narrowed region |
| 802 | clipped "tail" in treesit_sync_visible_region later, | 802 | will grow to accommodate the new text, so this is the |
| 803 | while it is technically equivalent, tree-sitter's | 803 | correct behavior. (Bug#61369). */ |
| 804 | incremental parsing algorithm doesn't seem to like it | ||
| 805 | (bug#61369). */ | ||
| 806 | ptrdiff_t new_end_offset = (max (visible_beg, new_end_byte) | 804 | ptrdiff_t new_end_offset = (max (visible_beg, new_end_byte) |
| 807 | - visible_beg); | 805 | - visible_beg); |
| 808 | eassert (start_offset <= old_end_offset); | 806 | eassert (start_offset <= old_end_offset); |
diff --git a/src/window.c b/src/window.c index 9334f922f89..bf89261e79c 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -762,10 +762,15 @@ future use. */) | |||
| 762 | 762 | ||
| 763 | DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, | 763 | DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, |
| 764 | doc: /* Return the use time of window WINDOW. | 764 | doc: /* Return the use time of window WINDOW. |
| 765 | WINDOW must be a live window and defaults to the selected one. | 765 | WINDOW must specify a live window and defaults to the selected one. |
| 766 | The window with the highest use time is the most recently selected | 766 | |
| 767 | one. The window with the lowest use time is the least recently | 767 | The window with the highest use time is usually the one most recently |
| 768 | selected one. */) | 768 | selected by calling `select-window' with NORECORD nil. The window with |
| 769 | the lowest use time is usually the least recently selected one chosen in | ||
| 770 | such a way. | ||
| 771 | |||
| 772 | Note that the use time of a window can be also changed by calling | ||
| 773 | `window-bump-use-time' for that window. */) | ||
| 769 | (Lisp_Object window) | 774 | (Lisp_Object window) |
| 770 | { | 775 | { |
| 771 | return make_fixnum (decode_live_window (window)->use_time); | 776 | return make_fixnum (decode_live_window (window)->use_time); |
| @@ -773,15 +778,27 @@ selected one. */) | |||
| 773 | 778 | ||
| 774 | DEFUN ("window-bump-use-time", Fwindow_bump_use_time, | 779 | DEFUN ("window-bump-use-time", Fwindow_bump_use_time, |
| 775 | Swindow_bump_use_time, 0, 1, 0, | 780 | Swindow_bump_use_time, 0, 1, 0, |
| 776 | doc: /* Mark WINDOW as having been most recently used. | 781 | doc: /* Mark WINDOW as second most recently used. |
| 777 | WINDOW must be a live window and defaults to the selected one. */) | 782 | WINDOW must specify a live window. |
| 783 | |||
| 784 | If WINDOW is not selected and the selected window has the highest use | ||
| 785 | time of all windows, set the use time of WINDOW to that of the selected | ||
| 786 | window, increase the use time of the selected window by one and return | ||
| 787 | the new use time of WINDOW. Otherwise, do nothing and return nil. */) | ||
| 778 | (Lisp_Object window) | 788 | (Lisp_Object window) |
| 779 | { | 789 | { |
| 780 | struct window *w = decode_live_window (window); | 790 | struct window *w = decode_live_window (window); |
| 791 | struct window *sw = XWINDOW (selected_window); | ||
| 781 | 792 | ||
| 782 | w->use_time = ++window_select_count; | 793 | if (w != sw && sw->use_time == window_select_count) |
| 794 | { | ||
| 795 | w->use_time = window_select_count; | ||
| 796 | sw->use_time = ++window_select_count; | ||
| 783 | 797 | ||
| 784 | return Qnil; | 798 | return make_fixnum (w->use_time); |
| 799 | } | ||
| 800 | else | ||
| 801 | return Qnil; | ||
| 785 | } | 802 | } |
| 786 | 803 | ||
| 787 | DEFUN ("window-pixel-width", Fwindow_pixel_width, Swindow_pixel_width, 0, 1, 0, | 804 | DEFUN ("window-pixel-width", Fwindow_pixel_width, Swindow_pixel_width, 0, 1, 0, |
diff --git a/src/xdisp.c b/src/xdisp.c index be6556a288a..518014dc11a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -9609,8 +9609,8 @@ move_it_in_display_line_to (struct it *it, | |||
| 9609 | else | 9609 | else |
| 9610 | line_number_pending = true; | 9610 | line_number_pending = true; |
| 9611 | } | 9611 | } |
| 9612 | /* If there's a line-/wrap-prefix, handle it. */ | 9612 | /* If there's a line-/wrap-prefix, handle it, if we didn't already. */ |
| 9613 | if (it->method == GET_FROM_BUFFER) | 9613 | if (it->area == TEXT_AREA && !it->string_from_prefix_prop_p) |
| 9614 | handle_line_prefix (it); | 9614 | handle_line_prefix (it); |
| 9615 | } | 9615 | } |
| 9616 | 9616 | ||