GNU bug report logs - #70507
30.0.50; eshell: grep -H and -n flags are hardcoded and the latter cannot be overwritten

Previous Next

Package: emacs;

Reported by: Jose A Ortega Ruiz <jao <at> gnu.org>

Date: Mon, 22 Apr 2024 01:31:04 UTC

Severity: normal

Found in version 30.0.50

To reply to this bug, email your comments to 70507 AT debbugs.gnu.org.

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#70507; Package emacs. (Mon, 22 Apr 2024 01:31:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jose A Ortega Ruiz <jao <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 22 Apr 2024 01:31:04 GMT) Full text and rfc822 format available.

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

From: Jose A Ortega Ruiz <jao <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; eshell: grep -H and -n flags are hardcoded and the latter
 cannot be overwritten
Date: Mon, 22 Apr 2024 02:30:22 +0100
Hi,

I've noticed that -Hn flags are hardcoded when calling eshell's grep
command. Specially in pipes, where -H prints a noisy (standard input)
prefix for every line, those flags are rarely what I personally want,
and I'd like to have the option to disable them. For -H i can add -h to
the call, or even redefine eshell/grep to not use -H, but there's no
flag to disable -n.

Thanks!


In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, cairo version
 1.18.0) of 2024-04-10 built on osgiliath
Repository revision: dd6b9c9426c5d7dde66974c5790815c3520a755b
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Debian GNU/Linux trixie/sid

Configured using:
 'configure --prefix /usr/local/stow/emacs30jit --with-x-toolkit=no
 --with-native-compilation --with-imagemagick'

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

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

Major mode: ELisp/l

Minor modes in effect:
  TeX-PDF-mode: t
  eat-eshell-visual-command-mode: t
  eat-eshell-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  circe-lagmon-mode: t
  paredit-mode: t
  whitespace-mode: t
  display-fill-column-indicator-mode: t
  symbol-overlay-mode: t
  telega-root-auto-fill-mode: t
  telega-active-video-chats-mode: t
  telega-active-locations-mode: t
  telega-patrons-mode: t
  telega-mode-line-mode: t
  telega-active-stories-mode: t
  jao-outline-minor-mode: t
  outline-minor-faces-mode: t
  global-diff-hl-mode: t
  diff-hl-mode: t
  eshell-syntax-highlighting-global-mode: t
  winner-mode: t
  global-auto-revert-mode: t
  vertico-multiform-mode: t
  vertico-mode: t
  marginalia-mode: t
  persistent-scratch-autosave-mode: t
  ednc-mode: t
  tracking-mode: t
  outline-minor-mode: t
  jao-minibuffer-mode: t
  minibuffer-electric-default-mode: t
  minibuffer-depth-indicate-mode: t
  repeat-mode: t
  server-mode: t
  savehist-mode: t
  recentf-mode: t
  save-place-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/jao/lib/elisp/notmuch/notmuch-compat hides /usr/local/share/emacs/site-lisp/notmuch-compat
