unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#65431: 30.0.50; pcomplete should not quote everything in a file name
@ 2023-08-21 14:10 Michael Albinus
  2023-08-21 17:51 ` Jim Porter
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2023-08-21 14:10 UTC (permalink / raw)
  To: 65431


- emacs -Q -l tramp --eval "(tramp-change-syntax 'separate)" -f eshell

- Type "cd /[ssh/localho TAB"

- This expands to "cd /[ssh/localhost\]"

Due to the quoted right square bracket, the cd command fails. pcomplete
should be taught to not quote everything in a file name.

Best regards, Michael.

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.8) of 2023-08-15 built on gandalf
Repository revision: 5c101b1adac2b4f3cc4e08a6492b406952c529f3
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12201009
System Description: Fedora Linux 38 (Workstation Edition)

Configured using:
 'configure --with-tree-sitter'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LIBOTF LIBSELINUX LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG
RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8

Major mode: Group

Minor modes in effect:
  gnus-undo-mode: t
  display-time-mode: t
  delete-selection-mode: t
  icomplete-mode: t
  global-goto-address-mode: t
  goto-address-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-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
  column-number-mode: 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:
/home/albinus/src/elpa/packages/debbugs/debbugs hides /home/albinus/.emacs.d/elpa/debbugs-0.36/debbugs
/home/albinus/src/elpa/packages/debbugs/debbugs-org hides /home/albinus/.emacs.d/elpa/debbugs-0.36/debbugs-org
/home/albinus/src/elpa/packages/debbugs/debbugs-gnu hides /home/albinus/.emacs.d/elpa/debbugs-0.36/debbugs-gnu
/home/albinus/src/elpa/packages/debbugs/debbugs-guix hides /home/albinus/.emacs.d/elpa/debbugs-0.36/debbugs-guix
/home/albinus/src/elpa/packages/debbugs/debbugs-browse hides /home/albinus/.emacs.d/elpa/debbugs-0.36/debbugs-browse
/home/albinus/src/elpa/packages/debbugs/debbugs-pkg hides /home/albinus/.emacs.d/elpa/debbugs-0.36/debbugs-pkg
/home/albinus/src/elpa/packages/debbugs/debbugs-autoloads hides /home/albinus/.emacs.d/elpa/debbugs-0.36/debbugs-autoloads
/home/albinus/src/elpa/packages/debbugs/debbugs-compat hides /home/albinus/.emacs.d/elpa/debbugs-0.36/debbugs-compat
~/lisp/telepathy hides /home/albinus/.emacs.d/elpa/telepathy-20131209.1258/telepathy
/home/albinus/src/elpa/packages/tramp-theme/tramp-theme-autoloads hides /home/albinus/.emacs.d/elpa/tramp-theme-0.2/tramp-theme-autoloads
/home/albinus/src/elpa/packages/tramp-theme/tramp-theme hides /home/albinus/.emacs.d/elpa/tramp-theme-0.2/tramp-theme
/home/albinus/src/elpa/packages/tramp-theme/tramp-theme-pkg hides /home/albinus/.emacs.d/elpa/tramp-theme-0.2/tramp-theme-pkg
/home/albinus/.emacs.d/elpa/hydra-0.15.0/lv hides /home/albinus/.emacs.d/elpa/lv-0.15.0/lv
/home/albinus/src/tramp/lisp/tramp-sh hides /usr/local/share/emacs/site-lisp/tramp-sh
/home/albinus/src/tramp/lisp/tramp-cmds hides /usr/local/share/emacs/site-lisp/tramp-cmds
/home/albinus/src/tramp/lisp/tramp-gvfs hides /usr/local/share/emacs/site-lisp/tramp-gvfs
/home/albinus/src/tramp/lisp/tramp-ftp hides /usr/local/share/emacs/site-lisp/tramp-ftp
/home/albinus/src/tramp/lisp/tramp-crypt hides /usr/local/share/emacs/site-lisp/tramp-crypt
/home/albinus/src/tramp/lisp/tramp-adb hides /usr/local/share/emacs/site-lisp/tramp-adb
/home/albinus/src/tramp/lisp/tramp hides /usr/local/share/emacs/site-lisp/tramp
/home/albinus/src/tramp/lisp/tramp-cache hides /usr/local/share/emacs/site-lisp/tramp-cache
/home/albinus/src/tramp/lisp/tramp-rclone hides /usr/local/share/emacs/site-lisp/tramp-rclone
/home/albinus/src/tramp/lisp/tramp-compat hides /usr/local/share/emacs/site-lisp/tramp-compat
/home/albinus/src/tramp/lisp/tramp-integration hides /usr/local/share/emacs/site-lisp/tramp-integration
/home/albinus/src/tramp/lisp/tramp-archive hides /usr/local/share/emacs/site-lisp/tramp-archive
/home/albinus/src/tramp/lisp/tramp-sudoedit hides /usr/local/share/emacs/site-lisp/tramp-sudoedit
/home/albinus/src/tramp/lisp/tramp-loaddefs hides /usr/local/share/emacs/site-lisp/tramp-loaddefs
/home/albinus/src/tramp/lisp/tramp-uu hides /usr/local/share/emacs/site-lisp/tramp-uu
/home/albinus/src/tramp/lisp/tramp-smb hides /usr/local/share/emacs/site-lisp/tramp-smb
/home/albinus/src/tramp/lisp/trampver hides /usr/local/share/emacs/site-lisp/trampver
/home/albinus/.emacs.d/elpa/transient-20230602.2121/transient hides /usr/local/share/emacs/30.0.50/lisp/transient
~/lisp/dbus hides /usr/local/share/emacs/30.0.50/lisp/net/dbus
/home/albinus/src/tramp/lisp/tramp-sh hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-sh
/home/albinus/src/tramp/lisp/tramp-fuse hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-fuse
/home/albinus/src/tramp/lisp/tramp-loaddefs hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-loaddefs
/home/albinus/src/tramp/lisp/tramp-ftp hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-ftp
/home/albinus/src/tramp/lisp/tramp hides /usr/local/share/emacs/30.0.50/lisp/net/tramp
/home/albinus/src/tramp/lisp/tramp-cache hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-cache
/home/albinus/src/tramp/lisp/tramp-uu hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-uu
/home/albinus/src/tramp/lisp/tramp-rclone hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-rclone
/home/albinus/src/tramp/lisp/tramp-integration hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-integration
/home/albinus/src/tramp/lisp/tramp-archive hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-archive
/home/albinus/src/tramp/lisp/tramp-adb hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-adb
/home/albinus/src/tramp/lisp/tramp-cmds hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-cmds
/home/albinus/src/tramp/lisp/tramp-compat hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-compat
/home/albinus/src/tramp/lisp/tramp-sudoedit hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-sudoedit
/home/albinus/src/tramp/lisp/tramp-container hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-container
/home/albinus/src/tramp/lisp/tramp-gvfs hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-gvfs
/home/albinus/src/tramp/lisp/tramp-crypt hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-crypt
/home/albinus/src/tramp/lisp/tramp-message hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-message
/home/albinus/src/tramp/lisp/tramp-smb hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-smb
/home/albinus/src/tramp/lisp/trampver hides /usr/local/share/emacs/30.0.50/lisp/net/trampver
/home/albinus/src/tramp/lisp/tramp-sshfs hides /usr/local/share/emacs/30.0.50/lisp/net/tramp-sshfs

Features:
(shadow warnings emacsbug timezone tramp-cmds cl-print backtrace
noutline outline tramp-gvfs zeroconf pulse find-dired xref project grep
compile misearch multi-isearch vc-git dired-aux find-func shortdoc
help-fns radix-tree shr-color color eww mm-url url-queue smerge-mode
diff diff-mode easy-mmode url-http url-gw url-auth gnus-gravatar
gravatar dns url-cache sort smiley gnus-cite flow-fill mm-archive
mail-extr gnus-bcklg textsec uni-scripts idna-mapping ucs-normalize
uni-confusable textsec-check gnus-async cl-extra qp gnus-ml
debbugs-browse bug-reference disp-table pop3 utf-7 nndraft nnmh nnml
network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig
gnus-cache gnus-sum shr pixel-fill kinsoku url-file svg dom nnnil
smtpmail gnus-demon nntp gnus-group gnus-undo gnus-start gnus-dbus dbus
xml gnus-cloud nnimap nnmail mail-source utf7 nnoo gnus-spec gnus-int
gnus-range message sendmail yank-media puny rfc822 mml mml-sec epa
derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader
gnus-win gnus nnheader gnus-util text-property-search mail-utils range
mm-util mail-prsvr face-remap ob-shell ob ob-tangle ol org-src ob-ref
ob-lob ob-table ob-exp ob-comint ob-core org-cycle org-fold
org-fold-core ob-eval org-keys oc org-compat org-version org-macs vc
vc-dispatcher time tramp-cache time-stamp tramp-sh lxc-tramp lxd-tramp
tramp trampver tramp-integration files-x tramp-message help-mode
tramp-compat xdg shell pcomplete comint ansi-osc ring parse-time iso8601
time-date format-spec ansi-color tramp-loaddefs rx delsel ido jka-compr
icomplete cus-edit pp cus-load icons wid-edit dired dired-loaddefs
goto-addr thingatpt alert-autoloads android-mode-autoloads
auth-source-gopass-autoloads auth-source-keytar-autoloads
auth-source-kwallet-autoloads auth-source-xoauth2-autoloads
auto-sudoedit-autoloads auto-virtualenv-autoloads
auto-virtualenvwrapper-autoloads clang-format-autoloads
company-shell-autoloads company-autoloads counsel-toki-autoloads
counsel-tramp-autoloads counsel-autoloads dbus-codegen-autoloads
debbugs-autoloads dired-du-autoloads dired-rsync-autoloads
direnv-autoloads disk-usage-autoloads dockerfile-mode-autoloads
ednc-autoloads el-get-autoloads envrc-autoloads
exec-path-from-shell-autoloads fontaine-autoloads forge-autoloads
closql-autoloads emacsql-autoloads friendly-tramp-path-autoloads
ggtags-autoloads ghub-autoloads gited-autoloads
gitlab-ci-mode-flycheck-autoloads gitlab-ci-mode-autoloads
flycheck-autoloads gntp-autoloads gnus-desktop-notify-autoloads
helm-gitlab-autoloads helm-projectile-autoloads helm-autoloads
helm-core-autoloads async-autoloads ibuffer-tramp-autoloads
inheritenv-autoloads ivy-gitlab-autoloads gitlab-autoloads
jarchive-autoloads journalctl-mode-autoloads keepass-mode-autoloads
keytar-autoloads kubel-autoloads kubernetes-autoloads log4e-autoloads
lsp-java-autoloads dap-mode-autoloads lsp-docker-autoloads bui-autoloads
lsp-treemacs-autoloads lsp-mode-autoloads lxc-tramp-autoloads
lxd-tramp-autoloads magit-filenotify-autoloads magit-autoloads pcase
git-commit-autoloads magit-popup-autoloads magit-section-autoloads
marcopolo-autoloads nexus-autoloads nnir-est-autoloads oauth2-autoloads
ob-restclient-autoloads orderless-autoloads org-tree-slide-autoloads
pkg-info-autoloads epl-autoloads popup-autoloads projectile-autoloads
promise-autoloads pyenv-mode-autoloads pylint-autoloads
python-environment-autoloads deferred-autoloads pythonic-autoloads
f-autoloads pyvenv-autoloads recentf-remove-sudo-tramp-prefix-autoloads
relint-autoloads request-autoloads restclient-test-autoloads
restclient-autoloads s3ed-autoloads finder-inf slime-autoloads
macrostep-autoloads spinner-autoloads ssh-deploy-autoloads
swiper-autoloads ivy-autoloads sx-autoloads markdown-mode-autoloads
telepathy-autoloads tramp-theme-autoloads transient-dwim-autoloads
transient-autoloads treemacs-autoloads cfrs-autoloads posframe-autoloads
ht-autoloads pfuture-autoloads ace-window-autoloads avy-autoloads
treepy-autoloads urgrep-autoloads uuid-autoloads vdiff-autoloads
hydra-autoloads lv-autoloads vertico-autoloads virtualenv-autoloads
virtualenvwrapper-autoloads s-autoloads dash-autoloads
web-server-autoloads with-editor-autoloads info compat-autoloads
xr-autoloads yaml-autoloads yaml-mode-autoloads package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib 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 touch-screen 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
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk x-toolkit xinput2 x multi-tty move-toolbar
make-network-process emacs)

Memory information:
((conses 16 534828 101559) (symbols 48 26095 2)
 (strings 32 123353 13481) (string-bytes 1 4611443) (vectors 16 73125)
 (vector-slots 8 1663284 216847) (floats 8 458 10208)
 (intervals 56 16674 3395) (buffers 992 42))





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#65431: 30.0.50; pcomplete should not quote everything in a file name
  2023-08-21 14:10 bug#65431: 30.0.50; pcomplete should not quote everything in a file name Michael Albinus
@ 2023-08-21 17:51 ` Jim Porter
  2023-08-21 19:09   ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Porter @ 2023-08-21 17:51 UTC (permalink / raw)
  To: Michael Albinus, 65431

