Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/10sr/switch-buffer-functions-el
Hook Run Just After Switching Current Buffer Interactively
https://github.com/10sr/switch-buffer-functions-el
Last synced: 2 days ago
JSON representation
Hook Run Just After Switching Current Buffer Interactively
- Host: GitHub
- URL: https://github.com/10sr/switch-buffer-functions-el
- Owner: 10sr
- License: unlicense
- Created: 2016-07-02T07:11:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-10-27T08:53:10.000Z (about 3 years ago)
- Last Synced: 2024-11-15T20:41:02.886Z (2 months ago)
- Language: Emacs Lisp
- Homepage:
- Size: 14.6 KB
- Stars: 33
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= switch-buffer-functions
image:https://travis-ci.org/10sr/switch-buffer-functions-el.svg?branch=master["Build Status", link="https://travis-ci.org/10sr/switch-buffer-functions-el"]
image:https://melpa.org/packages/switch-buffer-functions-badge.svg["MELPA", link=https://melpa.org/\#/switch-buffer-functions]
image:https://stable.melpa.org/packages/switch-buffer-functions-badge.svg["MELPA Stable", link=https://stable.melpa.org/#/switch-buffer-functions]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:[source,elisp]
----
(add-hook 'switch-buffer-functions
(lambda (prev curr)
(cl-assert (eq curr (current-buffer))) ;; Always t
(message "%S -> %S" prev curr)))
----then the message like `"# -> #>"`
will be displayed to the echo area each time when you switch the current
buffer.== License
This software is Unlicensed. See `LICENSE` for details.