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

At Last

For time, I’ve been unsatisfied with the options for moving between windows. 【Ctrl+x o】is great when there are only two windows in the frame but becomes clumsy when there are three or more. For a long time I’ve been using windmove and that works well except that I always type【Ctrl】 and an arrow instead of 【Shift】and an arrow. Furthermore, 【Shift】 plus an arrow conflicts with Org mode bindings.

Now, at last, I’ve found the perfect solution: ace-window. It works pretty much like ace-jump-mode (see this Emacs Rocks! video for an example of ace-jump-mode in action). When invoked, ace-windows grays the text in each window except for a red number in the upper left hand corner. Pressing the number gives focus to that window and ungrays the text. Very nice.

I first found ace-window a week or two ago but there was an autoload problem that kept it from working. Now, happily, that’s been fixed and I can zip around between windows almost effortlessly. I love this package.

Posted in General | Tagged | 8 Comments

Encrypt Your Dropbox Data!

I’ve told you many times (here, here, here, here, and here) that if you’re using Dropbox and you have any file in it that you wouldn’t like to see on the Internet, then you better be encrypting those files. Dropbox is a great product and their developers take care to make it as secure as possible but bugs still creep in. If you’re a developer, that knowledge is held in your DNA. If you’re not a developer, take my word for it: bugs always creep in.

Now it’s Dropbox’s turn. The problem occurs when users issue a shared link. That can result in an unintentional file leak. Dropbox has disabled the shared link mechanism while they consider ways of tightening things up. The problem results not from a flaw but from the fact that the links can be revealed in unexpected ways—see the article for the details.

So here’s the bottom line: if you’re going to issue a shared link you should require a password and/or expire it after a set time. If there’s anything really sensitive in the file set being shared, you had better encrypt it. Yes, it’s a pain for your collaborators but it’s better than having your secret plans for world domination revealed.

Posted in General | Tagged | Leave a comment

Password Silliness Epitomized

Remember how I told you of a sure tip off to an insecure site? Were you looking for an in-the-wild example? Well, here it is. The very apotheosis of a bad password policy. Forget, for a moment, the ridiculous explanation for this policy. How does disabling special characters and essentially making the use of password managers impossible constitute good security policy?

These people deserve all the ridicule that the Internet can provide. Of course, the real cost will come when their database is captured, customer information compromised, and customers start suing. They will, I’m sure, express their surprise and mystification as to how it all happened.

Posted in General | Tagged | Leave a comment

Guessing File Applications in Dired

One of the really great tools in Emacs is the Dired/Dired+ package. Recently, Mickey wrote a nice introduction to using Dired to run shell commands on files; I commented on that here. The other day, by happenstance, I found myself needing to do just that. I wanted to display a series of PDF files from a directory to collect some information. Since I was in Emacs already to collect the data, I used Dired to list the directory and then used 【!】 to invoke the PDF viewer.

Emacs, of course, is pretty smart about things like that and suggested that I use xpdf. That would be precisely the right answer if I was working on one of my Linux machines but this was OS X and I really needed to invoke the open command. So I had to delete the suggestion and type in open for each file. Not really much trouble but later I thought that there was undoubtedly a way to control the suggestions.

There is, of course. After grubbing around in dired.el for a bit, I found the answer. Dired uses an alist to match the default applications to file extensions but it has another—empty by default—alist, dired-guess-shell-alist-user, that it will prepend to the default list if it’s present.

So I added

(setq dired-guess-shell-alist-user      ;quess shell command by file ext
      '(("\\.pdf\\'" "open")
        ("\\.ps\\'" "open")))

to my OS X specific configuration and now I get the proper suggestion when I run a shell command on PDF or PS files. How can you not love Emacs?

Posted in General | Tagged | 3 Comments

Emacs Life

I recently came across this sketchnote from Sacha Chua. I not sure how I missed emacslife.com but I don’t remember reading anything about it before. The site is a wonderful Emacs resource. It’s got links to tons of posts, articles, and videos about Emacs and Org mode.

It’s got tutorials for beginners, links to her Emacs chats, links to a slew of videos on Emacs, and a long section on Org mode and how to use it for managing your work flow and publishing blog posts, talks, and other documents.

Take a look at the landing page to get an idea of the topics the site covers. It’s all done as simple Org files, which are available on Github, so it’s easy to keep up to date and expand. According the sketchnote, Chua is hoping for input from others so if you have a valuable link that’s not listed, drop her a line. And take a look at the Emacs Life site. I think you’ll like it.

Posted in General | Tagged | 1 Comment

Orgtbl Mode

Like most Org users, I was aware of orgtbl-mode. It’s a minor mode that brings the power of the Org mode table editor to other modes. Because just about everything I do that might require a table gets done in Org mode, I never paid very much attention to it. I envisioned it as an easy way of generating ASCII tables like

|       Date | Item      |  Cost |
|------------+-----------+-------|
| 2014-03-14 | Book      | 12.95 |
| 2014-05-01 | Batteries |  7.50 |
| ...        |           |       |

in, say, an email or some other non-Org file.

It turns out, though, that Orgtbl mode is much more powerful than that. For example, all the spreadsheet functions are there so I could have added a Total row to the above table and had the costs summed automatically. That still doesn’t exhaust the power of Orgtbl, however.

Here’s a two minute video that shows how powerful it can be. You add a comment with the Org style table in it, put another comment where you want the table to appear in your source code, press 【Ctrl+c Ctrl+c】 and the table is added to your file in HTML. If you write a lot of HTML that has tables in it, this can be a real time saver.

Orgtbl has built-in conversion engines for HTML, LaTeX, and texinfo. The manual gives some hints on writing your own if you have special needs.

Posted in General | Tagged , | Leave a comment

Some Good News for Org

Bastien Guerry has resumed his role as the Org Mode maintainer.

Guerry has done a lot for Org and was instrumental in moving it forward during his last tenure as maintainer. I’m sure that he’s already at work making it better. Welcome back!

Posted in General | Tagged , | Leave a comment

Sacha Chats with Xah Lee

The indefatigable Sacha Chua has been chatting up a storm lately and has even more scheduled for the near future. Recently she chatted with Xah Lee and discussed his approach to and use of Emacs. It was an interesting chat.

One might call Lee the King of Customization. He, more than anyone else I know, has taken advantage of the near-infinite customizability of Emacs. He’s changed almost every key sequence in his quest for ergonomics in Emacs. This is more than just changing a key sequence to some other random, easier-to-reach set of keys. Rather he has worked to eliminate all chording. He does that by replacing chords with a sequential sequence of two or more keys. Watch the video for the details.

I’ve posted many times about the various helper Elisp functions he’s written. One of the reasons for all those functions is that, unlike lazy people such as me, Lee writes his blogs in raw HTML rather than leveraging Org mode or some other higher-level tool. In a sense, that’s a bit like writing in assembly code so Lee needs a lot of help from his editor. Happily, Emacs is up to the challenge and Lee has been able to build a custom environment precisely tuned to his needs and inclinations. The result is that he can write HTML as quickly as most of us can generate the same content with, say, Org mode.

Like most of Chua’s chats, this one is just short of an hour so plan accordingly. I think you’ll find the chat interesting and worth your time. Lee is a man of strongly held opinions, which he is never hesitant to express. Many find this off-putting but I think you’ll find that this video shows that he’s an engaging and interesting guy. An Emacs geek just like the rest of us.

Posted in General | Tagged | 1 Comment