Prevent unsaved prompts when formatting #1498
The fix for #1489 (in 13f5a762
) gives the temp buffer (where formatting
is performed) a real buffer-file-name, which causes it to prompt to save
it when it is killed.
This commit is contained in:
parent
0b1ecb8105
commit
9bba39bd3a
1 changed files with 13 additions and 12 deletions
|
@ -134,6 +134,7 @@ See `+format/buffer' for the interactive version of this function, and
|
|||
(origin-buffer-file-name (buffer-file-name (buffer-base-buffer)))
|
||||
(origin-default-directory default-directory))
|
||||
(with-temp-buffer
|
||||
(with-silent-modifications
|
||||
(insert output)
|
||||
;; Ensure this temp buffer _seems_ as much like the origin
|
||||
;; buffer as possible.
|
||||
|
@ -145,7 +146,7 @@ See `+format/buffer' for the interactive version of this function, and
|
|||
(setq indent (+format--current-indentation))
|
||||
(when (> indent 0)
|
||||
(indent-rigidly (point-min) (point-max) (- indent))))
|
||||
(funcall f-function executable mode-result)))))
|
||||
(funcall f-function executable mode-result))))))
|
||||
(unwind-protect
|
||||
(cond ((null output) 'error)
|
||||
((eq output t) 'noop)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue