Skip to content

Local minor mode to save a buffer when Emacs is idle

License

Notifications You must be signed in to change notification settings

alphapapa/salv.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

salv.el

Salve, v. t. & i.

To save, as a ship or goods, from the perils of the sea.

–Webster, 1913

Q: How does this package differ from other ones that automatically save buffers?

A: Salve is a buffer-local minor mode, rather than being a global mode. It is activated in buffers the user wants to be saved, rather than in all buffers (requiring the user to exclude ones that aren’t to be saved). It uses per-buffer idle timers, rather than a global timer. It only runs a timer when a buffer is modified after being saved, rather than constantly. Because of these characteristics, it’s simple and lightweight.

Installation

salv is distributed in GNU ELPA, which is available in Emacs by default, so it can be installed with the package-install command.

Usage

To use, just, e.g. add salv-mode to a major mode hook. Or, if you only want it activated in certain conditions, write a simple lambda to activate it when appropriate. For example, the author uses:

(add-hook 'org-mode-hook
          (lambda ()
            (when (and (buffer-file-name)
                       (file-in-directory-p (buffer-file-name) org-directory))
              (salv-mode 1))))

Changelog

v0.2-pre

Nothing new yet.

v0.1

Initial release.

Development

Bug reports, feature requests, suggestions — oh my!

Copyright assignment

This package is part of GNU Emacs, being distributed in GNU ELPA. Contributions to this project must follow GNU guidelines, which means that, as with other parts of Emacs, patches of more than a few lines must be accompanied by having assigned copyright for the contribution to the FSF. Contributors who wish to do so may contact [email protected] to request the assignment form.

License

GPLv3

About

Local minor mode to save a buffer when Emacs is idle

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published