From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#56225: args-out-of-range error in tramp-debug-buffer-command-completion-p Date: Sun, 26 Jun 2022 11:04:52 +0200 Message-ID: <87fsjrvlqj.fsf@gmx.de> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12987"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 56225@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 26 11:06:09 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o5ODY-00039J-UY for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Jun 2022 11:06:08 +0200 Original-Received: from localhost ([::1]:41932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5ODX-0007jM-R1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Jun 2022 05:06:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5ODS-0007jB-5I for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2022 05:06:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52811) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5ODR-0006e0-TS for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2022 05:06:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o5ODR-0007Bk-NQ for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2022 05:06:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Jun 2022 09:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56225 X-GNU-PR-Package: emacs Original-Received: via spool by 56225-submit@debbugs.gnu.org id=B56225.165623430227556 (code B ref 56225); Sun, 26 Jun 2022 09:06:01 +0000 Original-Received: (at 56225) by debbugs.gnu.org; 26 Jun 2022 09:05:02 +0000 Original-Received: from localhost ([127.0.0.1]:46708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5OCU-0007AO-8O for submit@debbugs.gnu.org; Sun, 26 Jun 2022 05:05:02 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:41465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5OCR-00079p-W0 for 56225@debbugs.gnu.org; Sun, 26 Jun 2022 05:05:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656234294; bh=1G7aZ4KHpYN7JPe8LH9a72hw0gsGUUmx04nCa/aWj0o=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date; b=lbN3T3AdjT34W7BRGPWGWolHWzQaLeLVj1IMI8G/3pPAljDOuuV+8/wfSOjUd1r77 gXe96aIJ/JxDdgHBE8UTY6cAGzRhyJo4JNlh/sF9jiqytOBFoaxY3RuS95bAWELw7K ii867FsShtFU9cSg1teO+uWveXqfvruP+R4VX9g0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.125.228]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MOiDd-1oIPhi2wpj-00QBNW; Sun, 26 Jun 2022 11:04:53 +0200 X-Provags-ID: V03:K1:9dh9v7Z+Dddjg7gVX97GbppSEo2slBBrRKKBoR6ORyMR/sbNrrD qo2mvOoAcy5j2FJntQF0zgcoJ/OjHX1jGdsZViqb1ucyFmwTgAru+lZJpJZDS3c4kPpFW4T WLE9d6GTfX/V81poCSPrN45MHNZsd1XByulMr/b9f7K+yuwkSksDjZJdi9KXJZFRLa0zXcc u2mriAaHBNXHM7q6uLrQg== X-UI-Out-Filterresults: notjunk:1;V03:K0:4UhgCegm2JQ=:hBXYp49522Nhchvw+M713L BWjcp18yispTRNUUI/3Jpepi2XRN+ujiTflUcSG52xY6Wkvri4HGWpjic2XZ/Pyn03PGQyYs8 3EDMFT1S3y3mMoncqQi1izkEPvmcTU7tNYCEXU0fvSSd5V+sCPhpZe8roYsSecneiKSFSP+8e neN4xPKWRkND+gKmQi4VcSaYAnDlU6/xtuO5RUwLp0AwxuxI+ijaXtUPOrNFBUJs0YXgMezXk mb2VbA8t67SbSToFEmQTS6WDyNHdGS+W4xojBWpZfMXUHqiSGI3oY0lwsmwULyQWaeQzN30dI f7OaGq9GAQC5j0U72O3n+3LWv8RRcYvQL9G/3IxyEaCWNCT/sOPQSWojNzIhQoYpD+A/ipwoo dRQHrA1a0ApXN8MM/YMR8zSvzU3BY5mBac2aJ0O8L3SIR0Cet4n3c25rM/CaQpPkPAgqPIblA ei/zALPOTgODWYEOKsVHgg8RmQ/WD9VcHuLf+jm3bfx92sEw3pArDn13ULkrN7TS1J1IWysjo DlXOKWZkq1J2WaHWHyKkXRFmFKaqIjw4B0wNp1faZAMBLT0gjq+zEdQZu8wIA9wVUwMtVyD+o VOE5jXvP6/JSLhLBOU/x8Z6M8+JR4zQQ6Fv2tS+FgIeVVUjsqioPw8k9tDThV+SNrQrdqQhm8 jbAPWxYQa3j/JRYiuGkNZjKKTPfXBxYpLPPt/2YwLmb1x/zNlD5QAaw1ary4mmJbW4VN8Qt34 WcE8NuOgmXElQezdIEV7z0zfm2Ol0PxroHV7ZuELc+J+rsc9mJYEGifeeXRE9s7/rQZYyd4U X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235312 Archived-At: Stefan Kangas writes: Hi Stefan, > I'm seeing the below error when typing `M-x' (`execute-extended-command') > in narrowed buffers. I haven't been able to reproduce it in "emacs -Q". You can reproduce it with "emacs -Q -l tramp" with --8<---------------cut here---------------start------------->8--- (with-temp-buffer (insert (make-string 20 ?x)) (narrow-to-region 2 5) (tramp-debug-buffer-command-completion-p nil (current-buffer))) --8<---------------cut here---------------end--------------->8--- > The below patch seems to fix it, but I have no idea if it's correct: tramp-debug-buffer-command-completion-p should be very cheap. So it is sufficient to apply --8<---------------cut here---------------start------------->8--- diff --git a/lisp/tramp.el b/lisp/tramp.el index 1674bf27..7aba76d7 100644 --- a/lisp/tramp.el +++ b/lisp/tramp.el @@ -1955,7 +1955,8 @@ The outline level is equal to the verbosity of the Tramp message." "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 (min 10 (point-max))) ";; Emacs:"))) + (string-equal + (buffer-substring (point-min) (min 10 (point-max))) ";; Emacs:"))) (put #'tramp-debug-buffer-command-completion-p 'tramp-suppress-trace t) --8<---------------cut here---------------end--------------->8--- There could be false positives when the string ";; Emacs:" is somewhere in the buffer, and the buffer is narrowed at this point. But that's not the end of the world :-) And we don't need to worry about narrowed Tramp debug buffers: they don't exist. > Michael, what do you think? I've applied the patch to master. Could you pls check? Best regards, Michael.