diff options
| author | Joakim Verona | 2011-02-05 11:23:09 +0100 |
|---|---|---|
| committer | Joakim Verona | 2011-02-05 11:23:09 +0100 |
| commit | 4bd51ad5c3445b644dfb017d5b57b10a90aa325f (patch) | |
| tree | 894801e7308ce4ecc34933f959e28f4b9cff9533 /lisp/eshell/em-script.el | |
| parent | 13cfe8df462ab8da9f0028e16cc84dcaceaca3d1 (diff) | |
| parent | 9bcaafce5351d270ac514e23cb69ff1a5fd35229 (diff) | |
| download | emacs-4bd51ad5c3445b644dfb017d5b57b10a90aa325f.tar.gz emacs-4bd51ad5c3445b644dfb017d5b57b10a90aa325f.zip | |
merge from upstream. currently seems to have bitroted and i get segfaults
Diffstat (limited to 'lisp/eshell/em-script.el')
| -rw-r--r-- | lisp/eshell/em-script.el | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el index 183faa1dd77..ed4ad1c0712 100644 --- a/lisp/eshell/em-script.el +++ b/lisp/eshell/em-script.el | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | ;;; em-script.el --- Eshell script files | 1 | ;;; em-script.el --- Eshell script files |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, | 3 | ;; Copyright (C) 1999-2011 Free Software Foundation, Inc. |
| 4 | ;; 2008, 2009, 2010 Free Software Foundation, Inc. | ||
| 5 | 4 | ||
| 6 | ;; Author: John Wiegley <johnw@gnu.org> | 5 | ;; Author: John Wiegley <johnw@gnu.org> |
| 7 | 6 | ||
| @@ -90,23 +89,25 @@ Comments begin with '#'." | |||
| 90 | (interactive "f") | 89 | (interactive "f") |
| 91 | (let ((orig (point)) | 90 | (let ((orig (point)) |
| 92 | (here (point-max)) | 91 | (here (point-max)) |
| 93 | (inhibit-point-motion-hooks t) | 92 | (inhibit-point-motion-hooks t)) |
| 94 | after-change-functions) | ||
| 95 | (goto-char (point-max)) | 93 | (goto-char (point-max)) |
| 96 | (insert-file-contents file) | 94 | (with-silent-modifications |
| 97 | (goto-char (point-max)) | 95 | ;; FIXME: Why not use a temporary buffer and avoid this |
| 98 | (throw 'eshell-replace-command | 96 | ;; "insert&delete" business? --Stef |
| 99 | (prog1 | 97 | (insert-file-contents file) |
| 100 | (list 'let | 98 | (goto-char (point-max)) |
| 101 | (list (list 'eshell-command-name (list 'quote file)) | 99 | (throw 'eshell-replace-command |
| 102 | (list 'eshell-command-arguments | 100 | (prog1 |
| 103 | (list 'quote args))) | 101 | (list 'let |
| 104 | (let ((cmd (eshell-parse-command (cons here (point))))) | 102 | (list (list 'eshell-command-name (list 'quote file)) |
| 105 | (if subcommand-p | 103 | (list 'eshell-command-arguments |
| 106 | (setq cmd (list 'eshell-as-subcommand cmd))) | 104 | (list 'quote args))) |
| 107 | cmd)) | 105 | (let ((cmd (eshell-parse-command (cons here (point))))) |
| 108 | (delete-region here (point)) | 106 | (if subcommand-p |
| 109 | (goto-char orig))))) | 107 | (setq cmd (list 'eshell-as-subcommand cmd))) |
| 108 | cmd)) | ||
| 109 | (delete-region here (point)) | ||
| 110 | (goto-char orig)))))) | ||
| 110 | 111 | ||
| 111 | (defun eshell/source (&rest args) | 112 | (defun eshell/source (&rest args) |
| 112 | "Source a file in a subshell environment." | 113 | "Source a file in a subshell environment." |
| @@ -140,5 +141,4 @@ environment, binding ARGS to $1, $2, etc.") | |||
| 140 | ;; generated-autoload-file: "esh-groups.el" | 141 | ;; generated-autoload-file: "esh-groups.el" |
| 141 | ;; End: | 142 | ;; End: |
| 142 | 143 | ||
| 143 | ;; arch-tag: a346439d-5ba8-4faf-ac2b-3aacfeaa4647 | ||
| 144 | ;;; em-script.el ends here | 144 | ;;; em-script.el ends here |