Scrolling Left and Right

Hideo tweeted out a link

to this nice configuration by Shanthakumar. It’s a blog post written in Org mode that can be tangled to his init.el. It has some good ideas and is worth taking a look at.

One of the things in the configuration is a standard Emacs binding that I didn’t know about. You can scroll a window left or right with Ctrl+x < and Ctrl+x >. If you’re like me, you don’t often need to do that but I have one use case that comes up often: when I paste in the code for an embedded Tweet (like the above) it’s a long line. Sometimes I want to look at something in the middle of that line. I’ve been doing that by moving forward by word to get to the point I want to see. Moving by window length is much more efficient.

One thing to be wary of is that moving the screen left moves toward the right side of the screen—you’re moving the window not the cursor. Similarly for moving the screen right. I don’t know why I didn’t already know this but I’m glad to learn it.

Posted in General | Tagged | Leave a comment

The Iron Law and the Census

Not that we need another one but this 2007 Scientific American article has a frightening illustration of the Iron Law of Data Collection at work. Here in the U.S. the Constitution provides for a decennial census of the population in order to apportion members of the House of Representatives and direct taxes among the states. Over the years it’s evolved from a simple head count into a nosy inquiry into such things as how many bathrooms each household has. Many people object to the snooping but there’s been no organized resistance to it.

Despite years of pledges about confidentiality and specific denials about its use to round up Japanese-Americans during WWII, it turns out that that’s exactly what happened. They had to change the law to allow the Census Bureau to release the information and for years the Census Bureau has insisted that they released only neighborhood information on Japanese-Americans but not the “microdata” about them. If you’re familiar with the Iron Law, you won’t be surprised to learn that that was a lie. Read the Scientific American article for the details.

You can understand why the Census Bureau would resist admitting this (other than an institutional sense of shame): if people felt that their personal information would be released whenever the government felt they had a good reason, they would be less forthcoming with that information. Then how would the government know how many bathrooms we had?

Posted in General | Tagged | Leave a comment

Mastering Emacs is 50% Off

The excellent Mastering Emacs is 50% off.

If you use Emacs, you really want this book. It’s been updated for Emacs 25 and is only $20 dollars while on sale.

UPDATE [2016-11-26 Sat 19:49]: matering → mastering

Posted in General | Tagged | 2 Comments

Introductory Magit Video

Arjen Wiersma has a very nice introductory video on Magit. He covers the basic usage such as staging, committing, creating and checking out branches, and logging. If you’re just coming to Magit, it serves as good way to get oriented.

The video is 18 minutes so you’ll need to schedule a bit of time. Eighteen minutes is long enough to get you going but not so long that you get bogged down in details. Wiersma points to the Magit documentation and recommends that for more details or questions.

Wiersma has several videos available. Most of them involve Clojure related topics but he also has some on Emacs. Be sure to take a look at his channel to see what’s available.

Posted in General | Tagged , | Leave a comment

Another of Life’s Little IQ Tests

If you follow security at all, you’re always seeing stupid things. Often it’s stupidity on the part of users but not always. Here’s an example from a vendor that’s so outrageous it takes your breath away. MWave Australia is asking users to provide their complete banking credentials as part of the checkout process. That means MWave would have complete access to your bank account and could, for example, transfer all your funds to their account or do anything else that you could do on-line.

I’ve used MWave here in the U.S. and have always had a very positive experience with them. I checked the U.S. MWave site and they aren’t making this ridiculous demand. I also checked the Australian site and, sure enough, they’re still asking customers for the keys to their bank accounts. I’m sure MWave Australia is honest and has no intention of robbing their customers but how can they not know that this is beyond the pale. It’s beyond the pale even before we begin considering things like man-in-the-middle attacks. It just makes no sense at all.

The site is saying that they need this information to “verify your credit card” and that it’s safe because the information goes through BankStatements.com.au, which, we’re assured, is safe and fast. I know Irreal readers know better but if you live or do business in Australia, warn your friends not to fail this IQ test.

UPDATE [2016-11-24 Thu 13:30]: breadth → breath

Posted in General | Tagged | Leave a comment

Displaying Sunrise/Sunset in Emacs

