Another “How Did I Not Know This?”

I’ve been using Emacs for over a decade and like all of us, I’m still learning things I didn’t know about it. Still, this really surprised me. Sure, maybe I don’t know about some obscure command or key binding but a modifier key?

At first I thought the person asking the question was simply misinterpreting something. Then I read the first couple of lines of the answer and thought, “Aha! It’s simply someone trying to convince us to use Alt instead of Meta.” But no. It turns out there really is an Alt modifier and it has nothing to do with the Alt key we all have on our keyboards and map to the Meta modifier1. It’s a completely different modifier that I, at least, had never heard of. It’s an artifact from the days when keyboards had both Alt and Meta keys. It’s seldom used these days but if you need it, the easiest way to specify it is with Ctrl+x @ a.

Perhaps I’m the last Emacs user in the inhabited universe to learn this but just in case I’m not, I’m sharing the information.

Footnotes:

1

Let this be a word of caution to those revisionists who are always fussing at us to be “modern” and call the Meta modifier the Alt modifier because the Meta modifier is most often mapped to Alt on today’s keyboards.

Posted in General | Tagged | Leave a comment

Recording Your Org Mode Activity

Over at Infin there’s a nice post on recording Org mode activity. What that means is logging all the little administrative steps you take with your agenda such as marking an item done, changing its state, adding a note, and so on.

If you have a need to audit your actions—exactly when did I change the state of that task to WAITING—the functions in this post could be a big help. There’s also some code to query your agenda for things like “Show me all the activity in the last two days.” Not everyone will have a need for this type of thing but if you do, the post may give you some ideas and a starting point.

Posted in General | Tagged , | Leave a comment

Clean Screen Writing

There’s a certain type of writer—mostly prose writers, I’d guess, but others too—who don’t want to be distracted by extraneous information from their editor. They don’t want to see the name of the file they’re editing, what line they’re on, or, in Emacs terms, what mode they’re in. They don’t want a mode line or anything else. The metaphor they’re seeking is the blank sheet of paper.

I remember coming across this same idea years ago; so many years ago I was still using WordStar for non-programming editing. I didn’t understand it then and I don’t understand it now. Knowledge is power, after all, and I never saw the benefit of unnecessarily doing without it1.

Needless to say, not everyone agrees. A few years ago, Bastien Guerry showed how to achieve a blank screen in Org mode. Now Pete Corey is doing the same thing in Spacemacs (although his approach will, mutatis mutandis, work with any Emacs configuration) using Olivetti. Corey’s approach isn’t limited to Org mode. He likes the blank screen even when he’s coding so he’s arranged for his mode to be active in text-mode and prog-mode buffers.

Most folks probably wouldn’t want such a setup but if you do, Corey shows how easy it is to obtain it with the help of Olivetti.

Footnotes:

1

To be fair, I do use diminish to get rid of some minor modes but that’s mostly so that I can see all the important information on the mode line.

Posted in General | Tagged | Leave a comment

A Tiny Change to Irreal

Those of you who are super-observant may have noticed that I’ve removed the “Recent Comments” widget from the site’s sidebar. That’s because the widget doesn’t work with Disqus and was displaying “recent” comments from some time ago.

A while back, frequent commenter Phil pointed out to me that it wasn’t working and I’ve just now gotten around to figuring out what the problem is. It’s a feature that I doubt most people used and anyone will miss so this change shouldn’t have any effect on most people.

Posted in General | Leave a comment

Why You Should Buy Into the Emacs Platform

I’ve been seeing a lot of references to Christoffer Stjernlöf’s (slightly old) post on Two Wrong about Why You Should Buy Into the Emacs Platform. It seems to me to offer a nice coda to my two posts on ancient editors. It fits in with that discussion because it looks at another reason to spend the time to learn and master Emacs.

The TL;DR is extensibility but that characterization misses the point of what Stjernlöf is saying. His thesis is that Emacs is really a framework for writing text-based tools. That means that it can be—if you like—more than an editor. You can use it to read mail, follow your RSS feed, play music, and all sorts of other things. But even considered as a text editor, the ease with which you can write editing tools is a powerful benefit.

Gosh, that fancy editor over there has this feature called multiple cursors. You don’t have to switch editors or beg maintainers to add the feature to Emacs, you can do it yourself just as Magnar Sveen did. What this means is other editors can’t be more powerful because whatever feature makes them seem that way can be added to Emacs relatively easily (Sveen had a first hack at multiple cursors working after just 2 hours). It can be added by an individual user even if no one else cares about or is interested in the feature.

Isn’t that a capability you’d like your editor to have? Different people have different needs and priorities but to my way of thinking that capability alone makes it worthwhile to spend the time mastering Emacs.

Posted in General | Tagged | Leave a comment

Things I Don’t Miss

I just upgraded to Safari 12.0. I’ve been looking forward to it because Apple has greatly expanded the anti-tracking measures in the new Safari. Apparently the extension framework has changed because one of my extensions was deleted and the other was turned off. The one that was turned off was Ghostery on the grounds that it would slow down browsing. Perhaps I wouldn’t need it anyway with Safari’s new features.

Once the update was completed, I went back to my browsing—visiting a typical tech site—and nearly had a heart attack. Ads started popping up and the screen was redrawn several times to adjust for them. Although the content appeared pretty much immediately, it was hard to read because it kept jumping around. This went on for some time. In exasperation, I turned Ghostery back on—it’s easy to do from the Extension Preferences Pane—and reloaded the page. Boom! It loaded just as it always had with no delay and no jumping around. As far as I can tell, turning Ghostery off actually makes loading slower not faster.

In any event, Ghostery is coming out with Ghostery Lite that will work with the new browser but it’s not ready yet. If you’re using Ghostery with Safari, I recommend turning Ghostery back on. Your life will be much better and as far as I can see, it doesn’t appear to effect the speed, at least compared to the old Safari.

In a way, the episode was a revelation to me. I’ve written several times that I don’t mind the ads—I consider them a fair cost for the content that the advertiser is paying for—but it turns out that I do mind them. A lot. In fairness to the content providers, I’d put up with them were it not for the tracking but they really do make for a considerably less pleasant browsing experience. All those ads are something I don’t miss at all. Happily, the malevolent adtech people will never give up trying to track us so I can continue to use Ghostery to filter their ads without the slightest twinge of conscience.

Posted in General | Tagged , , | Leave a comment

Finding Happiness with an Ancient Editor

Apropos of yesterday’s post on learning ancient editors, tareefdev has a post on the Emacs subreddit on why and how he moved from one of those “modern” electron-based editors to Emacs. His problem was a simple one: he had a 6.3 MB file and couldn’t open it with his editor. Say what you will about Emacs and large files, it can easily handle files of that size as tareefdev discovered when he opened his file in Emacs with no problems. As his expertise with Emacs grew, he discovered that he could use it for more and more of his tasks and that it made his life easier.

This is a quotidian story that normally wouldn’t be worth writing about except in light of the argument discussed in yesterday’s post that young developers shouldn’t waste their time learning ancient editors like Vim and Emacs. Just stick with that flashy new editor that’s easy to learn and has a glitzy UI. Except then you find it isn’t up to the job and you have to revert to one of those dusty old editors that folks were telling you weren’t worth your time.

If you’re lucky—and smart—like tareefdev, you may find that your problem was actually an opportunity to begin a life-long relationship with a powerful tool that can lessen your workload in many ways.

Posted in General | Tagged | Leave a comment

Why Learn Those Ancient Editors?

I went back and forth over whether I should embed the following tweet or just extract the quote from it. My remarks are about its contents and not the tweeter, who I don’t know and is probably a fine person and developer but I decided that it wasn’t fair to just steal his words without credit. I do want to emphasize that this is not an attack on Umbel, only a statement of my profound disagreement with a particular opinion of his.

