]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/ibuf-ext.el (ibuffer-do-shell-command-file):
authorTino Calancha <f92capac@gmail.com>
Tue, 7 Jun 2016 23:24:51 +0000 (19:24 -0400)
committerGlenn Morris <rgm@gnu.org>
Mon, 17 Oct 2016 06:36:24 +0000 (23:36 -0700)
Fix non-file-visiting-buffer case.  (Bug#22678)

(cherry picked from commit 738738259ba77fe17e433c64e0758ea59ab5bc75)

lisp/ibuf-ext.el

index f5375612c342a5180c96b6dedbfc48a27747639c..4443383cdf5ac7e9c05aa5f2101c6078663dbfa7 100644 (file)
@@ -347,10 +347,14 @@ the mode if ARG is omitted or nil."
    :modifier-p nil)
   (shell-command (concat command " "
                         (shell-quote-argument
-                         (if buffer-file-name
-                             buffer-file-name
-                           (make-temp-file
-                            (substring (buffer-name) 0 (min 10 (length (buffer-name))))))))))
+                         (or buffer-file-name
+                             (let ((file
+                                    (make-temp-file
+                                     (substring
+                                      (buffer-name) 0
+                                      (min 10 (length (buffer-name)))))))
+                               (write-region nil nil file nil 0)
+                               file))))))
 
 ;;;###autoload (autoload 'ibuffer-do-eval "ibuf-ext")
 (define-ibuffer-op eval (form)