Following Org Links Outside of Org

Tony Aldon has been busy posting informative articles to the Emacs reddit. One of his latest discusses org-open-at-point-global, a way of following a link formatted in Org syntax even if it’s not within an Org buffer. That’s something I didn’t know about but can be pretty handy. Rather than killing the link and pasting it into Emacs, your browser, or some other application, you simply put the point on the link and call org-open-at-point-global.

The example Aldon uses has two links before the definition of a user-defined function in an init.el file. One, [[help:pcase]], was a link to the HELP entry for pcase. The other, [[info:elisp#Current Buffer]], was a link to the Elisp info node for “Current Buffer”. Both links are in a comment in an Elisp buffer so they are in no way active as Org links. Nonetheless, org-open-at-point-global will follow the link by popping up a buffer to the appropriate place.

Almost all my non-code text buffers are Org buffers so Aldon’s example is perfect for me. If I want to put a link to something in a source code buffer, I can use the usual Org syntax in a comment and follow it easily if I need to.

It turns out that there’s an edge case concerning link definitions that Aldon discusses but other than that, org-open-at-point-global will faithfully follow any link. The link definition issue was raised on the Org-mode list so perhaps the edge case will be fixed.

To be sure, org-open-at-point-global is a small thing that’s not going to revolutionize anyone’s workflow but it’s still useful and I’m glad to have discovered it from Aldon’s post.

Posted in General | Tagged , | Leave a comment

Org Roam From An Outsider’s View

As most of you know, I’m a big fan of the Zettelkasten idea and of its org-roam implementation in Emacs. There are several videos on org-roam, including the System Crafter series, that will help you get started. Matt Williams also has a video that provides motivation for why you might want to explore org-roam and a few words on how to get started.

What makes Williams’ video unique is that he’s not really an Emacs user. He’s bounced around between editors and is apparently currently using VS Code. Nonetheless, he likes org-roam and uses Emacs specifically to get access to it.

As an Emacs n00b, Williams had to figure out how to install Emacs and get everything configured. That turned out to be not too hard. He installed Doom Emacs and its dependencies using Homebrew. I’m not sure that’s really easier than just installing or compiling vanilla Emacs and adding a couple of lines to your init.el to add the org-roam package. Regardless, neither method too hard even for a beginner.

The video is 13 minutes, 49 seconds so it should be easy to schedule some time to watch it. The majority of the video is devoted to why you should embrace org-roam so there’s not a lot of technical complexity and it’s easy to watch.

Posted in General | Tagged , | Leave a comment

Renaming Files With Dired

I’ve written about this many times before but it’s so useful it bears repeating. It’s about a technique I use all the time and one that I’m sure the rest of you will find worthwhile too. This post is inspired by one from Alain Lafon, a master Emacs user, about whom I’ve written several times.

The idea is simple. If you’re an Emacs user and want to rename a file, the easiest way to do that is to use dired from within Emacs. But what if you want to rename several, similarly named files? The answer is the same except that you have to turn on wdired mode (Ctrl+x Ctrl+q by default). Once you’ve entered wdired mode, the changes you make to the dired listing are reflected back to the actual files. So all you have to do is turn on wdired mode and use your favorite search replace method to change the target file names. Then you simply type Ctrl+c Ctrl+c to exit wdired mode and rename the files.

Lafon’s post has an animated GIF that demonstrates the process but the easiest way to see how it works is to try it out yourself. It really is a trick worth knowing.

Posted in General | Tagged | Leave a comment

Red Meat Friday: Real Software Is Not Written with IDEs

Last week’s Red Meat Friday was essentially anodyne so here’s something to get (certain) people’s juices flowing:

Don’t worry IDE users, next week we’ll have another point of view that will annoy all the folks who are laughing now.

Posted in General | Tagged , | Leave a comment

Pointers

One of the hardest things to learn in C—indeed, many say it’s the acid test for a good C programmer—is pointers. Here’s an amusing cartoon (via Karl Voit) that explains it as well as any other explanation I’ve seen.

On top of that, it’s funny and made me laugh. Educational and funny: what’s not to like?

Posted in Programming | Tagged | Leave a comment

Choosing Your Tools

Yann Esposito has an interesting take on choosing tools and the choice between VS Code and Emacs. His post is from a couple of years ago but has aged well. He reminds us of a Microsoft strategy that we all knew about a few years ago but seem to have forgotten: Embrace, Extend, Extinguish. In essence, the strategy was to adopt a popular idea, extend it in a proprietary way, and then use their extended version to shut out their competitors. It’s worked well for them for many years but lately they’ve been presenting a kinder, gentler face.

Esposito is not deceived. He says that in choosing your tools you must always keep this strategy in mind. That brings us to the choice between VS Code and Emacs. Esposito has two points. First, despite the trappings of open source, VS Code is essentially a Microsoft product and there is no reason to believe that they won’t change or evolve the product in any way that they believe benefits Microsoft, even if it’s at the expense of VS Code’s users.

Second, there’s the matter of which is the better choice leaving aside the issue of its Microsoft provenience. VS Code, he says, is certainly easier to get started with than Emacs. It just works out of the box. But down the road, problems start popping up. It’s not extensible and really, really wants you to adapt to it instead of the other way around.

Emacs, on the other hand, is harder to learn and get started with, but its extensibility makes it a lifelong tool that you can adapt to your way of working. Esposito mentions Org-mode, in particular, as an example of this. It’s now part of core
Emacs but it’s worth remembering that it began life as a third party extension leveraging Emacs’ mutability. Similarly with Magit. Neither were developed by core Emacs developers but by users who had an itch that needed scratching.

If you want the easiest plug ’n play solution for your editor, none of this will convince you but if you’re a serious developer who’s willing to put in the effort to learn the best possible tool, Esposito’s post may hold some wisdom for you.

Posted in General | Tagged | Leave a comment

Are Multiple Cursors Suboptimal?

Over at EINVAL, Wojciech Siewierski considers multiple cursors (in Emacs) and whether it’s suboptimal. His post is entitled Multiple cursors considered… suboptimal, which seems rather provocative but the post is actually very even handed and concludes, as you’d expect, that whether or not multiple cursors makes sense depends on the task at hand.

I like multiple cursors and am still in awe every time I watch Magnor Sveen’s astounding demo, especially the last bit where he calculates the total time spent watching his videos. That said, I always find it a bit hard to use and, like Siewierski, usually fall back to keyboard macros. That’s probably because there’s not much to remember when using keyboard macros, whereas multiple cursors has a lot of commands and several edge cases. Doubtless, I’d be better at using them if I made a point of invoking them more often.

One of the most compelling use cases of multiple cursors for me is changing every instance of a word, phrase, or even regular expression. It’s perfect for that but I find that I generally use iedit, again because there’s not much to remember.

Still, there are some cases where you just can’t beat multiple cursors. The examples in Sveen’s video provide several cases of that. I do use and like it and should probably make a point of doing so more often so that I internalize its operation.

Chris Wellons makes a compelling case that multiple cursors is not very efficient in Emacs because it doesn’t play well with the gap buffer mechanism that is at the heart of Emacs editing. I agree with that but don’t care because, at least on the machines I use, there’s no detectable delay. Wellons has other complaints about multiple cursors that you can read about at the above link if you’re interested in the controversy but they mostly concern the edge cases where multiple cursors doesn’t work very well.

Posted in General | Tagged | Leave a comment

Another PhD Workflow

I’ve written previously about the PhD workflows of Gilles Castel and Sam Wallace. They’re Emacs based and highly efficient. Now, Tony Zorman has published his own PhD workflow. It’s also Emacs based and has several interesting wrinkles.

The most salient aspect of Zorman’s setup is that he’s using XMonad as his window manager. That provides a lot of automation and integration in his desktop. In particular, he uses the XMonad TopicSpace module to provide a separate workspace for each of his projects. Each topic space has its own directory and startup hook to provide consistent views.

He uses org-roam as a knowledge database and take notes using Org-mode but uses the usual AUCTeX/CDLaTeX combination along with aas for taking formal notes and writing papers. I’d be more reliant on Org-mode than AUCTeX for typesetting my Mathematics but I’m sure he’s used to his workflow and it seems to be working very well for him.

His post has lots of examples and animated GIFs so you can see things in action. The post serves as a great example of using Emacs and XMonad together to build a great workflow. Give his post a read if you’re interested in implementing a research workflow of your own. As I say, he has lots of good ideas.

Posted in General | Tagged | Leave a comment

Book Logging

Jack Baty has a post on how he logs the books he’s read. Logging books you read may be useful information to keep but it’s probably not all that interesting to others. What is interesting, though, is how he uses column view to display the information.

He collects the information as an Org file with each top-level header the title of the book. Specific information about each book—such as author, pages, rating, and other information—is kept in a PROPERTIES drawer. Since the items in the PROPERTIES drawer are tagged, it’s easy to access them to produce reports.

As Baty demonstrates, it’s easy to produce such a report using Column View. You can even perform some elementary arithmetic on the numeric entries as Baty shows by summing the total number of pages he’s read.

Of course, not everyone is a prolific reader or wants to track which books they’ve read. Still, the paradigm Baty illustrates is applicable to many situations: collect the information as tagged data in a PROPERTIES drawer and use column view to display it.

Baty doesn’t even use a capture template to record his data. He feels that the books he’s read are insufficiently numerous to make a capture template worthwhile. I disagree with that but it’s surely an individual decision. For many applications, a capture template is just what you need to ease data collection.

The post is short and worth your attention as a nice way of collecting and organizing data.

Thanks to Karl Voit for the link.

Posted in General | Tagged , | Leave a comment

Airbnb Faces and Adapts to the Future of Work

With the COVID-19 pandemic winding down, many companies have started planing for getting their workers back into the office. They are, if you’ll forgive the hackneyed cliché, like dinosaurs after the meteor hit wondering how to get things back to normal. But the old days aren’t coming back and the companies most likely to survive the post pandemic world understand this and are planning for it.

A case in point is Airbnb. Rather than asking how they can get their workers to return to the office, they’re asking how they can leverage what they learned about remote work during the pandemic to hire and retain the best possible people. Their CEO, Brian Chesky, just announced Airbnb’s plan for the new order.

The TL;DR is that virtually everyone in the company can work anywhere they like within the country they’re currently working in without a change in compensation. That includes, for those inclined, a return to the office. Chesky also recognizes the importance of face-to-face interaction so they’re planning (at least) quarterly get-togethers.

There’s more involved in the Airbnb plan, of course. Here’s Chesky’s summary:

  1. You can work from home or the office
  2. You can move anywhere in the country you work in and your compensation won’t change
  3. You have the flexibility to travel and work around the world
  4. We’ll meet up regularly for gatherings
  5. We’ll continue to work in a highly coordinated way

Which sort of company would you rather invest in: a company like Airbnb that accepts and plans for the new reality or a company that obsesses over how to force employees back into the office? Who would you rather work for: a CEO who says I trust you to work as you always have or a CEO who thinks that if he takes his eyes off you for a second you’ll start goofing off? Put that way, the questions answer themselves.

Posted in General | Tagged | Leave a comment