Function: mh-exec-cmd

mh-exec-cmd is a byte-compiled function defined in mh-e.el.gz.

Signature

(mh-exec-cmd COMMAND &rest ARGS)

Documentation

Execute mh-command COMMAND with ARGS.

The side effects are what is desired. Any output is assumed to be an error and is shown to the user. The output is not read or parsed by MH-E.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-e.el.gz
(defun mh-exec-cmd (command &rest args)
  "Execute mh-command COMMAND with ARGS.
The side effects are what is desired. Any output is assumed to be
an error and is shown to the user. The output is not read or
parsed by MH-E."
  (with-current-buffer (get-buffer-create mh-log-buffer)
    (let* ((initial-size (mh-truncate-log-buffer))
           (start (point))
           (args (mh-list-to-string args)))
      (apply #'call-process (expand-file-name command mh-progs) nil t nil args)
      (when (> (buffer-size) initial-size)
        (save-excursion
          (goto-char start)
          (insert "Errors when executing: " command)
          (cl-loop for arg in args do (insert " " arg))
          (insert "\n"))
        (save-window-excursion
          (switch-to-buffer-other-window mh-log-buffer)
          (sit-for 5))))))