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

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

bug#46023: No error when a qualified eshell glob fails to match


From: ch . emacs
Subject: bug#46023: No error when a qualified eshell glob fails to match
Date: Thu, 21 Jan 2021 18:03:43 +0000
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1

With eshell-error-if-no-glob set to t, eshell will give en error when a glob fails to match, e.g. `ls *` in an empty directory. However, if a qualified glob fails to match, the behaviour is inconsistent, depending on whether the lack of matches is due to the glob or the qualifier. For example `ls *(@)` in an empty directory will error (* does not match), but `ls *(@)` in a directory with no symlinks will not ((@) does not match).

I have replicated this when running with `emacs -q`. To replicate:

- Start emacs
- (setq eshell-error-if-no-glob t)
- M-x eshell
- cd to or create and cd to an empty directory
- `ls *` will give "No matches found: *" (as expected)
- `ls *(@)` will give "No matches found: *" (as expected?)
- create an empty file, e.g. `touch foo`
- `ls *` will give "foo" (as expected)
- `ls *(@)` will give "foo" (but we only wanted symlinks!)
- create a symlink, e.g. `cp -s foo foo-link`
- `ls *` will give "foo foo-link" (as expected)
- `ls *(@)` will give "foo-link" (as expected)

This is not exclusive to the symlink predicate, equivalent examples can be devised for the others with the same behaviour. For what it's worth, zsh (on, from what I understand of the documentation, eshell's globbing behaviour is based) will fail to match on *(@) when there are no symlinks in the current directory.

Ideally, I believe eshell should copy zsh's behaviour should error if a qualifier causes a glob not to match.

In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3)
 of 2020-08-28 built on juergen
Windowing system distributor 'HC-Consult', version 11.0.12005001
System Description: Arch Linux

Recent messages:
ESC M-x is undefined
History item: 28
History item: 27
History item: 26
History item: 27
History item: 29
History item: 30
funcall-interactively: End of buffer
History item: 30 [4 times]
delete-backward-char: Text is read-only [2 times]

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-wide-int
 --with-modules --with-cairo --with-harfbuzz 'CFLAGS=-march=x86-64
 -mtune=generic -O2 -pipe -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

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

Important settings:
  value of $LC_MESSAGES:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Eshell

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config
gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq
byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-print ielm pp
em-unix em-term term disp-table easymenu ehelp em-script em-prompt em-ls
cl-loaddefs cl-lib em-hist em-pred em-glob em-dirs esh-var em-cmpl
pcomplete comint ansi-color ring em-basic em-banner em-alias esh-mode
eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module
esh-groups esh-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type 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 elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer cl-generic
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 charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 64992 10312)
 (symbols 48 7750 1)
 (strings 32 21107 1988)
 (string-bytes 1 713243)
 (vectors 16 13460)
 (vector-slots 8 165955 11882)
 (floats 8 29 211)
 (intervals 56 401 0)
 (buffers 1000 14))





reply via email to

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