Live data from Hacker News

Emacs Is My New Window Manager

howardism.org

41–50 of 166 posts

Re: Emacs Is My New Window Manager

#41

Xmonad, Emacs, a terminal and Chrome pretty much do the same thing for me on Ubuntu desktop, possibly with a little less pain. Mostly mouse free operation, and easy resizing, swapping etc. If you want to learn Emacs, just jump in head first. Try and use it like a native. Just for kicks I'm trying to do the same with vi by forcing myself to use it for anything vaguely sysadmin related.

I generally like that setup better as well, but imo one of the advantages of the emacs approach is that there is more of a culture of providing extensive API hooks for scripting. If you run an RSS reader inside emacs, it's expected that it'll expose many/most of its operations via elisp function entry points, so what's going on in the reader is "transparent" in a sense: scripts can query the list of feeds, the items within the feed, the read/unread status of items, can grab the text of items, can trigger re-fetches, etc. And you can integrate that with a bookmarks manager, outgoing email, whatever.

Most tabbing window managers also provide a pretty good scripting interface, but the programs you run inside them tend to be more opaque. If you run the ncurses RSS reader 'newsbeuter' in a window, your WM scripts can't easily interact with a running instance, short of screenscraping its output and sending it raw keystrokes as input, because it doesn't expose any kind of API.

Re: Emacs Is My New Window Manager

#42

What is the best way to actually learn emacs? I'm a vim guy who is curious enough to switch but I'd rather just hack the introductory process and get to the fun bits.

The most interesting cultural observation thats not often talked about is bare emacs and bare vi are equivalent-ish, but all the "cool" stuff in emacs is in the addons.

If you just use bare emacs you'll think its pretty boring and not see any productivity gains.

If you use a pre-packaged set for emacs, you'll be utterly overwhelmed trying to learn a million things at once. There are no pre-pack sets with just systemic improvements.

Another cultural thing is there's addons for emacs that improve everything (like helm) and addons that provide one nifty feature (like magit) and addons that are affinity specific (like clojure-mode thats of interest to clojure coders but not likely other coders). So we call them all the same thing, addon or extension or whatever, but there's 3 classes of thing with that name that differ in how you interact with them and they interact with you.

So ... my advice is install your vanilla emacs, put in the stereotypical system wide addons maybe just helm, and then add one package at a time figuring out what they do.

Aggressive-indent rather forcefully indents your code as it sees fit, which some like, others hate. Maybe a good place to start?

So projectile and helm-projectile makes opening files in the same project simple. It understands your git repos and you can open any file in that repo and a lot of other repo related stuff.

And perspective lets to segregate multiple project buffers so however unwise it is, you can work on multiple separate real world projects at the same time.

And flycheck does on the fly highlighting of errors in your code.

And magit does git inside emacs sorta

rainbow-* does colorful syntax highlighting (or drives people nuts)

yasnippet adds tab completion (so "i" "f" "tab" give you a whole if-then stanza ready for editing, depending on your language)

Trying to add all that at once would drive you nuts, so one package at a time till you feel OK with it. I still don't entirely feel OK with magit, whatever.

There's also language specific packages although cider and clojure-mode will be quite useless unless you code clojure, etc.

Re: Emacs Is My New Window Manager

#43
Minor nitpick, but isn't that Firefox, not Chromium in the screenshot of the web browser overlaying emacs, right after mentioning that he uses Chromium instead of Firefox because it requires a "real" window manager?

Regardless though it's an interesting setup, I've always wanted to try a minimal window manager.

Re: Emacs Is My New Window Manager

#46
post #15

My impression has been that emacs is a poor window manager. Granted, I am not incredibly skilled with emacs but even after some weeks I was still confused by the way emacs opened up new windows or changed existing windows when you've clicked on something (for instance, in dired or org-mode's agenda) I ended up to open everything in a new frame and left the management of these frames to awesomewm.

Emacs has many frustrating behaviors out of the box. Typo-> C-z->Crap->Grab Mouse->Expand Emacs Window->Scold self for not calling it a frame. "Frames v. Windows" thing aside, every behavior in Emacs is configurable. It's just that the default assumes that the user fired up Dired to seriously use Dired. The default assumes that the user is using Emacs as Dired and so it becomes Dired with lots of dedicated resources.…

