This function creates all temporary files empty which doesn't seem the intended behaviour. emacs -Q --eval="(mapc (lambda(x) (switch-to-buffer x) (insert x)) '(\"foo\" \"bar\"))" --eval='(ibuffer)'w % n ^\(foo\|bar\)$ RET ! cat RET g C-x b *Shell Command Output* ;; empty buffer In GNU Emacs 25.0.91.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.29) Repository revision: 23ca48d3d867cfff9f49ef600e2aad7a26c7a870