Some Notes On ace-window

The other day, I wrote about ace-window, a really nice way of quickly jumping from one window to another. I used the suggested key sequence 【Meta+p】 to trigger it so it seemed pretty fast.

After using it for a while, I noticed that it didn’t work with ibuffer because ibuffer uses 【Meta+p】 to move through filters. Since I very often have an ibuffer buffer open, I decided to change the triggering key sequence.

One further thing you should know about ace-window is that if there are only two windows, it simply switches to the window that doesn’t have focus (exactly as if you had typed 【Ctrl+x o】). I remembered that Mathias Dahl had commented that he used 【F1】 and 【F2】 to move between windows because it was a single key and very quick so I decided to use a function key. I chose 【F11】 because I find it easy to reach. Now things are even better. If I have two windows open I can switch between them with 【F11】 and if there are more than two windows, ace-window gets triggered with the same key. A definite win.

Posted in General | Tagged | 4 Comments

Sacha Chats with Bozhidar Batsov

Sacha Chua has posted the latest episode in her Emacs Chats series. This time it’s with Bozhidar Batsov, who, among other things, runs the excellent Emacs Redux blog. Batsov is also the author of the prelude, projectile, and cider packages for Emacs.

Batsov talks about how he got started with Emacs, his hopes for its future, and his plans for ongoing Emacs work. He demonstrates some of the features of prelude, a sort of advanced starter kit for Emacs, and his project manager projectile. I was delighted to learn that he uses many of the same micro-optimizations that I do. For example, he’s a big user of ace-jump-mode and ace-windows, two packages that I’m using more and more lately.

The chat is a bit over 53 minutes so you’ll need to set some time aside. The beginning of the chat has some technical problems with bandwidth but once you get through the initial snafus it’s fine. Batsov has made some significant contributions to the Emacs community so I think you’ll enjoy hearing what he has to say.

Update: Added link to the video.

Posted in General | Tagged | Leave a comment

Bjarne Stroustrup on Linked Lists

Suppose you have a large, sorted sequence of integers that you wish to store in memory. You need to be able to efficiently add and delete elements to and from the sequence while keeping it sorted. What data structure would you use?

The two natural candidates are arrays and linked lists. Which one do you think is most efficient? If you’re like most programmers you would choose the linked list to limit the amount of data you have to move. For example, if you use arrays and your sequence is 1,000,000 integers long, you will, on average, have to move 500,000 integers for each addition or deletion. With a linked list, on the other hand, it’s simply a matter of adjusting a couple of pointers. It makes sense, then, that a linked list is the most efficient data structure to use.

Except it’s not. The linked list is, in fact, a couple of orders of magnitude slower than using an array. How can this be? It turns out, as Bjarne Stroustrup explains in this video that the process is completely dominated by the linear search to find the insertion/deletion point. The reason for that has to do with the cache; watch the video for the details.

If you’re familiar with Emacs internals, you’ve probably wondered why Emacs treats its buffers as arrays and moves data when it needs to insert or delete characters from the middle of the buffer rather than using a linked list of lines as many editors do. It may seem grossly inefficient to do things this way but as the video shows, it is, in fact, far more efficient on modern machines.

The video is only 7 minutes and 45 seconds but makes an important point. It’s entertaining as well as informative and well worth your time.

Posted in Programming | Tagged | 8 Comments

Getting Stable Packages from MELPA

I get most of my packages from the MELPA repository and I’m very happy with the results. Some folks object to MELPA because the repository has snapshots of the packages that may not be stable. I’ve seldom had any problems with a package but I can see how others might be concerned.

Bozhidar Batsov has a nice post at Emacs Redux that explains how to get only stable packages from MELPA. The TL;DR is that MELPA has a second repository made directly from Github packages tagged as ready to release by the maintainers. See Batsov’s post for the details.

Posted in General | Tagged | Leave a comment

Transparency Database

Yesterday, I wrote about the increased commitment to transparency being exhibited by many of the tech companies. Silk is a platform for visualizing information interactively. The staff at Silk has put together a database of information on government requests for information gathered from companies’ transparency reports.

You can view the (normalized) data by country, company, or year. For each country and company the database lists the number of requests and compliance rates. You can click on a country or company to get more detailed information.

This seems like a nice resource that will get more useful as the idea of issuing transparency reports gains steam. I found the compliance numbers particularly interesting. Be sure to click on the link to see the complete list of countries. The compliance rates of the companies is interesting too. WordPress and Apple have the lowest rates (33%) while Pinterest has the highest (92%). Part of that can be explained by the fact that Pinterest had only 12 requests but Microsoft with the second highest rate of 81% had 142944 requests so some companies are definitely more amenable to cooperating than others.

I’m not sure you can use the data to make significant decisions but it’s fascinating to explore it.

Posted in General | Tagged | Leave a comment

Tech Companies Get Religion

In the aftermath of the push back from the Snowden revelations American tech companies are feeling the heat about suspicions they are a bit too cooperative with the NSA and various law enforcement agencies. Now they are endeavoring to put a little distance between themselves and the government.

