how to change the Firefox Close Tab shortcut

C-w is already a highly used shortcut system-wide on my machine, so I’d like to make a different shortcut for close-tab – say, F4. How can I make this change in Firefox? I felt the frustration of several Firefox questioners who asked the same thing and were answered as if they just didn’t know the shortcut, missing the point entirely. On Reddit, though, I receive two excellent answers. One is the easy solution, with a handy plugin that takes care of it.

emacs popular for python

When the results of the State of Emacs survey came out I was really surprised to see that its most reported programming use was in Python. There are some definite biases in the survey participants – I think it was slanted to media used by new users, which were much more plentiful than I expected but obviously much less than the full emacs-using population. Nonetheless I did not at all expect Python to top the language list ahead of Emacs’ classic best-of-class support of lisps like my Clojure, which was down in the middle of languages reported.

Emacs sorting with sort-regexp-fields

Emacs is really an endless world of commands, options, and use-cases, especially for dealing with text. Sorting text is a really common thing and often plain-old M-x sort-lines does the trick in one fell swoop. But what if you want something more sophisticated? It turns out my eyes have been opened and emacs has led me to think about sorting things in ways I never even thought about before.

ghosts in the elisp machine

What ghosts/anomalies do you encounter in the Chtulhu Mansion that is your emacs setup? Emacs is the closest thing now existing to the vaunted “lisp machines” that were originally prescribed to make lisp run effectively. This seems all the more true of exwm users like myself, who are taking the proposition of “emacs as operating system” somewhat literally (at least, to those who don’t consider the difference between a window manager and an operating system.

Why isn't elisp nil the empty string?

Sometimes in emacs nil is not punned well enough. I found this when using Telephone Line, when the crucial problem is that nil can’t be construed as a string (why isn’t it the empty string when strings are wanted?). Error during redisplay: (eval (telephone-line-add-subseparators ‘((lambda (face) (telephone-line-raw (if (telephone-line-selected-window-active) (progn (propertize battery-mode-line-string ‘mouse-face ‘(:box 1))))))) telephone-line-cubed-hollow-left ‘evil)) signaled (wrong-type-argument stringp nil) [36 times] I fixed this manually with some extra code, when writing such cruft feels like a slight against lisps:

Falsehoods about time and names

As programmers occasionally we run into things that should be so simple and common that we don’t even think twice about them. Two of the most egregious are time and people names. A matching pair of articles (by different authors) address these with some fairly broad lists. Check out the original posts for full credit, but they are reproduced here for compilation and history’s sake. The fact is names are hard, and time is the most annoying thing since printers.

Migrating to a custom-file-less setup

I love the advocacy for a custom-less setup given here. Mind you, I have no desire to go without the customization family of helper commands like customize-group and customize-variable: the ability to rapidly explore the options available for plugins, libraries, and styles feels like a “killer feature”. But as software engineering has grown over the decades we are in a place to better understand the values in locating those customization in the same place where they can be associated, shared, and simultaneously deleted/edited.

Websockets for Clojure Sente in Apache Reverse Proxy

The Clojure library sente allows you to do smooth web-socket work in Clojure. In our case, we wanted the typical “Your Session Expires in N seconds” alert for users of the app. Sente was working smoothly on our local machines, but we were getting obscure errors in the console about 500 responses in our browser console. The Problem As mentioned, our console was showing server errors on the path that was supposed to be doing the Sente channels.

Capturing key-presses in Clojurescript with Closure

Having good keybindings on your site makes a world of difference for technical users (Twitter and Slack are good examples of this), but writing them yourself has several annoying steps. You have everything you need out of the box with Google Closure, though. Here’s how it goes withotu needing to add any dependencies to your project, since Closure is part of Clojurescript. Strategy and Solution The plan is simple:

zero-padding and truncating with string formats in Clojurescript

One of the discrepancies between Clojure and Clojurescript is that the javascript version doesn’t have anything like the classic Unix/C-style string format functions. Some functionality is not simply reproducible with clever uses of str, but fortunately Google Closure is here to save the day. Because Closure is part of Clojurescript, there are no added project dependencies to make this work. (ns myapp.services (:require [goog.string :as gstring] [goog.string.format])) (str "$" (gstring/format "%.