Editing macOS Text Fields with Emacs

If you’re like me, you hate dealing with text outside of Emacs. Even those of us who spend as much time as we can inside Emacs have to interact with other applications. In my case, that’s mostly Safari. The problem with Safari is that its architecture doesn’t allow extensions that will call Emacs to edit text fields the way, say, Firefox does.

MacOS, of course, recognizes many of the Emacs keybindings but you can do much better. For many years, I’ve used the operating system’s ability to assign keys to editing functions to install a fairly comprehensive set of Emacs editing keybindings but while that helps with muscle memory, it’s not really like editing with Emacs. I’ve long wished for a way of popping into Emacs to edit the text fields from other apps.

Now, happily, my wish has been answered. Take a look at this video by dmgerman that demonstrates his Edit with emacs Everywhere package. It provides just what you’d want: if you’re in any text field in any Mac application, you can press a key sequence to put up an Emacs buffer in which you can edit the text in the field and then return the edited text to the calling app. The important thing here is that you’re not just using Emacs keybindings but using Emacs itself with all its power. Perfect!

The package depends on Hammerspoon to mediate with the OS. It’s easy to install and, of course, is more generally useful but even if it weren’t, giving us the ability to edit all text fields with Emacs is worth the price of admission.

Posted in General | Tagged | Leave a comment

Search Hydra

If you use the Ivy/Swiper/Counsel package, you know that are a lot of ways to do searches. So many that it can hard to remember what they all are and how to invoke them. Fortunately, Yuri Tricys has come to the rescue with a hydra for searching.

Tricys is planning some follow on posts that describe a few of the functions and packages that his hydra uses. He also has a separate section for some programs to use in the Windows environment.

It’s worth taking look at his hydra if only to get some ideas for the searches you may want to make. I agree with Tricys that hydras are the ideal solution for this sort of thing. They’re easy to implement even for someone who doesn’t know Elisp. That makes them a great way for any user to create and manage their own menuing system. There’s extensive documentation for hydras at the package’s Git repository so they’re accessible to everyone.

Posted in General | Tagged | Leave a comment

Read Meat Friday: Chrome Is Not Your Friend Either

A few months ago, I noted that Google is not your friend. You’d think everyone would know this by now but apparently lots of folks don’t. As a corollary to that truism, we also have, “Chrome is not your friend either”. That’s old news too, of course, but now we have this:

Next up, Missouri and Gov. Parson will change their education website to work only with Chrome and disable viewing the HTML. Problem Solved.

Really, there are numerous reasons to not be using Chrome and this is another. Sadly, most folks who are going to get the message have already gotten it and the rest will keep right on using this abomination.

Posted in General | Tagged , | Leave a comment

Three N00b Emacs Mistakes

Derek Taylor has a video that calls out what he says are Three HUGE Mistakes New Emacs Users Make. He says that many Emacs n00bs have a hard time getting started because they make the same three basic mistakes.

The first mistake they make, he says, is treating Emacs like Vim or other editors and starting it for each file they want to edit. This is one of the first things someone moving to Emacs learns. You have to modify the way you do things. What I and many others do is start Emacs when I first login and just keep it running for the whole session. As a practical matter, that’s until I reboot the system or restart Emacs because of package updates. Taylor recommends starting Emacs in daemon mode and calling emacsclient when you want to edit a file. That’s okay but not as efficient for my workflow, especially since I do almost everything from within Emacs. In either case, you avoid the relatively long—compared to other editors—startup time.

The second mistake is using some sort of file manager to choose a file to edit. Emacs, of course, has Dired that does this and more. There’s no reason to use a separate application for file browsing especially since it leaves an unneeded application running and taking up screen real estate.

Taylor’s last piece of advice is the most controversial. He says that you shouldn’t run Emacs in terminal mode unless you’re running on a system without a GUI windowing system. Some people have very strong feelings on this question: they’re either all in for running the GUI version of Emacs or they insist that real programmers stick to terminal mode. Although I almost always run Emacs in GUI mode—because of the extra capabilities you get—I’m pretty much agnostic on the issue. I do think that the GUI offers enough benefits that you should use it in most cases but it doesn’t bother me when other folks choose to run in the terminal.

