bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56225: args-out-of-range error in tramp-debug-buffer-command-complet


From: Stefan Kangas
Subject: bug#56225: args-out-of-range error in tramp-debug-buffer-command-completion-p
Date: Sat, 25 Jun 2022 16:16:57 -0700

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 #<buffer org-manual.org> 1 10)
  tramp-debug-buffer-command-completion-p(tramp-setup-debug-buffer
#<buffer org-manual.org>)
  command-completion-default-include-p(tramp-setup-debug-buffer
#<buffer org-manual.org>)
  #f(compiled-function (sym) #<bytecode
-0x3e27aaa25208a7d>)(tramp-setup-debug-buffer)
  #f(compiled-function (sym) #<bytecode
-0x1e2881bcfce59feb>)(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) #<bytecode -0x1e2881bcfce59feb>))
  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) #<bytecode -0x1e2881bcfce59feb>))
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_54>(""
#f(compiled-function (sym) #<bytecode -0x3e27aaa25208a7d>) t)
  all-completions("" #<subr
F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_54>
#f(compiled-function (sym) #<bytecode -0x3e27aaa25208a7d>))
  ivy--reset-state(#s(ivy-state :prompt "M-x " :collection #<subr
F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_54> :predicate
#f(compiled-function (sym) #<bytecode -0x3e27aaa25208a7d>)
:require-match t :initial-input nil :history extended-command-history
:preselect nil :keymap nil :update-fn nil :sort nil :frame #<frame
/home/skangas/wip/org-mode/doc/org-manual.org -- Emacs [Org]
0x55fbd001b9a8> :window #<window 80 on org-manual.org> :buffer
#<buffer org-manual.org> :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 " #<subr
F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_54> :predicate
#f(compiled-function (sym) #<bytecode -0x3e27aaa25208a7d>)
: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 " #<subr
F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_54>
#f(compiled-function (sym) #<bytecode -0x3e27aaa25208a7d>) 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]