diff options
| author | Philipp Stephani | 2020-04-01 19:54:01 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2020-05-25 21:11:59 +0200 |
| commit | f8e99938ec41a9af8d42b2ed78af1370fc2c1bc2 (patch) | |
| tree | 7b8c109989b5320506eddf8e13d4bd61277dfe90 | |
| parent | c812223c9fc2684d0edc9cb848cfa6d83c6fdb9a (diff) | |
| download | emacs-f8e99938ec41a9af8d42b2ed78af1370fc2c1bc2.tar.gz emacs-f8e99938ec41a9af8d42b2ed78af1370fc2c1bc2.zip | |
Allow inhibiting 'auto-save-visited-mode' on a per-buffer basis.
At least for me, 'auto-save-visited-mode' is very slow and blocks user
interaction for files visited over TRAMP. Therefore, I'd like a
mechanism to disable it for some buffers (namely, those visiting
remote files).
* (auto-save-visited-mode): Document that 'auto-save-visited-mode' can
be set to nil buffer-locally.
* etc/NEWS: Document new behavior.
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/files.el | 9 |
2 files changed, 11 insertions, 1 deletions
| @@ -98,6 +98,9 @@ shows equivalent key bindings for all commands that have them. | |||
| 98 | 'gomoku-move-sw' and 'gomoku-move-ne' now work correctly, and | 98 | 'gomoku-move-sw' and 'gomoku-move-ne' now work correctly, and |
| 99 | horizontal movements now stop at the edge of the board. | 99 | horizontal movements now stop at the edge of the board. |
| 100 | 100 | ||
| 101 | ** Autosaving via 'auto-save-visited-mode' can now be inhibited by | ||
| 102 | setting the variable 'auto-save-visited-mode' buffer-locally to nil. | ||
| 103 | |||
| 101 | 104 | ||
| 102 | * Changes in Specialized Modes and Packages in Emacs 28.1 | 105 | * Changes in Specialized Modes and Packages in Emacs 28.1 |
| 103 | 106 | ||
diff --git a/lisp/files.el b/lisp/files.el index dba704f7a4b..cb370476496 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -430,7 +430,13 @@ idle for `auto-save-visited-interval' seconds." | |||
| 430 | 430 | ||
| 431 | Unlike `auto-save-mode', this mode will auto-save buffer contents | 431 | Unlike `auto-save-mode', this mode will auto-save buffer contents |
| 432 | to the visited files directly and will also run all save-related | 432 | to the visited files directly and will also run all save-related |
| 433 | hooks. See Info node `Saving' for details of the save process." | 433 | hooks. See Info node `Saving' for details of the save process. |
| 434 | |||
| 435 | You can also set the buffer-local value of the variable | ||
| 436 | `auto-save-visted-mode' to nil. A buffer where the buffer-local | ||
| 437 | value of this variable is nil is ignored for the purpose of | ||
| 438 | `auto-save-visited-mode', even if `auto-save-visited-mode' is | ||
| 439 | enabled." | ||
| 434 | :group 'auto-save | 440 | :group 'auto-save |
| 435 | :global t | 441 | :global t |
| 436 | (when auto-save--timer (cancel-timer auto-save--timer)) | 442 | (when auto-save--timer (cancel-timer auto-save--timer)) |
| @@ -441,6 +447,7 @@ hooks. See Info node `Saving' for details of the save process." | |||
| 441 | #'save-some-buffers :no-prompt | 447 | #'save-some-buffers :no-prompt |
| 442 | (lambda () | 448 | (lambda () |
| 443 | (and buffer-file-name | 449 | (and buffer-file-name |
| 450 | auto-save-visited-mode | ||
| 444 | (not (and buffer-auto-save-file-name | 451 | (not (and buffer-auto-save-file-name |
| 445 | auto-save-visited-file-name)))))))) | 452 | auto-save-visited-file-name)))))))) |
| 446 | 453 | ||