It’s an interesting video. If you’d like to watch, it’s just short of 13 and a half minutes so it should be easy to fit in.

Posted in General | Tagged | Leave a comment

Getting Closer to Walletless

Those of you who have been around Irreal for a while are aware of my quest to ditch my wallet and be able to leave my house and conduct my business with nothing but my iPhone. I am getting closer. My house has digital locks, my credit cards are in my digital wallet on my phone, and now, finally, I have a digital license.

Florida still hasn’t officially rolled out its digital license program but you can download the license app and, if you’re particularly persistent, you can get it registered and activated with the state. Doubtless the program will be completely rolled out in the next week or two. Of course, Florida law still requires that I carry my physical license when I’m driving but I expect that the law will be amended to say that the digital license suffices. As a practical matter, police officers probably won’t even ask to see your physical license because they can more easily capture your information from the digital license.

So where am I? I feel like I still need a physical credit card because there are a few recalcitrant merchants who haven’t enabled NFC and, thus, Apple Pay. So I still need to carry a license and a credit card as backup even though I can theoretically get along without them. That leaves only the car.

I’m hoping that the next car will have digital locks and ignition so that I no longer have to carry car keys. Once that happens, I will have essentially realized my ambition to have my every day carry down to my phone. In my saner moments, I recognize that this is definitely a first world problem but I view it as another step in obtaining a digital life. Really, why should we still be carrying around pieces of paper to verify information that could just as easily be provided digitally?

Posted in General | Tagged , | Leave a comment

Updating describe-bindings

One of the things you often want to know is what keybindings are available for the current buffer. Emacs, of course, has a command for that: describe-bindings, bound to Ctrl+h b. I never use it.

The problem is that it outputs too much garbage in an unhelpful way. Lars Ingebrigtsen has noticed this too an decided to do something about it. Part of the problem is that the original code was written in C making it hard for many to work on. Happily, it’s recently been refactored in Elisp so changes are easier. Ingebrigtsen took advantage of that to prettify the output and put the relevant information at the top.

In Ingebrigtsen’s post you can see side-by-side comparisons of the old versus Ingebrigtsen’s updated version. The best news is that the changes are already on trunk in the Git Emacs repository so we should be seeing them soon.

The describe-bindings function has been in Emacs for a long time without much change but now it’s been significantly revised. This story—and many others like it—put the lie to the ignorant assertions on social media that Emacs is old and dead. It may be old, for software, but it’s far from dead. Indeed, even ancient and relatively unimportant parts of it are candidates for improvement.

And, of course, thanks to Ingebrigtsen for bringing us this improvement.

Posted in General | Tagged | Leave a comment

How To Be an Ankle Biter

It’s Sunday night and I’m completely unmotivated to write something coherent and interesting for tomorrow’s (i.e. today’s) post. Instead, I offer this oldie but goody from the Way Back Machine that they title Things to say when you’re losing a technical argument. We’ve all been in, say, a code review or planning meeting and experienced being the recipient of one of these tropes.

They’re all the sure sign of an ankle biter. By “ankle biter”, I mean one of those annoying people who has nothing of value to contribute but nonetheless feel obligated to raise silly objections to everyone else’s suggestions. If you can’t think of a real objection, what better to say than, “That won’t scale”? If you look at the list, they’re all like that: they sound technically astute but actually have no meaning in the situations in which they’re used.

Probably the best defense is to ask the ankle biter to elaborate on and explain the objection. If the objector is, in fact, an ankle biter, they almost certainly won’t be able to and you can move on.

Posted in General | Tagged , | Leave a comment

Blogs and RSS

Brandon Quakkelaar has an interesting post on Social Media, Blogs, and RSS. His feelings are amazingly congruent with mine. We both don’t care for social media but recognize that they present a good way of discovering new content.

