GNU bug report logs - #46023
No error when a qualified eshell glob fails to match

Previous Next

Package: emacs;

Reported by: ch.emacs <at> themaw.xyz

Date: Thu, 21 Jan 2021 18:55:02 UTC

Severity: normal

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 46023 in the body.
You can then email your comments to 46023 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#46023; Package emacs. (Thu, 21 Jan 2021 18:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ch.emacs <at> themaw.xyz:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 21 Jan 2021 18:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ch.emacs <at> themaw.xyz
To: bug-gnu-emacs <at> gnu.org
Subject: No error when a qualified eshell glob fails to match
Date: Thu, 21 Jan 2021 18:03:43 +0000
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 sent to Jim Porter <jporterbugs <at> gmail.com>:
You have taken responsibility. (Mon, 05 Sep 2022 18:29:02 GMT) Full text and rfc822 format available.

Notification sent to ch.emacs <at> themaw.xyz:
bug acknowledged by developer. (Mon, 05 Sep 2022 18:29:02 GMT) Full text and rfc822 format available.

Message #10 received at 46023-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: ch.emacs <at> themaw.xyz, 46023-done <at> debbugs.gnu.org
Subject: Re: bug#46023: No error when a qualified eshell glob fails to match
Date: Mon, 5 Sep 2022 11:28:18 -0700
On 1/21/2021 10:03 AM, ch.emacs <at> themaw.xyz wrote:
> 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 fixed this in commit 598d7c5d1c10bfb161cb53aa76d480864414487c. (It was 
listed as a TODO entry in the Eshell manual.)

Closing this now. If there's something I missed when fixing this, feel 
free to reply to the bug and I'll take another look.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Oct 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 205 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.