BTW, you can run "killall -CONT emacs" instead of having to use a mouse and expand the window (which is hack anyway).

You could also use cua-mode, which makes Ctrl-Z work like in other applications. Or you could use an "Emacs starter kit" which includes it (I started with "Emacs Prelude", although that doesn't include cua-mode if that's what you're after).

Other answers are given here, including a one-liner to disable Ctrl-Z completely:

http://superuser.com/questions/349943/how-to-awake-emacs-gui...

Of course, this "frustrating behaviour" goes the other way too. I've lost count how many times I've made a selection in some application, then pressed Ctrl-W to cut it, only to have the document/program close!

I don't think it's fair to blame this kind of mis-match on Emacs though, since it's been around for 30 years and pre-dates the "standard" conventions by quite a bit. Emacs shouldn't have to change based on current trends, and as I've already mentioned, changing the default behaviour is a job better suited to Emacs starter kits than Emacs itself.

I don't blame the convention for not being Emacs-compatible either. It's just another unfortunate case of standardising on a sub-optimal solution. An "optimal" solution wouldn't need to work across every application, it would just minimise the chances of accidental data loss, crashes, etc. when used across as many popular applications as possible. Accidentally selecting text, or moving to the end of a line, is better than accidentally closing an application ;)

Re: Emacs Is My New Window Manager

#47
post #35

One can get the same effect (full-screen emacs, no window decorations, Lisp) with stumpwm, a window manager written in Common Lisp. It's under active development, but it has not so far succumbed to creeping featuritis. And one can then run Firefox instead of Chrome…

Yeah, the main problem with this approach is all the mouseless extensions I found for webkit (vimperator, surf, uzbl, etc) were built around Vim bindings instead of Emacs bindings. For some reason all the Emacs-centric ones (Conkeror, Keysnail) are based on Gecko.

Maybe this is because Gecko's extension mechanism is worlds better than the one that ships with Chromium, (which requires you to recompile the C++ just to change the key bindings for menu items) and the crap extension mechanism bothers Emacs users more than Vim users, but it's a weird coincidence all the same.

And it's always possible (and hopeful) that things have improved in webkit land since I last took a look.

Re: Emacs Is My New Window Manager

#48
post #19

If only eshell was more usable. My favourite setup so far is i3 + emacs + xterm.

There's eshell, shell and term, each with tradeoffs (see on of my other comments). I have an external terminal running tmux and a bunch of curses programs (wicd-curses, alsamixer and cmus) but do everything else in shell mode or eshell mode.

To me, the killer feature of shell mode is the ability to manipulate the buffer contents like any other file. The killer feature of eshell is its built-in TRAMP support, for manipulating and opening remote files transparently. Eshell's lack of pipes makes shell mode my default though.

Re: Emacs Is My New Window Manager

#50
post #38
post #8

I'm always a little jealous when I see what people do with emacs. But I've never liked using emacs, so I've resigned myself to a permanent, mild case of emacs envy. I think you could get approximately his same functionality with a terminal (e.g urxvt) and tmux for the splitting. In fact I do essentially that at work on Windows, from a cygwin terminal and tmux. When it fits whatever workflow I'm doing from within cygw…

What do you use i3wm with? I like Debian and wonder if there's a best practise setup for desktop environment plus i3wm. Everyone seems to do something different and the setups I've seen have all had minor quirks (wifi tray icon, sound control, locking, etc). Currently my main machine is Ubuntu 14.04 with Xcfe and i3wm and I have a few quirks (something about the keyboard charset picker never aligning with the Xcfe tr…

I use i3 on Arch with a custom dmenu (https://wiki.archlinux.org/index.php/dmenu) for opening GUI applications, along with tmux for terminal applications like OP. I also use the included i3bar (http://i3wm.org/i3bar/). i3 documentation is so good it's a joy to configure. I only have few tools, but it gets me wherever I need to go.
Post reply on HN