One way they’re doing that is by serving notice that unless prohibited by a warrant they will notify targets that the government is seeking their information. Yahoo did this some time ago and Apple just posted their new guidelines for law enforcement agencies.

The Apple guidelines are worth reading just to see what information Apple says it can extract from its devices. Significantly, they say that they can not provide any FaceTime or iMessage data because those communications are encrypted end-to-end.

In a way you almost have to feel sorry for the law enforcement agencies. No one wants to make it more difficult to stop real criminals but they brought this problem on themselves. For years they’ve abused tools like administrative subpoenas and along with the NSA have tried to vacuum up as much information as possible. Now they’re whining and issuing dire warning about the four horsemen of the infopocalypse. It’s the same nonsense they always use: Terrorists! Think of the children! I think I’d rather think of the constitution.

In any event, this is good news and, I hope, the harbinger of more push back to come. It will be interesting to see what happens next.

Posted in General | Tagged | Leave a comment

A Guide for Writing Reproducible Research with Org Mode

Vikas Rawal has an excellent guide up at Github for writing papers with Emacs and Org Mode. He takes a reproducible research tact so it’s a great resource for learning how to produce a paper with everything in a single file and all the tables and graphs produced automatically.

The guides takes a “from the beginning” approach so it’s fine for even those with limited or, perhaps, no Emacs experience. If you have even a little bit of Emacs under your belt you should have no problems at all. One of the points that Rawal makes is that you can spend more time figuring out LaTeX than you do actually writing the paper. Using Org Mode removes most of that friction and lets you to concentrate on your writing but still allows an escape into LaTeX for specialized tweaks.

It turns out that Emacs and Org Mode are almost everything you need. He recommends Pandoc for some conversions, TeXLive and BibTeX for producing LaTex, and, in his case, R and ESS to handle statistics. R is a good solution if you’re producing a lot of statistics but the techniques he describes works just as well with other languages if your needs are different. He doesn’t go into the details of R itself so its use as the example language is not distracting.

Even if you know only a little LaTeX (or, I suppose, none at all) you can follow his recipe and get good results. That’s a major benefit when you’re just starting and don’t want to hassle with LaTeX along with everything else. Even the amount of Org that he uses is minimal so by following his example you can be producing great looking papers without knowing much about LaTeX or even Org.

I really liked this guide and recommend it if you’re looking for a way to produce journal-quality papers.

Posted in General | Tagged , | Leave a comment

The Oldest Religious War

Over at Slate, David Auerbach has an amusing article on the oldest religious war. That would be vi versus Emacs, of course. Auerbach has a dangerous marriage: he’s an Emacs user and his wife is a Vim user so he’s probably seen some front-line action.

I’ve logged a lot of time with both editors so I was able to evaluate his descriptions of the editors. By and large I agree but he thinks that Emacs is easier to learn than vi. Vi’s modality can confuse a beginner for a short time but it seems to me the command set is pretty regular and intuitive while the Emacs key sequences are much less so. I think Emacs was harder to get really efficient in but the effort was worth it because of the tremendously powerful platform that you then have at your disposal.

There’s not much new in the article for Irreal readers but you’ll probably find it interesting anyway. Read it and see what you think. If you’ve got both vi(m) and Emacs experience, leave a comment telling us whether or not you agree with Auerbach’s assessments.

Posted in General | Tagged , | 7 Comments

Emacs For Developers

Pierre Lecocq has a nice set of Emacs tips for developers. I’ve been meaning to write about it for a while now and Lecocq has recently updated it to include tips for Ruby, Python, C/C++/Objective C, Go, PHP, Java, and R developers so this seems like a good time.

If you follow the link, you land on his Github page where the README is the Table of Contents for the tips. Rather than going through them, I’ll just send you over to take a look. Some of the examples have animated gifs so it’s worth checking the tips out.

I see a lot of posts on Reddit asking how to set up Emacs for language X. Provided that X is one of the above languages, these tips may help. The sections on tips for developers is mostly links to other resources but it’s convenient to have the links in one place.

The other sections are more general tips that all Emacs users will find helpful. Again, these tips are mainly for beginners but you may find something useful. Use the TOC to explore things you think might be interesting.

Posted in General | Tagged | Leave a comment

Sacha Chats with Phil Hagelberg

For her latest chat, Sacha Chua meets up with Phil Hagelberg. A year and a half ago, Hagelberg was featured on The Setup where he had some very interesting things to say about Emacs. I wrote about that here.

Chua and Hagelberg begin with a discussion and demonstration of syme, a facility for doing pair programming on Githup projects. If you’re working jointly on a project that’s hosted on Github, you’ll want to check syme out.

They also talk about Clojure and getting a REPL for it within Emacs. That’s informative but what’s really interesting is Hagelberg’s hardware hack to control the heating in his detached programming shed. One nice feature of that is that he can control it from his house by chatting with the system over XMPP. That nice because he can get the heat going in the shed before he has to leave his house.

The chat is a few seconds over an hour so plan accordingly. Hagelberg is an interesting guy so I think you’ll enjoy the chat. Don’t worry about trying to write down the links he talks about; Chua lists them along with the video of the chat.

Posted in General | Tagged | 1 Comment