Function: embark-shell-command-on-buffer

embark-shell-command-on-buffer is an interactive and byte-compiled function defined in embark.el.

Signature

(embark-shell-command-on-buffer BUFFER COMMAND &optional REPLACE)

Documentation

Run shell COMMAND on contents of BUFFER.

Called with C-u (universal-argument), replace contents of buffer with command output. For replacement behavior see shell-command-dont-erase-buffer setting.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/embark-20260610.302/embark.el
(defun embark-shell-command-on-buffer (buffer command &optional replace)
  "Run shell COMMAND on contents of BUFFER.
Called with \\[universal-argument], replace contents of buffer
with command output.  For replacement behavior see
`shell-command-dont-erase-buffer' setting."
  (interactive
   (list
    (read-buffer "Buffer: " nil t)
    (read-shell-command "Shell command: ")
    current-prefix-arg))
  (with-current-buffer buffer
    (shell-command-on-region (point-min) (point-max)
                             command
                             (and replace (current-buffer)))))