feature/popup: add new autosave window parameter
(autosave . CDR) This parameter determines what to do with modified buffers in closing popup windows. CDR can be a t, 'ignore, a function or nil. + If t, no prompts. Just save them automatically (if they're file-visiting buffers). + If 'ignore, no prompts, no saving. Just silently kill it. + If nil (the default), prompt the user what to do if the buffer is file-visiting and modified. + If a function, the return value must return one of the other values. It takes two arguments: the popup window and buffer.
This commit is contained in:
parent
f16aa539c7
commit
dcec3b9b25
2 changed files with 16 additions and 3 deletions
|
@ -68,7 +68,8 @@ and enables `+popup-buffer-mode'."
|
|||
ttl)
|
||||
(when (and (buffer-file-name buffer)
|
||||
(buffer-modified-p buffer)
|
||||
(y-or-n-p "Popup buffer is modified. Save it?"))
|
||||
(or (+popup-parameter-fn 'autosave window buffer)
|
||||
(y-or-n-p "Popup buffer is modified. Save it?")))
|
||||
(with-current-buffer buffer (save-buffer)))
|
||||
(set-buffer-modified-p nil)
|
||||
(let ((ignore-window-parameters t))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue