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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53367 in the body.
You can then email your comments to 53367 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#53367; Package emacs. (Wed, 19 Jan 2022 14:29:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Koen van Greevenbroek <koenvg <at> posteo.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 19 Jan 2022 14:29:03 GMT) Full text and rfc822 format available.

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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53367; Package emacs. (Wed, 19 Jan 2022 16:19:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Koen van Greevenbroek <koenvg <at> posteo.net>
Cc: 53367 <at> debbugs.gnu.org
Subject: Re: bug#53367: 29.0.50; tramp-debug-buffer-command-completion-p
 fails in empty buffers
Date: Wed, 19 Jan 2022 17:18:20 +0100
Koen van Greevenbroek <koenvg <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53367; Package emacs. (Thu, 20 Jan 2022 14:27:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 53367 <at> debbugs.gnu.org, Koen van Greevenbroek <koenvg <at> posteo.net>
Subject: Re: bug#53367: 29.0.50; tramp-debug-buffer-command-completion-p
 fails in empty buffers
Date: Thu, 20 Jan 2022 15:26:04 +0100
Michael Albinus <michael.albinus <at> 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




bug marked as fixed in version 29.1, send any further explanations to 53367 <at> debbugs.gnu.org and Koen van Greevenbroek <koenvg <at> posteo.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 20 Jan 2022 14:27:02 GMT) Full text and rfc822 format available.

Merged 53367 53405 53593. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Fri, 28 Jan 2022 08:38:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Feb 2022 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 112 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.