Markdown in Org-mode

Org-mode seems to be gobbling up everything having to do with text generation. Here’s the latest example:

That’s pretty neat. Given that Org markup is superior to Markdown—sorry Markdown partisans, it is—it’s a bit hard to envision a non-contrived use case for the functionality but they surely exist. One example might be if you want to integrate some existing Markdown into an Org document. Doubtless folks with better imaginations can think of others.

It’s no wonder that Org envy is spreading to users of those other editors. There are already several ports to some of those editors as well as a standalone version. Of course, Org documents are plain text so you can trivially use any editor to write them but it’s Org’s integration with Emacs that provides the wonderful display, text wrangling capabilities, and, of course, (executable) Babel code blocks.

Posted in General | Tagged , | Leave a comment

A Development Environment

If you’re a software engineer, one of the most important aspects of your working life is your development environment. You’ve got to be comfortable with your editor, your debuggers, your OS, your desktop, and the other important pieces of your software stack.

Evgeny Budilovsky over at Meta-x86 has an interesting post describing his environment. His post focuses on the three main legs of that environment:

  1. His OS;
  2. His Desktop;
  3. His editor.

Budilovsky uses Nixos because he likes the way it lets him manage his configuration and software installation. Take a look at his post for more on that.

For his desktop, he uses Xmonad, which I’ve written about before. If you haven’t already, watch the demonstration video linked from that post to see how powerful Xmonad can be. Budilovsky says he likes it because it’s configurable with Haskell in a way that reminded him of Emacs.

Emacs is, of course, his editor. He likes the way it’s configurable and can be personalized. Between Emacs and Xmonad he can largely avoid using the mouse. Not everyone likes that idea, I suppose, but I consider it a real win.

If you’re living in the Linux world, be sure to take a look at Budilovsky’s post. His setup seems very nice and may appeal to you.

Posted in General | Tagged | Leave a comment

Refactoring in Spacemacs

Jack of Some is back with another video. This one is about using Spacemacs to refactor code. For someone who’s content with vanilla Emacs and has no plans to move to one of the other configurations, I’ve been writing a lot about Spacemacs lately. This is justified with today’s video because it taught me several things I didn’t know about iedit that apply no matter what flavor of Emacs you prefer.

Ever since abo-abo turned me on to it, I’ve been a heavy user of iedit. I almost always prefer it to query-replace or query-replace-regexp. It turns out, though, that it’s much more flexible than I imagined and Jack demonstrates that flexibility in his video. If you’re not a Spacemacs user, the keysequences are different, of course, but bringing up the doc-string will show you their vanilla Emacs counterparts.

As an example, when I was writing the post on Org gems, I decided to change ‘6’ to “six” in the text so I fired up iedit. Unfortunately, the ‘6’ in the list got changed too. It was easy to fix it up, of course, but I thought it was too bad there wasn’t a way of turning iedit off for some occurrences of the target symbol. After watching Jack’s video, I realized that there was a way of doing it and that it was all documented in the docstring.

If you’re an iedit user and are not aware of all of it’s functionality, be sure to watch the video and visit the documentation.

Posted in General | Tagged | Leave a comment

More Org Gems: Tables

Just after I published yesterday’s post on Org-mode Gems, I discovered that Cheong Yiufung has another post up with some more Org gems. This time he considers Org Table Gems. In this post he demonstrates three things about working with Org tables that you might not know:

  1. Operating on table regions.
  2. Converting a (semi-formatted) region to a table.
  3. Special markings to name rows, columns, and fields and to enable automatic recalculation.

As before, he has animations showing the gems in action. This time, however, he used mp4 instead of gif for the animation. That has certain advantages, I guess, but, for me at least, comes with a problem. I couldn’t figure out how to freeze the animation without having the video control bar cover the minibuffer. That’s a problem because I want to follow what he’s typing and sometimes it’s necessary to freeze the video to read a longer command.

That’s a small nit, of course, and Yiufung more than makes up for it with a little extra at the end. He shows how he used Dired to bulk convert his animations from webm format—which doesn’t work well with the Safari browser—to mp4. It’s a nice workflow and worth studying because the same ideas are portable to other bulk conversions or, really, any command line action on multiple files.

Posted in General | Tagged , | Leave a comment

Org-mode Gems

Every Org-mode user is aware that Org is a huge package stuffed with all sorts of useful functionality. For most of us, a lot of that functionality remains unknown and hidden. Most often the only way to find out about it is to read the Org-mode manual but that can be an undertaking.

Luckily, Cheong Yiufung has done the reading for us and made a very nice post that reveals some of the gems he found. The post mentions six pieces of functionality and illustrates them with animated GIFS. The six items are:

  1. Avoid inadvertently editing in a folded area.
  2. Show headings only.
  3. Clone trees with a time shift.
  4. Hide empty lines between headings in collapsed view.
  5. Turn lists into subtrees.
  6. Demote sequence for list bullets.

He also mentions a couple of miscellaneous items.

I’ve been a heavy Org user for many years but all six of those items were new to me. With Org, as with Emacs, there’s always something else to learn. Perhaps I should just RTFM from cover-to-cover but I’ve never had much luck in reading whole manuals. Fortunately in this case, Yiufung has done that for me. If you’re an Org user, you really should spend a few minutes reading Yiufung’s post. It’s a great post and definitely worth your time.

Posted in General | Tagged , | Leave a comment

Another Org-mode with Spacemacs Tutorial

Nathan Lovato has a tutorial on using Org-mode with Spacemacs. It’s longer and more comprehensive than Jack of Some’s introductory video on Org with Spacemacs, but as with that video, Lovato’s looks at Org from the Spacemacs user’s point of view. If you’re not a Spacemacs user, you probably won’t find the tutorial too helpful. If you are a Spacemacs user or are thinking of becoming one you might find it useful.

