By the Way

On Tuesday, I wrote about my discovery of org-next-link and how it quickly became my go to method of navigating to Org links. Today, my target link was before the point and it suddenly dawned on me that there was probably an org-previous-link and that it would be mapped to Ctrl+c Ctrl+x Ctrl+p. That turned out to be true, of course, so I’m passing it on in case there are one or two other folks out there to whom this is not immediately obvious.

Again, if you often have the need to navigate to Org links it’s worth internalizing the shortcuts. It’s amazing how much faster it’s made my moving around in Org documents.

Posted in General | Tagged , | Leave a comment

Zamansky 26: Syncing with Gcal

The other day I wrote about Rainer König’s video on syncing Gcal with Org agenda. Serendipitously, Mike Zamansky just posted a video on the same subject. Zamansky solves the problem in a different way so it’s definitely worth watching his video too.

His idea is to use org-gcal, which is available on MELPA, to do the heavy lifting. Under the covers, it does pretty much what König did in his video but it appears to be a bit easier to implement. As you can see from Zamansky’s video, org-gcal allows you to move entries in both directions.

In the video, Zamansky also walks us through getting things set up with Google so that everything works smoothly. If you’d like to see your Google calendar event in your agenda, take a look at this and König’s video. One of them should work for you. The video is 12 and a half minutes.

Posted in General | Tagged , | Leave a comment

Indexing Org Files with a Database

The other day, I wrote about how Karl Voit uses an Org file to index his other Org files. It’s a nice scheme that’s light weight and easy to understand and it fits in well with his Memacs system. John Kitchin has a similar problem. He uses Org mode for writing papers, taking meeting notes, writing letters of recommendation, taking notes on papers he’s reading, keeping TODO lists, maintaining help files on software, writing lecture notes, running his courses, and many other chores.

Kitchin has about 5 years of Org files that are scattered across Dropbox, Google Drive, Git repos, and his local file system. It’s hard for him to locate a particular file, especially if he hasn’t accessed it in a while. His solution is to index everything in an SQLite database. He indexes the headlines, properties, tags, links, and even (provisionally) content. He uses EmacSQL to access the data and has hooks that (re)index any Org file he opens.

The system is still in the proof of concept stage but appears to be working well. Kitchin has stopped indexing the content because it slows things down too much and generates about a half gig of data. Even so, he can generate amazingly fine grained queries. For example, it’s trivial to find all his files that cite a certain paper. His post has other examples of queries like that.

If you have a huge collection of Org files, indexing them in a database like Kitchin does might be a good strategy. As usual, his code is available and although you probably won’t want his exact database schema, his is a good jumping off point for your own needs. Adapting his system will require a bit of knowledge of SQL but even generating non-trivial queries requires basic SQL knowledge so it’s definitely not for casual users.

This post is yet another example of Kitchin leveraging the power of Org mode to get his primary job of a Chemical Engineering researcher and teacher done. As always, his work is full of useful ideas that many of us can adopt or adapt.

Posted in General | Tagged , | 2 Comments

Syncing GCal with Your Org Agenda

Rainer König has the latest video in his OrgMode Tutorial series up. This time it’s about synching Google calendar to the Org agenda. Many folks, even those who otherwise live in Emacs, prefer to maintain a separate calendar. Most calendar apps can generate alarms, can share calendars with other people, and can be accessed from your smartphone so they offer some advantages over keeping everything in the agenda.

König uses Gcal for this because it meets all those requirements but he would really like to see the entries in his daily and weekly agendas. It turns out to be pretty easy to do. You just set up a cron job to import your .ics files from Google and add them to your diary file. You tell Org mode to include the diary in the agenda and everything just works. See the video for the details.

Because I have no interest in letting Google harvest my information and sell it to one and all, I don’t use Gcal but as an Apple user I have access to the Calendar app, which provides the same functionality1. There is already a contributed package, org-mac-iCal that will import the Apple calendar into the Org agenda. It’s available from Melpa if you’d like to try it out. From a quick scan of the code, it looks like it does the same thing that König does: it grabs the calendar files and adds them to the diary.

König’s method should work with any calendar app that uses .ics files so if you’ve been looking for a way to see your calendar entries in your Org agenda, take a look at the video.

Footnotes:

1

I probably can’t share calendars with non-Apple users but the need has never come up so I haven’t looked into the possibility.

Posted in General | Tagged , | Leave a comment

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