Idiomdrottning’s homepage


Here’s an Emacs macro that lets you easily make modes turn on briefly and then turn themselves off after a while.


For example, let’s say you have smart-quotes-mode and you love it but you also want a smart-quotes-mode-briefly that when you call it turns smart quotes mode on for three seconds and then turns it off again.

	smart-quotes-mode 3
	(smart-quotes-mode 1)
	(smart-quotes-mode -1))

You can bind this to something, type a few smart quotes and emdashes, and then it turns off.

Here’s another example. Let’s say you want to have the mark active for seven seconds after you have set mark. That’d be:

(setq select-active-regions nil);; Don't want to sent passwords to X clipboard

	(setq transient-mark-mode t mark-active t)
	(setq transient-mark-mode nil mark-active nil))

(advice-add 'set-mark-command :after #'(lambda (o) (transient-mark-mode-briefly)))


Here’s how to install it with straight.el.

(push '(idi "" "") straight-hosts)

 '(def-briefly-mode :host idi :repo "def-briefly-mode"))

With other package systems, I don’t know, but you can get a repo with:

git clone