After a short introduction, he covers creating and manipulating nodes, widening/narrowing, lists, and checkmarks. Then he moves on to using Org for task management, including TODO keywords and time tracking.

Next, he takes up using sparse trees, column view, tags, and sorting. He approaches these from the point of view of searching and organizing your data. I, at least, usually forget about sparse trees and column view but that’s a mistake because they can be very useful for accessing your data. Lately, I’ve been making a point of using it just to burn it into my muscle memory.

Finally, he shows how he exports his Org data to his (Android) smart phone using Orgzly. Of course, if you’re living on the Apple plantation, Orgzly won’t work for you but there are other options such as beorg.

The best way to think of this tutorial is not as a how-to but as a demonstration of some of the things Org can do. The video moves quickly but Lovato provides a list of topics and their timestamp so you can easily revisit any topic you want to see again.

Posted in General | Tagged , | Leave a comment

Alzheimer’s and Gaming

Years (and years) ago, the usual crazies were running around making dire predictions about Rock and Roll and how it was going to destroy young people. It seems pretty ludicrous now but these people were serious and generally made pests (and fools) of themselves for many years.

Fast forward half a lifetime and another bunch of crazies were (or, perhaps, are) running around screaming that video games are going to be the death of our youth. Perfectly useless wastes of time. Maybe they should be outlawed. And, well, you know…

Now in an especially delicious piece of irony, CNN is reporting that researchers have been using a video game to diagnose early stage Alzheimer’s disease. The diagnoses, it turns out, are more accurate than the standard medical tests. You can follow the link for the details but the TL;DR is that an early sign of Alzheimer’s is a subtle deficiency in spatial awareness and navigation skills. The game, which involves navigating through a maze, can detect these deficits years before the memory problems that we associate with Alzheimer’s appear.

The CNN article has a link to a paper describing the research where you can read the abstract. Sadly, the paper itself is behind a paywall. This is a fine opportunity for a rant about Open Science—especially science that we’ve already paid for—but I’ll forbear.

Posted in General | Tagged , | Leave a comment

Tabs and Indentation in Emacs

To my mind, one of the most confusing and arcane “everyday things” in Emacs is the subject of tabs, the Tab key, and indentation. I’ve been using Emacs for over a decade but I still remember how hard it was for me to get Emacs configured to do what I wanted. Back in those days, I was still doing a lot of C coding and the default behavior of C indentation was so odd and off-putting that I almost gave up on Emacs and went back to Vim. Being a n00b, I had no idea how to fix things so I asked Google and found some configuration items to put in my init.el that made things work correctly.

When I was researching this post, I searched my init.el for “indent” and found that I still wasn’t clear on what some of those configuration items were doing. These days, of course, I know how to look them up but you’d think after all this time I’d understand these things a little better.

Doug Beney to the rescue. Over at dougie.io he has a very useful post that discusses how to get tabs and spaces to work as you’d like them to. It’s definitely worth reading to get a handle on how to get indentation and the Tab key working in a sane manner.

Beney likes using tabs instead of spaces and his default configuration reflects that. I’ve never cared much about that controversy but I’ve come to believe that spaces are the better answer (this despite my using tabs in my Vim days). Beney is careful to show how to configure things to use spaces and even provides a couple of functions to enable one or the other so if you’re in the spaces camp, the post is still useful.

Posted in General | Tagged | Leave a comment

Brian Kernighan & Ken Thompson Chat

Last Saturday at the Vintage Computer Festival East, Brian Kernighan and Ken Thompson sat down and chatted about some Unix history and other interesting events in Thompson’s life. The chat was billed as “Kernighan interviewing Thompson” but it was really more like two old friends sitting down and reminiscing. Happily, there’s a video of the chat.

You don’t often see Thompson in public and I can’t recall ever hearing him say more than a few words so the video is a real treat. He turns out to be an engaging and amusing speaker and, of course, there is no one more qualified to talk about the early days of Unix than he.

He tells the story of how after AT&T withdrew from the Multics project and declared that Bell Labs “would no longer do operating systems” the small group (about 4) of users of the nascent Unix system wanted to move it off the PDP-7 to a larger machine. The request for a new machine was denied because “we don’t do operating systems” so Joe Ossana came up with a fib about them building a word processing system for the Patent Department. That proposal was accepted and Unix was officially under way.

Thompson tells a bunch of other stories, including how he came to work at Bell Labs and a slightly different version of the genesis of grep. The whole thing is an hour and 4 minutes so you’ll definitely need to schedule some time but it’s a great video and you really should watch it. It may be your last chance to hear about early Unix from the people who built it.

Posted in General | Tagged , | Leave a comment

A Practical Guide to Sed

Yesterday, I wrote about Liran B. H’s Practical AWK Guide. He has a similar guide for sed called Understanding sed – Practical Guide. Like the Practical AWK post, it illustrates some of sed’s power by showing a few sed one-liners.

Sed is, in principle, pretty simple—especially if you’re familiar with Vi/Vim colon commands—but in practice it can be tricky to get its use exactly right. That’s the real value, I think, of guides like this: it serves to remind us of the basic form of the commands and some of the common tasks it’s used to perform.

If you like the command and want more, the best “quick” guide that I know of is this one. Sadly, tools like sed (and even awk) aren’t used as much these days. It’s sad because they’re powerful tools that often provide a much faster and easier way to accomplish certain tasks than the tools that have replaced them.

Posted in General | Tagged | Leave a comment