emacs

Replacing beacon.el with hl-line-flash

Intro EDIT [2021-09-27 Mon]: decreased hl-line-flash-show-period1 I learned about beacon.el2 in one of Sacha Chua’s videos3 that asted users about their favorite tweaks, and it remained one that I found useful throughout several years with emacs. However, it stopped working somewhere in version 27, with a number of glitches that were eventually recognized in the repo, but no fix was available. Beacon candy Beacon was nice because it didn’t highlight the whole line, but only a gradient extending from your cursor, which would gently fade away (at least, that was the idea).

Fail-fast Transients like Hydra

Problem: exwm choking on Transients with Unbound suffix I have been gradually experimenting with replacing my hydras with Transients1, partly as a proof of concept. I have a show-stopping issue2 when I sometimes end up invoking the Transients from an EXWM window, however. The Transient pops up, but no key I press is then sent to the Transient and I end up trapped in a loop: Transient is expecting a key, which needs to be passed by EXWM, but EXWM can’t pass the right keys because Transient is intercepting them3.

Swapping chords in Dvorak, or Why does emacs keyboard-translate fail with (wrong-type-argument characterp 134217845)

Intro One of the great pieces of advice I received for setting up Dvorak keys was to swap C-x and C-u keys, and the following snippet does just that. ;; Dvorak settings (keyboard-translate ?\C-u ?\C-x) (keyboard-translate ?\C-x ?\C-u) I had hoped that a simple replacement of the the C with M would make that change for Meta, too, since M-x is common and awkward on Dvorak. However, that gave me a type error.

The lost art of page breaks in text documents

Updated: [2021-09-23 Thu] comment from Mark Intro Somewhere back in Emacs’ memory of text esoterica and ideas that don’t seem to have taken off, there is support for ascii page breaks: the idea that within a single text document, “pages” could be represented by special characters. This is before the dawn of word processors or orgmode or PDF files, and this is an idea that might still be useful for some enterprising archeologist.

My emacs godmode indicators and Elisp equivalent of defonce

Godmode Godmode1 is a handy mode that aims to ease the stress on otherwise stretching fingers by basically holding C- or M-C for you. A common difficulty is knowing if you are currently in Godmode or not, especially since I no longer use doom-modeline2. The first solution that is recommended is to change your cursor depending on whether you are in the mode or not. For years, back when I used godmode more rarely, this was enough.

How I Switched to DVP Dvorak Keyboard Layout as a Linux EXWM Emacs User

My heavy emacs use was both the motivation and the obstacle to switching to a new keyboard layout. Motivation because my life is keyboard driven, so there are healh and efficiency reasons to want to make the best of my keyboard experience. Obstruction because so much of my emacs and typing proficiency is in my muscle memory, and this might be lost if I make a drastic change. Well, rather than Colemaks or QwertZ, which aim to maintain most of your muscle memory, I decided to go whole hog and do Dvorak.

org-agenda no longer clocks out and in

For years my workflow has centered in org-agenda and I would go from one clocked item to the next. For instance, I would be clocked into my “Emails” task, which never closes, and then eventually move down in the agenda to “Task B”. Then I hit C-x TAB to clock in. It correctly queries for a comment on the task I’m leaving but no longer clocks me in to the new task as I’d asked.

Two modes on loading a file

** This question was posted to the emacs stackexchange. 1 Clojure files should open in Clojure-mode. I also have Clojure files that contain color info and are used to generate my styles; they live under a /styles path. For these files, I want them to have both clojure-mode (a major mode) and rainbow-mode (a minor mode). I can implement this on a file-by-file basis be starting such files with a line like this:

How to get readable mode in emacs w3m?

I’ve made the switch to w3m from eww, which has been great overall since the eww thread-blocking was insufferable. However, one of the biggest benefits of eww was the ability to engage a readability mode that cut all but the content of the page, which is also a feature I use a lot on Firefox on my phone. A previous answer from 20201 did something like this but was referencing elfeed, which has nothing to do with my use case, and used a bootstrap Python script.

dired no hiline

I was trying to make sure that hl-line mode (to highlight a line) is not on in my dired buffers without changing its presence anywhere else, since it messes up display of my diredfl permission faces. Unfortunately, the following didn’t work, probably because “setting” isn’t the same thing as calling the variable. What was the best way to selectively disable hl-line-mode? There were many good answers on Reddit1. (add-hook 'dired-mode-hook (lambda () (setq-local global-hl-line-mode nil hl-line-mode nil) ;; I wasn't sure on the relationship between ;; these two, or even which one was being used )) Learning along the way: global- is unrelated to hl-line-mode It turns out that global-hl-line does not share anything in common with hl-line-mode other than the end result, so altering one does not alter the other.