GNU bug report logs - #53367
29.0.50; tramp-debug-buffer-command-completion-p fails in empty buffers

Previous Next

Package: emacs;

Reported by: Koen van Greevenbroek <koenvg <at> posteo.net>

Date: Wed, 19 Jan 2022 14:29:03 UTC

Severity: normal

Merged with 53405, 53593

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Koen van Greevenbroek <koenvg <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; tramp-debug-buffer-command-completion-p fails in empty
 buffers
Date: Wed, 19 Jan 2022 11:27:41 +0000
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.