News for hackers. Stuff that matters.
Re:Eshell as a main shell by TeMPOraL on Wednesday May 09, 2018 @05:29AM (#17028491)
I must say I really like the UI paradigm of Emacs. It's the "best of both worlds" combination of text-based interfaces and GUIs. It supports software that can be interactive, and yet also as interoperable as CLI applications (or even more).

It's the reason it isn't silly that people read e-mails, chat or manage their files from Emacs. A CLI e-mail client is annoying because of the typing. A GUI e-mail client lacks any sensible interoperability. A curses-based e-mail client is the worst of both worlds - neither interoperable, not particularly nice looking. An e-mail client in Emacs - and any other application made within it - immediately gains several deep levels of productivity features and interoperability:

- All your usual keybindings work. All your usual searching and editing operations work - that includes not just typical "move around and edit stuff", but also things like advanced autocompletion, interactive or batch regexp search & replace, grepping through everything that's displayed, multiple cursors, and whatever other thing you like.

- Since application's UI is rendered mostly as text (with some minimal non-text overlays if necessary), you can navigate around, interact with and copy everything you see. Need to copy headers of an e-mail to somewhere? If they're displayed, you can. Need to copy a list of e-mails sent from someone? Filter those mails, and then just copy the list from the buffer, as if it was regular text.

- Above solves like 90% of your basic interoperability requirements that let you be extremely productive. Need more? Learn some basic elisp, and now you can script or extend everything, both from outside (using "exposed" application's API) and inside (augmenting/modifying application's code at runtime). Emacs exposes lots of functions optimized for working with text in an editor, so it usually takes just a few lines of code to compose together a new productivity feature. Need the list of e-mails mentioned previously regularly, for your weekly report? That's probably one call to generate it in the background, few more lines to select and copy it as text, and paste it straight into the file you're editing.

Really, in my life I haven't seen any other platform embracing interoperability by default.

EDIT:

Turns out, the author of TFA covers this topic in another post: https://ambrevar.bitbucket.io/emacs-everywhere/.

Re:Eshell as a main shell by Torwald on Thursday May 17, 2018 @04:53PM (#17095636)
"the UI paradigm of Emacs" is also called a roguelike interface by ESR, vi's too: "In Chapter 11 we described the effect of the absence of standard arrow keys on early roguelike programs; vi was one of these. " http://www.catb.org/esr/writings/taoup/html/ch13s03.html

read: http://www.catb.org/esr/writings/taoup/html/ch11s06.html

"orthodox" seems to be more related to file managers https://en.wikipedia.org/wiki/File_manager#Orthodox_file_man...

Re:Eshell as a main shell by kqr on Wednesday May 09, 2018 @02:01PM (#17032161)
This is maybe known as the orthodox UI paradigm. I have been meaning to write about it but in the meantime here's someone elses words: http://www.softpanorama.org/Articles/introduction_to_orthodo...
Re:Eshell as a main shell by TeMPOraL on Wednesday May 09, 2018 @02:42PM (#17032611)
Never heard of that term before, thanks!

Skimming the article, Emacs seems to be an outlier even for that category. Quoting from the abstract, the set of ideas defining Orthodox UIs:

1. Distinct command set layer with commands that can be entered from the command line and reflected in GUI interface. In this sense vi is a reference implementation and OFM inspired by vi have some interesting, distinct from traditional line of OFM ideas implemented. See ranger and vifm.

2. Tiled, nonoverlapping windows with minimum decorations

3. Stress on availability of all commands via keyboard, not only via mouse clicks, although mouse can be productively used and is used in such interface.

4. Ability to redirect output of commands executed in one window to other windows and processes.

5. Usage of GUI elements to generate commands on command line (macrovariables and such commands as Ctrl-Enter, Ctrl-[ and Ctrl-] in OFM. )

6. Accent of extensibility and programmability (with shell and/or scripting languages) instead of eye candy.

Emacs doesn't seem to meet #1. Sure, you can transfer commands from commandline to a new and/or existing Emacs instance (e.g. through emacsclient -e "some lisp code"), but it's not a common way of using it. It definitely meets #2, #3 and #4. It would fail at #5 if I understand it correctly - sure you can do this, but most of the time you use keys to execute elisp directly, not through shelling out. And as for #6, Emacs blows everything else out of the water.

Re:Eshell as a main shell by kqr on Wednesday May 09, 2018 @05:20PM (#17034199)
This is the reason I'd like to write more about it. The author has a needlessly narrow definition.

I'd argue it is more useful to talk about "a language interpreter" rather than a "commandline". A command line is a language interpreter, of course, where the commands make up the language. Emacs is also, at its core, a language interpreter -- but its language is not a simple command set, it is Emacs Lisp.

From that perspective, one can reevaluate 1 and 5:

1. Emacs is at its core a virtual machine that runs elisp, and any modifications you do to that elisp environment shows in the GUI. Change the mode line variable? GUI reflects it. Evaling Emacs Lisp expressions is one of the most common ways to interact with the editor in more fundamental ways than offered by the interactive functions.

5. It is common for some people to use the mouse to click around in Emacs. I do it too, sometimes, with stuff like dired. These clicks are not magic built-ins. They are, just like keys on the keyboard, only bound to execute Emacs Lisp functions. Redefine the function, and you redefine the meaning of the click.

This is the very reason Emacs is as hackable as it is.

Re:Eshell as a main shell by TeMPOraL on Thursday May 10, 2018 @01:20AM (#17036584)
Yes, I agree with that.

If you have more thoughts on that, I'd love to read them. So I want to encourage you to write about it. It's a very much underdiscussed topic.

I thought about it in the context of the "Tech's Two Philosophies" article (https://news.ycombinator.com/item?id=17030339) that showed up a couple hours ago. I look at the overall way Emacs works, and how many other powerful OSS tools work, and then I look at those companies mentioned, and it makes me deeply sad. Those companies, which happen to be trendsetters of our industry, are so up to their ears in moneymaking that they no longer realize most of their practices and recommendations are user-hostile and productivity-minimizing.