From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#56225: args-out-of-range error in tramp-debug-buffer-command-completion-p Date: Sat, 25 Jun 2022 16:16:57 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14015"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Albinus To: 56225@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 26 01:18:20 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 1o5F2h-0003Mm-U8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Jun 2022 01:18:20 +0200 Original-Received: from localhost ([::1]:57438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5F2g-0002W1-GJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Jun 2022 19:18:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5F2R-0002Vd-8V for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2022 19:18:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5F2Q-0002iV-V0 for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2022 19:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o5F2Q-00012I-Iw; Sat, 25 Jun 2022 19:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: michael.albinus@gmx.de, bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Jun 2022 23:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56225 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Michael Albinus Original-Received: via spool by submit@debbugs.gnu.org id=B.16561990263910 (code B ref -1); Sat, 25 Jun 2022 23:18:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Jun 2022 23:17:06 +0000 Original-Received: from localhost ([127.0.0.1]:46417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5F1W-000110-2l for submit@debbugs.gnu.org; Sat, 25 Jun 2022 19:17:06 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:36688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5F1R-00010W-OI for submit@debbugs.gnu.org; Sat, 25 Jun 2022 19:17:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5F1R-0002OV-Ht for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2022 19:17:01 -0400 Original-Received: from mail-pl1-f174.google.com ([209.85.214.174]:35412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5F1P-0002dk-HE for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2022 19:17:01 -0400 Original-Received: by mail-pl1-f174.google.com with SMTP id o18so5147215plg.2 for ; Sat, 25 Jun 2022 16:16:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=S81ZzT8G//YZeHOugL80nwffudZQEXOnOMLoaOEhDUg=; b=69UyBbZTj4esRAyTQXDaHX8bddIaeET2I4YNjM40SeO7QZU8jTyj5vsKC6oThjJoLT sEmqw1RqAytVH7BaDftd7nQTwC6ZARjbWJQaRhgJxRt9tDuov62mC0iPSGXoCvBORTRF o9fpbpkwZNpm8egaQr5LwFP60A1iZdJtU3Alil1kSFueRM76A2i/ZBFpKlI3j+UgxayS O4c2uQhOY2gYrIyuhxp3l16d9V7H3mjtgEMXaAARyi0zZa28wlzc52wb7aurducYjs8B u8Qx4FzZpO3GHQVX22zYsDCGWJK0ACArKrbprlKXQB6iPMSDFLoRV/Eoy71itsVtBMia ikBA== X-Gm-Message-State: AJIora9ZhYUnpH8VivNS1bGqNfDe8PQQfKqZJo/ExrN2FG214qq8dnj8 5RrRwsr/nk+C4oAGxm0bCiiKAcud7tyuH3svOtp1FUgH X-Google-Smtp-Source: AGRyM1sMuCpY9VbZC4H0zPuVn4MiQaApHWw/WfJbgTChDA8O70cL4UcODgueyOXDQDJ+R1sM+ButNGs887ZU4oou4i8= X-Received: by 2002:a17:902:cecc:b0:16a:416c:3d14 with SMTP id d12-20020a170902cecc00b0016a416c3d14mr6410319plg.73.1656199017876; Sat, 25 Jun 2022 16:16:57 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 25 Jun 2022 16:16:57 -0700 Received-SPF: pass client-ip=209.85.214.174; envelope-from=stefankangas@gmail.com; helo=mail-pl1-f174.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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:235295 Archived-At: 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". The below patch seems to fix it, but I have no idea if it's correct: diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index c6665c2792..a6b4d3dffe 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1954,8 +1954,10 @@ tramp-debug-outline-level (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 (min 10 (point-max))) ";; Emacs:"))) + (save-restriction + (widen) + (with-current-buffer buffer + (string-equal (buffer-substring 1 (min 10 (point-max))) ";; Emacs:")))) (put #'tramp-debug-buffer-command-completion-p 'tramp-suppress-trace t) Michael, what do you think? Debugger entered--Lisp error: (args-out-of-range # 1 10) tramp-debug-buffer-command-completion-p(tramp-setup-debug-buffer #) command-completion-default-include-p(tramp-setup-debug-buffer #) #f(compiled-function (sym) #)(tramp-setup-debug-buffer) #f(compiled-function (sym) #)(tramp-setup-debug-buffer) all-completions("" [flymake--backend-state-p--cmacro magit-section-show-headings vc-src-responsible-p soap-xs-complex-type-is-group--cmacro tramp-sudoedit-file-name-handler hydra-message-timer Browse\ URL embark--cache-info--completion-list python-nav-beginning-of-defun-regexp vc-sccs-log-view-mode-hook ob-session-async-R-indicator magit-revision-filter-files-on-follow idlwave-check-abbrev yas-x-prompt news-inews soap-operation-namespace-tag magit-buffer-lock-functions magit-xref-insert-button tramp-actions-copy-out-of-band f-ancestor-of? gnus-demon-idle-has-been-called smiley-directory org-habit-scheduled transient:magit-diff-refresh:--irreversible-delete org-journal--open-entry c-make-ml-string-opener-re-function traversed magit-list-modified-modules winum-mode-hook ada-cd-command python-syntax--context-compiler-macro gdb-thread-number org-export-highlight-first-table-line xref--push-markers vc-bzr-shelve-menu About allout-post-undo-hook swiper-include-line-number-in-search python-skeleton-available xesam-engine pages-directory-mode-hook emacs-lock--set-mode ibuffer-delete-alist org-man-center-block copy-soap-xs-attribute-group tramp-adb-connection-local-default-shell-variables Noto\ Sans\ Gurmukhi transient:magit-log:--dense bibtex-text-in-string zot ...] #f(compiled-function (sym) #)) complete-with-action(t [flymake--backend-state-p--cmacro magit-section-show-headings vc-src-responsible-p soap-xs-complex-type-is-group--cmacro tramp-sudoedit-file-name-handler hydra-message-timer Browse\ URL embark--cache-info--completion-list python-nav-beginning-of-defun-regexp vc-sccs-log-view-mode-hook ob-session-async-R-indicator magit-revision-filter-files-on-follow idlwave-check-abbrev yas-x-prompt news-inews soap-operation-namespace-tag magit-buffer-lock-functions magit-xref-insert-button tramp-actions-copy-out-of-band f-ancestor-of? gnus-demon-idle-has-been-called smiley-directory org-habit-scheduled transient:magit-diff-refresh:--irreversible-delete org-journal--open-entry c-make-ml-string-opener-re-function traversed magit-list-modified-modules winum-mode-hook ada-cd-command python-syntax--context-compiler-macro gdb-thread-number org-export-highlight-first-table-line xref--push-markers vc-bzr-shelve-menu About allout-post-undo-hook swiper-include-line-number-in-search python-skeleton-available xesam-engine pages-directory-mode-hook emacs-lock--set-mode ibuffer-delete-alist org-man-center-block copy-soap-xs-attribute-group tramp-adb-connection-local-default-shell-variables Noto\ Sans\ Gurmukhi transient:magit-log:--dense bibtex-text-in-string zot ...] "" #f(compiled-function (sym) #)) #("" #f(compiled-function (sym) #) t) all-completions("" # #f(compiled-function (sym) #)) ivy--reset-state(#s(ivy-state :prompt "M-x " :collection # :predicate #f(compiled-function (sym) #) :require-match t :initial-input nil :history extended-command-history :preselect nil :keymap nil :update-fn nil :sort nil :frame # :window # :buffer # :text nil :action (1 ("o" identity "default") ("i" ivy--action-insert "insert") ("w" ivy--action-copy "copy")) :unwind nil :re-builder ivy--regex-plus :matcher nil :dynamic-collection nil :display-transformer-fn nil :directory "/home/skangas/wip/org-mode/doc/" :caller execute-extended-command :current nil :def nil :ignore t :multi-action nil :extra-props (:caller ivy-completing-read))) ivy-read("M-x " # :predicate #f(compiled-function (sym) #) :require-match t :initial-input nil :preselect nil :def nil :history extended-command-history :keymap nil :dynamic-collection nil :extra-props (:caller ivy-completing-read) :caller execute-extended-command) ivy-completing-read("M-x " # #f(compiled-function (sym) #) t nil extended-command-history nil nil) read-extended-command-1("M-x " nil) read-extended-command() byte-code("\302\30\11\303 \10E)\207" [execute-extended-command--last-typed current-prefix-arg nil read-extended-command] 3) command-execute(execute-extended-command) In GNU Emacs 29.0.50 (build 16, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2022-06-25 built on joffe Repository revision: 3d3029353b95360e374fc673339b7c8cd5568db1 Repository branch: bug-56148-recentf-open Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Debian GNU/Linux 11 (bullseye) Configured using: 'configure --with-native-compilation' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LC_COLLATE: C value of $LC_CTYPE: sv_SE.UTF-8 value of $LC_TIME: C value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix