Here’s a little red meat for the Vim vs. Emacs crowd:
#Mindrot #categories #computerworld #emacs "If it runs Emacs, it's a computer. Otherwise, it's a peripheral"
–jwz
— mindrot (@mintrod) July 2, 2018
Here’s a little red meat for the Vim vs. Emacs crowd:
#Mindrot #categories #computerworld #emacs "If it runs Emacs, it's a computer. Otherwise, it's a peripheral"
–jwz
— mindrot (@mintrod) July 2, 2018
My friend Watts tweets that he thinks BBEdit has the simplest workflow for doing a search and replace on the files of a directory that do not include some term:
I’m sure BBEdit isn’t the only editor that can do “find all text files in this folder that do not contain ‘foo’ and do a separate multifile search-and-replace within the first search’s result set” in just two operations, but I’d be surprised if any others can do it as easily.
— Watts Martin (@chipotlecoyote) June 19, 2018
I took that as a challenge, of course, and immediately started figuring out how to do it in Emacs. I have a solution that uses two (or arguably 3) simple commands to do the same thing starting from a dired buffer. So the challenge is, how would you do this in Emacs using the minimum number of {commands | keystrokes}1? If you know BBEdit (I don’t) is your solution easier/simpler than the same thing in BBEdit?
Not counting keystrokes for the search term or regular expressions in the search and replace.
Mike Zamansky is getting ready to give a presentation at a professional conference. As always, this means preparing a slide deck and Zamansky is faced with deciding how to do it.
In the past, he’s described reveal.js as his go to presentation software but he decided to look at the other options. In particular, he looked at ox-beamer and epresent as well as ox-reveal. His latest video discusses each of these and what he chose to use for his presentation.
All these solutions share the virtue that you can write your slides with Org mode and export them to ready-to-show slide decks. He starts by explaining why he doesn’t just use something like PowerPoint, Google Slides, or one of their free software siblings. Those systems, he says, force him to focus on how the slides are laid out and that gets in the way of writing coherent content. He much prefers to write in Org mode taking advantage of its editing capabilities and leave it to the exporter to make the final results look pretty.
His first attempt was to use beamer. Although he likes the way the slides look, he found beamer difficult to use. He doesn’t give very many presentations so it would be hard to remember the details of using it even if he made the initial investment in learning the system.
Epresent’s slides don’t look as nice as those from the other two systems but they have the virtue of displaying from within Emacs. It’s also very easy to navigate through the slides.
Finally, Zamansky considers reveal.js and its Emacs interface, ox-reveal. It combines a nice looking final product with a dead simple input structure. Basically, any Org file can be exported as a slide deck by the inclusion of a single statement telling ox-reveal where reveal.js is located. In the video, Zamansky just uses the epresent source file for the reveal.js example. All he needed to do was point it towards reveal.js. He also showed how it’s possible to serve the slide deck directly from GitHub. That could be handy if it’s not possible to use your own laptop for some reason or another.
The video is a bit longer than usual (20:12) so you may need to schedule some time. As always, it’s definitely worth your while to watch it.
I just came across some old videos from AT&T about Unix that are worth taking some time to watch. I thought I had written about them before but I couldn’t find any mention of them either locally or on Irreal itself. In 1982, Unix had been around for a bit over a decade, had matured quite a bit, and was being used throughout the Bell system as well as other places. That year, Bell Labs produced two short films, The UNIX System: Making Computers More Productive and The UNIX System: Making Computers Easier to Use. They cover the same material and even use some of the same sequences but it’s still worth watching both. AT&T says the first was aimed towards software developers and computer science students. The second was for programmers specifically.
I really enjoyed seeing some of the original Unix developers including an impossibly young Brian Kernighan but also Thompson, Ritchie, Steve Johnson, Lorinda Cherry, John Mashey, and Al Aho. They’re all delightfully nerdy as they describe Unix and how it makes developers’ lives easier.
At one point in both films, Kernighan builds a spell checker by piping together a series of existing programs to do things like splitting text into one word per line, sorting, eliminating duplicates, and checking against an existing dictionary. What was interesting is that although the same commands (more or less) exist today, they had different names. Kernighan used a program called makewords
to split the text into words while today we’d probably use tr
. What we now know as uniq
as called unique
and the functionality of comm
was implemented in a program called mismatch
. Nonetheless, you could build the same pipeline today with any Unix system using the modern versions of the programs Kernighan used.
If you enjoy seeing how things were early in Unix’s life and would like to see what the early researchers looked and sounded like, it’s definitely worth spending a bit of time watching these videos. The first is about 27 and a half minutes and the second is about 23 and a half minutes.
Someone posted a chapter from Sam Williams’ book Free as in Freedom (online here), that discusses the early history of Emacs. The chapter, The Emacs Commune, is full of things I didn’t know about how Emacs evolved from the TECO editor.
We all know that Emacs started as a set of macros to the TECO editor (hence Editing MACroS) but there’s a lot more to the story. In the first place, the choice of the name Emacs involved more than just the obvious mnemonic. The choice was, in fact, chosen for efficiency reasons. You can read the chapter to see what that was.
You may also have heard that Guy Steele played an important role in the development of Emacs. That’s true, and, in a way, he started the whole thing, but the driving force was always Richard Stallman.
If you’re an Emacser, you owe it to yourself to take a look at this chapter if only so you’ll know where the editor that we love and depend on came from. Even early on, lots of people contributed, if only in the form of their own TECO macros. It turns out that the early standardization of those macros—in what was later to become Emacs—presented a political problem for Stallman. Read it and become enlightened.
Troy Hunt, whom I’ve written about many times, has performed a public service by putting together 4 simple videos that show how easy it is to implement HTTPS on your site. The link takes you to a blog post that discusses all this but the actual videos are on a separate site, httpsiseasy.com.
You can get security that’s stronger than the typical bank site security with a little more than 5 minutes of work. It turns out you can do all of this and more for free. As Hunt explains, CloudFlare has a free service that allows you to easily do all this without changing your hosting provider.
Head over to the httpsiseasy.com site and watch the videos. The four of them together take a little less than 20 and a half minutes to watch. You’ll see how easy it is to secure your site. Even if, like Irreal, there’s nothing on the site worth securing, you’ll protect your users from malware and make it harder for the nosey parkers to peek at what you’re doing.
As I’ve said many times, I consider abo-abo’s define-word one of my most useful packages. I use it several times a day. If you’re looking for a dictionary that ties in seamlessly with Emacs, you should take a look at define-word
.
Some people may be put off by the fact that define-word
leverages the Wordnik dictionary site to get its definitions. As I noted in my post on powerthesaurus, I’ve used define-word
since it was announced (over 3 years ago) and have never had a problem with its depending on a third-party site. I guess that if I lost or didn’t have connectivity for some reason, I could just use the macOS system dictionary but I’ve never had to do that.
For any macOS Emacs users who are worried about such things, Xu Chunyang has written a package to query the macOS system dictionary from Emacs. I am, as I said, perfectly happy with define-word
so I haven’t installed osx-dictionary
. I could, I suppose, install it as a backup system in case I don’t have connectivity but, at least at this point, it doesn’t seem necessary.
But don’t let my preferences sway you. If you’re looking for an easy way to access the macOS system dictionary from Emacs, you should definitely take a look at Xu’s package.
Gregory Stein has an excellent post on Literate Programming with Org-Mode. Despite the title, it’s really more about leveraging Org Babel to create literate documents that contain notes, code, and results. This is, of course, the same area that Howard Abrams covered so well with his Literate DevOps post and video and Stein mentions Abrams work but also adds some material that I wasn’t familiar with.
In his section on working with code blocks, Stein covers how to set parameters that are specific to a language. That’s not useful for individual code blocks, of course, but it’s handy for file-global settings in, say, the :PROPERTIES: drawer when the file contains code from more than one language. He also shows how to enable the asynchronous execution of the code blocks using the ob-async package.
Finally, Stein offers an extended example of setting up a Python virtual buffer, If you program in Python with Emacs, that alone makes his post worthwhile.
Stein’s examples are a little less complex than Abrams’ so his post is a nice introduction to the subject and should probably be read first if you haven’t already read Abrams’ post and watched his video. This is really useful material that’s sure to give you plenty of good ideas; I recommend reading both Stein’s and Abrams’ posts and, of course, watching the video.
Howard Abrams has a very nice post in which he talks about how he uses Org capture in his workflow. Most of us are familiar with Org capture and the use of templates to store data in some Org file. I use them all the time and they are a critical part of my workflow.
Abrams’ post is about how he sands down the friction points involved in the process to make capturing data as painless as possible. His main trick is to use the currently clocked task as the destination for his captures. One of the things that adds friction to the capturing process, he says, is the need to determine where the captured data should go. It turns out that you can make the currently clocked task the destination so that the data will automatically go to the Org file (and headline) you’re currently working with.
With that idea in mind he created a template to move the highlighted item to his target Org file. That’s pretty nice but there’s still the distraction of creating and seeing the Org capture buffer. He solves that by creating a couple of templates that just store the selected data without bothering with a capture buffer.
Next, he considers capturing code and the metadata (such as file name and location) that goes with it. This requires a bit of Elisp but is pretty simple and easy to understand.
Finally, he thinks about capturing data that is not in an Emacs buffer. He wrote a shell script that you can pipe data into and have it capture the data and store it in the currently clocked task. That’s very handy when you want to capture the data from some external task or pipeline. He also wrote some scripts (particular to macOS) to scrape data and its formatting from a browser page.
Abrams post has a lot of useful ideas and is worth taking a look at. You may find some or all of them useful in your own workflow
Lately, it’s become obvious that just about every “official news source”—even tech sites—are in it only for the clicks. Journalists have been ignorant and biased for a long time, of course—see Michael Crichton’s hilarious explanation of the Gell-Mann Amnesia effect or Ben Rhodes’ description of the vaunted White House Press Corp as literally knowing nothing—but they, or their editors, no longer seem to care if their stories are even remotely correct. It’s not that the advertising is necessarily bad, it’s that the attached content has no value and, in fact, is most often ludicrously wrong.
All this occurred to me while I was reading one of the Macalope’s frequent take downs of tech pundits’ prognostications. Why, I wondered, do they keep making the same obviously wrong predictions? (“The iPhone X is a failure” is their latest trope even after Apple’s last quarter’s results proved that to be nonsense.) Why would they continue to embarrass themselves with predictions that any sane person knows are silly?
Then I realized that they don’t care about the truth or reasonableness of what they’re writing. It’s all about making some outrageous claim that will infuriate Apple fans (or give sustenance to Apple haters) encouraging then to click through in order to capture their eyeballs. If it were just Apple news we could shrug and take comfort in its fueling a never ending flow of Macalope humor but if you look closely, you’ll find that it’s all like that.
If you look at almost any news site, you’ll see an incendiary headline fronting a story that doesn’t make much sense. Either it’s obviously wrong or it doesn’t say anything at all. Once you’ve clicked through, their job is done and there’s no sense wasting effort on the story itself.
So what to do? One solution is to look for news in blogs, especially non-monetized blogs. There are a couple of problems with that. Sure, those of us who blog have our biases too but at least they’re ours and we’re mostly up front about them. More importantly, we’re not getting paid to push them. If you look at a variety of blogs, you’ll have a reasonable chance of getting a balanced viewpoint. More worrisome, is the fact that most blogs—not even Irreal—can afford a cadre of reporters to gather the news so they have to rely on the traditional news sources. But, as suggested by Crichton’s quote, there are always folks who are experts in the particulars of any given story and if you read a reasonable selection of blogs you’ll get their viewpoint.
That’s not ideal, of course. We’d like to be able to read a single paper or site and get reliable news. Sadly, such papers and sites no longer exist.