emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/eshell/em-alias.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/eshell/em-alias.el,v
Date: Wed, 05 Dec 2007 06:59:24 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       07/12/05 06:59:24

Index: em-alias.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/eshell/em-alias.el,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- em-alias.el 26 Jul 2007 05:26:53 -0000      1.17
+++ em-alias.el 5 Dec 2007 06:59:24 -0000       1.18
@@ -22,17 +22,6 @@
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-(provide 'em-alias)
-
-(eval-when-compile (require 'esh-maint))
-(require '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)
-
 ;;; Commentary:
 
 ;; Command aliases greatly simplify the definition of new commands.
@@ -62,19 +51,8 @@
 ;;
 ;; Aliases are written to disk immediately after being defined or
 ;; deleted.  The filename in which they are kept is defined by the
-;; following variable:
+;; variable eshell-aliases-file.
 
-(defcustom eshell-aliases-file (concat eshell-directory-name "alias")
-  "*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
-sake of simplicity, since that's pretty much the only benefit to be
-gained by using this module."
-  :type 'file
-  :group 'eshell-alias)
-
-;;;
 ;; The format of this file is quite basic.  It specifies the alias
 ;; definitions in almost exactly the same way that the user entered
 ;; them, minus any argument quoting (since interpolation is not done
@@ -102,19 +80,12 @@
 ;; mispelled command, once a given tolerance threshold has been
 ;; reached.
 
-(defcustom eshell-bad-command-tolerance 3
-  "*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)
-
-;;;
-;; Whenever the same bad command name is encountered this many times,
-;; the user will be prompted in the minibuffer to provide an alias
-;; name.  An alias definition will then be created which will result
-;; in an equal call to the correct name.  In this way, Eshell
-;; gradually learns about the commands that the user mistypes
-;; frequently, and will automatically correct them!
+;; Whenever the same bad command name is encountered
+;; `eshell-bad-command-tolerance' times, the user will be prompted in
+;; the minibuffer to provide an alias name.  An alias definition will
+;; then be created which will result in an equal call to the correct
+;; name.  In this way, Eshell gradually learns about the commands that
+;; the user mistypes frequently, and will automatically correct them!
 ;;
 ;; Note that a '$*' is automatically appended at the end of the alias
 ;; definition, so that entering it is unnecessary when specifying the
@@ -122,6 +93,32 @@
 
 ;;; Code:
 
+(eval-when-compile
+  (require 'esh-util))
+(require '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.
+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
+sake of simplicity, since that's pretty much the only benefit to be
+gained by using this module."
+  :type 'file
+  :group 'eshell-alias)
+
+(defcustom eshell-bad-command-tolerance 3
+  "*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."
   :type 'hook
@@ -180,6 +177,9 @@
     (eshell-write-aliases-list))
   nil)
 
+(defvar pcomplete-stub)
+(autoload 'pcomplete-here "pcomplete")
+
 (defun pcomplete/eshell-mode/alias ()
   "Completion function for Eshell's `alias' command."
   (pcomplete-here (eshell-alias-completions pcomplete-stub)))
@@ -274,5 +274,7 @@
                                        eshell-prevent-alias-expansion))))
                     (eshell-parse-command alias))))))))))
 
+(provide 'em-alias)
+
 ;;; arch-tag: 8b018fc1-4e07-4ccc-aa73-c0a1ba361f82
 ;;; em-alias.el ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]