On 8/21/2023 7:10 AM, Michael Albinus wrote:
> 
> - emacs -Q -l tramp --eval "(tramp-change-syntax 'separate)" -f eshell
> 
> - Type "cd /[ssh/localho TAB"
> 
> - This expands to "cd /[ssh/localhost\]"
> 
> Due to the quoted right square bracket, the cd command fails. pcomplete
> should be taught to not quote everything in a file name.

I believe the problem is actually the *left* square bracket. Both square 
brackets should be quoted; otherwise, [...] gets treated as a glob. I'm 
a little surprised that the tab-completion even works here; I guess it's 
more forgiving than it should be. However, if you type "cd /\[ssh/loca 
TAB", it should work correctly.

I see a couple of options:

1) Could Pcomplete fix the unquoted "[" for us? *Should* it?

2) I see that Pcomplete fails if you try to quote the whole file name, 
like "cd '/[ssh:loca TAB". Maybe we should fix that. Then users could 
rely on quoting with ' or " to escape the special glob characters instead.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#65431: 30.0.50; pcomplete should not quote everything in a file name
  2023-08-21 17:51 ` Jim Porter
@ 2023-08-21 19:09   ` Michael Albinus
  2023-08-27 11:23     ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2023-08-21 19:09 UTC (permalink / raw)
  To: Jim Porter; +Cc: 65431

