Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add modified buffers information to exit-lem
  • Loading branch information
Sasanidas committed Jul 19, 2023
commit 9499656d4b02f11565025aeaacdab67c30fdd0b1
14 changes: 10 additions & 4 deletions src/commands/other.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@

(define-command exit-lem (&optional (ask t)) ()
"Ask for modified buffers before exiting lem."
(when (or (null ask)
(not (any-modified-buffer-p))
(prompt-for-y-or-n-p "Modified buffers exist. Leave anyway"))
(exit-editor)))
(let ((modified-buffers
(mapcar #'buffer-name (modified-buffers))))
(and (or
(null ask)
(not modified-buffers)
(prompt-for-y-or-n-p
(format nil
"Modified buffers exist:~%~{~a~%~}Leave anyway?"
modified-buffers)))
(exit-editor))))

(define-command quick-exit () ()
"Exit the lem job and kill it."
Expand Down