diff options
Diffstat (limited to 'lisp/eshell/em-script.el')
| -rw-r--r-- | lisp/eshell/em-script.el | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el index 183faa1dd77..21a5d804073 100644 --- a/lisp/eshell/em-script.el +++ b/lisp/eshell/em-script.el @@ -90,23 +90,25 @@ Comments begin with '#'." (interactive "f") (let ((orig (point)) (here (point-max)) - (inhibit-point-motion-hooks t) - after-change-functions) + (inhibit-point-motion-hooks t)) (goto-char (point-max)) - (insert-file-contents file) - (goto-char (point-max)) - (throw 'eshell-replace-command - (prog1 - (list 'let - (list (list 'eshell-command-name (list 'quote file)) - (list 'eshell-command-arguments - (list 'quote args))) - (let ((cmd (eshell-parse-command (cons here (point))))) - (if subcommand-p - (setq cmd (list 'eshell-as-subcommand cmd))) - cmd)) - (delete-region here (point)) - (goto-char orig))))) + (with-silent-modifications + ;; FIXME: Why not use a temporary buffer and avoid this + ;; "insert&delete" business? --Stef + (insert-file-contents file) + (goto-char (point-max)) + (throw 'eshell-replace-command + (prog1 + (list 'let + (list (list 'eshell-command-name (list 'quote file)) + (list 'eshell-command-arguments + (list 'quote args))) + (let ((cmd (eshell-parse-command (cons here (point))))) + (if subcommand-p + (setq cmd (list 'eshell-as-subcommand cmd))) + cmd)) + (delete-region here (point)) + (goto-char orig)))))) (defun eshell/source (&rest args) "Source a file in a subshell environment." |
