Three Emacs Modes for Note Taking

Irreal readers can’t help but know that I’m a fanatical Org mode addict. I use it for almost everything that doesn’t involve coding and sometimes, via code blocks, even then. I’m an inveterate data gatherer and note taker and all that data and notes go right into Org files.

Still, not everyone is as fond as I am of Org mode but they still need to take notes and collect data. There are lots of ways of doing that, of course, but if you’re an Emacser who hates leaving Emacs, you’ll want a way of taking notes from within Emacs.

Scott Nesbitt offers 3 Emacs modes for taking notes. One of those, of course, is Org mode and I’ve written at length about its virtues for note taking and other tasks. The other two are deft-mode and howm.

I’ve written about deft before (1, 2, 3, 4) and lots of Emacs users—including Org users—swear by it. It’s main attraction appears to be the ease with which you can search and filter the notes. I use tags in Org mode for that and have never seriously used deft but, as I say, lots of knowledgeable people have and love it.

Finally, there’s howm. I’d never heard of it before I read Nesbitt’s post so I can’t add anything intelligent to the discussion about it. Nesbitt says it’s a bit quirky but that he really likes it. You can get an idea of what it’s like by following the howm link above.

As usual, Emacs gives you lots of opportunities to do it your way.

Posted in General | Tagged , | Leave a comment

DHH on Open Offices

David Heinemeier Hansson has a nice article on open offices: The open-plan office is a terrible, horrible, no good, very bad idea. He cites the usual research showing that purported gains in interaction and communication just don’t happen and that productivity for thought workers is severely damaged. Most everyone knows this.

There are, DHH says, a minority of people who enjoy the environment but it seems unlikely to me that they’re going to be the productive ones. Judging from the comments, those that liked open offices liked them because it allowed them to do all the things that make them so horrible for everyone else: easy talk to colleagues, see what everyone is doing, and so on. There are, I’m sure, a few people who like open plan offices and still manage to be productive but I’m betting they’re a minority of the minority.

Another interesting point that emerged from the comments is that no one is fooled by all the management babble about collaboration and increased communication. They all know that that’s a lie intended to sugar coat the real reason that is, of course, reduced costs. Other commenters note that management never avails themselves of all the reputed advantages, preferring to inflict those advantages on others. The situation would be slightly improved by a little less hypocrisy on the part of those who decree it for others but not themselves.

Whatever your feelings on the matter, it’s a good article and the comments are worth reading too.

Posted in General | Tagged | Leave a comment

More YASnippet Templates

I’ve mentioned before that I’m a YASnippet user and really like the system. Not everyone agrees but you owe it to yourself to give them a try. If you are a user, you might not be aware, as I wasn’t, that there’s a package of additional templates.

RmberYou has a post that describes the package and how to configure it. A glance at the source directory gives you an idea of the many modes that the snippets cover.

Despite my best intentions, I seldom use any templates except the ones I’ve written myself. Mostly that’s a matter of being too lazy to learn what’s available and memorize their names. If you, on the other hand, don’t want to bother writing your own templates and would like a nice collection of prefab snippets, this package could be just what you’re looking for.

Posted in General | Tagged | Leave a comment

Building an Initial Emacs Configuration

One of the problems—perhaps the major problem—that a new Emacs user faces is building an initial configuration. One would think that a vanilla install would be a good starting point for a new user but we all know that that initial install is not going to deliver a very good experience. Mostly that’s because even if you’re interested in Emacs strictly as an editor, it’s most usefully thought of as an editor construction kit. Even at the start, you need to do a bit of customization.

Huy Tran has a post that can help the n00b out. His post, Emacs from scratch, outlines a minimal configuration to get the new user going. It’s oriented towards a Spacemacs-like setup but even a relative new user should be able to include or exclude those parts as desired.

The major parts of the configuration are:

  • Getting rid of the menu bar, tool bar, scroll bar, and tool tips.
  • Setting up the package manager including making sure that the use-package macro is loaded.
  • Enabling evil mode and other basic Vim comfort settings.
  • Installing a theme.
  • Installing Helm.
  • Installing which-key.
  • Setting custom key settings.
  • Installing and configuring projectile.
  • Installing neotree and icons.

He also configures a bit of macOS specific data that a new user probably shouldn’t worry about.

I disagree with the Helm installation, not because there’s anything wrong with Helm (although I prefer Ivy) but because it’s not something a n00b should be worrying about initially. I also don’t care for neotree but perhaps it’s helpful for n00bs and it probably doesn’t hurt to install it.

If you know someone who’s new to Emacs and looking for an initial configuration to get started, this is a good resource.

Posted in General | Tagged | Leave a comment