It’s easy to ignore this sort of thing and I usually do because, as I’ve said before, choosing an editor is like choosing a mate: it’s nobody else’s business. Still, I find the sentiment behind it disturbing.

On the one hand, we can take the position that, fine, this advice will ensure that its adherents remain mediocre or, perhaps, “good enough” developers who leave the path to advancement open for those who are willing to put in the effort to learn and master their tools, even the “old” tools that, by surviving, have demonstrated their value. That’s not to say, “Use Emacs or die.” It’s not about using any editor in particular. It’s about not bothering to master—or even try—a tool just because it’s old, preferring, instead, an editor that while less powerful looks “prettier” and is easier to learn.

On the other hand, I think this advice is disastrous for all of us, not just the misguided who follow it. We all benefit when our colleagues are as good as possible and following this advice strikes me as a way of ensuring that they won’t be. Again, this is not to say that unless you use Emacs or Vim you’re a bad developer. It’s more about the attitude of “why bother?” and the smug assurance that “I know better than to waste my time on this old junk.” I don’t care if you use Emacs (or Vim) or not. I’d just like your decision to be an informed one.

Posted in General | Tagged | Leave a comment

Little Languages

Last month, I wrote about one of John Bentley’s Programming Pearls columns in the Communication of the ACM. Someone has posted another column, this one on Little Languages. I remember reading the column in More Programming Pearls; it instilled in me a way of looking at certain problems that I’ve used throughout my career.

It’s surprising how often a problem can be easily solved by writing a little language to transform the data you have into a form suitable for some other existing program that can do all the heavy lifting. Bentley gives the example of chem, a small awk program that took the description of some chemical as input and output a pic program that could be used as input to troff to typeset the standard graphical representation of the chemical. Thus he (and Brian Kernighan) chained together two little languages to produce a useful input to troff to do something that I’m sure Joseph Ossanna never envisioned when he wrote troff.

Early in my career, I did something similar. I was part of a small remote team working on Unix systems. My personal computer was running FreeBSD, which at that time did not have anything like OpenOffice. The HR trolls demanded time sheets that were printed from an Excel spreadsheet. Since I couldn’t do that, I wrote an awk program to take my task times as input and output tbl (another troff little language preprocessor) commands that troff then typeset as a reasonable facsimile of the Excel spreadsheet. I’ve used the same trick over and over: write a simple program to produce input to some larger program to produce the needed output.

Take a look at Bentley’s column1. Perhaps you’ll learn a new way or working too.

Footnotes:

1

The PDF of the ACM article is a little confusing. Pages 714 and 715 are a sidebar meant to be read separately but it comes right in the middle of the main text and it’s easy to get lost.

Posted in General | Tagged , | Leave a comment

Org Capture

I’ve seen some questions lately asking if it’s worthwhile to learn Org mode. Regular readers will have no doubt as to my answer but I stumbled across a nice post from Charles Cave on how he uses Org capture, templates, and agendas to organize his day and log relevant information. The post is (probably) from a few years ago but its content is still up to date.

Like me, Cave records a lot of information that has an associated timestamp so he makes extensive use of datetrees in his capture templates. That’s really handy because Org-capture will file each entry in a 4-level hierarchy with the first three levels being year, month, day and the fourth level being the actual item. That makes it easy to see, for example, all the entries recorded in June of 2016. Being an Org file, all the headings are foldable so it’s easy to hide everything except the information you’re interested in.

You can also add one or more tags to each entry so if you want to see all the entries associated with, say, your dentist, it’s easy to pull them up by the “dentist” tag. One of the nice features of Org capture is that you can have the template prompt you for a tag. That makes it harder to forget to add them.

There’s much more so if you’re not familiar with Org capture and templates, take a look at Cave’s post to see what’s possible.

Posted in General | Tagged , | Leave a comment