Editors versus IDEs

Over at the Hacking the Grepson podcast, Mike and Matt discuss text editors versus IDEs. The podcast was at once informative and annoying. On the one hand, they discuss the difference between a text editor and an IDE.

If you’re like me, your first reaction is, “What’s the problem? Everyone knows the difference.” That works right up until someone asks you specify what that difference is. Then we mostly fall back to channeling Justice Stewart and settle for saying we can’t define it “but I know it when I see it”.

Mike and Matt have a pretty good definition: it’s an IDE if you can compile, debug, and run the code from within the application. Of course, even that’s a little squishy. Is Emacs an editor or an IDE? According to Mike and Matt’s definition, it’s an IDE. I’m fine with that but others would disagree. Everyone agrees that Nano is an editor and that Eclipse is an IDE but there are a lot of editors/IDEs in the middle.

The annoying aspect of the podcast is that Mike and Matt act as if they were born yesterday. In discussing the ED line editor, they wonder why anyone would choose such a paradigm as if they’d never heard of a teletype and were unaware of how editing was done in the days before cursor addressable terminals—including, of course, the early development of Unix as this iconic picture of Ken Thompson and Dennis Ritchie illustrates.

Even worse, from my point of view, is their dismissal of Emacs as a niche editor that has long since been eclipsed by VS Code. As I’ve said many times, I’m fine with the unenlightened preferring the bling and glitz of editors like VS Code but please don’t tell me that VS Code and other pretenders have supplanted the Emacs. The fact—as evidenced by Org-mode and Magit—is that Emacs is at the forefront of editor/IDE development. If you don’t understand and admit this then your opinions on the relative merits of editors is suspect.

Posted in General | Tagged , | Leave a comment

Invoking the *Messages* Buffer

The Emacs Command of the Day Twitter feed tells us something that I didn’t know:

That’s a really handy way of popping up the *Messages* buffer and it works even though the minibuffer is not active. Of course, you have to use the mouse to invoke it but that’s not too bad if you have a laptop with a trackpad—especially a MacBook where you can do the whole operation with your thumb while keeping your fingers on the home row.

There are many ways of popping up the *Messages* buffer—Ctrl+h e for example—but clicking on the minibuffer seems particularly easy. If you’ve taken a sacred pledge to abjure mouse usage from within Emacs, this method is obviously not for you but if you’re flexible about the mouse it’s a nice thing to know.

UPDATE [2022-04-26 Tue 13:24]: adjure → abjure

Posted in General | Tagged | Leave a comment

Org Mode 9.5.3

I somehow missed this yesterday but Bastien has announced the release of Org-mode 9.5.3. It’s a bug release so it’s probably not urgent to install it unless you’re being bitten by one of the bugs.

Bantien’s announcement notes that the next release, Org 9.5.4, will be released with Emacs 28.2.

As always, thanks to everyone involved in getting this release out to us. Org is incredibly important to my workflow and I couldn’t do most of what I do without it.

Posted in General | Tagged , | Leave a comment

Tony Aldon On Catch/Throw

Here’s another post from Tony Aldon. Sacha already covered it in Emacs News but it’s interesting enough that it deserves another mention. The post is about catch/throw and examples of its use.

Aldon starts with some simple made up examples of using the catch/throw paradigm. He shows some of the ways it can be used. Most of the variation is in specifying the symbol that names the catch block but he also shows some examples of nested catch blocks.

After the simple introductory examples, Aldon presents some real examples from the Emacs source code. They’re more complicated, of course, and involve more code than just the catch/throw but they do show catch blocks in the wild.

The main takeaway about catch/throw is that it’s a mechanism for non-local exits—the throw can even be in a separate function—and is not an error mechanism like the try/catch sequence in Python, Javascript, C#, and many other languages. Its quintessential use is to break out of loops. A nice example is a dolist loop: there’s no way to specify an exit criterion so the catch/throw mechanism is perfect for exiting the loop when some criterion is satisfied.

