diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/whitespace.el | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3e75e2a720a..2bdab884b93 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -42,6 +42,11 @@ | |||
| 42 | 42 | ||
| 43 | 2008-09-05 Vinicius Jose Latorre <viniciusjl@ig.com.br> | 43 | 2008-09-05 Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 44 | 44 | ||
| 45 | * whitespace.el (whitespace-kill-buffer-hook, whitespace-action): Don't | ||
| 46 | clean up a buffer when killing it. | ||
| 47 | |||
| 48 | 2008-09-05 Vinicius Jose Latorre <viniciusjl@ig.com.br> | ||
| 49 | |||
| 45 | * whitespace.el: Fix auto-cleanup on kill prevents killing read-only | 50 | * whitespace.el: Fix auto-cleanup on kill prevents killing read-only |
| 46 | buffers (bug#360). New version 11.2.1. | 51 | buffers (bug#360). New version 11.2.1. |
| 47 | (whitespace-action): New value `warn-read-only' to give a warning when | 52 | (whitespace-action): New value `warn-read-only' to give a warning when |
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 59da0469be3..56d4e58f138 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -2403,15 +2403,16 @@ It should be added buffer-locally to `write-file-functions'." | |||
| 2403 | (defun whitespace-kill-buffer-hook () | 2403 | (defun whitespace-kill-buffer-hook () |
| 2404 | "Action to be taken when buffer is killed. | 2404 | "Action to be taken when buffer is killed. |
| 2405 | It should be added buffer-locally to `kill-buffer-hook'." | 2405 | It should be added buffer-locally to `kill-buffer-hook'." |
| 2406 | (whitespace-action) | 2406 | (whitespace-action t) |
| 2407 | nil) ; continue hook processing | 2407 | nil) ; continue hook processing |
| 2408 | 2408 | ||
| 2409 | 2409 | ||
| 2410 | (defun whitespace-action () | 2410 | (defun whitespace-action (&optional is-killing-buffer) |
| 2411 | "Action to be taken when buffer is killed or written. | 2411 | "Action to be taken when buffer is killed or written. |
| 2412 | Return t when the action should be aborted." | 2412 | Return t when the action should be aborted." |
| 2413 | (cond ((memq 'auto-cleanup whitespace-action) | 2413 | (cond ((memq 'auto-cleanup whitespace-action) |
| 2414 | (whitespace-cleanup) | 2414 | (unless is-killing-buffer |
| 2415 | (whitespace-cleanup)) | ||
| 2415 | nil) | 2416 | nil) |
| 2416 | ((memq 'abort-on-bogus whitespace-action) | 2417 | ((memq 'abort-on-bogus whitespace-action) |
| 2417 | (whitespace-report nil t)) | 2418 | (whitespace-report nil t)) |