"Save file XXXXXX (OPTIONS)" will be displayed at the end of emacs when the file is not edited and saved."Rather than confirming whether to save or not by displaying them one by one, I thought, ""I would like to check this list in advance and kill it as it is if necessary."""
Can I list the files (buffers that are visiting) that ask me if I want to save at the end and do various operations (at least select that buffer)?
emacs
Is it like this?
(defun user/buffer-needs-save-p (buffer)
"Return non-nil if the visited-file BUFFER is still modified."
(and (buffer-file-name buffer)
(buffer-modified-p buffer))
;; process unsaved buffers
(dolist(b(buffer-list))
(when (user/buffer-needs-save-pb)
...))
Looking at the Emacs source code (1, 2), elisp did not seem to provide a function to determine if it needs to be saved.
"Based on @kosh's answer, I tried ""list display"" and it was as follows." (The keybind is not good enough, but for now.)
(defun user/buffer-needs-save-p (buffer)
"Return non-nil if the visited-file BUFFER is still modified."
(and (buffer-file-name buffer)
(buffer-modified-p buffer))
;; process unsaved buffers
(defun modified-buffer-list()
(interactive)
(let(ret)
(dolist(b(buffer-list))
(when (user/buffer-needs-save-pb)
(setqret(consbret)))
(switch-to-buffer (list-buffers-noselect nil ret)))
623 Uncaught (inpromise) Error on Electron: An object could not be cloned
584 PHP ssh2_scp_send fails to send files as intended
614 GDB gets version error when attempting to debug with the Presense SDK (IDE)
578 Understanding How to Configure Google API Key
577 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.