/home/jao/lib/elisp/notmuch/notmuch hides /usr/local/share/emacs/site-lisp/notmuch
/home/jao/lib/elisp/notmuch/notmuch-tree hides /usr/local/share/emacs/site-lisp/notmuch-tree
/home/jao/lib/elisp/notmuch/notmuch-lib hides /usr/local/share/emacs/site-lisp/notmuch-lib
/home/jao/lib/elisp/notmuch/notmuch-message hides /usr/local/share/emacs/site-lisp/notmuch-message
/home/jao/lib/elisp/notmuch/notmuch-address hides /usr/local/share/emacs/site-lisp/notmuch-address
/home/jao/lib/elisp/notmuch/notmuch-show hides /usr/local/share/emacs/site-lisp/notmuch-show
/home/jao/lib/elisp/notmuch/notmuch-wash hides /usr/local/share/emacs/site-lisp/notmuch-wash
/home/jao/lib/elisp/notmuch/notmuch-print hides /usr/local/share/emacs/site-lisp/notmuch-print
/home/jao/lib/elisp/notmuch/notmuch-company hides /usr/local/share/emacs/site-lisp/notmuch-company
/home/jao/lib/elisp/notmuch/notmuch-hello hides /usr/local/share/emacs/site-lisp/notmuch-hello
/home/jao/lib/elisp/notmuch/notmuch-parser hides /usr/local/share/emacs/site-lisp/notmuch-parser
/home/jao/lib/elisp/notmuch/coolj hides /usr/local/share/emacs/site-lisp/coolj
/home/jao/lib/elisp/notmuch/notmuch-jump hides /usr/local/share/emacs/site-lisp/notmuch-jump
/home/jao/lib/elisp/notmuch/notmuch-maildir-fcc hides /usr/local/share/emacs/site-lisp/notmuch-maildir-fcc
/home/jao/lib/elisp/notmuch/notmuch-tag hides /usr/local/share/emacs/site-lisp/notmuch-tag
/home/jao/lib/elisp/notmuch/notmuch-version hides /usr/local/share/emacs/site-lisp/notmuch-version
/home/jao/lib/elisp/notmuch/notmuch-mua hides /usr/local/share/emacs/site-lisp/notmuch-mua
/home/jao/lib/elisp/notmuch/notmuch-crypto hides /usr/local/share/emacs/site-lisp/notmuch-crypto
/home/jao/lib/elisp/notmuch/notmuch-draft hides /usr/local/share/emacs/site-lisp/notmuch-draft
/home/jao/lib/elisp/notmuch/notmuch-query hides /usr/local/share/emacs/site-lisp/notmuch-query
/home/jao/.emacs.d/elpa.30/transient-20240421.1327/transient hides /usr/local/stow/emacs30jit/share/emacs/30.0.50/lisp/transient
/home/jao/etc/emacs/site/custom hides /usr/local/stow/emacs30jit/share/emacs/30.0.50/lisp/custom

