A Full Screen Eshell

Almost all of my tube time is spent in 4 programs: Emacs; Safari; Reeder; and Mail, roughly in that order. Naturally, I try to stay in Emacs as much as I can. In particular, I’ve long bound 【Ctrl+c s】 to start a bash shell in an Emacs buffer.

Recently, I came across this post and video by Eric Himmelreich on ways he makes Emacs fit his workflow. He demonstrates two things. First, he has a function that splits his Emacs frame into two side-by-side windows of 80 characters each and makes the frame take up all available screen height. I do much the same thing except that the window configuration is performed by a system-specific initialization file.

The second thing is more interesting. He likes to have a full screen terminal running that he can bring up when he needs it. He decided to integrate that into Emacs by writing a keyboard macro to start a full screen eshell and another to restore the previous window configuration. That seemed pretty useful to me and after playing around with eshell a bit, I decided I liked it better than running bash so I decided to implement something similar to what Himmelreich did.

Rather than use keyboard macros, as he did, I stole the idea behind Magnar Sveen’s excellent magit-status hack. The idea is simple: typing 【Hyper+e】 saves the current window configuration, starts eshell, and deletes the other windows. A subsequent 【Hyper+e】 restores the window configuration. The code is simple

(global-set-key (kbd "H-e")
                (lambda ()
                  "Bring up a full-screen eshell or restore previous config."
                  (interactive)
                  (if (string= "eshell-mode" major-mode)
                      (jump-to-register :eshell-fullscreen)
                    (progn
                      (window-configuration-to-register :eshell-fullscreen)
                      (eshell)
                      (delete-other-windows)))))
Posted in Programming | Tagged , | 3 Comments

Pallet

I just saw a reference to Pallet on reddit. It’s a way of syncing your Emacs packages across several machines. For example, you might, like me, have several machines and want your ELPA configuration to look the same on all of them. The usual strategy of throwing everything in git or some other version control can cause merge conflicts and other problems. Pallet is supposed to handle the syncing in a more efficient way.

It looks pretty nice but judging from the comments it’s very new and no one commenting on reddit had any experience with it. Does anyone here have wisdom to share about it?

Posted in General | Tagged | 5 Comments

Enough Already

Over at the Emacs subreddit, MoreHugs is gnashing his teeth and beating his brow over the fact that the Emacs UI is not pretty enough for some users and thus inhibits uptake. Why, he wonders, can’t Emacs have a nice modern UI like Light-Table or SublimeText 2? Really, this is almost as annoying as the non-Lispers complaining about all those parentheses.

I love Emacs and don’t understand why everyone doesn’t use it but, as I’ve said before, the choice of an editor is a personal matter and no one else’s business. That said, if your reason for not using Emacs is that the UI isn’t pretty enough then as far as I’m concerned you’re not a serious person and we have nothing more to discuss1.

Use Emacs or don’t use it. Use whatever editor makes you happy and productive but for goodness sake, make your choice on something more important than how “pretty” the UI looks. People who do that are the same type of people who would choose a nice looking sports car for working the farm.

Vivek Haldar, who’s thought about these matters in some depth, put it best:

What I don’t understand is: why should you ever care how your editor
looks, unless you’re trying to win a screenshot competition? The
primary factor in looking good should be the choice of a good font at
a comfortable size, and a syntax coloring theme that you like.

I use Emacs because it gives me power—including the power to add missing functionality to make my life easier. I don’t care about tabbed displays, menus, or fancy buttons. And I certainly don’t care about a pretty interface. It’s a text editor for crying out loud.

Update: Added link to original reddit post.

Footnotes:

1 Strong words? They’re not nearly as intemperate as what I originally wrote.

Posted in General | Tagged | 5 Comments

SBCL 1.1.5 Is Out

I know I just wrote about SBCL 1.1.4 but that was because I somehow missed its release notice. This month I’m doing better and writing about SBCL 1.1.5 closer to when it was actually released.

As usual, compilation and installation went without a hitch. Besides the usual bug fixes, there a bunch of enhancements (see release notes for details) and a couple of new features, including package local nicknames. SBCL just keeps getting better and better. As I’ve said before, if you’re a Lisper you really should check it out.

Posted in Programming | Tagged , | Leave a comment

Remarks on EmacsGolf 2

There were a lot of good solutions to this challenge. I thought the interesting part would be switching the character entries in the table. If you are just before the first character pair vector, you can do that in 5 keystrokes with

F3 start keyboard macro
Meta+f forward to just after A
Meta+t switch characters
Meta+0 for the whole table…
F4 …execute the macro

