Advanced Usage of the Org Agenda

A great deal of my Emacs tube time is spent displaying the Org agenda. My use of the agenda is probably not standard: I use it mainly as a portal into my log type entries. There are some TODO entries but it’s mostly just the headlines from log/journal entries. Most people, I think, use the agenda as an agenda: as a list of appointments and things they need to do. If you’re one of those people, there are several things you can do to make the agenda more useful.

Vedang Manerikar is one of those people who uses his agenda to plan and run his day and he has spent some time making it as useful as possible. His video, Using Org-Agenda to run your life!, shows what his agenda looks like—spoiler: it’s not at all like the vanilla agenda—and some of the built-in shortcuts that he uses to interact with it.

The entire video is useful but what I found particularly useful (perhaps because of my abnormal use of the agenda) is the information he gives on entering dates and filtering agenda entries. I learned a few things that will definitely make my daily workflow easier. Even if you don’t use the agenda at all, the information on entering dates is worthwhile.

As for filtering agenda entries, it’s a much richer capability than I thought. You can filter on many different parameters, can combine multiple filters, and can refine filters by adding additional items. Take a look at the video to see how rich the capability is.

The video is 36 minutes 40 seconds long so you’ll need to schedule some time. It’s from a remote conference so there’s occasional distortion but it’s still worth watching.

Posted in General | Tagged , | Leave a comment

Setting the Initial Visibility of Magit Sections

Like most Emacsers, I very seldom restart Emacs. When I do it’s usually because I just finished my weekly ELPA update. Despite my extensive configuration, Emacs starts up reasonably quickly for me but I still hate restarting it. The major reason is Magit. I love Magit but the first time I open the status page, the “Untracked Files” and “Unmerged Info” sections are expanded. For various reasons, these sections are fairly large in some of my repositories so I always have to close them. If I don’t do that, disaster is only a keystroke away when I accidental stage a large collection of untracked files and freeze Emacs for a minute or two and then another long wait when I undo the erroneous staging.

Obviously, this is a situation crying out for a remedy. The obvious approach is to look for some variables controlling which sections are displayed initially. It’s not hard to find it. The magit-section-initial-visibility-alist variable is an alist that controls whether a section is shown or hidden. That seems straightforward but the problem is discovering the names of the sections. They’re not the labels shown on the status page. I checked the source code but couldn’t find a list of the names. Finally, I dropped back to basics and RTFM. The manual has a section on matching section names. There I found the magit-describe-section-briefly function that displays information about the section under the point. The information is meant to help maintainers with debugging so it’s not very end-user friendly. However, part of the output is [XXX status] and the XXX is the name we’re after.

With that information at hand, I solved my problem by adding

