Quantcast
Channel: How do I save multiple buffers (of my choosing) at the same time in Emacs? - Stack Overflow
Viewing all articles
Browse latest Browse all 7

Answer by Joe Casadonte for How do I save multiple buffers (of my choosing) at the same time in Emacs?

$
0
0

Use ibuffer, which should come with all late-model emacsen. Put the following in your .emacs file:

(autoload 'ibuffer "ibuffer""" t)(global-set-key (kbd "C-x C-b") 'ibuffer)(defun my-ibuffer-load-hook ()"Hook for when ibuffer is loaded."  (define-ibuffer-filter unsaved-file-buffers"Only show unsaved buffers backed by a real file." (:description "unsaved file buffers") (and (buffer-local-value 'buffer-file-name buf)   (buffer-modified-p buf)))  (define-key ibuffer-mode-map (kbd "/ *") 'ibuffer-filter-by-unsaved-file-buffers)  );; (add-hook 'ibuffer-load-hook 'my-ibuffer-load-hook)(eval-after-load 'ibuf-ext '(my-ibuffer-load-hook))

Then use C-x C-b to bring up the ibuffer list, and / * to show just unsaved buffers backed by a real file (so you don't see *scratch* in the list, for example). Mark the desired buffers with m and then save them with S.


Viewing all articles
Browse latest Browse all 7

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>