2-Column Editing

Emacs Elements has an interesting video on something I didn’t really know about: 2-Column editing. I say “really know about” because I always assumed it was just another name for follow mode. But, of course, it’s an entirely different thing.

Even after watching the video and reading the Emacs manual entry, I still couldn’t give a clear explanation of its purpose. The TL;DR is that if you have a buffer that contains vaguely table like data where there’s some notion of columns, you can “split” the data between columns with each column being in its own buffer. These two buffers are displayed side by side and can be edited independently. When you’re finished editing, you can merge the two buffers back together.

I’m doubtlessly suffering from a lack of imagination but I’m having a hard time figuring out a use case for this. As far as I can see, you can do all the same editing almost as easily without learning the somewhat confusing 2-column commands.

You, of course, may disagree. Obviously some people do or the facility wouldn’t exist. Take a look at the video and see what you think. The video is 11 minutes, 42 seconds so it should be easy to fit in.

Posted in General | Tagged | Leave a comment

Zamansky: Learning Elisp #9

Mike Zamansky is back with the concluding video in his function header project. It’s the 9th video in his Learning Elisp series. This video ties up the loose ends in the previous videos in the project and provides a serviceable function to generate header comments for C-like languages. The final function generates javadoc formatted headers but it’s trivial to change the form by altering the format strings to be what you need.

The new ideas in this video include:

  1. Using string-split, string-join, and mapcar to parse and format the individual parameters and recombine them into a printable string.
  2. Using save-excursion to return the point back to where it was when the function was invoked.

The next project will involve inserting emojis by name into Emacs text but that will have to wait until Zamansky gets back from a European trip. He says that will be in mid October but that he might fit in a short video before he leaves.

In any event, the current video is 24 minutes, 20 seconds so you’ll definitely need to schedule some time. This video presents the development of a real function that an Emacs user might want to write to aid in their day-to-day development. Indeed, the function is a recreation of an actual function that Zamansky wrote years ago when he was an active developer.

Posted in General | Tagged | Leave a comment

Striving For A Mouse Free Workflow

As I’ve often suggested—most recently here and here—I try to minimize my use of the mouse as much as I can. Mostly that’s been in the context of Emacs where it’s easy. My desire to avoid the mouse is not ideological. It’s a matter of ergonomics. I find it faster and easier to to do my navigating from the keyboard.

Recently, I was reading an excellent article by Gwern on Internet Search Tips. It’s about how to optimize your Google-fu and search for hard to find papers, books, and other pieces of information.

One of the things that struck me was his insistence that your search has to be very easy to make or you won’t bother. The first part of his article is about keyboard shortcuts that he uses to initiate a search. He almost never needs to use a mouse for this. He’s a Linux user so much of his specific workflow doesn’t apply to me but I did take the general principle to heart.

I’ve had Alfred installed for a long time but hardly ever used it. I used it mostly to launch an application without having to click on its icon. After reading Gwern’s article, I tried to internalize this as a way of minimizing my mouse use. It turns out that the real power of Alfred resides in a subscription based plugin. I signed up for that and was amazed at how easy it made avoiding mouse use. For example, instead of clicking on 1password, scrolling down to the site I needed the password for, clicking on menu, and then clicking on the link to login page for the site, I merely brought up the Alfred prompt, typed 1p <site name> and I was taken right to the login page with all the password data filled in.

I’m still learning Alfred but already it’s essentially eliminated mouse use for everything except my browser. Browsers are the ultimate mouse-centric application for most of us and I’ve yet to find a reasonable way of avoiding the mouse when I’m in Safari. I’ve tried Keys for Safari, which tries to provide mouse free usage but it didn’t work for me.

The main point of this post is that whatever platform you’re on there’s something like Alfred that helps you avoid the mouse. If, like me, you like to avoid using the mouse, it’s worthwhile taking a look at one of the applications like Alfred that are appropriate for your platform.

