Emacs Elements On Bookmarks

Emacs Elements has a new video on bookmarks out. I’ve written about bookmarks before—most recently here—but it bears repeating how useful they can be. I don’t have a huge bookmark list but I use those bookmarks several times a day. I hate entering long file paths or, worse, trying to remember them. Bookmarks eliminates all that. They can even remember where you were in a file so it’s easy to bookmark specific parts of specific files.

As the video points out, all the keybindings for bookmarks start with Ctrl+x r, which is the same prefix used for registers. Some people find the overloading of Ctrl+x r confusing. Emacs Elements’ suggested solution is to rebind those keys. My solution is to use a hydra to jump to bookmarks and let which-key remind me of the rest after I type the Ctrl+x r prefix.

For me, the most useful part of the video was a link to his previous video on Bookmarks+. That’s what I use and have for a long time. Among other things it allows you to bookmark Websites, which can be really useful. If you’re using bookmarks, and you should be, you should definitely take a look at Bookmarks+. You should also take a look at abo-abo’s headlong-bookmark-jump to make choosing bookmarks easy.

Posted in General | Tagged | Leave a comment

Reasons To Work From Home

There’s been an ocean of words written about why it makes sense for companies to support work from home. Irreal has reported on a lot of it. A bit less has been written about why it makes sense for the employees. Those reasons could, I suppose, be deemed self evident but it doesn’t hurt to have them written down if only so management can catch a glimpse of their employees’ points of view.

Sysadmin over at Shaving The Yak writes about why he prefers—and will always prefer—working from home. A lot of it’s what you’d expect but seeing it from an employee’s perspective, in his own words, gives it more impact. One, I think, powerful point he makes is that his home office is his office and he has it outfitted in a way that makes him maximally productive. He’s got 4 monitors, an extra large desk, a couch, and a drink fridge. As Sysadmin puts it, he’d need to be in the C-Suite to have comparable working conditions at the office.

There also the cost of commuting, both in dollars and time lost in your life. The hours lost to commuting are hours you’re never getting back. There’s also the monetary aspect. Tolls, gas, and insurance can cost a significant amount of money: Sysadmin estimates around $200 per month in his case. That doesn’t even consider what happens if there are children to take care of. That alone can cost thousands a month.

He also examines some of management’s arguments including the ever popular water cooler and offers some countervailing perspectives. In particular, he’s merciless in taking down the “builds company loyalty” argument.

It’s a nice post and worth spending a few minutes on.

Posted in General | Tagged | Leave a comment

Remote Work versus Revenue Growth

Forbes has an interesting article that, to mix a metaphor, puts another stake through the heart of the Zombie that is the notion remote work is somehow harmful to productivity and the bottom line. It’s an idea that refuses to die. Yet every time research with actual data—rather than apocryphal, “gut feelings” of CEOs and micromanagers—is brought to bear, the results always put the lie to it.

Last month, I wrote about some data driven research that showed, in fact, that remote workers were MORE productive than their office bound colleagues. As I wrote then, it pays to look at the data rather than depending on the intuition of so called experts. The Forbes article looks at research that shows the revenue growth of companies that have “fully flexible” remote work policies was 16% greater than companies with more restrictive policies. Even when tech companies are eliminated from consideration, the fully flexible enterprises enjoyed a 13% greater increase in revenue growth. Those are astounding results.

Of course, correlation is not the same as causality and my first thought was that maybe the results are more reflective of the companies’ treatment of their employees rather than remote work itself. The Forbes article considers the same possibility but notes that the results do counter the commonly held belief that companies that insist their employees be on-site perform better because of water coolers and stuff.

Whether you like or agree with the findings, they do provide additional real evidence that’s based on more than some bosses’ gut feelings about the issue. The Forbes article is another great resource for those who have input to management’s thoughts on this issue.

Posted in General | Tagged | Leave a comment

Building A Bookmark Launcher

Álvaro Ramírez has a very nice post on Building your own bookmark launcher. The idea is that you have certain Web sites that you visit all the time and you’d like a quick way of opening them in your browser.

