Replace eshell-defgroup with plain defgroup
[bpt/emacs.git] / lisp / eshell / em-script.el
index 78ec6c0..3b203b4 100644 (file)
@@ -1,7 +1,6 @@
 ;;; em-script.el --- Eshell script files
 
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;;   2008  Free Software Foundation, Inc.
+;; Copyright (C) 1999-2012  Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
 (require 'eshell)
 
 ;;;###autoload
-(eshell-defgroup eshell-script nil
+(progn
+(defgroup eshell-script nil
   "This module allows for the execution of files containing Eshell
 commands, as a script file."
   :tag "Running script files."
-  :group 'eshell-module)
+  :group 'eshell-module))
 
 ;;; User Variables:
 
-(defcustom eshell-script-load-hook '(eshell-script-initialize)
-  "*A list of functions to call when loading `eshell-script'."
+(defcustom eshell-script-load-hook nil
+  "A list of functions to call when loading `eshell-script'."
+  :version "24.1"                       ; removed eshell-script-initialize
   :type 'hook
   :group 'eshell-script)
 
-(defcustom eshell-login-script (concat eshell-directory-name "login")
-  "*If non-nil, a file to invoke when starting up Eshell interactively.
+(defcustom eshell-login-script (expand-file-name "login" eshell-directory-name)
+  "If non-nil, a file to invoke when starting up Eshell interactively.
 This file should be a file containing Eshell commands, where comment
 lines begin with '#'."
   :type 'file
   :group 'eshell-script)
 
-(defcustom eshell-rc-script (concat eshell-directory-name "profile")
-  "*If non-nil, a file to invoke whenever Eshell is started.
+(defcustom eshell-rc-script (expand-file-name "profile" eshell-directory-name)
+  "If non-nil, a file to invoke whenever Eshell is started.
 This includes when running `eshell-command'."
   :type 'file
   :group 'eshell-script)
@@ -90,23 +91,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."
@@ -140,5 +143,4 @@ environment, binding ARGS to $1, $2, etc.")
 ;; generated-autoload-file: "esh-groups.el"
 ;; End:
 
-;; arch-tag: a346439d-5ba8-4faf-ac2b-3aacfeaa4647
 ;;; em-script.el ends here