GNU bug report logs -
#53367
29.0.50; tramp-debug-buffer-command-completion-p fails in empty buffers
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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
This bug report was last modified 3 years and 113 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.