Features:
(shadow emacsql-sqlite-builtin tmm haskell-doc inf-haskell
haskell-decl-scan hlint-refactor flymake-hlint flymake-easy dictionary
external-completion dictionary-connection texinfo texinfo-loaddefs
toolbar-x reporter desktop frameset context plain-tex latex
latex-flymake tex-ispell tex-style tex texmathp cider-scratch
cider-macroexpansion cider tramp-sh cider-debug cider-browse-ns
cider-mode cider-xref-backend cider-find cider-inspector
cider-completion cider-profile cider-eval cider-jar cider-repl-history
cider-repl cider-resolve cider-test cider-overlays cider-stacktrace
cider-doc cider-browse-spec cider-clojuredocs cider-eldoc
cider-docstring cider-client cider-common cider-completion-context
cider-connection cider-popup sesman-browser nrepl-client cider-util
sesman queue spinner parseedn parseclj-parser parseclj-lex
parseclj-alist clojure-mode nrepl-dict embark-vc forge-list
forge-commands forge-semi forge-bitbucket forge-gogs gogs forge-gitea
gtea forge-gitlab glab forge-github forge-notify forge-revnote
forge-pullreq forge-issue forge-topic yaml forge-post markdown-toc
markdown-mode forge-repo forge forge-core forge-db closql
emacsql-sqlite-common emacsql emacsql-compiler eieio-base buck
ghub-graphql treepy gsexp ghub ediff ediff-merg ediff-mult ediff-wind
ediff-diff ediff-help ediff-init ediff-util slack slack-company
slack-unread slack-websocket slack-dialog-edit-element-buffer
slack-search-result-buffer slack-thread-message-compose-buffer
slack-file-list-buffer slack-all-threads-buffer slack-room-info-buffer
slack-thread-event slack-room-event slack-star-event
slack-reaction-event slack-reply-event slack-stars-buffer slack-typing
slack-search slack-file-info-buffer slack-dialog-buffer slack-dialog
slack-slash-commands slack-message-event slack-event
slack-message-buffer slack-user-profile-buffer slack-pinned-items-buffer
slack-pinned-item slack-thread-message-buffer slack-room-buffer
slack-star slack-reminder slack-message-share-buffer
slack-message-edit-buffer slack-room-message-compose-buffer
slack-message-compose-buffer slack-message-attachment-preview-buffer
slack-message-editor slack-message-sender slack-action
slack-message-notification slack-message-reaction slack-buffer
slack-message-formatter slack-thread slack-im slack-channel slack-group
slack-conversations slack-create-message slack-attachment
slack-selectable slack-bot-message slack-file slack-modeline
slack-user-message slack-message slack-message-faces slack-unescape
slack-block slack-mrkdwn slack-usergroup slack-reaction slack-room
slack-counts slack-user slack-bot slack-dnd-status slack-emoji
slack-image slack-request slack-log slack-team slack-team-ws slack-util
slack-autoloads ert cl websocket tls websocket-autoloads apropos
emojify-autoloads package-vc qp ecomplete sort mailalias bbdb-message
mail-extr yaml-mode tabify benchmark sh-script cus-start cl-print debug
backtrace tramp-cache time-stamp password-store auth-source-pass macros
pulse goto-chg app-launcher gnus-dired org-cliplink
org-cliplink-transport org-cliplink-string consult-imenu quail
display-line-numbers pcmpl-unix bash-completion eat term/xterm xterm
em-unix em-script em-pred em-ls em-hist em-glob em-extpipe em-cmpl
em-basic em-banner misearch multi-isearch shortdoc
mastodon-notifications vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs
bug-reference magit-extras magit-bookmark magit-submodule magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func magit-diff smerge-mode diff git-commit
log-edit add-log magit-core magit-autorevert magit-margin
magit-transient magit-process with-editor magit-mode magit-git
magit-base magit-section face-remap org-agenda image-file
image-converter oc-basic bibtex cal-iso cal-move shr-color
vertico-directory tramp-cmds mule-util mastodon-media textsec
uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check
mastodon-profile circe-lagmon lui-track circe-display-images circe
lui-irc-colors irc lcs lui-logging lui-format lui flyspell ispell
circe-compat mastodon-tl mastodon-auth mastodon-client plstore time
jao-custom-exwm exwm-systemtray xcb-systemtray xcb-xembed exwm-edit exwm
exwm-input xcb-keysyms xcb-xkb exwm-manage exwm-floating xcb-cursor
xcb-render exwm-layout exwm-workspace exwm-core xcb-ewmh xcb-icccm xcb
xcb-xproto xcb-types xcb-debug executable copyright paredit whitespace
display-fill-column-indicator symbol-overlay bigml bml-logs bml bml-misc
bml-whizzml bml-clojure bml-clj-tests bml-python bml-skels bml-utils
multisession sqlite whizzml-skeletons whizzml-mode sieve sieve-mode
sieve-manage sasl sasl-anonymous sasl-login sasl-plain xmobar xclip
jao-wayland jao-spt consult-spotify espotify jao-mpc jao-random-album
jao-lyrics jao-mpris mastodon mastodon-search mastodon-toot facemenu
mastodon-iso mastodon-http telega-obsolete telega telega-tdlib-events
telega-webpage telega-match telega-root telega-info telega-chat
visual-fill-column telega-modes telega-company telega-emoji telega-user
telega-notifications telega-voip telega-msg telega-story telega-tme
telega-sticker telega-vvnote bindat telega-ffplay telega-i18n
telega-sort telega-filter telega-ins telega-inline telega-util
telega-folders telega-topic telega-media telega-tdlib
rainbow-identifiers dired-aux color telega-server telega-core
cursor-sensor telega-customize emacsbug jao-mullvad bluetooth json-mode
smie virtualenvwrapper gud s pie haskell haskell-completions
haskell-load haskell-commands highlight-uses-mode haskell-modules
haskell-sandbox haskell-navigate-imports haskell-repl haskell-svg
haskell-collapse hideshow haskell-debug haskell-interactive-mode
haskell-presentation-mode haskell-compile haskell-process
haskell-session haskell-hoogle consult-hoogle hoogle-base align
geiser-chez geiser-guile tramp trampver tramp-integration tramp-message
tramp-compat parse-time iso8601 tramp-loaddefs info-look geiser-debug
geiser-repl geiser-image geiser-capf geiser-doc geiser-menu
geiser-autodoc geiser-edit geiser-completion geiser-eval
geiser-connection tq geiser-syntax scheme geiser-impl help-fns
geiser-log geiser-popup view geiser-custom geiser-base geiser
package-lint let-alist finder edit-list outline-minor-faces git-modes
gitignore-mode gitconfig-mode conf-mode gitattributes-mode git-link
git-timemachine diff-hl log-view pcvs-util vc-dir ewoc vc
jao-eshell-here eshell-autojump em-dirs eshell-up git-ps1-mode em-term
term disp-table ehelp eshell-syntax-highlighting em-prompt em-alias
jao-custom-email jao-custom-notmuch consult-notmuch org-capture
jao-notmuch link-hint avy notmuch notmuch-tree notmuch-jump
notmuch-hello notmuch-show notmuch-print notmuch-crypto notmuch-mua
notmuch-message notmuch-draft notmuch-maildir-fcc notmuch-address
notmuch-company notmuch-parser notmuch-wash coolj goto-addr icalendar
notmuch-tag notmuch-lib notmuch-version notmuch-compat hl-line mm-view
mml-smime smime dig bbdb-anniv bbdb-com crm bbdb bbdb-site timezone
randomsig jao-proton-utils nov imenu esxml-query saveplace-pdf-view
jao-custom-eww ol-eww jao-eww-session eww url-queue shr pixel-fill
kinsoku url-file svg mm-url gnus nnheader range edit-indirect reverso
dom request jao-custom-blog htmlize jao-custom-org jao-org-links
jao-doc-view jao-pdf doc-view image-mode exif ol-info ol-eshell esh-mode
esh-var eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg
esh-module esh-groups esh-util files-x jao-org-notes ob-shell shell
ob-scheme ob-python python treesit ob-org ob-ocaml ob-makefile
ob-haskell ob-gnuplot ob-clojure ob-calc calc-store calc-trail calc-ext
calc calc-loaddefs rect calc-macs org-tempo tempo ox-pandoc ht dash
ox-org ox-texinfo ox-latex ox-html table ox-ascii ox-publish ox
org-fragtog embark-org org-element org-persist xdg org-id org-refile
avl-tree org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-src ob-comint org-pcomplete pcomplete org-list org-footnote
org-faces org-entities ob-emacs-lisp ob-core ob-eval org-cycle org-table
ol org-fold org-fold-core org-keys oc org-loaddefs find-func org-version
org-compat org-macs advice winner autorevert filenotify consult-recoll
embark-consult consult bookmark jao-custom-completion embark ffap
vertico-multiform vertico marginalia orderless jao-skel-latex
jao-skel-haskell haskell-mode haskell-cabal haskell-utils
haskell-font-lock haskell-indentation haskell-string
haskell-sort-imports haskell-lexeme haskell-align-imports
haskell-complete-module haskell-ghc-support flymake-proc flymake
thingatpt etags fileloop generator xref project dabbrev
haskell-customize jao-compilation jao-skel-lisp jao-skel-geiser jao-skel
skeleton autoinsert wgrep grep jka-compr dired-duplicates dired-x
persistent-scratch cal-china lunar solar cal-dst cal-bahai cal-islam
cal-hebrew holidays holiday-loaddefs vc-git diff-mode vc-dispatcher appt
diary-lib diary-loaddefs cal-menu calendar cal-loaddefs jao-ednc ednc
jao-tracking jao-afio jao-doc-session tracking shorten jao-notify alert
log4e notifications gntp alert-autoloads gntp-autoloads compile comint
ansi-osc ring log4e-autoloads loaddefs-gen lisp-mnt radix-tree tar-mode
arc-mode archive-mode mm-archive message sendmail yank-media dired
dired-loaddefs rfc822 mml mml-sec gnus-util text-property-search
time-date mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode
mail-utils gnutls network-stream url-cache url-http url-auth mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm puny
battery noutline outline diminish jao-mode-line comp comp-cstr warnings
comp-run comp-common rx jao-minibuffer minibuf-eldef mb-depth man
jao-light-theme jao-themes ansi-color epa-file epa derived epg rfc6068
epg-config transient format-spec compat repeat jao-shell edmacro kmacro
jao-sleep dbus xml server savehist recentf tree-widget saveplace persist
cus-edit pp cus-load wid-edit jao-gnus-private gnu-elpa-keyring-update
cl-extra help-mode use-package use-package-ensure use-package-delight
use-package-diminish use-package-bind-key bind-key easy-mmode
use-package-core finder-inf auctex-autoloads tex-site
bash-completion-autoloads bbdb-autoloads bluetooth-autoloads
cider-autoloads circe-autoloads clojure-mode-autoloads
consult-git-log-grep-autoloads consult-hoogle-autoloads
diff-hl-autoloads diminish-autoloads dired-duplicates-autoloads
eat-autoloads edit-indirect-autoloads edit-list-autoloads ednc-autoloads
embark-consult-autoloads consult-autoloads embark-vc-autoloads
embark-autoloads eshell-autojump-autoloads
eshell-syntax-highlighting-autoloads eshell-up-autoloads exwm-autoloads
exwm-edit-autoloads flymake-hlint-autoloads flymake-easy-autoloads
forge-autoloads closql-autoloads emacsql-autoloads ghub-autoloads
git-link-autoloads git-modes-autoloads git-ps1-mode-autoloads
git-timemachine-autoloads gnu-elpa-keyring-update-autoloads
goto-chg-autoloads haskell-mode-autoloads hlint-refactor-autoloads
htmlize-autoloads jenkins-autoloads json-mode-autoloads
link-hint-autoloads avy-autoloads magit-autoloads pcase
git-commit-autoloads magit-section-autoloads marginalia-autoloads
markdown-toc-autoloads markdown-mode-autoloads mastodon-autoloads
nov-autoloads esxml-autoloads kv-autoloads orderless-autoloads
org-cliplink-autoloads org-fragtog-autoloads org-static-blog-autoloads
outline-minor-faces-autoloads ox-pandoc-autoloads ht-autoloads
package-lint-autoloads paredit-autoloads parseedn-autoloads
parseclj-autoloads password-store-autoloads persist-autoloads
persistent-scratch-autoloads queue-autoloads reverso-autoloads
request-autoloads saveplace-pdf-view-autoloads sesman-autoloads
spinner-autoloads symbol-overlay-autoloads telega-autoloads
rainbow-identifiers-autoloads transient-autoloads treepy-autoloads
vertico-autoloads virtualenvwrapper-autoloads s-autoloads dash-autoloads
visual-fill-column-autoloads wgrep-autoloads info with-editor-autoloads
xclip-autoloads xelb-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 icons
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 lcms2
dynamic-setting system-font-setting font-render-setting cairo xinput2 x
multi-tty move-toolbar make-network-process native-compile emacs)