Posted in General | Tagged , | Leave a comment

Weather Update

Idalia did indeed move a bit West resulting in a minimal impact in Tampa. The Irreal bunker didn’t lose power and had only moderate winds. The weather people say it’s possible we could get some more wind so it’s possible, I suppose, that we could still lose power but I don’t expect that.

I’ll push today’s regular post shortly.

Posted in General | Tagged | Leave a comment

Hurricane Alert

It’s late summer in Florida so of course the weather is getting dicey. The latest excitement is hurricane Idalia, which is currently about 200 miles West of Key West and forecast to move up the coast of Florida and come on shore a bit North of Tampa as a (probably Major) hurricane. That’s scheduled to begin tonight and continue into Wednesday morning.

Hurricanes are notoriously fickle so landfall could easily move a bit South to Tampa or further Northwest to the panhandle. As things stand now, the Irreal bunker will probably see tropical storm wind effects which, while not too bad, are enough for us to lose power. The real danger from hurricanes is flooding but, happily, the bunker is not in a flood zone.

If Irreal disappears for a day or two, don’t worry. We’ll be back as soon as Tampa Electric gets the power back up. Fortunately, we here in Florida are used to these things so the power company is really good at restoring power quickly.

Those of you who want to follow along at home can head over to the National Hurricane Center and monitor the storm with the latest information from the hurricane trackers.

Posted in Blogging | Tagged | Leave a comment

Bell Labs: The Idea Factory

Irreal has been on an Emacs binge for the last few weeks so here’s a change of pace. This post is about a Computerphile video featuring Brian Kernighan talking about what it was like to work at Bell Labs. Kernighan, is a treasure. Almost everyone in our industry is familiar with him if only as the “K” is K&R, the definitive C book but of course he’s done much more.

People in almost any other industrial setting will be amazed—and jealous—by Kernighan’s description of working life at the Labs. No one told him, or the other staff, what to do. People worked on whatever they found interesting whether or not it had any apparent application to the telephone system. One such project was Unix, which not only didn’t have any immediate corporate use but was essentially a skunk works project, management having lost interest in developing operating systems after their experience with the Multics project.

Interspersed with his description of life at the Labs, Kernighan describes how he came to be at the Labs. A lot of it was luck. That luck culminated in a summer job at the Labs while he was in graduate school at Princeton. That worked out so well for both sides that the Labs offered him a job upon graduation and he didn’t bother interviewing anywhere else.

Kernighan is a master at telling compelling tales about the early Unix days and is always worth a few minutes of our time. This video is no exception. It’s 12 minutes, 31 seconds long so it should be relatively easy to find time for it.

Posted in General | Tagged , | Leave a comment

Subword Mode

This should probably be a Red Meat Friday post but I really hate camel case. It’s hard to read, hard to type, and looks ugly. Among it’s many other sins, it has made abominations such as subword mode necessary.

Over at Emacs Elements there is a (very) short video on using subword mode. There’s not much to say. It’s a way of having forward-word skip to each capitalized segment of a camel case word. The video recommends enabling it via a hook function for whatever programming modes you use. You can, of course, toggle it manually by invoking Meta+x subword-mode.

Some people love this mode but—the awfulness of camel case notation aside—I’ve never seen the point of it. Yes, occasionally it’s convenient to have forward-word stop at each subword of a camel case identifier, but most often you want to treat the camel case word for what it is: a single symbol. In those rare cases (heh) where you want to put the cursor on one of the subwords, it’s easy enough to skip to the head of the composite symbol and move the point to the correct spot. Or you could use something easier like jump-char-forward. Regardless, it’s hard to see the utility of subword-mode.

Still, people differ in their needs and if this is something that’s useful for your workflow, Emacs, as usual, has you covered. The video is only two minutes, 25 seconds so you should be able to slip it in easily.