Jim Porter <jporterbugs@gmail.com> writes:

Hi Jim,

> I believe the problem is actually the *left* square bracket. Both
> square brackets should be quoted; otherwise, [...] gets treated as a
> glob. I'm a little surprised that the tab-completion even works here;
> I guess it's more forgiving than it should be. However, if you type
> "cd /\[ssh/loca TAB", it should work correctly.

Indeed, I didn't think about glob chars. Quoting them works fine.

> I see a couple of options:
>
> 1) Could Pcomplete fix the unquoted "[" for us? *Should* it?
>
> 2) I see that Pcomplete fails if you try to quote the whole file name,
> like "cd '/[ssh:loca TAB". Maybe we should fix that. Then users could
> rely on quoting with ' or " to escape the special glob characters
> instead.

Since glob chars are an eshell feature, I believe we could leave it as
it is. It is even documented in the eshell manual. If we add the square
brackets to the speacial characters of remote file names, we could close
the bug I believe. Something like

--8<---------------cut here---------------start------------->8---
This is needed especially for file names with special characters like
pipe (‘|’) or square brackets ('[' or ']'), which could be part of
remote file names.
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#65431: 30.0.50; pcomplete should not quote everything in a file name
  2023-08-21 19:09   ` Michael Albinus
@ 2023-08-27 11:23     ` Michael Albinus
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2023-08-27 11:23 UTC (permalink / raw)
  To: Jim Porter; +Cc: 65431-done

Version: 29.2

Michael Albinus <michael.albinus@gmx.de> writes:

Hi Jim,

> Since glob chars are an eshell feature, I believe we could leave it as
> it is. It is even documented in the eshell manual. If we add the square
> brackets to the speacial characters of remote file names, we could close
> the bug I believe. Something like
>
> This is needed especially for file names with special characters like
> pipe (‘|’) or square brackets ('[' or ']'), which could be part of
> remote file names.

No further comment, so I've pushed this to the emacs-29 branch. Closing
the bug.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-27 11:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-21 14:10 bug#65431: 30.0.50; pcomplete should not quote everything in a file name Michael Albinus
2023-08-21 17:51 ` Jim Porter
2023-08-21 19:09   ` Michael Albinus
2023-08-27 11:23     ` Michael Albinus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).