It turns out, however, that the rest of the problem—what I thought of as “grunt work”—has some lessons to teach us too. Fuco has a nice trick for transposing “latin” and “gothic”: he makes use of the fact that a 0 argument to transpose words will transpose the words at or after the point and mark. I vaguely knew that but had never seen it used. Fuco also has a solution using multiple-cursors that solves the challenge in 22 keystrokes. In both solutions he makes use of his smartparens package. I’m not currently using it but it looks pretty nice so I’m going to look into it a bit more.

Jorge has a very nice solution in 21 keystrokes. Phil refines that a bit and gets it down to 17.

Xah Lee has a solution using query-replace-regexp that gets it done in 18 keystrokes using some of the customizations to his .emacs file.

Lee has sent me another proposed challenge, which I’ll post in a bit, but we shouldn’t make him do all the work or have all the fun. If you enjoy working on EmacsGolf challenges, please send your own challenges to challenges at the domain of this blog.

Posted in General | Tagged | Leave a comment

Emacs in the Coming Year

Nic Ferrier, the creator of elnode and the proprietor of Marmalade, gave an interesting Skills Matter talk on what the coming year will mean for Emacs. The video is about an hour and a quarter so plan appropriately.

The talk centers around Emacs becoming an important development environment in the same sense that Lisp Machines were. Ferrier begins with elnode, a platform that allows you to write Web servers that run under Emacs. As examples, he demonstrates a simple Web Chat app and then moves on to discuss how he is rewriting Marmalade to run under elnode.

There’s a lot good material and ideas in the talk. It’s long but well worth your time. Ferrier shows how the dream of having a modern Lisp Machine development environment is closer than you may think.

Posted in General | Tagged | 2 Comments

Quickdocs

Eitarow Fukamachi has put up an interesting service called Quickdocs. It’s a search engine for the Quicklisp repository. There’s no directions or explanation of exactly what a search provides so it’s a bit of an adventure game but appears to be quite useful. If I type in “iron,” I get a result that says “ironclad” the excellent crypto library from Nathan Froyd. When I click on “ironclad” it gives me the README for the project and offers to download it for me.

From what I can tell, the search is a regular expression search on the project name so typing in “crypto” returns no results. This appears to be a handy resource and will doubtless get better. Worth a look if you are, as you should be, a Quicklisp user.

Posted in Programming | Tagged , | Leave a comment

Richard Dillon’s Emacs Videos

Via Magnar Sveen’s Emacs Rocks! twitter feed I came across this retweet pointing me at Richard Dillon’s Emacs videos. It’s a set of 13 videos on using Emacs intended mostly for those inexperienced with Emacs. He covers several topics including

  • Working with buffers
  • Working with windows and frames
  • The mark and point
  • Org mode
  • Customization
  • Loading mechanisms
  • Initialization files
  • Working with the REPL
  • Hacking the mode line

Even though these videos are mainly aimed at the n00b, I still learned a few things I didn’t know. They’re each 10 to 20 minutes long so they cover the material pretty well.

If you want to view the videos in order, start at the end of the list and work your way up. Of course, YouTube starts the video automatically when you click on the link. That leads to a slight problem (at least for me). I like to view them in full screen so I click on the expand button after the video has started but then it’s very hard to read his Emacs screen. I discovered that if you stop the video and restart it (while in full screen mode) it restarts and will be perfectly clear.

All in all, a useful addition to the set of Emacs videos. Well worth taking a look at regardless of your familiarity with Emacs.

Posted in General | Tagged | Leave a comment

Reflections on Trusting Trust Redux

Way back in 1984, Ken Thompson wrote what I consider one of the greatest papers on computer security. I wrote about this in my The Greatest Hack of all Time post. If you haven’t read this paper your education is incomplete and you should remedy the situation immediately. You can find the paper here.

Bruce Schneier is reporting that David Wheeler has published a paper on how to detect the Thompson hack. This is good stuff. The solution is simple and obvious in retrospect but interesting nonetheless. You really should take a look at this (and Thompson’s original paper) even if you’re not particularly interested in security—it’s part of your heritage.

Posted in General | Tagged | Leave a comment

The Vivid Schemer

Recursion always seems to cause beginning CS students trouble. One of the very best resources for learning and becoming comfortable with it is The Little Schemer. Although the exercises are in Scheme, they apply equally well to Common Lisp or Elisp.

Now Cheng Yichao brings us The Vivid Schemer, which captures the spirit of The Little Schemer in an interactive Web page. If you’re a fan of The Little Schemer or you’d like to get a feel for what it’s like, take a look at the Vivid Schemer.

Posted in Programming | Tagged , | Leave a comment