Skip to content
Hook Run When Switching Current Buffer
Emacs Lisp Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.gitignore
.travis.yml
LICENSE
Makefile
README.adoc
_config.yml
switch-buffer-functions.el

README.adoc

switch-buffer-functions

Build Status MELPA MELPA Stable

Hook run when switching current buffer

What is This?

This is a Emacs Lisp package that provides a hook variable switch-buffer-functions.

This hook will be run when the current buffer has been changed after each interactive command, i.e. when post-command-hook is called.

When functions are added to the hook, they will be called with the previous buffer and the current buffer. For example, if you eval:

(add-hook 'switch-buffer-functions
          (lambda (prev cur) (message "%S -> %S" prev cur)))

then the message like "#<buffer *Messages*> → #<buffer init.el<.emacs.d>>" will be displayed to the echo area each time when you switch the current buffer.

License

This software is Unlicensed. See LICENSE for details.

You can’t perform that action at this time.