What are the alternatives? Quakkelaar says that blogs solve many of the problems with the shorter hot takes that one mostly sees on social media. The average Irreal post is between 3 and 4 hundred words, which is hardly long form writing but they’re much longer than a tweet. More importantly, writing a blog post is a different process than writing a tweet. Tweeting is like shouting out whatever’s on your mind at the moment; A blog post is more like writing an essay. It requires some thought and consideration of what you want to say and how to say it.

That leaves two problems. How does a consumer of blog content keep up with new posts and how does that consumer discover new content? The answer to the first is easy: RSS. By subscribing to a blog’s RSS feed you get notified when there’s a new post and, depending on the blog, a summary of the post. Of course, you need an RSS reader for this but there are several excellent readers available. If you’re an Emacs user, you can’t beat Christopher Wellon’s Elfeed. Take a look at John Kitchin’s excellent video on Elfeed or Mike Zamansky’s series on it (1, 2, 3) for a good introduction. If you’re not an Emacser, take a look at Feedly. I used it before I found Elfeed and liked it a lot.

Finally, there’s the question of how to discover new blogs. There’s no standardized way of doing that but Quakkelaar has a prototype solution. Head on over to his blog to see what it is.

Posted in General | Tagged | Leave a comment

Taking Math Notes With LaTeX in Emacs

Two and a half years ago, I wrote about Gilles Castel’s astounding ability to take math notes at speed using LaTeX and Vim. As someone who once came perilously close to being lapped on a three panel blackboard by a Math professor, I found this amazing yet Castel says he can keep up with his professors. A year ago, I wrote about a post on reddit by karthink that gave a quick overview of how he did the same thing with Emacs.

Now Karthink has long post that goes into detail on how he does it. If you’re like me, you probably think that most of the magic involves yasnippet but karthink uses yasnippet almost as an afterthought. All the heavy lifting is done by AUCTeX and CDLaTeX. Karthink presents his methods in three stages: AUCTeX, CDLaTeX, and yasnippet. You can, he says, get a long way just with AUCTeX.

CDLaTeX provides a series of shortcut keys that can really speed things up. For example, `a gives you α, `> gives →, ``R gives \Re, and ```s gives \sin. Most of these are mnemonic and in any event, CDLaTeX will pop up a which-key-like help screen if you delay for a second.
Finally, he uses yasnippet for those things not covered by AUCTeX and CDLaTeX. He has a pointer to his snippets but says you should make your own specialized for your particular needs.

Happily, my days of taking class notes are over but it’s still nice to know how to speed up entering mathematical notation while I’m in Emacs or Org-mode. If you’re a student taking Math classes, you should take a look at Karthink’s post.

Posted in General | Tagged , | Leave a comment

Leaving the Office is Easier Than Returning

ABC in Australia has a provocative article that makes the (obvious) case that it’s easier to start remote work than it is to end it. Remote work seems custom made for the tech industry and, indeed, they were among the first to embrace the notion when the COVID-19 epidemic first appeared. Now, though, as they see the end of the threat, they’re trying to get their employees back in the office. Their employees aren’t enthusiastic. Most, but not all of them, don’t want to return.

The companies make their usual claim that having people in the office encourages synergy: that employees will talk to each other, exchange ideas, and new concepts will emerge. We hear this so often it seems like an inarguable truth. But is it true? Not everyone thinks so. According to the article, Ed Zitron, who runs a public relations firm, has this to say,

The only reason to have an office, he says, is to satisfy managers
with vested interests in grouping people together “so that they can
look at them and feel good about the people that they own … so that
they can enjoy that power”.

Irreal is inclined toward that view but not everyone agrees. Odd as it seems to those of us who love remote work, some people really do like going into the office. Some folks just don’t like the feeling of isolation. Others feel that going to the office serves to separate their work life from their home life.

It’s hard to know how it will all play out but it’s probably true that micromanagers who would like to enforce a one-size-fits-all solution are going to experience a lot of pushback. One thing for sure, we’re not going back to the way things were.

Posted in General | Tagged | Leave a comment