summaryrefslogtreecommitdiff
path: root/lisp/eshell/em-script.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-11-23 12:36:15 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2010-11-23 12:36:15 -0500
commit6e13206c036278d386b70e742355876b0340d28a (patch)
tree12563ed9a12eabe554db040d46e0fc1b4cd16395 /lisp/eshell/em-script.el
parent3d92f44ea0c9a356ce828b07db72c432f773b94c (diff)
downloademacs-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.el34
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."