1
In Aquamacs 3.2, I want to remap cmd+W so it will kill the current buffer instead of closing the frame. I use Aquamacs in a classic Emacs style with one window, so I close buffers far more often than I close windows.
I tried this in my .emacs
to no effect.
(global-unset-key [?\s-w])
(define-key global-map [?\s-w] 'kill-buffer)
I also tried a variation on this answer but it still kills the window.
(defun kill-current-buffer ()
(interactive)
(kill-buffer (current-buffer)))
(global-unset-key (kbd "s-w"))
(global-set-key (kbd "s-w") 'kill-current-buffer)
I also tried putting that code into ~/Library/Preferences/Aquamacs Emacs/Preferences.el
as suggested in this answer.
I've verified with describe-function
that it is loaded.
kill-current-buffer is an interactive Lisp function in `.emacs'.
It is bound to s-W.
(kill-current-buffer)
Not documented.
Have you been able to establish if any preference settings that you might add are being read in? – JonathanS – 2015-03-31T23:23:22.803
@JonathanS Yes,
.emacs
and~/Library/Preferences/Aquamacs Emacs/Preferences.el
are definitely being read in as I have other preferences in them. Even if I useeval-region
on the code it does not work. I verified withdescribe-function
that it is loaded. – Schwern – 2015-04-01T20:49:46.363