(setq magit-section-initial-visibility-alist
        '((stashes . hide) (untracked . hide) (unpushed . hide)))

to my init.el. If you have other sections you’d like to control, you can use magit-describe-section-briefly to discover their names and add them to the alist. The available options are show and hide.

Posted in General | Tagged , | Leave a comment

Work From Home Surveillance

Speaking of the downsides of working from home, NPR and CNBC have horrifying stories about the anal micromanagers requiring workers to install spyware on their computer and even their phones so they can track their every movement, keystroke, and mouse click. Employees are not amused. At all. The NPR story says that one employee went on unpaid leave rather than load the malware on her computer and is now spending her time looking for another job.

The sociopaths doing this doubtlessly consider themselves effective managers but all they’re doing is destroying moral and engendering cynicism. The end result is perfectly predictable: the good people will leave as soon as they can and the losers will stay but, hey, at least we know they’re not on Facebook or taking overly long bathroom breaks. Apparently these managers have never heard of ROWE and the concept of trusting your employees to get those results.

Austen Allred has a tweet the succinctly captures the madness of this approach to management:

As for the people building this software, they should be ashamed.

Posted in General | Tagged | Leave a comment

Roam Research

Those of you who have been paying attention know that I’m embarking on a project to implement a Zettelkasten to organize my notes and ideas. My current plan is to base this on Jethro Kuan’s org-roam. Org-roam is an Emacs package that attempts to replicate the capabilities of the Roam Research note taking application.

Given that the package I plan to use for the project is based on Roam, it’s worthwhile taking a look at Roam to get an idea of what it can do. Happily, Thomas Frank has a video that take a detailed look at the application. As you can see, Roam does an excellent job of implementing the Zettelkasten idea. It can even draw a graph of how your notes are linked. The program has already earned itself a cult following. All in all, it’s a great app.

Sadly, as with Notion, I can’t recommend Roam for the same reason I can’t recommend Notion: Your data lives on Roam Research’s servers and, as they say, they can terminate your account at any time for any reason. That doesn’t mean they will, of course, but the point of a Zettelkasten is to gather a lifetime’s collection of data and ideas and the last thing you need is to lose that data or even have your workflow destroyed. At least for the paranoid like me, an open source package that stores your data locally, as org-roam does, is a much safer bet.

Frank’s video is 14 and a half minutes long so you can probably watch it on a coffee break or at least easily find time to schedule it.

Posted in General | Tagged , , | Leave a comment

Emacs By Macros 6

Sahas Subramanian is back with another excellent episode of learning Emacs through keyboard macros. This video covers editing macros to correct or change a macro without starting over. If you have a long and complicated macro, that can be a real win.

He begins by showing how you can add some instructions to the last macro by simply calling kmacro-start-macro (usually bound to Ctrl+x ( or F3) with the universal argument. That can be useful but the real power comes from calling edit-last-kbd-macro. That brings up a buffer of the keystroke in the last macro and lets you edit them to correct errors or add or delete keystrokes. The nice thing about edit-last-kbd-macro is that there’s nothing to remember other than the name of the command so you can easily use it even though you probably won’t have the opportunity very often.

The video starts with Subramanian using occur to locate the function definitions in a C++ file. That’s tricky, of course, so the video provides an amusing real life example of building and correcting complex regular expressions. As I said last time, almost everyone watching Subramanian’s videos is going to bring experience with another editor with them so the idea regular expressions will be familiar and the video serves as a partial explanation of Emacs’ regular expression peculiarities.

Posted in General | Tagged | Leave a comment

Manhattan and Working From Home

Irreal readers know that I’ve been fascinated with remote work for a long time and consider it a good thing for most people and the companies they work for. COVID-19 has accelerated the trend as many companies—and their employees—discover that working from home is not only possible but actually works pretty well. This realization has led many companies to extend or consider extending their work from home programs post COVID-19. Indeed, Twitter has announced that most employees can work from home as long as they like.

Of course, as with every change of this magnitude there are unintended consequences. Manhattan in New York City is especially likely to suffer from those consequences. The big advantage for companies is, of course, that they save on expensive office rental fees. In Manhattan, Barclays, JP Morgan Chase, and Morgan Stanley alone rent office space amounting roughly to all that available in downtown Nashville. The consequences for the Real Estate industry are pretty clear but that’s only the beginning. Restaurants, corner bodegas, bars and many other small businesses depend on all those workers for their livelihoods. And then there’s the tax base. Real estate taxes account for about a third of the City’s revenue. Add in the loss of taxes from all those restaurants, bars, and so on, and it’s easy to predict that the city could take a huge hit.

Of course, New York City is famously resilient and has bounced back from such disasters as 9-11 but even many usually sanguine New Yorkers worry that this time might be different. As liberating as the remote work movement is for most people, it’s not without its dark side and that dark side could be devastating to many people and businesses large and small.

Posted in General | Tagged | Leave a comment

Zamansky 71: Openwith

Mike Zamansky, freshly back from a bout with COVID-19, has a new video in his Using Emacs Series that considers the openwith package. The backstory is a long standing annoyance in Zamansky’s workflow: although he can open non-text files such as PDFs, PNGs, docx, and others, he can’t edit them and Emacs will choke if the file is too large.

What he wanted was an easy way to choose a file from Dired and open it with an external app—LibreOffice for docx, for example. That would save him from cluttering his desktop with a bevy of unneeded windows. The openwith package lets you associate an application with a list of file extensions and Emacs will use that application to open any files with that extension. In particular, if you type Return on a file in Dired, it will be opened in the external application instead of Emacs.

There is, I think, a problem with this solution: it’s all or nothing. Either the file is opened normally in Emacs or it is always opened by the external app. You can’t choose. Even if you open the file normally with find-file, the external application will be invoked. In some cases, it’s convenient to use the external app, and it others it’s more convenient to open the file in Emacs but with openwith you can’t choose. Zamansky also sees this as a problem but feels he can live with it and, of course, he can always turn off openwith. To be sure, that’s a pain but the need to use both Emacs and an external application on the same file type is apparently rare in Zamansky’s workflow.

In the comments, Zamansky offers an update saying that he’s discovered that openwith interferes with his mail client, mu4e. That’s a deal breaker and Zamansky will probably hunt for another solution. If you aren’t a mu4e user, you may find openwith a useful addition to your workflow.

The video is 14 minutes long so schedule some time. As usual with Zamansky’s videos, you won’t want to miss watching it.

Posted in General | Tagged | Leave a comment

Digital Payments in Developing Countries

As all of you know by now, I’m a big fan of the digital lifestyle but I have a first-world perspective. I want to be able to use Apple pay because it’s easier and I don’t have to carry around a bunch of cash or credit cards. Those are legitimate reasons given where I live but in some parts of the world, digital payments are the difference between being stuck in debilitating poverty and the chance to better your circumstances. For many people in developing countries, digital payments offer bank-like services to those who would otherwise have to rely on cash and a chance to start small businesses and escape from poverty.

Now Google, the Gates Foundations, and other charities are trying to spread digital payments to developing countries. That’s a good thing, of course, wherever you live but it’s worth asking what implications it has for the world at large.

In the near term, it’s a direct challenge to those resisting cashless business practices by bleating the abhorrent neologism “unbanked.” As the developing countries show, far from holding the disadvantaged down, digital payment methods, properly applied, offer a way up. More generally, movements like these will help to normalize the idea of digital cash.

As I’ve said before, I’m not advocating for a cashless society but I am in favor of having the universal ability to make payments digitally. For me, that’s a selfish desire to be spared the burden of having to carry around a wallet. For many of those in developing countries, it’s a matter of survival.

Posted in General | Tagged | Leave a comment

Better Emacs Configuration with use-package

Menno Finlay-Smits has an interesting post on using John Wiegley’s use-package package. It’s a fairly short post but Finlay-Smits makes a good case that the package make Emacs configuration cleaner and easier. As he also points out, it’s easy to arrange to have use-package defer loading of packages until they’re needed. If you’re the type of person who starts and stops Emacs a lot, that’s a win because it makes Emacs load faster. A feature that I really like is the ability to cause the installation of any packages not already present. I have my init.el set up so that I can create my entire Emacs environment just by loading a new Emacs with it. That’s great for moving to new machines.

Finally, although Finlay-Smits doesn’t mention it, another reason that I like use-package is that it’s a wonderful example of an Elisp macro. If you’ve used it, you know that use-package has many options that can operate in complex ways. If you want to see how a complicated macro is built, use-package is a good place to look.

Posted in General | Tagged | Leave a comment

Zetteldeft

This is another entry in my series of posts on the idea of a Zettelkasten. Although I’ve mostly written about and am planning to use org-roam, that’s not the only possibility. Elias Storms built his own Zettelkasten by leveraging the Deft package and Org-mode. He built the system, which he calls Zetteldeft, for his own use but is sharing the code on GitHub.

Deft is a good starting point for a Zettelkasten because it stores each Deft note as a file in a flat hierarchy. That takes care of a lot of infrastructure for a Zettelkasten; the main thing that needs to be added is a way making and maintaining links between the notes.

Unlike org-roam, Zetteldeft does not maintain a database of backlinks. Instead, it has a function that will add a list of notes that contains a given search term. By calling this function with the ID of the current note, you can add a list of all notes that link to the current note. As far as I can tell, there’s no easy way to maintain this list other than deleting and rebuilding it.

Zetteldeft is written in a literate style so it’s easy to understand and hack on if you want to adopt it to your workflow. It’s a nice light-weight solution for implementing a Zettelkasten and provides an excellent starting point if you want to build your own unique implementation.

Posted in General | Tagged , , | Leave a comment