This isn’t too hard to do at small scale. I use the Bookmark+ package to launch a couple of frequently used Web sites, such as Irreal, directly from Emacs using abo-abo’s headlong-bookmark-jump to enable single letter targets. That’s great and I use it many times a day but there are a couple of problems:

  1. It doesn’t scale very well to more than a few bookmarks
  2. It only works from inside Emacs

The first problem doesn’t matter too much to me because I don’t have many Websites I need to call from within Emacs. The second (and even the first) problem is solved by the wonderful Alfred framework that I’ve written about before. I simply invoke Alfred with a hotkey, type in a letter or two of the target, and BAM! I’m taken to that site in my browser.

Ramírez’s solution solves both of the above problems in a unified way. It’s pretty straightforward, but interesting, when used from within Emacs: You get the usual completing read list of targets that allows you to fuzzy search for the desired site.

When not in Emacs, it makes a command line call to Emacs asking it to invoke the bookmark code. The clever part is that Ramírez sets up a custom frame for the interface. He also uses Hammerspoon to map a shortcut for his call to Emacs.

It’s a nice solution and worth studying even if you don’t need a way to launch bookmarks to Web sites. There’s plenty of good ideas and techniques so be sure to take a look.

Posted in General | Tagged , | Leave a comment

More On SQL For Arbitrary Data

In response to my recent post on Making Ad Hoc SQL Tables From Org Tables, commenter Fritz Grabo points to another, more general system, for doing the same thing. As Grabo points out, the method depends on the external package dsq from Multiprocess Labs. That package allows SQL queries on a number of different data types.

Grabo’s contribution is ob-dsq.el, a package that integrates dsq into the Emacs Org Babel framework. You can get an idea for what it is and how it works from his blog post. Even though my knowledge of SQL is limited, I can see how useful a facility like this can be. If you have a reasonable facility with SQL and are an Emacs user, this seems like it would be a worthwhile package. SQL is a wonderfully expressive way of querying tables and it’s nice to bring it to bear from Emacs. It’s another win if you’re committed to the reproducible research way of working.

The shortest way of seeing what’s going on is to read Grabo’s blog post. If, after reading that, you decide to adopt the system, the other links should tell you everything you need to know.

Posted in General | Tagged , | Leave a comment

Zamansky: Learning Elisp #15

Mike Zamansky has published the latest video in his Learning Elisp series. This is (probably) the last video in his emoji replacement project. In the last video, Zamansky showed how to turn his emoji replacement code into a minor mode. This video cleans things up a bit and explores two other aspects of programming in Elisp.

First off, he shows how configure the minor mode to use either the replace or overlay method for substituting an emoji for a keyword. That’s done with a boolean variable, of course, but rather than use it to test which function to call after every screen update, he uses it to set a function variable that is installed in the appropriate hook.

He mentions, but does not elaborate on, the need to use funcall to actually call the function in the variable. That doesn’t matter here because the variable is used by hook mechanism and not called directly by Zamansky’s code.

The second aspect is how to define the boolean variable. He first considers using devar instead of setq but explains that the proper way of doing it in this instance is with defcustom. Doing it that way allows the user to set the variable using the Emacs Custom interface. That way, the variable can be set once and the values will persist between Emacs invocations but can still be changed whenever the user desires.

Even if you’re familiar with Lisp from, say, Common Lisp or Scheme, the defcustom form will be new and is worth learning about. The video is 11 minutes, 59 seconds so you’ll probably have to schedule some time but as usual with Zamansky’s videos, it will be time well spent.

Posted in General | Tagged , | Leave a comment

Making Ad Hoc SQL Tables From Org Tables

This is the coolest thing. Charles Choi—who contributions I’ve written about several times—has a really surprising post on turning Org tables into ad hoc SQL tables. There are a couple of things that make this a worthwhile endeavor:

  1. It’s easy to do
  2. SQL queries that you make on the SQL table are output as a RESULTS block just like any other Org Babel invocation.

If you’re used to using SQL to query a database table and generate new tables or other results, this a a really handy thing. Choi has an example of a query on a simple table that would hard to do otherwise. The SQL table is held in memory and no actual database is generated, just a table corresponding to the Org table but you can make normal SQL queries on that table and export the results to your Org file.