If you’d like to know what time the sun will rise and set in your area, it turns out to be simple to add it to your Org mode agenda. Jon-Michael Deldin shows how.

The ability to display them is already built into the Emacs Diary. All you have to do is specify your latitude/longitude in your init.el and add

* Calendar
%%(diary-sunrise-sunset)

to one of the files in your agenda list. See Deldin’s post for the details including how to get your lat/lon if your computer or phone won’t tell you.

Posted in General | Tagged , | 1 Comment

Another Great Avy Command

One of the most powerful tricks I’ve learned about using Emacs is from Steve Yegge’s famous post on effective Emacs use in which he recommended using incremental search for navigation. That gave me a huge increase in efficiency. I got an even bigger increase when I started using ace-jump-mode and its later generalization, avy, by abo-abo.

The avy library has many ways of selecting a jump point but they all involve building a jump tree. One of those methods is avy-goto-char-timer. I’ve read its description a few times as I’ve added to my Avy configuration but its usefulness never hit me until I read this tweet from Wilfred Hughes:

It solves a problem that I sometimes have with avy-goto-word-1 (the successor to ace-jump-mode): If you want to jump to a word beginning with a common letter you may have many selections to choose from and the selection labels cover up the beginning of the word. One way to solve this is with avy-goto-char-timer, which allows you to enter a sequence of characters—much like isearch—and it then gives you selections that begin with that sequence.

The “timer” in the command’s name comes from the fact that it considers your entering of the sequence complete when you stop typing for the timer’s value (0.5 seconds by default). I mostly still use avy-goto-word-1 but sometimes avy-goto-char-timer is more efficient and I’ll use that instead. If you don’t like the timer aspect, there’s also avy-goto-char-2, which allows you to enter two characters and build a search tree for those two characters. Its functionality is subsumed under avy-goto-char-timer so I haven’t bothered mapping it to a key sequence.

If you aren’t using one of the Avy functions to navigate, you’re really shortchanging yourself and you should check them out. Avy is available from MELPA so it’s easy to install.

Posted in General | Tagged | Leave a comment

Translating Text with Org Babel

This really blew me away when I saw it. It’s an example of a simple use of Org Babel to translate phrases from English to Mandarin. Of course, all the heavy lifting is done by the Python library translate but the amazing thing is how simple it is to put everything together in just a few lines of an Org python source block.

Take a look and see if you aren’t impressed. What I find most impressive is that it’s just a quotidian use of Babel. It’s merely that it does something besides add a column of numbers that makes it so spectacular.

Posted in General | Tagged , | Leave a comment

Zamansky 22: emacsclient

Mike Zamansky has another video in his Using Emacs series up. This time it’s about emacsclient. All Emacs users tend to obsess over the editor’s load time. We are always looking for ways to speed it up or to avoid having to load it in the first place.

For many of us that means leaving Emacs running all the time. Some folks even arrange for it to be loaded by systemd as part of the boot process. Leaving Emacs up all the time has the downside of accumulating buffers. I used to fret about that myself but I finally realized that Emacs can handle hundreds of buffers without difficulty so I stopped worrying about it. I restart Emacs often enough—due to things like updating packages such as yasnippet that really want to be restarted when they’re updated—that I never accumulate more than a couple hundred buffers anyway.

One nice way of handling this strategy is to run Emacs in server mode and pop up a new frame when needed with emacsclient. The way to do that is to call it as

emacsclient -a "" -c

The -a "" will try to start the Emacs server if it’s not already running. If you want to start it in a terminal, the spell for that is

emacsclient -a "" -t

The terminal version is really useful for when you ssh into a remote machine and need to bring up Emacs on the remote. I have this captured in a bash script named et so that I can call it easily.

Zamansky demonstrates all this and shows how he binds the magic spells to keyboard shortcuts so that he can instantly launch an Emacs frame in the desktop or in a terminal window when he needs it. This weeks video is really short—less than 5 minutes—so you can watch it while you’re waiting for your coffee to cool enough to sip.

Posted in General | Tagged | Leave a comment

Org Mode 9.0.1

There’s a bug fix release of Org Mode out.

Posted in General | Tagged , | Leave a comment