Live data from Hacker News

Take Two: Eshell

yummymelon.com

41–50 of 69 posts

Re: Take Two: Eshell

#41
post #13
post #2

I wish someone could write a "The Good Parts" book for Emacs. Even after reading the manual twice, I'm still overwhelmed with the API and forget even the most basic configuration options after a month of inactivity.

Emacs is the type of environment you need to immerse yourself in and build an intuition for. There's no shortcut for that. If you can't spend a couple hours a day for a few months using it, you're never going to feel at home in it. It's quite possible you just don't need Emacs.

As a longtime emacs user, this perfectly summarizes what is most awful about it! It makes me cringe when people wag their fingers to correct the "misperception" that emacs is merely a great text editor and IDE, but rather a programmable elisp application platform. In reality, vanilla emacs with only a little bit of configuration (and as with any other editor, substantially more tinkering with installation and configuration of supporting binaries), provides a really great programming environment for almost any type of application.

Re: Take Two: Eshell

#42

The writer is incredibly knowledgable. But all of this is completely unapealing. To me this isn't power, it is just learning a lot more things.

I liked all the parts that were not about eshell. Wdired and its cousin wgrep are killer. I didn't see much value in the eshell examples provided.

Re: Take Two: Eshell

#43
post #38

Earlier quoted context omitted.

> These were essentially drop-in replacements with minimal impact to me. Consider what it would take to replace dired or Magit, as perfect as they might be. There's a difference of philosophy there. The Unix way is a good concept to align software, but it's not the only one. In Emacs, the primitives are different. Instead of having pipes, redirectors, thinking in terms of lines,... What you have are buffers, windows…

Right, the primitives are definitely different. But that's my point. The Unix primitives are simple and generic, which allows the user to quickly and easily adapt a disparate set of tools into an infinite number of workflows. The user is not required to also be a programmer[1]. If they are missing a specific tool, which is very rare, then it can be written in any language and integrated into existing workflows by fol…

Emac's primitive are much more involved for sure. But the focus on having a simple and common representation for input and output instead of the separation between prompt and output has make it a lot easier to write involved tooling. Instead of a TUI application which breaks the unix philosophy or a script for a single workflow, you have both. The closest I think is now Vim+tmux, but it's now as easy to modify on the fly.

Re: Take Two: Eshell

#45
> For file management these days, Dired is my interface of choice. It is simply the more elegant tool for the job. Case in point: renaming a bunch of files in a directory to arbitrary names. With a shell, my standard approach would have been to run some variant of `ls -1 > foo.sh`, edit `foo.sh` to insert `mv` on each line to a renamed target file, `chmod u+x foo.sh` to be executable, run `foo.sh`, delete `foo.sh` and call it a day.

I used to do this before I discovered vidir. [1] vidir is not actually tied to vi; it lets you rename and delete files through your `$EDITOR`. You edit a temporary file that looks like this:

  ...
  0093./fstab
  0094./fuse.conf
  0095./fwupd
  ...
There is also https://github.com/bulletmark/edir designed to improve on vidir. I haven't used it yet.

I'll give Emacs another try some day, I swear, and Dired is one of the reasons.

Edit: [1] I linked to https://github.com/trapd00r/vidir here at first. That is a fork; vidir comes from https://joeyh.name/code/moreutils/. You probably want the original. It is packaged for Debian, FreeBSD, Homebrew, etc. as part of the package `moreutils`.

Re: Take Two: Eshell

#46
post #2

I wish someone could write a "The Good Parts" book for Emacs. Even after reading the manual twice, I'm still overwhelmed with the API and forget even the most basic configuration options after a month of inactivity.

FWIW, for just "using" Emacs, I wrote a number of keyboard-driven menus for different modes called Casual. Read all about it here: https://github.com/kickingvegas/casual

For understanding Elisp, I wrote an "Elisp Cheetsheet for Python Programmers" to help as a reference.

https://github.com/kickingvegas/elisp-for-python

Re: Take Two: Eshell

#47

> For file management these days, Dired is my interface of choice. It is simply the more elegant tool for the job. Case in point: renaming a bunch of files in a directory to arbitrary names. With a shell, my standard approach would have been to run some variant of `ls -1 > foo.sh`, edit `foo.sh` to insert `mv` on each line to a renamed target file, `chmod u+x foo.sh` to be executable, run `foo.sh`, delete `foo.sh` an…

Is https://github.com/trapd00r/vidir> the same as `vidir` from https://joeyh.name/code/moreutils/>?

Shout out to moreutils, there are many nice utilities, and there's a `moreutils` package in most distributions.

Update: Looking at the authors listed in the man pages, the `trapd00r` version looks to be a fork of the moreutils version. Not sure how the functionality compares. Both versions seem to have been updated since the fork.

Re: Take Two: Eshell

#48

> For file management these days, Dired is my interface of choice. It is simply the more elegant tool for the job. Case in point: renaming a bunch of files in a directory to arbitrary names. With a shell, my standard approach would have been to run some variant of `ls -1 > foo.sh`, edit `foo.sh` to insert `mv` on each line to a renamed target file, `chmod u+x foo.sh` to be executable, run `foo.sh`, delete `foo.sh` an…

I didn't know of vidir, but I just thought I'd share some funny etymology, since I know someone called Viðir.

Besides meaning vi + dir, the Icelandic name means "willow tree", which is a cool name for a directory traversal tool.

Re: Take Two: Eshell

#49
post #47

> For file management these days, Dired is my interface of choice. It is simply the more elegant tool for the job. Case in point: renaming a bunch of files in a directory to arbitrary names. With a shell, my standard approach would have been to run some variant of `ls -1 > foo.sh`, edit `foo.sh` to insert `mv` on each line to a renamed target file, `chmod u+x foo.sh` to be executable, run `foo.sh`, delete `foo.sh` an…

Is https://github.com/trapd00r/vidir > the same as `vidir` from https://joeyh.name/code/moreutils/ >? Shout out to moreutils, there are many nice utilities, and there's a `moreutils` package in most distributions. Update: Looking at the authors listed in the man pages, the `trapd00r` version looks to be a fork of the moreutils version. Not sure how the functionality compares. Both versions seem to have been updated s…

> Both versions seem to have been updated since the fork.

Thanks for pointing this out. It looks like the @trapd00r version has added `--sort` but lacks zero padding for the numbers that improves the UX. I mistakenly thought it was a fork tracking the original. I have edited my comment.

Re: Take Two: Eshell

#50
post #2

I wish someone could write a "The Good Parts" book for Emacs. Even after reading the manual twice, I'm still overwhelmed with the API and forget even the most basic configuration options after a month of inactivity.

> forget even the most basic configuration options after a month of inactivity

So do I. ChatGPT4o and the like of course do not forget, and they've read more documentation, library code, and message forum postings than any human could. They know all the five or so ways to initialize per-buffer variables and will write you little snippets of Elisp to add to your .emacs or .dir-locals.el or per-file headers/trailers.

So, if Org-mode or multi-occur aren't doing what I want, and `M-x info-emacs-manual` doesn't make it obvious, ChatGPT4o is my next recourse.

Post reply on HN