unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#53367: 29.0.50; tramp-debug-buffer-command-completion-p fails in empty buffers
@ 2022-01-19 11:27 Koen van Greevenbroek
  2022-01-19 16:18 ` Michael Albinus
  0 siblings, 1 reply; 3+ messages in thread
From: Koen van Greevenbroek @ 2022-01-19 11:27 UTC (permalink / raw)
  To: 53367

Starting from `emacs -Q`:
1. Evaluate the following:
(require 'tramp)
(setq read-extended-command-predicate
      #'command-completion-default-include-p)
2. Open any empty buffer.
3. Press 'M-x TAB' to trigger a completion.

We get the following message: "read-extended-command-predicate:
tramp-setup-debug-buffer: Args out of range: #<buffer *scratch*>, 1,
10".

This is due to the following code in tramp.el:

;; This function takes action since Emacs 28.1, when
;; `read-extended-command-predicate' is set to
;; `command-completion-default-include-p'.
(defun tramp-debug-buffer-command-completion-p (_symbol buffer)
  "A predicate for Tramp interactive commands.
They are completed by \"M-x TAB\" only in Tramp debug buffers."
  (with-current-buffer buffer
    (string-equal (buffer-substring 1 10) ";; Emacs:")))

In particular, the above function assumes that the current buffer
contains 10 or more characters, which might not always be the case.

In emacs -Q, the error message is "silent" (only shown in the
*Messages*), but the message is somewhat annoyingly shown in the
completion prompt when using e.g. vertico.

Cheers,

Koen






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#53367: 29.0.50; tramp-debug-buffer-command-completion-p fails in empty buffers
  2022-01-19 11:27 bug#53367: 29.0.50; tramp-debug-buffer-command-completion-p fails in empty buffers Koen van Greevenbroek
@ 2022-01-19 16:18 ` Michael Albinus
  2022-01-20 14:26   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Albinus @ 2022-01-19 16:18 UTC (permalink / raw)
  To: Koen van Greevenbroek; +Cc: 53367

Koen van Greevenbroek <koenvg@posteo.net> writes:

Hi Koen,

> Starting from `emacs -Q`:
> 1. Evaluate the following:
> (require 'tramp)
> (setq read-extended-command-predicate
>       #'command-completion-default-include-p)
> 2. Open any empty buffer.
> 3. Press 'M-x TAB' to trigger a completion.
>
> We get the following message: "read-extended-command-predicate:
> tramp-setup-debug-buffer: Args out of range: #<buffer *scratch*>, 1,
> 10".

Thanks for the bug report and the analysis! I've fixed this in master.

> Cheers,
>
> Koen

Best regards, Michael.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#53367: 29.0.50; tramp-debug-buffer-command-completion-p fails in empty buffers
  2022-01-19 16:18 ` Michael Albinus
@ 2022-01-20 14:26   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-20 14:26 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 53367, Koen van Greevenbroek

Michael Albinus <michael.albinus@gmx.de> writes:

> Thanks for the bug report and the analysis! I've fixed this in master.

I can confirm that the change fixed the problem, so I'm therefore
closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-20 14:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 11:27 bug#53367: 29.0.50; tramp-debug-buffer-command-completion-p fails in empty buffers Koen van Greevenbroek
2022-01-19 16:18 ` Michael Albinus
2022-01-20 14:26   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).