Handy:
A neat way to get all of your buffers reverted to a branch's state, is to go to #magit and type 'g'. #emacs
— Pericles Theodorou (@PericlesTheo) January 30, 2015
Handy:
A neat way to get all of your buffers reverted to a branch's state, is to go to #magit and type 'g'. #emacs
— Pericles Theodorou (@PericlesTheo) January 30, 2015
A while ago I wrote about coding some Elisp to grab the URL of the current Web page and turn it into an Org link. It doesn’t seem like it would reduce friction by that much but it really has made linking in my blog posts much more efficient. So much so that now I hate to make links to the site and then to a particular post like
abo abo over (or emacs has a nice video on using Hydra.
because now I have to switch focus to Safari to cut the site name of the blog and then paste it into a link just like I used to do for links to individual posts.
So I looked for some URL parsing functions in Emacs and found url-generic-parse-url
that breaks a URL into its constituent parts. I used that to modify jcs-get-link
to return a link to just the host name if it’s called with the universal argument:
(defun jcs-get-link (hostp) "Retrieve URL from current Safari page and prompt for description. With the universal argument, return a link to the host only. Insert an Org link at point." (interactive "P") (let* ((link (read-from-minibuffer "Link Description: ")) (result (shell-command-to-string "osascript -e 'tell application \"Safari\" to return URL of document 1'")) (urlobj (url-generic-parse-url result)) (host (concat (url-type urlobj) "://" (url-host urlobj)))) (insert (format "[[%s][%s]]" (if hostp host (org-trim result)) link))))
It’s a bit of a hack because the host name may not be the same as the site name so the new function may not give the right site link. Ironically, an example of this is Irreal. If you want the address for the blog itself, it’s http://irreal.org/blog
not http://irreal.org
as the above code returns.
Still, this problem isn’t that common and even handling it as a special case is still less friction that changing focus to the browser.
Devin Chalmers has some words of wisdom for startups:
"Your password contains invalid characters." No, your startup contains incompetent engineers.
— Devin Chalmers (@qwzybug) December 15, 2014
Nick Selby already told them but apparently they didn’t listen.
Remember Karl Voit from the Sacha Chua chat that I wrote about previously? Voit collects data on just about every aspect of his life and stores it in an Org file. If you haven’t watched the chat yet, be sure to take a look. You’ll be amazed.
The other half of collecting all that data is being able to search it. Voit has lots of homegrown tools for that but he also makes use of the built-in Org tools:
Advanced searching in #Orgmode http://t.co/etyXQEvx1u is *very* important to know for users of #Emacs. #PIM
— n0v0id (@n0v0id) February 6, 2015
His tweet points to this excellent Worg tutorial that describes how to extract data from Org files. The methods are surprisingly flexible, and although the syntax can be daunting they’re well worth learning if you collect any data at all into Org files. It’s worth reading through the tutorial if only to see what’s available. You can always check back for the exact details when yo need them.
Voit is an expert on data collection and retrieval and it’s worth studying his methods and software. You’ll be a lot more proficient with data if you do.
occur
a Bit Smarter Abo-abo is still blogging up a storm and giving us a daily dose of great Elisp. Someone looking to amass a first rate Emacs configuration could do worse than simply grab abo-abo’s daily posts and integrate them into their .emacs
file.
One very nice offering is this bit of Elisp that makes occur
a little bit smarter. His code arranges to make any active region the default regular expression for occur
unless there’s no region, in which case the symbol at point is used.
He says that these two cases hit about 95% of his invocations of occur
. Your mileage may vary, of course, but I’d guess most of us would have a similar success rate. At any rate, it’s a nice optimization and just a few lines so head on over and take a look. I’m definitely going to integrate it into my configuration.
Most of you have probably figured out that I’m a workflow geek. I love reading about people’s workflow and how they optimize their daily tasks. Popular Mechanics has a great article on The New York Times workflow. Many people in many different jobs collaborate, often under rigorous time constraints, to get each day’s paper into the hands of its readers.
The article starts out at 1:35 AM at the Times printing plant. Just getting the rolls of newsprint loaded for use by the presses is a major undertaking. They have a control room that the director of plant operations describes as an indoor traffic control tower. The facility is so large that the crew uses adult size tricycles and golf carts to get around.
The story moves on to 6:20 AM when one of the editors opens her eyes and starts checking on what happened overnight. The story continues through the day covering editorial meetings, dropping by the NYT R&D lab (yes really) and finally ends with the paper route couriers picking up and assembling the papers before delivering them to readers.
It’s a machine with a huge number of moving parts. Not all of those parts are covered with glory but every one is a necessary cog needed to get the readers’ daily papers to their doorsteps. Most people don’t think about what it takes to deliver their everyday amenities so articles like this serve to remind us that even quotidian articles can require a complicated and sophisticated operation for their production.
If you like knowing how things work, you’ll enjoy this article. It’s a look at something most of us don’t often think about.
I’m so ashamed:
Oh, wow. I had over 200 buffers open in #Emacs (15 day uptime). Didn't even notice. Buffer navigation w/ IBuffer / ido-switch-buffer rocks.
— Gergely Nagy (@algernoone) February 6, 2015
Even though my uptime is measured in months, I get twitchy as soon as I have twenty or more open. I’ve got to train myself to be a little less obsessive-compulsive.
John Cook, who’ve I’ve mentioned a few times here, has a nice Twitter feed called TeX Tips. Every weekday, he posts a TeX/LaTex tip. Mostly they’re things you’ve probably seen—although some surprised me—but they’re of great value to folks like me who use TeX but not everyday. Even LaTeX has lots of commands that are easy to forget—how do you typeset the Å character, for example—so having a daily reminder of them is useful.
Sometimes he links to a longer post by himself or someone else that covers some useful piece of TeX/LaTeX advice. For example, one post covers the draftwatermark
package that allows you to put a watermark, typically DRAFT
, on a document. I was wondering how to do that just the other day so it was a good find.
If you use TeX or LaTeX occasionally, Cook’s feed is an excellent and painless way to help you remember the details. It’s one post every week day so you won’t be overwhelmed.
The Stasi is a good point. The Stasi is what happens when a state tries to achieve total watchfullness.
— Nic Ferrier (@nicferrier) January 18, 2015
If you’re looking for a static-page blogging engine that you can post to from Emacs, you should take a look at Calum MacRae’s post on blogging with org-page. MacRae writes about his setup in detail so that you can set up your own blog relatively easily. His setup uses Ansible, which you may or may not want to implement.
I like the idea of static web pages but I’m not sure I like how org-page displays things. Basically, it reproduces the Org-mode buffer complete with much of the (deemphasized) markup. My source files look similar to MacRae’s but WordPress (or rather org2blog/wp
) generates a display that could have been typeset with the default WordPress editor or even LaTex. I like what org2blog/wp
does much better but take a look at MacRae’s post and see what you think.
A lot of bloggers I respect that I know are Emacs users are not posting from Emacs. I really don’t understand that. There are lots of blog solutions available that allow you to post directly from Emacs. Why would you not want to do this?