emacs -q -mm -l test.el I create a profile report for the following code when it did not work as expected (setq inhibit-startup-message t) (setq initial-scratch-message nil) (defun test() (let ((shell-cmd "ls -la") (output-buffer "my-buf") (default-directory "/scpx:bangmyhead@192.168.0.46:~/") (process-name "my-proc")) (start-file-process-shell-command process-name (get-buffer-create output-buffer) shell-cmd) (switch-to-buffer output-buffer) (with-current-buffer output-buffer (goto-char (point-min)) (find-file-other-window "~/readme")))) (require 'profiler) (profiler-reset) (profiler-start 'cpu+mem) (test)