Memory information:
((conses 16 7446884 1304663) (symbols 48 147697 287)
 (strings 32 1011999 111534) (string-bytes 1 106814715) (vectors 16 363473)
 (vector-slots 8 6352574 537834) (floats 8 302078 71273)
 (intervals 56 290975 39561) (buffers 992 321))

-- 
Ignorance more frequently begets confidence than does knowledge
  - Charles Darwin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70507; Package emacs. (Mon, 20 May 2024 20:20:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Jose A Ortega Ruiz <jao <at> gnu.org>, 70507 <at> debbugs.gnu.org
Cc: Jim Porter <jporterbugs <at> gmail.com>
Subject: Re: bug#70507: 30.0.50; eshell: grep -H and -n flags are hardcoded
 and the latter cannot be overwritten
Date: Mon, 20 May 2024 20:18:37 +0000
Jose A Ortega Ruiz <jao <at> gnu.org> writes:

> Hi,
>
> I've noticed that -Hn flags are hardcoded when calling eshell's grep
> command. Specially in pipes, where -H prints a noisy (standard input)
> prefix for every line, those flags are rarely what I personally want,
> and I'd like to have the option to disable them. For -H i can add -h to
> the call, or even redefine eshell/grep to not use -H, but there's no
> flag to disable -n.
>
> Thanks!

Jim, any comments on the above bug report?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70507; Package emacs. (Mon, 20 May 2024 20:54:02 GMT) Full text and rfc822 format available.

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

From: Jim Porter <jporterbugs <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>, Jose A Ortega Ruiz <jao <at> gnu.org>, 
 70507 <at> debbugs.gnu.org
Subject: Re: bug#70507: 30.0.50; eshell: grep -H and -n flags are hardcoded
 and the latter cannot be overwritten
Date: Mon, 20 May 2024 13:52:29 -0700
On 5/20/2024 1:18 PM, Stefan Kangas wrote:
> Jose A Ortega Ruiz <jao <at> gnu.org> writes:
> 
>> I've noticed that -Hn flags are hardcoded when calling eshell's grep
>> command. Specially in pipes, where -H prints a noisy (standard input)
>> prefix for every line, those flags are rarely what I personally want,
>> and I'd like to have the option to disable them. For -H i can add -h to
>> the call, or even redefine eshell/grep to not use -H, but there's no
>> flag to disable -n.
> 
> Jim, any comments on the above bug report?

It would probably be reasonable to define some new 
'eshell-grep-default-interactive-flags' variable, defaulting to "-nH" 
and only taking effect when being redirected to a compilation buffer. 
Maybe 'eshell-compile' could also take an EXTRA-ARGS argument that holds 
extra args to use. There are a few edge cases here I haven't fully 
though through, so maybe this is all wrong.

In the short term though, you have a few options:

1. "alias grep '*grep $@*'": This just makes "grep" always use the real 
"grep" program on your computer, with no fancy compilation buffers.

2. "alias grep 'compile --mode=grep-mode grep $@*'": This ensures that 
"grep" opens in a compilation buffer when called interactively (and not 
in a pipeline, etc), but only with the flags you explicitly specify.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70507; Package emacs. (Mon, 20 May 2024 20:57:01 GMT) Full text and rfc822 format available.

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

From: jao <jao <at> gnu.org>
To: "Jim Porter" <jporterbugs <at> gmail.com>
Cc: 70507 <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#70507: 30.0.50; eshell: grep -H and -n flags are hardcoded
 and the latter cannot be overwritten
Date: Mon, 20 May 2024 21:56:39 +0100
On Mon, May 20 2024, Jim Porter wrote:

> On 5/20/2024 1:18 PM, Stefan Kangas wrote:
>> Jose A Ortega Ruiz <jao <at> gnu.org> writes:
>>
>>> I've noticed that -Hn flags are hardcoded when calling eshell's grep
>>> command. Specially in pipes, where -H prints a noisy (standard input)
>>> prefix for every line, those flags are rarely what I personally want,
>>> and I'd like to have the option to disable them. For -H i can add -h to
>>> the call, or even redefine eshell/grep to not use -H, but there's no
>>> flag to disable -n.
>>
>> Jim, any comments on the above bug report?
>
> It would probably be reasonable to define some new
> 'eshell-grep-default-interactive-flags' variable, defaulting to "-nH"
> and only taking effect when being redirected to a compilation buffer.
> Maybe 'eshell-compile' could also take an EXTRA-ARGS argument that holds
> extra args to use. There are a few edge cases here I haven't fully
> though through, so maybe this is all wrong.
>
> In the short term though, you have a few options:
>
> 1. "alias grep '*grep $@*'": This just makes "grep" always use the real
> "grep" program on your computer, with no fancy compilation buffers.
>
> 2. "alias grep 'compile --mode=grep-mode grep $@*'": This ensures that
> "grep" opens in a compilation buffer when called interactively (and not
> in a pipeline, etc), but only with the flags you explicitly specify.

Thanks for your feedback. For my use cases, solution 2 is probably
covering all the bases.

Cheers,
jao
-- 
ā€œIā€™m all these words, all these strangers, this dust of words, with no
ground for their setting, no sky for their dispersing.ā€
 - Samuel Beckett, The Unnamable




This bug report was last modified 186 days ago.

Previous Next


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