]> code.delx.au - gnu-emacs/blobdiff - lisp/eshell/em-alias.el
merge from upstream
[gnu-emacs] / lisp / eshell / em-alias.el
index 58c6d84bb4e5397c59841607f27c8af784b4f1c7..4e1dbd410454bbadd5d8e9254fcb864e0d6159cd 100644 (file)
@@ -1,7 +1,6 @@
 ;;; em-alias.el --- creation and management of command aliases
 
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2011  Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
   (require 'esh-util))
 (require 'eshell)
 
-(defgroup eshell-alias nil
+;;;###autoload
+(eshell-defgroup eshell-alias nil
   "Command aliases allow for easy definition of alternate commands."
   :tag "Command aliases"
   ;; :link '(info-link "(eshell)Command aliases")
   :group 'eshell-module)
 
-(defcustom eshell-aliases-file (concat eshell-directory-name "alias")
-  "*The file in which aliases are kept.
+(defcustom eshell-aliases-file (expand-file-name "alias" eshell-directory-name)
+  "The file in which aliases are kept.
 Whenever an alias is defined by the user, using the `alias' command,
 it will be written to this file.  Thus, alias definitions (and
 deletions) are always permanent.  This approach was chosen for the
@@ -112,13 +112,14 @@ gained by using this module."
   :group 'eshell-alias)
 
 (defcustom eshell-bad-command-tolerance 3
-  "*The number of failed commands to ignore before creating an alias."
+  "The number of failed commands to ignore before creating an alias."
   :type 'integer
   ;; :link '(custom-manual "(eshell)Auto-correction of bad commands")
   :group 'eshell-alias)
 
-(defcustom eshell-alias-load-hook '(eshell-alias-initialize)
-  "*A hook that gets run when `eshell-alias' is loaded."
+(defcustom eshell-alias-load-hook nil
+  "A hook that gets run when `eshell-alias' is loaded."
+  :version "24.1"                      ; removed eshell-alias-initialize
   :type 'hook
   :group 'eshell-alias)
 
@@ -156,7 +157,7 @@ command, which will automatically write them to the file named by
 (defun eshell/alias (&optional alias &rest definition)
   "Define an ALIAS in the user's alias list using DEFINITION."
   (if (not alias)
-      (eshell-for alias eshell-command-aliases-list
+      (dolist (alias eshell-command-aliases-list)
        (eshell-print (apply 'format "alias %s %s\n" alias)))
     (if (not definition)
        (setq eshell-command-aliases-list
@@ -238,7 +239,7 @@ command, which will automatically write them to the file named by
   "Find all possible completions for NAME.
 These are all the command aliases which begin with NAME."
   (let (completions)
-    (eshell-for alias eshell-command-aliases-list
+    (dolist (alias eshell-command-aliases-list)
       (if (string-match (concat "^" name) (car alias))
          (setq completions (cons (car alias) completions))))
     completions))
@@ -274,5 +275,8 @@ These are all the command aliases which begin with NAME."
 
 (provide 'em-alias)
 
-;; arch-tag: 8b018fc1-4e07-4ccc-aa73-c0a1ba361f82
+;; Local Variables:
+;; generated-autoload-file: "esh-groups.el"
+;; End:
+
 ;;; em-alias.el ends here