├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── test.yml ├── CONTRIBUTING.md ├── Eldev ├── README.md ├── changelog.md └── super-save.el /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: bbatsov 4 | patreon: bbatsov 5 | ko_fi: bbatsov 6 | liberapay: bbatsov 7 | custom: https://www.paypal.me/bbatsov 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | *Use the template below when reporting bugs. Please, make sure that 2 | you're running the latest stable Projectile and that the problem you're reporting 3 | hasn't been reported (and potentially fixed) already.* 4 | 5 | **Remove all of the placeholder text in your final report!** 6 | 7 | ## Expected behavior 8 | 9 | ## Actual behavior 10 | 11 | ## Steps to reproduce the problem 12 | 13 | *This is extremely important! Providing us with a reliable way to reproduce 14 | a problem will expedite its solution.* 15 | 16 | ## Environment & Version information 17 | 18 | ### super-save version 19 | 20 | *E.g. 0.4* 21 | 22 | ### Emacs version 23 | 24 | *E.g. 24.5* (use C-h C-a to see it) 25 | 26 | ### Operating system 27 | 28 | *E.g. Windows 10* 29 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **Replace this placeholder text with a summary of the changes in your PR. 2 | The more detailed you are, the better.** 3 | 4 | ----------------- 5 | 6 | Before submitting a PR make sure the following things have been done (and denote this 7 | by checking the relevant checkboxes): 8 | 9 | - [ ] The commits are consistent with our [contribution guidelines](../blob/master/CONTRIBUTING.md) 10 | - [ ] You've added tests (if possible) to cover your change(s) 11 | - [ ] All tests are passing ([`eldev test`](https://github.com/doublep/eldev)) 12 | - [ ] The new code is not generating bytecode or `M-x checkdoc` warnings 13 | - [ ] You've updated the [changelog](../blob/master/CHANGELOG.md) (if adding/changing user-visible functionality) 14 | - [ ] You've updated the readme (if adding/changing user-visible functionality) 15 | 16 | Thanks! 17 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | paths-ignore: ['**.md', '**.adoc'] 6 | pull_request: 7 | paths-ignore: ['**.md', '**.adoc'] 8 | 9 | jobs: 10 | test: 11 | runs-on: ubuntu-latest 12 | continue-on-error: ${{matrix.emacs_version == 'snapshot'}} 13 | 14 | strategy: 15 | matrix: 16 | # Earliest supported + latest in each stable branch + snapshot. 17 | emacs_version: ['25.1', '25.3', '26.3', '27.1', '28.1', '29.1', 'snapshot'] 18 | 19 | steps: 20 | - name: Set up Emacs 21 | uses: purcell/setup-emacs@master 22 | with: 23 | version: ${{matrix.emacs_version}} 24 | 25 | - name: Install Eldev 26 | run: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/github-eldev | sh 27 | 28 | - name: Check out the source code 29 | uses: actions/checkout@v2 30 | 31 | - name: Lint the project 32 | run: | 33 | eldev -dtT -C compile --warnings-as-errors 34 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | If you discover issues, have ideas for improvements or new features, or 4 | want to contribute a new module, please report them to the 5 | [issue tracker][1] of the repository or submit a pull request. Please, 6 | try to follow these guidelines when you do so. 7 | 8 | ## Issue reporting 9 | 10 | * Check that the issue has not already been reported. 11 | * Check that the issue has not already been fixed in the latest code 12 | (a.k.a. `master`). 13 | * Be clear, concise and precise in your description of the problem. 14 | * Open an issue with a descriptive title and a summary in grammatically correct, 15 | complete sentences. 16 | * Include any relevant code to the issue summary. 17 | 18 | ## Pull requests 19 | 20 | * Read [how to properly contribute to open source projects on Github][2]. 21 | * Use a topic branch to easily amend a pull request later, if necessary. 22 | * Write [good commit messages][3]. 23 | * Mention related tickets in the commit messages (e.g. `[Fix #N] Add missing autoload cookies`) 24 | * Use the same coding conventions as the rest of the project. 25 | * Verify your Emacs Lisp code with `checkdoc` (C-c ? d). 26 | * Open a [pull request][4] that relates to *only* one subject with a clear title 27 | and description in grammatically correct, complete sentences. 28 | 29 | [1]: https://github.com/bbatsov/super-save/issues 30 | [2]: http://gun.io/blog/how-to-github-fork-branch-and-pull-request 31 | [3]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html 32 | [4]: https://help.github.com/articles/using-pull-requests 33 | -------------------------------------------------------------------------------- /Eldev: -------------------------------------------------------------------------------- 1 | ; -*- mode: emacs-lisp; lexical-binding: t; no-byte-compile: t -*- 2 | 3 | (eldev-use-package-archive 'gnu) 4 | 5 | ;; the tests depend on the assess library 6 | ;; (eldev-add-extra-dependencies 'test 'assess) 7 | 8 | (eldev-use-plugin 'autoloads) 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![License GPL 3][badge-license]][copying] 2 | [![MELPA][melpa-badge]][melpa-package] 3 | [![MELPA Stable][melpa-stable-badge]][melpa-stable-package] 4 | [![Build Status](https://github.com/bbatsov/super-save/workflows/CI/badge.svg)](https://github.com/bbatsov/super-save/actions?query=workflow%3ACI) 5 | 6 | # super-save 7 | 8 | `super-save` auto-saves your buffers, when certain events happen - e.g. you switch 9 | between buffers, an Emacs frame loses focus, etc. You can think of it as both 10 | something that augments and replaces the standard `auto-save-mode`. 11 | 12 | ## Installation 13 | 14 | Available on all major `package.el` community maintained repos - [MELPA 15 | Stable][] and [MELPA][] repos. 16 | 17 | MELPA Stable is recommended as it has the latest stable version. MELPA has a 18 | development snapshot for users who don't mind breakage but don't want to run 19 | from a git checkout. 20 | 21 | You can install `super-save` using the following command: 22 | 23 | M-x package-install [RET] super-save [RET] 24 | 25 | or if you'd rather keep it in your dotfiles: 26 | 27 | ```el 28 | (unless (package-installed-p 'super-save) 29 | (package-refresh-contents) 30 | (package-install 'super-save)) 31 | ``` 32 | 33 | If the installation doesn't work try refreshing the package list: 34 | 35 | M-x package-refresh-contents 36 | 37 | ### use-package 38 | 39 | If you're into `use-package` you can use the following snippet: 40 | 41 | ```el 42 | (use-package super-save 43 | :ensure t 44 | :config 45 | (super-save-mode +1)) 46 | ``` 47 | 48 | ### Emacs Prelude 49 | 50 | super-save started its life as the extraction of a similar functionality I had 51 | originally developed for [Emacs Prelude](https://github.com/bbatsov/prelude) and 52 | the package is bundled with Prelude. 53 | 54 | ## Usage 55 | 56 | Add the following to your Emacs config to enable 57 | `super-save`: 58 | 59 | ```el 60 | (super-save-mode +1) 61 | ``` 62 | 63 | If you want to enable the additional feature of auto-saving buffers when Emacs 64 | is idle, add the following as well: 65 | 66 | ```el 67 | (setq super-save-auto-save-when-idle t) 68 | ``` 69 | 70 | At this point you can probably switch off the built-in `auto-save-mode` (unless 71 | you really care about its backups): 72 | 73 | ```el 74 | (setq auto-save-default nil) 75 | ``` 76 | 77 | ## Configuration 78 | 79 | super-save will save files on command (e.g. `switch-to-buffer`) and hook 80 | triggers (e.g. `focus-out-hook`). 81 | 82 | Both of those are configurable via `super-save-triggers` and 83 | `super-save-hook-triggers`. Here's a couple of examples: 84 | 85 | ```el 86 | ;; add integration with ace-window 87 | (add-to-list 'super-save-triggers 'ace-window) 88 | 89 | ;; save on find-file 90 | (add-to-list 'super-save-hook-triggers 'find-file-hook) 91 | ``` 92 | 93 | You can turn off `super-save` for remote files like this: 94 | 95 | ```el 96 | (setq super-save-remote-files nil) 97 | ``` 98 | 99 | Sometimes you might want to exclude specific files from super-save. You can 100 | achieve this via `super-save-exclude`, for example: 101 | 102 | ```el 103 | (setq super-save-exclude '(".gpg")) 104 | ``` 105 | 106 | You can add predicate to `super-save-predicates`, this predicates must not take 107 | arguments and return nil, when current buffer shouldn't save. If predicate don't 108 | know needle of save file, then predicate must return t. Following example stop 109 | `super-save`, when current file in Markdown mode: 110 | 111 | ```el 112 | (add-to-list 'super-save-predicates (lambda () 113 | (not (eq major-mode 'markdown-mode)))) 114 | ``` 115 | 116 | When saving a file automatically, Emacs will display a message in the 117 | `*Messages*` buffer and in the echo area. If you want to suppress these 118 | messages, you can set `super-save-silent` to `t`. 119 | 120 | ```el 121 | ;; Save silently 122 | (setq super-save-silent t) 123 | ``` 124 | 125 | The `super-save-delete-trailing-whitespace` variable can be used to enable 126 | deleting trailing white spaces before saving (via Emacs' 127 | `delete-trailing-whitespace`). 128 | 129 | ```el 130 | ;; Enable deleting trailing white spaces before saving 131 | (setq super-save-delete-trailing-whitespace t) 132 | 133 | ;; Enable deleting trailing white spaces before saving (except for the current line) 134 | (setq super-save-delete-trailing-whitespace 'except-current-line) 135 | ``` 136 | 137 | By default, `super-save` will automatically save only the current buffer, if you 138 | want to save all open buffers you can set `super-save-all-buffers` to `t`. 139 | 140 | Setting this to `t` can be interesting when you make indirect buffer edits, like 141 | when editing `grep`s results with `occur-mode` and `occur-edit-mode`, or when 142 | running a project-wide search and replace with `project-query-replace-regexp` 143 | and so on. In these cases, we can indirectly edit several buffers without 144 | actually visiting or switching to these buffers. Hence, this option allow to 145 | automatically save these buffers, even when they aren't visible in any window. 146 | 147 | ## License 148 | 149 | Copyright © 2015-2023 Bozhidar Batsov and [contributors][]. 150 | 151 | Distributed under the GNU General Public License; type C-h C-c to view it. 152 | 153 | [badge-license]: https://img.shields.io/badge/license-GPL_3-green.svg 154 | [melpa-badge]: http://melpa.org/packages/super-save-badge.svg 155 | [melpa-stable-badge]: http://stable.melpa.org/packages/super-save-badge.svg 156 | [melpa-package]: http://melpa.org/#/super-save 157 | [melpa-stable-package]: http://stable.melpa.org/#/super-save 158 | [COPYING]: http://www.gnu.org/copyleft/gpl.html 159 | [contributors]: https://github.com/bbatsov/super-save/contributors 160 | [melpa]: http://melpa.org 161 | [melpa stable]: http://stable.melpa.org 162 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## master (unreleased) 4 | 5 | ## 0.4.0 (2023-12-09) 6 | 7 | ### New features 8 | 9 | - Make super-save checks customizable via `super-save-predicates`. 10 | - Introduce defcustom `super-save-max-buffer-size` as a way to avoid auto-saving 11 | big files. 12 | - Introduce defcustom `super-save-exclude` (a list of regular expression) as a 13 | way to filter out certain buffer names from being auto-saved. 14 | - [#43](https://github.com/bbatsov/crux/issues/43): Introduce `super-save-silent` 15 | to avoid printing messages in the `*Messages*` buffer or in the echo area. 16 | - [#43](https://github.com/bbatsov/crux/issues/43): Introduce 17 | `super-save-delete-trailing-whitespace` which defaults to `nil` and accepts 18 | `t` to run `delete-trailing-whitespace` before saving the buffer. This 19 | variable accepts only the symbol `except-current-line` to delete trailing 20 | white spaces from all lines except the current one. This can be useful when we 21 | are in the middle of writing some thing and we add a space at the end, in this 22 | case, we more likely need the space to stay there instead of deleting it. 23 | - [#44](https://github.com/bbatsov/crux/issues/44) & 24 | [#20](https://github.com/bbatsov/crux/issues/20): Introduce 25 | `super-save-all-buffers` to save all modified buffers instead of only the 26 | current one. 27 | 28 | ### Changes 29 | 30 | - Require Emacs 25.1. 31 | 32 | ## 0.3.0 (2018-09-29) 33 | 34 | ### New features 35 | 36 | - [#16](https://github.com/bbatsov/crux/issues/16): Make this of hook triggers 37 | customizable (see `super-save-hook-triggers`). 38 | - [#18](https://github.com/bbatsov/crux/issues/18): Make it possible to disable 39 | super-save for remote files (see `super-save-remote-files`). 40 | 41 | ### Changes 42 | 43 | - Make `super-save-triggers` a list of symbols (it used to be a list of strings). 44 | - Trigger super-save on `next-buffer` and `previous-buffer`. 45 | 46 | ## 0.2.0 (2016-02-21) 47 | 48 | ### New features 49 | 50 | - [#3](https://github.com/bbatsov/crux/issues/3): Turn super-save into a global 51 | minor-mode (`super-save-mode`). 52 | - Add some functionality for auto-saving buffers when Emacs is idle (disabled by 53 | default). 54 | 55 | ## 0.1.0 (2016-02-11) 56 | 57 | Initial release. Most of super-save was an extraction of a similar functionality I had originally developed for [Emacs Prelude](https://github.com/bbatsov/prelude). 58 | -------------------------------------------------------------------------------- /super-save.el: -------------------------------------------------------------------------------- 1 | ;;; super-save.el --- Auto-save buffers, based on your activity. -*- lexical-binding: t -*- 2 | 3 | ;; Copyright © 2015-2023 Bozhidar Batsov 4 | 5 | ;; Author: Bozhidar Batsov 6 | ;; URL: https://github.com/bbatsov/super-save 7 | ;; Keywords: convenience 8 | ;; Version: 0.4.0 9 | ;; Package-Requires: ((emacs "25.1")) 10 | 11 | ;; This file is NOT part of GNU Emacs. 12 | 13 | ;; This program is free software; you can redistribute it and/or modify 14 | ;; it under the terms of the GNU General Public License as published by 15 | ;; the Free Software Foundation; either version 3, or (at your option) 16 | ;; any later version. 17 | ;; 18 | ;; This program is distributed in the hope that it will be useful, 19 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | ;; GNU General Public License for more details. 22 | ;; 23 | ;; You should have received a copy of the GNU General Public License 24 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 25 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 26 | ;; Boston, MA 02110-1301, USA. 27 | 28 | ;;; Commentary: 29 | ;; 30 | ;; super-save auto-saves your buffers, when certain events happen - e.g. you 31 | ;; switch between buffers, an Emacs frame loses focus, etc. You can think of it 32 | ;; as both something that augments and replaces the standard auto-save-mode. 33 | ;; 34 | ;;; Code: 35 | 36 | (require 'seq) 37 | 38 | (defgroup super-save nil 39 | "Smart-saving of buffers." 40 | :group 'tools 41 | :group 'convenience) 42 | 43 | (defvar super-save-mode-map 44 | (make-sparse-keymap) 45 | "super-save mode's keymap.") 46 | 47 | (defcustom super-save-triggers 48 | '(switch-to-buffer other-window windmove-up windmove-down windmove-left windmove-right next-buffer previous-buffer) 49 | "A list of commands which would trigger `super-save-command'." 50 | :group 'super-save 51 | :type '(repeat symbol) 52 | :package-version '(super-save . "0.1.0")) 53 | 54 | (defcustom super-save-hook-triggers 55 | '(mouse-leave-buffer-hook focus-out-hook) 56 | "A list of hooks which would trigger `super-save-command'." 57 | :group 'super-save 58 | :type '(repeat symbol) 59 | :package-version '(super-save . "0.3.0")) 60 | 61 | (defcustom super-save-auto-save-when-idle nil 62 | "Save automatically when Emacs is idle." 63 | :group 'super-save 64 | :type 'boolean 65 | :package-version '(super-save . "0.2.0")) 66 | 67 | (defcustom super-save-all-buffers nil 68 | "Auto-save all buffers, not just the current one. 69 | 70 | Setting this to t can be interesting when you make indirect buffer edits, like 71 | when editing `grep's results with `occur-mode' and `occur-edit-mode', or when 72 | running a project-wide search and replace with `project-query-replace-regexp' 73 | and so on. In these cases, we can indirectly edit several buffers without 74 | actually visiting or switching to these buffers. Hence, this option allow to 75 | automatically save these buffers, even when they aren't visible in any window." 76 | :group 'super-save 77 | :type 'boolean 78 | :package-version '(super-save . "0.4.0")) 79 | 80 | (defcustom super-save-idle-duration 5 81 | "Delay in seconds for which Emacs has to be idle before auto-saving. 82 | See `super-save-auto-save-when-idle'." 83 | :group 'super-save 84 | :type 'integer 85 | :package-version '(super-save . "0.2.0")) 86 | 87 | (defcustom super-save-remote-files t 88 | "Save remote files when t, ignore them otherwise." 89 | :group 'super-save 90 | :type 'boolean 91 | :package-version '(super-save . "0.3.0")) 92 | 93 | (defcustom super-save-silent nil 94 | "Save silently, don't display any message." 95 | :group 'super-save 96 | :type 'boolean 97 | :package-version '(super-save . "0.4.0")) 98 | 99 | (defcustom super-save-delete-trailing-whitespace nil 100 | "Controls whether to delete the trailing whitespace before saving. 101 | Set to `except-current-line' if you want to avoid the current line." 102 | :group 'super-save 103 | :type '(choice (boolean :tag "Enable/disable deleting trailing whitespace for the whole buffer.") 104 | (symbol :tag "Delete trailing whitespace except the current line." except-current-line)) 105 | :package-version '(super-save . "0.4.0")) 106 | 107 | (defcustom super-save-exclude nil 108 | "A list of regexps for `buffer-file-name' excluded from super-save. 109 | When a `buffer-file-name' matches any of the regexps it is ignored." 110 | :group 'super-save 111 | :type '(repeat (choice regexp)) 112 | :package-version '(super-save . "0.4.0")) 113 | 114 | (defcustom super-save-max-buffer-size nil 115 | "Maximal size of buffer (in characters), for which super-save work. 116 | Exists mostly because saving constantly huge buffers can be slow in some cases. 117 | Set to 0 or nil to disable." 118 | :group 'super-save 119 | :type 'integer 120 | :package-version '(super-save . "0.4.0")) 121 | 122 | (defcustom super-save-predicates 123 | '((lambda () buffer-file-name) 124 | (lambda () (buffer-modified-p (current-buffer))) 125 | (lambda () (file-writable-p buffer-file-name)) 126 | (lambda () (if (and super-save-max-buffer-size (> super-save-max-buffer-size 0)) 127 | (< (buffer-size) super-save-max-buffer-size) 128 | t)) 129 | (lambda () 130 | (if (file-remote-p buffer-file-name) super-save-remote-files t)) 131 | (lambda () (super-save-include-p buffer-file-name))) 132 | "Predicates, which return nil, when the buffer doesn't need to be saved. 133 | Predicate functions don't take any arguments. If a predicate doesn't know 134 | whether this buffer needs to be super-saved or not, then it must return t." 135 | :group 'super-save 136 | :type 'integer 137 | :package-version '(super-save . "0.4.0")) 138 | 139 | (defun super-save-include-p (filename) 140 | "Return non-nil if FILENAME doesn't match any of the `super-save-exclude'." 141 | (not (seq-some (lambda (regexp) (string-match-p regexp filename)) super-save-exclude))) 142 | 143 | (defun super-save-p () 144 | "Return t when current buffer should be saved, otherwise return nil. 145 | 146 | This function relies on the variable `super-save-predicates'." 147 | (seq-every-p #'funcall super-save-predicates)) 148 | 149 | (defun super-save-delete-trailing-whitespace-maybe () 150 | "Delete trailing whitespace, optionally avoiding the current line. 151 | 152 | See `super-save-delete-trailing-whitespace'." 153 | (cond 154 | ((eq super-save-delete-trailing-whitespace 'except-current-line) 155 | (let ((start (line-beginning-position)) 156 | (current (point))) 157 | (save-excursion 158 | (when (< (point-min) start) 159 | (save-restriction 160 | (narrow-to-region (point-min) (1- start)) 161 | (delete-trailing-whitespace))) 162 | (when (> (point-max) current) 163 | (save-restriction 164 | (narrow-to-region current (point-max)) 165 | (delete-trailing-whitespace)))))) 166 | (super-save-delete-trailing-whitespace 167 | (delete-trailing-whitespace)))) 168 | 169 | (defun super-save-buffer (buffer) 170 | "Save BUFFER if needed, super-save style." 171 | (with-current-buffer buffer 172 | (save-excursion 173 | (when (super-save-p) 174 | (super-save-delete-trailing-whitespace-maybe) 175 | (if super-save-silent 176 | (with-temp-message "" 177 | (let ((inhibit-message t) 178 | (inhibit-redisplay t) 179 | (message-log-max nil)) 180 | (basic-save-buffer))) 181 | (basic-save-buffer)))))) 182 | 183 | (defun super-save-command () 184 | "Save the relevant buffers if needed. 185 | 186 | When `super-save-all-buffers' is non-nil, save all modified buffers, else, save 187 | only the current buffer." 188 | (mapc #'super-save-buffer (if super-save-all-buffers (buffer-list) (list (current-buffer))))) 189 | 190 | (defvar super-save-idle-timer) 191 | 192 | (defun super-save-command-advice (&rest _args) 193 | "A simple wrapper around `super-save-command' that's advice-friendly." 194 | (super-save-command)) 195 | 196 | (defun super-save-advise-trigger-commands () 197 | "Apply super-save advice to the commands listed in `super-save-triggers'." 198 | (mapc 199 | (lambda (command) 200 | (advice-add command :before #'super-save-command-advice)) 201 | super-save-triggers)) 202 | 203 | (defun super-save-remove-advice-from-trigger-commands () 204 | "Remove super-save advice from to the commands listed in `super-save-triggers'." 205 | (mapc 206 | (lambda (command) 207 | (advice-remove command #'super-save-command-advice)) 208 | super-save-triggers)) 209 | 210 | (defun super-save-initialize-idle-timer () 211 | "Initialize super-save idle timer if `super-save-auto-save-when-idle' is true." 212 | (setq super-save-idle-timer 213 | (when super-save-auto-save-when-idle 214 | (run-with-idle-timer super-save-idle-duration t #'super-save-command)))) 215 | 216 | (defun super-save-stop-idle-timer () 217 | "Stop super-save idle timer if `super-save-idle-timer' is set." 218 | (when super-save-idle-timer (cancel-timer super-save-idle-timer))) 219 | 220 | (defun super-save-initialize () 221 | "Setup super-save's advices and hooks." 222 | (super-save-advise-trigger-commands) 223 | (super-save-initialize-idle-timer) 224 | (dolist (hook super-save-hook-triggers) 225 | (add-hook hook #'super-save-command))) 226 | 227 | (defun super-save-stop () 228 | "Cleanup super-save's advices and hooks." 229 | (super-save-remove-advice-from-trigger-commands) 230 | (super-save-stop-idle-timer) 231 | (dolist (hook super-save-hook-triggers) 232 | (remove-hook hook #'super-save-command))) 233 | 234 | ;;;###autoload 235 | (define-minor-mode super-save-mode 236 | "A minor mode that saves your Emacs buffers when they lose focus." 237 | :lighter " super-save" 238 | :keymap super-save-mode-map 239 | :group 'super-save 240 | :global t 241 | (cond 242 | (super-save-mode (super-save-initialize)) 243 | (t (super-save-stop)))) 244 | 245 | (provide 'super-save) 246 | ;;; super-save.el ends here 247 | --------------------------------------------------------------------------------