Subject: bug#45052: 27.1; GDB completion moves point

From: "Philip K." <[email-masked]>
Date: Sat, 05 Dec 2020 15:01:28 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: "Philip K." <[email-masked]>
>> Date: Sat, 05 Dec 2020 13:10:46 +0100
>> 
>> 1. M-x gdb
>> 2. Press enter a few times, so that the buffer can't fit into the window
>> 3. Ensure that the point is in the last few lines (C-l)
>> 4. Enter "l" and then press M-tab.
>> 
>> The point should now have been moved. This is not expected, and not seen
>> any other mode.
>
> Does the patch below give good results, and doesn't produce any
> adverse effects in other use cases?

It seems to work, and I can't see any unintended side-effects!

> diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
> index 9030056..2b9a9c1 100644
> --- a/lisp/progmodes/gdb-mi.el
> +++ b/lisp/progmodes/gdb-mi.el
> @@ -3010,7 +3010,7 @@ def-gdb-auto-update-handler
>         (,custom-defun)
>         (gdb-update-buffer-name)
>         ,@(when (not nopreserve)
> -          '((set-window-start window start)
> +          '((set-window-start window start t)
>              (set-window-point window p))))))
>  
>  (defmacro def-gdb-trigger-and-handler (trigger-name gdb-command
>

-- 
	Philip K.