Fast Opening an Org Index File

I’ve written before about Karl Voit’s Memacs system. It’s basically a set of programs that collects all his daily data—phone calls, emails, photographs, texts, bank statements, git commits, and so on—stores it in Org files and then makes it available via links in his daily agenda. The data is stored in various places in his file system and can be moved if necessary. He locates the data indirectly with an Org based index file. The agenda link points to the index file that, in turn, points to the actual file. The index file is sort of like the Unix File Table for you Unix heads.

The system is so useful to Voit that he’s run into a problem. His index file is now how almost half a million entries and Org takes too long to load the file and locate the correct entry. He solved this problem, with some help from John Kitchin, by using grep to search the index file and follow the link in the appropriate entry to the desired file. All this is initiated by simply clicking on the agenda link. Take a look at his post for the details and also a bit more information on how the index file works.

Voit’s solution is interesting and probably applicable to similar situations but it’s a detail buried in Kitchin’s Elisp that is really the gold in the post for me. After the code locates the proper index entry, it places it in a temporary buffer and moves to the link to the target file by calling org-next-link. That function simply moves the point to the next Org link. If you use a lot of Org links like I do, you’ll find yourself doing this all the time. Usually I’d just manually move the point with the usual motion keys. But with org-next-link, which is bound to Ctrl+c Ctrl+x Ctrl+n, I can move directly to the link. It’s very handy and I’m already addicted.

UPDATE [2017-01-07 Sat 10:56]: memecs → memacs in link.

Posted in General | Tagged , | 2 Comments

Terminal vs. GUI Emacs

The Emacs subreddit has an excellent thread on terminal versus GUI for Emacs. It started when iamquah asked if there were any large disadvantages to running Emacs in a terminal rather than using the GUI version. He’s a recent convert from Vim so he’s naturally inclined toward the terminal as most Vi/Vim users are. Among his reasons for wanting to run in a terminal is that he frequently logs on to remote systems and running the terminal Emacs is more light-weight than trying to run a GUI over SSH.

The rest of the thread takes his concerns seriously and provides a good discussion of the benefits of running GUI Emacs over terminal Emacs. Tramp, of course, solves the remote editing use case in a superior way regardless of which mode you run Emacs in. There are some disadvantages to running Emacs in a terminal—although they may not affect your particular workflow—and the thread discusses these in an evenhanded way.

Aaron Bieber is a longtime Vim user who converted to Emacs and gave a very interesting talk about that conversion (I wrote about the video of his talk here). He chimed in with a pointer to his recent post that says you shouldn’t use terminal Emacs. Bieber argues, convincingly I think, that the GUI version offers much that the terminal version doesn’t have while the terminal version offers nothing that the GUI version doesn’t have. Bieber’s post is worth reading on its own.

There is, I’m sure, someone out there with a use case that is best met with terminal Emacs and others who simply prefer working in a terminal. Nonetheless, the Reddit thread and Bieber’s post have convinced me that for most of us, running Emacs as a GUI is the better solution. If you feel otherwise or have a compelling use case for terminal mode be sure to leave a comment. I’d be interested in hearing what you have to say.

Posted in General | Tagged | 3 Comments

Devops with Emacs

Alexey Koval has a nice post illustrating some of his devops workflow using Emacs. In a way, devops brings together most of the chores that folks use Emacs for. You edit files on remote machines to adjust configurations, you write scripts and programs, and you write prose in the form of documentation. Emacs, of course, excels in all of these tasks.

Koval embedded some short videos that illustrate these tasks and includes commentary on useful packages that help you get things done. If you’re interested in seeing how Emacs can be used for various tasks, this post is worth checking out.

Oh, and one more thing: Happy New Year from us here at the International Irreal Headquarters

Posted in General | Tagged | Leave a comment

A Paperless Workflow

Aqeel Akber has a nice post up about his recent switch to an almost paperless workflow. Akber is a physicist so he has lots of notes to take on his various projects. Until recently he kept them in separate notebooks for each project or subject area. About 8 months ago he started keeping digital notes in Emacs instead.

He did that by making a (pretty much one-to-one) translation from notebooks to Org files. He used the scheme outlined by Howard Abrams that I wrote about a couple of years ago. The result is that he now has electronic versions of his notebooks that are searchable and easily shareable either in whole or in part.

So far, he doesn’t appear to be make use of the excellent Org Babel functionality to integrate calculations and results into his notes and he doesn’t mention that he is using Org mode to write his papers. Of course with only 8 months in he’s still a relative n00b so I’m sure he’ll start making use of these facilities if he isn’t already. On the other hand, he’s discovered something that I didn’t know about Org mode. You can encrypt individual headlines in an Org file simply by adding a :crypt: tag to it. You need a bit configuration in your init.el file that Akber shows in his post.

I always learn something useful from posts like his so I recommend that you take a look. You may or may not want to adopt his exact methods but you’re sure to learn some useful ideas.

Posted in General | Tagged , | Leave a comment

Elisp Symbols Tutorial

Four years ago, I wrote about Xah Lee’s Elisp symbols tutorial. It’s a excellent tutorial that helps n00bs understand symbols and distinguish them from their close cousins, variables, found in other languages.

I noticed today that Lee has updated the tutorial. I don’t remember the details of the previous version so I don’t know how much it’s changed but it’s an excellent tutorial and well worth another look. If you haven’t seen it before and ever work with Elisp, it’s a must-read.

More generally, if you’re just getting started with Elisp, Lee’s tutorials are an excellent resource. As with other Lisps, the syntax of Elisp is really easy to learn. It’s the library and idioms that make it hard and Lee’s tutorials really help with those.

Posted in General | Tagged , | Leave a comment

Who Would Have Thought?

Via Matthew Green about this story:

Who indeed? It’s almost like they’ve never heard of the iron law of data collection.

Of course the chance of any of us being involved in a murder is vanishingly small but do you like the idea of the police being able to hear what you were saying in your home? Or do you have nothing to hide?

Posted in General | Tagged | Leave a comment

Emacs Sales Pitch

Via Wilfred Hughes, here’s a pithy sales pitch for Emacs

Posted in General | Tagged | Leave a comment

Setting Org Mode Properties

Karl Voit has a nice bit of Elisp that makes it easy for him to set Org mode properties. He maintains his contacts in an Org file that (presumably) has the contact names in the headings and details, such as phone numbers, as Org properties associated with each heading. When a phone number changes, he makes note of that in the heading but also wants to update the phone number property.

He does that by highlighting the phone number on the headline and calling his code, which asks him which property he wants to change. He gets a list from which he can select and the highlighted region is set to the value of that property.

If you have a use case similar to Voit’s, take a look at his code. It may make your workflow easier.

Posted in General | Tagged , | 2 Comments

Zamansky 25: Tramp

Mike Zamansky has Video #25 in his Using Emacs series up. This time it’s about how to use tramp. Strictly speaking, you could do what tramp does by using scp to bring the remote file to your local machine, edit it with Emacs, and then scp it back. No one’s going to do that of course, so tramp is really useful if you frequently have to edit files remotely.

As Zamansky explains, you can also use tramp to edit files on the local machine with sudo. You can even edit remote files with sudo using tramp but the method’s not obvious. Check out the video for the details. If you need to edit remote root files a lot, you may find the method I detail here useful.

If, like me, you’re an eshell user, you can simply cd to the remote machine from eshell. That method uses tramp under the covers. Here’s an animated GIF from Bodil that shows the process in action.

Posted in General | Tagged | Leave a comment

Org Mode 9.0.3

A Christmas present from Bastien

Posted in General | Tagged , | Leave a comment