diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-11-23 12:36:15 -0500 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-11-23 12:36:15 -0500 |
| commit | 6e13206c036278d386b70e742355876b0340d28a (patch) | |
| tree | 12563ed9a12eabe554db040d46e0fc1b4cd16395 /lisp/eshell/em-script.el | |
| parent | 3d92f44ea0c9a356ce828b07db72c432f773b94c (diff) | |
| download | emacs-6e13206c036278d386b70e742355876b0340d28a.tar.gz | |
* lisp/eshell/: Use with-silent-modifications.
* lisp/eshell/esh-cmd.el (eshell-parse-command):
* lisp/eshell/esh-arg.el (eshell-parse-arguments):
* lisp/eshell/em-script.el (eshell-source-file):
Use with-silent-modifications.
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." |
