Say What?!?

I don't have the words…

Posted in General | Tagged | 2 Comments

Reading Code with Emacs

I have long believed that one of the best ways to move from journeyman to master coder is to read the code of the masters. I learned most of my advanced C techniques by reading the Unix source code. Other languages have different masters that you can learn from. Nathaniel Knight has a post that suggests some convenient methods of reading code with Emacs. These boil down to learning the marking and narrowing commands.

Once you learn to conveniently mark expressions and functions, for example, you can narrow to the region and look just at the code you're interested in. That may not seem like a huge win but as Knight explains, it often makes working with the code easier. Once you get in the habit of using narrowing, you'll want to take a look at Artur Malabarba's excellent post on narrow-or-widen-dwim. It's really great because you need only call a single command and it figures out what you want to do by context. It's a huge timesaver.

Knight also covers the little-known clone-indirect-buffer command. That's just what you need when you want to narrow to two (or more) separate areas at the same time. Again, the utility of doing this may not be obvious but it turns out to be tremendously useful. One common use case is where you have different types of code in the same buffer. You can clone the buffer, narrow to the desired code segments, and then work in the appropriate Emacs mode for each segment independently.

You can follow Knight's recipe for doing this but there's an easier way. The code discussed at the link is just a little bit of Elisp to automate the cloning and narrowing steps but it's a real time saver. Follow the link to Zane Ashby's post (at the easier way link) to see an example of the use case I mentioned.

Posted in General | Tagged | 1 Comment

Scimax

The ACM Technews newsletter has a short piece on John Kitchin's Scimax project. Here's the CMU article on Scimax, which gives an overview of the project.

Basically, Scimax is the collection of (mostly) Elisp utilities that Kitchin has put together to help with his group's writing and publishing of papers. It features using Org mode to write the papers in a reproducible research way and then publish them to the format required by the journal they are submitting the paper to. There are also some tools to aid in teaching. For more details, check out Kitchin's Scimax page.

The nice thing about Scimax is that all the utilities are packaged up into a single project repository that anyone interested can download and use. The project is hosted on Github if you're interested.

Posted in General | Tagged , | Leave a comment

Mark Rectangle

If you're like me you don't often have occasion to mark rectangles so it's easy to forget how simple it is to do. Here's a nice reminder from Tony Garnock-Jones.

Posted in General | Tagged | 3 Comments

Capturing BibTeX Entries with Google Scholar

Brad Collins has a nice post on collecting BibTeX citations. As he notes, there are plenty of articles on how to generate a citation in Org mode from a BibTeX entry but not on how to gather the entries to begin with.

He starts with a simple Org mode template to capture the citation once you retrieve it from Google Scholar. The idea is that you copy it from Google Scholar and paste it into the capture buffer. If you do this a lot, it would be pretty easy to write a bit of Elisp to automatically copy the citation, bring up the capture buffer, and paste the entry into it.

If you're using Firefox or Chrome you can make things easier by installing the Google Scholar button and then follow Collins' workflow. If you're on a Mac using Safari—or, I suppose, on Windows using one of the Microsoft browsers—his basic workflow still works. Just follow these steps:

  1. Go to the Google Scholar page
  2. Search for the paper you're interested in
  3. Click the “Cite” link at the bottom of the article description
  4. Choose BibTeX in the popup
  5. A tab will open with the plain text citation in BibTeX format
  6. Copy and paste the citation as described in Collins' post

If you're writing a lot of papers for school or for work, Collins' method is an easy way to build up your bibliography database. Even if gathering a citation is an occasional thing, knowing how to use Google Scholar to retrieve it is useful.

Posted in General | Tagged , | 3 Comments

König #28: Publishing

Rainer König has posted the latest video in his Orgmode Tutorial series. This time he looks at publishing. Publishing is a sort of generalization of exporting that allows you export whole projects at a time.

König begins by showing us how to set up Apache (under Linux) so that he can demonstrate publishing a Web site. Details will vary, of course, with other platforms or Web servers. Configuring Org to publish a project is pretty easy but König mentions a critical piece missing from the manual so be sure to watch the video. Once you've described the project and it's location, it simply a matter of choosing “Publish” from the export menu.

Check out the video for the details. As usual with König's videos, this one is relatively short (14 minutes) so it shouldn't be hard to fit it in. Let me say again, if you're trying to learn Org Mode or are just curious about it, König's video series is the absolutely easiest way to get going. After watching his videos, you may want to check out Bernt Hansen's excellent Org Mode - Organize Your Life In Plain Text! and, of course, the manual.

Posted in General | Tagged , | Leave a comment

Abo-abo Screencast

Abo-abo has a new screencast up that demonstrates his refactoring workflow. Watch it and be amazed at how fast he navigates through his code. Part of the demonstration is the best non-trivial use of keyboard macros that I can remember.

I also learned something new: If you're using swiper, it turns out that you can save the swiper list to another buffer and navigate through the original buffer from there. It works like occur and is, in fact, called ivy-occur. By default it's bound to【Ctrl+c Ctrl+o】so you don't have to do anything special to get it.

Actually, there's a lot of useful functionality hidden away in swiper but you have to read the manual (or watch abo-abo's screencasts) to discover it. In any event, take a look at the video. It's informative even if you don't use swiper. The video is just short of 10 minutes so scheduling shouldn't be a problem.

Posted in General | Tagged | Leave a comment

Get Xah's Emacs Tutorial for Free

Xah Lee is giving his Emacs tutorial away for free for the next few days. Read down in the comments to get the link to download the files.

Xah's tutorial is a good resource. I learned Elisp mostly through his Elisp tutorial. Here's your chance to get your own copy. Of course, it's always available on-line

Posted in General | Tagged | Leave a comment

Thoughts on Emacs

Mike Zamansky has the latest video in his Using Emacs series up. This time he takes a break to give us his thoughts on learning Emacs and making the videos. He's discovered—as every teacher who records his lectures for the first time does—that's it much harder than standing up in front of a class or a group of colleagues in a lecture and giving the same presentation. That's because you don't get any feedback from the audience. You can't tell if they're understanding the material, bored, delighted, or something else because it's just you and the computer.

The other point he makes is that when learning something, Emacs in particular, it's often enough to know that something can be done even if you don't know how to do it. He gives the example of using timers in Emacs. He saw that Sacha Chua had relative times in the transcripts of her Emacs Chats and from there it was (relatively) easy to discover how to add them to his own notes. I've found the same thing. Once I know that Emacs has a way of doing something, I can usually easily discover how to do it.

As I've said before, this is a great series and even if you're an experienced Emacs user, you'll probably learn a few new things from the videos. The video is 8 minutes, 39 seconds long so it should be easy to fit it into your schedule.

Posted in General | Tagged | Leave a comment

Rainer König on Advanced Exporting in Org Mode

Rainer König has posted the latest video in his Orgmode Tutorial series. This time it's about Advanced Exporting. König starts with a single Org mode document and exports it to Beamer, PDF, and ODT. The file was written with Beamer in mind so they look best when exported to Beamer but PDF looks good to my eyes too. The ODT export wasn't as successful but there's probably no reason it couldn't be.

Many people prefer to use pandoc when exporting to ODT because they feel it does a better job. Happily, I seldom have need to export to ODT so I can only report what others day. In any event, König's video shows how a single document can be exported to several different end formats.

You can take a look at the video for the details but it's really just a matter of choosing what you want to export to. The only non-obvious thing you have to do is enable the backends you want to use. König does this through the custom interface but it's just as easy to simply customize org-export-backends. See the documentation for the standard list of backends. There are others available as contributed packages.

Posted in General | Tagged , | Leave a comment