[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Auto add register when leaving buffer?
From: |
Marc Coquand |
Subject: |
Auto add register when leaving buffer? |
Date: |
Tue, 05 Nov 2024 11:29:55 +0200 |
Heya,
In vim I used to have a nifty setup where I would auto register marks
when leaving a buffer. For example, I'd auto assign 'c to be last open
css file, 'h to be last open html file etc.
I'm trying to setup something similar in emacs, and tried the following
hook:
(use-package sgml-mode
:hook
(css-mode . (lambda ()
(interactive)
(add-hook 'window-buffer-change-functions
(lambda ()
(interactive)
(point-to-register ?c)) 0 't))))
I think I'm on the right track, but it seems to not be working. The
following function
(defun me/point-to-c ()
(interactive)
(point-to-register ?c))
Seems to work, but the hook that should trigger on buffer change does
not work.
What am I missing?
-- mccd
- Auto add register when leaving buffer?,
Marc Coquand <=