For those who are familiar with SQL spells this is a tremendous capability. You can operate on “normal” Org tables in the same way you do on SQL database tables. Take a look at Choi’s post and his example to see how handy this can be.

Posted in General | Tagged , | Leave a comment

Racket and SICP

As I’ve written—seemingly hundreds of times—I’m a huge fan of Abelson and Sussman’s Structure and Interpretation of Computer Programs (SICP). In my opinion, it is one of the best—arguably the best—books on Computer Science. I read it relatively late in my career (I was already a senior developer and team lead) and it completely changed the way I thought of our discipline. I learned many, many things that I didn’t know or only dimly understood before.

When I worked through SICP, I used Guile Scheme to play with the examples and work through the problems. That was good but Guile isn’t the Scheme described and used in SICP. That was a version of MIT Scheme. For those of you who want to work through SICP in the original Scheme, Racket has two collections that offer SICP Scheme and the picture language from the book.

I don’t know that this is a big thing: after all, the book isn’t really about Scheme: it’s about computer science and just happens to use Scheme for its examples. Still, a lot of the examples in SICP would be difficult with a non-LISP language and if you consider SICP an historical as well as a Computer Science work, you might enjoy using the original version of Scheme as you read through the book. Happily, Racket makes this possible.

Posted in General | Tagged | Leave a comment

Denote Dynamic Blocks

For some time, Protesilaos Stavrou (Prot) has been working on an Emacs note taking application that he calls Denote. The system is vaguely reminiscent of a Zettlekasten and has a bunch of nice features. It doesn’t depend on Org mode but integrates nicely with it. You can even set up a Denote capture buffer in Org mode.

As I say, the project has been on-going for some time so there’s lots of information and videos about it. The basic idea is that each note is given a unique name that includes a fine grained time stamp, a title, some optional tags, and an extension. That uniqueness and predictability make it easier to organize your notes.

The purpose of this post is to describe Prot’s latest video reporting on an extension to Denote’s dynamic blocks. The TL;DR is that Denote has a special type of note—called a Meta note—that is denoted by the meta tag. The idea of a Meta note is that it contains information about a collection of other notes. That may include, for example, a commentary or summary of the affiliated notes but it’s also possible to (automatically) include links to those notes. The latest changes, described in the video, provide a way of directly including all or part of the associated notes in the Meta file.

I haven’t paid too much attention to Denote until I saw this video. I felt that Org met my note taking needs and didn’t see a reason to adopt a separate application just for notes. After watching Prot’s video, I may give it a try. I like what he’s done with dynamic blocks. Take a look at the video for the details. It’s only 11 minutes, 46 seconds long so it should be easy to fit in. It may convince you to try out the Denote note taking system.

Posted in General | Tagged | Leave a comment

Winner Mode

Ken Huang over at whatacold’s space has a very useful post on Emacs’ winner mode. I was familiar with the name “winner mode” long before I started using it but the name seemed slightly off-putting and offered no clue as to what it did so I ignored it. Later, I somehow discovered1 what it actually did and I’ve been a dedicated user ever since.

The TL;DR is that it will restore your previous window configuration(s). The typical use case is that you perform some temporary action, such as invoking HELP, and afterwards want to return your window configuration to what it was. Winner mode maintains a stack of window configurations so you can restore configurations older than the previous one.

You can also move forward to reestablish the last replaced configuration. The problem with that is that you can move forward only one configuration but I’ve never found that a problem because I almost never want to do that.

One potential problem that Huang points out is that moving back several configurations can be awkward because the default binding is Ctrl+c
, which is slightly hard to type. Huang offers a nice solution for this: a hydra that you invoke with Ctrl+c w and then simply type p to move backward for each configuration.

If you’re a winner-mode user, you may be interested in his hydra. If you want to see it in action, Huang has an embedded video demonstrating winner mode and the hydra. The video is just over 12 minutes so plan accordingly.

Footnotes:

1

Oh. It turns out it was yet more good advice from Phil.

Posted in General | Tagged | Leave a comment