Function: embark-shell-command-on-buffer

embark-shell-command-on-buffer is an interactive and natively 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

embark-buffer-map |

Source Code

;; Defined in /nix/store/lls066p88vbzffl5j0d16jbhwpn2zfz2-emacs-packages-deps/share/emacs/site-lisp/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)))))