Posted in General | Tagged | Leave a comment

Tony Aldon: Another Wgrep Workflow

Ever since I read Abo-abo’s post on using wgrep to edit multiple files, I’ve been a huge fan of using grep to search for some regular expression in multiple file, write enable the results buffer with wgrep, make changes to the results, and save those changes back to the original files. Although there are multiple workflows to accomplish this. they all involve using one of the grep commands to search for the regexp in multiple files, modifying the grep results, and then saving the results back to the files. This is an extraordinarily powerful technique that’s easy to generalize.

Tony Aldon has a post that offers another variation on the theme. It’s basically the same except that he uses rg.el to perform the grep duties. It’s very similar to what I do except that I use counsel-rg (part of the ivy swiper package) to do the searching.

Regardless of the details, the grep/wgrep paradigm is a powerful one and definitely worth knowing. It can make a complex refactoring utterly simple. The takeaway from all the posts on the matter is that you can use whatever flavor of grep you like and just write enable the grep results buffer to make changes that are reflected back to the original files.

Posted in General | Tagged | Leave a comment

Never Say Never

Some time ago, I stopped following politics and even stopped watching the news or reading a newspaper. I’m a much happier person since I did. Still, sometimes it means that I miss something important to me.

The latest such example is on the Pink Floyd front. If you’ve been around for a while, you know I’m a huge fan and consider them to best rock band in history. Of course, the band has long since dissolved and there’s not much news to be had. Roger Waters left the band decades ago, Rick Wright is dead, and iconic guitarist David Gilmour has been adamant that he is finished with Pink Floyd and has no interest in resurrecting the band. He relented when Wright died so that he and drummer Nick Mason could do a tribute album for him. That was in 2014 and although Gilmour, Mason, and Waters are still performing, none of them has appeared as Pink Floyd.

Then the Ukraine war happened. It turns out that Gilmour’s daughter in law, artist Janina Pedan, is Ukrainian and he has two grandchildren who are half Ukrainian. He was very frustrated that there was nothing he could do to support the Ukrainians until Pedan sent him a video of Andriy Khlyvnyuk, a member of the Ukrainian band Boombox, singing an a cappella version of a Ukrainian anthem. Gilmour realized that he could put this to music and in just a couple of weeks had put something together. He called Mason, who enthusiastically signed on, and along with a couple of other long time Pink Floyd backing members recorded the song as Pink Floyd and made a video.

You can see Gilmour being interviewed on CNN about the song and watch the video itself here. All proceeds from the sale of the song are being donated to the Ukrainian relief efforts so if you’re looking for a way to help the Ukrainians and are a Pink Floyd fan, purchasing the song is an excellent way of doing so.

Posted in General | Tagged | Leave a comment

How I Spent My Summer Vacation

Well, not me: Tom Lyon. His post was actually entitled My Summer at Bell Labs and tells the story of his summer internship at the Labs. Regular readers know I’m a sucker for this type of thing so of course I have to share it.

At the end of his junior year at Princeton, he applied for a summer internship at Bell Labs. He’d done some work with moving Unix to the IBM 370 so of course he wanted to work with the Unix group. The problem was that the Unix group was primarily a research organization and weren’t very active with the intern program so Lyon just applied to the normal intern program.

In an incredible stroke of luck, Ken Thompson went to lunch with Lyon and his interviewer and learned of Lyon’s work with porting Unix to the 370. As a result, he was invited to work with Dennis Richie and Steve Johnson who were working on porting Unix to the Interdata 8/32 minicomputer. Lyon’s job was making the user programs portable.

He says that his senior year at Princeton was a disappointment to him because after his experience at the Labs, he couldn’t take his courses seriously. He said they were interfering with his education.

If like me, you enjoy reading stories about the early days of Unix and the people involved in building it, take a look at Lyon’s post. It’s fairly short and a quick read but enjoyable nonetheless.

Posted in General | Tagged , | Leave a comment

