Subject: Re: 29.0.60; Eshell completion errors in the presence of buffer redirects

From: Augusto Stoffel <[email-masked]>
Date: Mon, 12 Dec 2022 23:41:45 +0100

This is essentially the same as bug#59956.  Note also that it's not
limited to completion rules defined by pcomplete-here-using-help.

On Mon, 12 Dec 2022 at 22:23, Daniel Mendler wrote:

> 1. Start emacs -Q
> 2. M-x eshell
> 3. ls > #<*scratch*> TAB
>
> The following error is observed:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp #<buffer *scratch*>)
>   pcomplete-match("\\`--[^=]+=\\(.*\\)" 0)
>   pcomplete-here-using-help("ls --help")
>   pcomplete/ls()
>   pcomplete-completions()
>   pcomplete-completions-at-point()
>
> In GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
>  version 1.16.0, Xaw scroll bars) of 2022-12-11 built on projects
> Repository revision: f221105723dc8d3ee9f3c8d1c2717058afbc6666
> Repository branch: emacs-29
> Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
> System Description: Debian GNU/Linux 10 (buster)
>
> Configured using:
>  'configure --prefix=/home/user/emacs/install --with-json
>  --with-native-compilation --with-x-toolkit=athena --without-dbus
>  --without-selinux --without-threads --without-gsettings --with-cairo'
>
> Configured features:
> CAIRO FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG JSON LIBXML2 MODULES
> NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 TIFF
> TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM LUCID ZLIB
>
> Important settings:
>   value of $LANG: en_US.UTF-8
>   locale-coding-system: utf-8-unix
>
> Major mode: Debugger
>
> Minor modes in effect:
>   shell-dirtrack-mode: t
>   tooltip-mode: t
>   global-eldoc-mode: t
>   show-paren-mode: t
>   electric-indent-mode: t
>   mouse-wheel-mode: t
>   tool-bar-mode: t
>   menu-bar-mode: t
>   file-name-shadow-mode: t
>   global-font-lock-mode: t
>   font-lock-mode: t
>   blink-cursor-mode: t
>   buffer-read-only: t
>   line-number-mode: t
>   indent-tabs-mode: t
>   transient-mark-mode: t
>   auto-composition-mode: t
>   auto-encryption-mode: t
>   auto-compression-mode: t
>
> Load-path shadows:
> None found.
>
> Features:
> (shadow sort mail-extr emacsbug message mailcap yank-media puny dired
> dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
> epg-config gnus-util text-property-search time-date mm-decode mm-bodies
> mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
> rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-fns
> radix-tree cl-print byte-opt debug backtrace find-func pcmpl-unix
> em-unix em-term term disp-table shell ehelp em-script em-prompt em-ls
> em-hist em-pred em-glob em-extpipe em-cmpl em-dirs esh-var pcomplete
> comint ansi-osc ansi-color ring em-basic em-banner em-alias esh-mode
> eshell esh-cmd generator esh-ext esh-opt esh-proc esh-io esh-arg
> esh-module esh-groups esh-util cus-edit pp cus-start cus-load wid-edit
> cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv
> cl-extra help-mode bytecomp byte-compile cl-lib files-x rmc iso-transl
> tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks
> lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
> tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
> newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
> rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
> font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
> simple cl-generic indonesian philippine cham georgian utf-8-lang
> misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
> cp51932 hebrew greek romanian slovak czech european ethiopic indian
> cyrillic chinese composite emoji-zwj charscript charprop case-table
> epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
> loaddefs theme-loaddefs faces cus-face macroexp files window
> text-properties overlay sha1 md5 base64 format env code-pages mule
> custom widget keymap hashtable-print-readable backquote inotify
> dynamic-setting font-render-setting cairo x-toolkit xinput2 x multi-tty
> make-network-process native-compile emacs)
>
> Memory information:
> ((conses 16 134689 10796)
>  (symbols 48 11140 0)
>  (strings 32 32175 1832)
>  (string-bytes 1 996479)
>  (vectors 16 21968)
>  (vector-slots 8 436129 17427)
>  (floats 8 49 31)
>  (intervals 56 529 0)
>  (buffers 976 14))