UPDATE [2023-09-01 Fri 12:39]: Mickey writes to tell me that I may have been too harsh on subword mode. What really happens when you invoke it is that the definition of a “word” is changed to encompass the subwords of SomethingLikeThis. That means that not just forward-word but any word-based command can stop and act on the subwords.

That makes it more useful than my original post suggested but I still think that usually you want to treat “SomethingLikeThis” as the single symbol that it is and subword mode is almost always overkill. As a real world, real time example, I misspelled SomethingLikeThis as SomethingLikrThis but rather than toggling on subword-mode and moving back to the error, I simply called jump-char-backward and went right to the error.

Posted in General | Tagged | Leave a comment

Editing In The Dired Buffer With Occur

I ran across this Toot—or whatever Mastodon calls it—in Sacha’s weekly Emacs News:

Even though it’s sort of old news at this point, it’s worth calling attention to. The idea is to use occur to narrow down the files in a Dired listing and then invoke the occur edit function to change the names of those files.

You can do the same thing from within Dired only but I like how the two-step process narrows down the files you’re concerned with and avoids errors. It’s a nice tip and worth taking a look at.

Posted in General | Tagged | Leave a comment

Red Meat Friday: Emacs vs. Vi

It’s a slow Friday here at Irreal so today’s offering barely qualifies as red meat but you may find it amusing. Someone posted this link to A Comparitive Study of VI and EMACS from the perspective of novice and regular users. It’s so old it was published as plain text. I expended a modest amount of effort trying to discover its publication date but couldn’t find anything.

What I find hilarious is that the study concludes Emacs is easier for new users than Vi. I’m guessing that that’s because of Vi’s modality. I don’t think it’s hard to achieve reasonable proficiency in either of them but I’d rank Emacs as slightly harder. Emacs partisans can cite this as further proof that it’s the one-true-editor but I doubt it was particularly dispositive even when it was published.

More in line with Irreal’s “let a thousand flowers bloom” philosophy regarding Emacs and Vi we have this post from TheWoodenPrince that speculates maybe Emacs and Vim can live happily ever after. We have, after all, the common enemy of bling infested hot new editors that we, the cognoscenti, know are inferior to both Vim and Emacs.

So there’s your red meat for the week. Enjoy the weekend and come back Monday ready to address the issues that really matter.

Posted in General | Tagged , | Leave a comment

The Downtown Apocalypse

If you’ve been around Irreal for a while, you know that I’m fascinated with remote work. I don’t understand why anyone wouldn’t embrace it but I realize that some don’t. Regardless, remote work is dug in and here to stay. A recent article in The Guardian notes that buildings in major U.S. cities are empty and business owners are facing a come to Jesus moment. Their employees are not coming back to the office no matter what they say and the smart money is making plans to adapt to the new reality.

Part of the pushback from the office-first folks is that you can’t run major projects without the principals having frequent face-to-face interaction. I’ve seen several posts and articles lately making this claim as if it’s indisputable. The thing is, we have several counter examples. Most of the open source movement is managed and thrives in a completely remote environment.

Since this is Irreal, let’s look at Emacs. The project, in its various guises has always been remote and has thrived that way for over 40 years. I don’t have any statistics but I doubt that more than a handful of Emacs developers have ever met in person. Rather, they debate and argue online. There’s no water cooler but there’s also no prattle about “How ‘bout them Yankees” or “Let me tell you about my date last night.” Sure, there’s some extraneous discussion but mostly it’s on point. Take a look at the Emacs-devel archives to see what I mean.

As much as the control freaks might wish otherwise, the days of everyone in the office all the time is over. Almost all of us are glad.

UPDATE [Added before publication]: CNBC Make It has an interesting article about the return to work movement. The TL;DR is that most executives who decreed workers must return to work now regret that decision and many have had to retract their demands. As with the Guardian article, a large factor is empty office space. It costs, CNBC Make It says, about $16,000 per employee per year for that office space so you can see why companies are loath to let it sit idle.

Posted in General | Tagged , | Leave a comment