Emacs and Calibre

Garjola Dindi has a very interesting post on using Calibre from within Emacs. Dindi already read his books from within Emacs using nov.el for Epubs and pdf-tools for PDFs but because he manages his library with Calibre, he had to leave Emacs and open Calibre to handle administrative chores on his library.

Recently, he (re)discovered calibredb.el and realized that he could use it to handle those administrative tasks without leaving Emacs. Calibredb.el wants to use ebook-reader and evince to open books so Dindi had a make a simple adjustment for that. Otherwise, everything worked out of the box.

I do almost all of my reading on an iPad so this doesn’t come up for me even though I have used Calibre on my laptop in the past. I sometimes read technical books on my laptop but I usually just fire up pdf-tools directly to do it. Dindi reminded me, though, that there’s a lot of benefit to reading technical material on a laptop: it’s easy to take notes with Org-mode and to leave bookmarks or other links into the book you’re reading.

The downside is that I haven’t been very diligent about organizing my books so I always have to go searching for them. That’s exactly the problem that Calibre solves, of course, so Dindi’s post has inspired me to consider reinstalling Calibre and getting my library in shape. At least for technical books, that makes a lot of sense.

Posted in General | Tagged , | Leave a comment

ERC: The Builtin Emacs IRC Chat Client

Derek Taylor over at DistroTube has a nice video up on ERC, the builtin Emacs IRC chat client. IRC is, of course, invisible to most of the general public and maybe even some of the younger nerds. It’s a very old chat protocol that predates the Web and was popular back when Usenet was still an important way of sharing information. It’s sort of like the old Unix talk application but it’s run on a remote server and supports multiple people.

The #Emacs channel, for example is a place where Emacs users and developers can hang out, ask questions, and discuss matter important to the community. Sort of like Twitter but without the crazy people.

Taylor first gives a demonstration of vanilla ERC without any configuration. It’s surprisingly useful that way and probably more than adequate for occasional users. Then he goes over his, fairly minimal, configuration and shows the difference it makes in a session.

Most of his configuration just involves setting up some useful defaults—such as his nickname, IRC server, and the like—to make signing onto a session a bit simpler. It’s probably easier for new users to simply fire up ERC without worrying about configuration. The configuration can come later when they decide to become regular users.

The video is 14 minutes, 51 seconds so it should be relatively easy to fit in. If you’ve been curious about IRC and are an Emacs user, Taylor’s video is an excellent way to learn enough to try it out.

Update [2022-04-16 Sat 17:45]: pubic → public

Posted in General | Tagged | Leave a comment

Monorepositories

One of the controversies—probably not ascending to the level of holy war—in our field is whether we should keep our version controlled source code in several repositories or a single monorepository. The correct answer is, of course, “it depends”. Still, there’s a widely held belief that monorepositories are not a good thing.

Except that Google, Facebook, and Twitter all use them and love ’em or hate ’em they indisputably have a lot of talented engineers who we can presume know what they’re doing. Dan Luu is another developer who believes that monorepositories can be a good thing.

Luu got tired of explaining why he believes this so he wrote it down in a blog post. In it, he lists the advantages of using a monorepository instead of several repos. These advantages are:

Simplified Organization
That’s pretty much obvious. With per project repos or some similar arrangement it’s hard to know how to structure things. With a monorepository, everything lives in a single repository and many of the structuring problems disappear.
Simplified Dependencies
With separate repositories, it’s hard to keep the versions of separate components in sync. With a monorepository, everything has the same version.
Simplified Tooling
With multiple repositories, build and other tools have to understand the relationship between the code in the individual repositories. That problem is easier in a monorepository.
Cross Project Changes
When there are interproject dependencies, changes can get complicated regardless of whether there is one or many repositories but with a monorepository it’s much easier to coordinate a big change that involves multiple projects.

Luu has much greater detail for each of these so if the matter interests you, be sure to take a look at his post.

Posted in General | Tagged | Leave a comment