Emacs As an Editor

Over at the Emacs reddit, honeywhite wonders why anyone would use the Emacs default key bindings. He’s an Emacs user but can’t understand why anyone would prefer the standard Emacs key bindings to one of the Vi emulation modes.

As most of you know, I was a Vi user for more than a couple of decades and then moved to Emacs. When I did, I went all in and learned the Emacs key bindings. It was a bit hard rearranging my muscle memory but now I’m perfectly happy with the Emacs bindings.

Honeywhite’s real objection to the standard Emacs editor is that commands generally require a key chord but that’s because Emacs, unlike Vi(m), isn’t modal. If your editor isn’t modal, you’re pretty much stuck with key chording (or menus/arrow keys). Oddly, honeywhite doesn’t mention the real advantage of Vi key bindings: they’re composable. Once you’ve learned the movement keys and that d is for “delete,” you automatically know how to delete just about everything. That’s a very powerful abstraction that Emacs lacks.

Fortunately, Emacs has both camps covered. If you hate key chording, you can use one of the Vi emulation modes. If you can’t put up with modality, you can use the standard bindings. I like both systems but decided to learn the Emacs way when I switched. That’s just me; you can switch and (mostly) bring Vim with you if you prefer.

Posted in General | Tagged | Leave a comment

Run a Raw Git Command From Within Magit

There isn’t much git work that you can’t do from within Magit but occasionally it’s convenient to call git directly. In another great tip from Wilfred Hughes’ Emacs Command of the Day we have:

You probably won’t use it often but it’s really nice to have the capability.

Posted in General | Tagged , | Leave a comment

Dired Hacks Redux

Back in 2015, I wrote about Fuco1’s dired hacks. It’s a collection of packages that make working with dired more convenient. You can read the original post or take a look at the dired-hacks GitHub repository to see what’s available.

There’s a lot there and it takes a bit of time to read through it all but you’ll probably find several ideas to improve your workflow. Even though the project is old, development is continuing and Fuco1 is still adding new packages to the collection.

If dired plays a central role in your Emacs use, you should definitely take a look at these packages.

Posted in General | Tagged , | Leave a comment

Literate Programming with Org Mode

Justin Worthe had a nice addition to the articles on literate programming and Org mode. It is, I think, a pretty balanced treatment of the benefits and disadvantages of literate programming. On the one hand you have the usual advantages of integrated documentation that goes beyond source code comments. That can yield large benefits for the programmers who end up maintaining the code and even for the original author 6 months later. There is also, as Worthe points out, the related field of reproducible research, which is I think, the premier application of the literate programming idea.

On the other hand there is the tricky matter of collaboration. It’s certainly the case that literate programming works best—or at least is easiest—for individual efforts but most work isn’t like that so it’s important to take collaboration into account. The problem is that engineers and scientists are fussy about their tools and it’s likely that the team members don’t agree on what those tools should be. That’s especially true when you’re talking about Emacs and Org mode.

Worthe has some suggestions about solving the collaboration problem but none of them are wholly satisfactory. The best suggestion is to use something like CWEB or NOWEB but they don’t have the same excellent tooling as Org mode and, of course, CWEB requires you to be working in C. For example, I could never warm up to CWEB but Org mode with code blocks seems natural to me and offers the same advantages.

For a large number of problems, literate programming can be a real win but it’s not without its challenges.

Posted in General | Tagged , , | Leave a comment

Things You Can Do With Regular Expressions in Emacs

Back in January, John D. Cook wrote an excellent post on the ways you can use regular expressions in Emacs. You’re probably familiar with most of them but there might be a couple of surprises in his list.

He looks at five main categories:

  • Searching and replacing
  • Purging line
  • Aligning code
  • Directory editing
  • Miscellaneous

but most of those consider several commands.

The use of regular expressions is endemic in Emacs. As Cook note, 15% of the pages in the Emacs manual mention them. Emacs regular expressions are often criticized for non-standard syntax and a lack of features but you certainly can’t complain that Emacs doesn’t make wide and appropriate use of them.

Posted in General | Tagged | Leave a comment

Setting the Line End Convention

Wilfred Hughes has tweeted another great Emacs Command of the Day:

You can follow the link in the tweet for a bit more information but the TL;DR is that unless you have special needs, you should be seeing U: as the first two characters of your mode line. The U means that the encoding is UTF-8 and the : means that lines are terminated in the Unix way with a newline character.

You can click on the : to cycle through the other possibilities but these days you probably want either : or DOS.

And who knew Ctrl+x Return was a valid command prefix? The completions all have to do with setting various encoding options.

Posted in General | Tagged | Leave a comment