aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell
diff options
context:
space:
mode:
authorMiles Bader2007-12-06 09:51:45 +0000
committerMiles Bader2007-12-06 09:51:45 +0000
commit0bd508417142ff377f34aec8dcec9438d9175c2c (patch)
tree4d60fe09e5cebf7d79766b11e9cda8cc1c9dbb9b /lisp/eshell
parent98fe991da804a42f53f6a5e84cd5eab18a82e181 (diff)
parent9fb1ba8090da3528de56158a79bd3527d31c7f2f (diff)
downloademacs-0bd508417142ff377f34aec8dcec9438d9175c2c.tar.gz
emacs-0bd508417142ff377f34aec8dcec9438d9175c2c.zip
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-294
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/em-alias.el74
-rw-r--r--lisp/eshell/em-banner.el35
-rw-r--r--lisp/eshell/em-basic.el43
-rw-r--r--lisp/eshell/em-cmpl.el29
-rw-r--r--lisp/eshell/em-dirs.el28
-rw-r--r--lisp/eshell/em-glob.el26
-rw-r--r--lisp/eshell/em-hist.el18
-rw-r--r--lisp/eshell/em-ls.el21
-rw-r--r--lisp/eshell/em-pred.el24
-rw-r--r--lisp/eshell/em-prompt.el16
-rw-r--r--lisp/eshell/em-rebind.el10
-rw-r--r--lisp/eshell/em-script.el8
-rw-r--r--lisp/eshell/em-smart.el32
-rw-r--r--lisp/eshell/em-term.el27
-rw-r--r--lisp/eshell/em-unix.el39
-rw-r--r--lisp/eshell/em-xtra.el15
-rw-r--r--lisp/eshell/esh-arg.el14
-rw-r--r--lisp/eshell/esh-cmd.el89
-rw-r--r--lisp/eshell/esh-ext.el25
-rw-r--r--lisp/eshell/esh-io.el30
-rw-r--r--lisp/eshell/esh-maint.el8
-rw-r--r--lisp/eshell/esh-mode.el26
-rw-r--r--lisp/eshell/esh-module.el17
-rw-r--r--lisp/eshell/esh-opt.el6
-rw-r--r--lisp/eshell/esh-proc.el8
-rw-r--r--lisp/eshell/esh-test.el19
-rw-r--r--lisp/eshell/esh-util.el20
-rw-r--r--lisp/eshell/esh-var.el28
-rw-r--r--lisp/eshell/eshell.el113
29 files changed, 394 insertions, 454 deletions
diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el
index 8ecc335523b..dd61dac0594 100644
--- a/lisp/eshell/em-alias.el
+++ b/lisp/eshell/em-alias.el
@@ -22,17 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-alias)
26
27(eval-when-compile (require 'esh-maint))
28(require 'eshell)
29
30(defgroup eshell-alias nil
31 "Command aliases allow for easy definition of alternate commands."
32 :tag "Command aliases"
33 ;; :link '(info-link "(eshell)Command aliases")
34 :group 'eshell-module)
35
36;;; Commentary: 25;;; Commentary:
37 26
38;; Command aliases greatly simplify the definition of new commands. 27;; Command aliases greatly simplify the definition of new commands.
@@ -62,19 +51,8 @@
62;; 51;;
63;; Aliases are written to disk immediately after being defined or 52;; Aliases are written to disk immediately after being defined or
64;; deleted. The filename in which they are kept is defined by the 53;; deleted. The filename in which they are kept is defined by the
65;; following variable: 54;; variable eshell-aliases-file.
66 55
67(defcustom eshell-aliases-file (concat eshell-directory-name "alias")
68 "*The file in which aliases are kept.
69Whenever an alias is defined by the user, using the `alias' command,
70it will be written to this file. Thus, alias definitions (and
71deletions) are always permanent. This approach was chosen for the
72sake of simplicity, since that's pretty much the only benefit to be
73gained by using this module."
74 :type 'file
75 :group 'eshell-alias)
76
77;;;
78;; The format of this file is quite basic. It specifies the alias 56;; The format of this file is quite basic. It specifies the alias
79;; definitions in almost exactly the same way that the user entered 57;; definitions in almost exactly the same way that the user entered
80;; them, minus any argument quoting (since interpolation is not done 58;; them, minus any argument quoting (since interpolation is not done
@@ -102,19 +80,12 @@ gained by using this module."
102;; mispelled command, once a given tolerance threshold has been 80;; mispelled command, once a given tolerance threshold has been
103;; reached. 81;; reached.
104 82
105(defcustom eshell-bad-command-tolerance 3 83;; Whenever the same bad command name is encountered
106 "*The number of failed commands to ignore before creating an alias." 84;; `eshell-bad-command-tolerance' times, the user will be prompted in
107 :type 'integer 85;; the minibuffer to provide an alias name. An alias definition will
108 ;; :link '(custom-manual "(eshell)Auto-correction of bad commands") 86;; then be created which will result in an equal call to the correct
109 :group 'eshell-alias) 87;; name. In this way, Eshell gradually learns about the commands that
110 88;; the user mistypes frequently, and will automatically correct them!
111;;;
112;; Whenever the same bad command name is encountered this many times,
113;; the user will be prompted in the minibuffer to provide an alias
114;; name. An alias definition will then be created which will result
115;; in an equal call to the correct name. In this way, Eshell
116;; gradually learns about the commands that the user mistypes
117;; frequently, and will automatically correct them!
118;; 89;;
119;; Note that a '$*' is automatically appended at the end of the alias 90;; Note that a '$*' is automatically appended at the end of the alias
120;; definition, so that entering it is unnecessary when specifying the 91;; definition, so that entering it is unnecessary when specifying the
@@ -122,6 +93,32 @@ gained by using this module."
122 93
123;;; Code: 94;;; Code:
124 95
96(eval-when-compile
97 (require 'esh-util))
98(require 'eshell)
99
100(defgroup eshell-alias nil
101 "Command aliases allow for easy definition of alternate commands."
102 :tag "Command aliases"
103 ;; :link '(info-link "(eshell)Command aliases")
104 :group 'eshell-module)
105
106(defcustom eshell-aliases-file (concat eshell-directory-name "alias")
107 "*The file in which aliases are kept.
108Whenever an alias is defined by the user, using the `alias' command,
109it will be written to this file. Thus, alias definitions (and
110deletions) are always permanent. This approach was chosen for the
111sake of simplicity, since that's pretty much the only benefit to be
112gained by using this module."
113 :type 'file
114 :group 'eshell-alias)
115
116(defcustom eshell-bad-command-tolerance 3
117 "*The number of failed commands to ignore before creating an alias."
118 :type 'integer
119 ;; :link '(custom-manual "(eshell)Auto-correction of bad commands")
120 :group 'eshell-alias)
121
125(defcustom eshell-alias-load-hook '(eshell-alias-initialize) 122(defcustom eshell-alias-load-hook '(eshell-alias-initialize)
126 "*A hook that gets run when `eshell-alias' is loaded." 123 "*A hook that gets run when `eshell-alias' is loaded."
127 :type 'hook 124 :type 'hook
@@ -180,6 +177,9 @@ command, which will automatically write them to the file named by
180 (eshell-write-aliases-list)) 177 (eshell-write-aliases-list))
181 nil) 178 nil)
182 179
180(defvar pcomplete-stub)
181(autoload 'pcomplete-here "pcomplete")
182
183(defun pcomplete/eshell-mode/alias () 183(defun pcomplete/eshell-mode/alias ()
184 "Completion function for Eshell's `alias' command." 184 "Completion function for Eshell's `alias' command."
185 (pcomplete-here (eshell-alias-completions pcomplete-stub))) 185 (pcomplete-here (eshell-alias-completions pcomplete-stub)))
@@ -274,5 +274,7 @@ These are all the command aliases which begin with NAME."
274 eshell-prevent-alias-expansion)))) 274 eshell-prevent-alias-expansion))))
275 (eshell-parse-command alias)))))))))) 275 (eshell-parse-command alias))))))))))
276 276
277(provide 'em-alias)
278
277;;; arch-tag: 8b018fc1-4e07-4ccc-aa73-c0a1ba361f82 279;;; arch-tag: 8b018fc1-4e07-4ccc-aa73-c0a1ba361f82
278;;; em-alias.el ends here 280;;; em-alias.el ends here
diff --git a/lisp/eshell/em-banner.el b/lisp/eshell/em-banner.el
index 17d930a055d..b9642f41df6 100644
--- a/lisp/eshell/em-banner.el
+++ b/lisp/eshell/em-banner.el
@@ -22,18 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-banner)
26
27(eval-when-compile (require 'esh-maint))
28
29(defgroup eshell-banner nil
30 "This sample module displays a welcome banner at login.
31It exists so that others wishing to create their own Eshell extension
32modules may have a simple template to begin with."
33 :tag "Login banner"
34 ;; :link '(info-link "(eshell)Login banner")
35 :group 'eshell-module)
36
37;;; Commentary: 25;;; Commentary:
38 26
39;; There is nothing to be done or configured in order to use this 27;; There is nothing to be done or configured in order to use this
@@ -51,6 +39,23 @@ modules may have a simple template to begin with."
51;; In this case, it allows the user to change the string which 39;; In this case, it allows the user to change the string which
52;; displays at login time. 40;; displays at login time.
53 41
42;;; Code:
43
44(eval-when-compile
45 (require 'cl)
46 (require 'esh-mode)
47 (require 'eshell))
48
49(require 'esh-util)
50
51(defgroup eshell-banner nil
52 "This sample module displays a welcome banner at login.
53It exists so that others wishing to create their own Eshell extension
54modules may have a simple template to begin with."
55 :tag "Login banner"
56 ;; :link '(info-link "(eshell)Login banner")
57 :group 'eshell-module)
58
54;;; User Variables: 59;;; User Variables:
55 60
56(defcustom eshell-banner-message "Welcome to the Emacs shell\n\n" 61(defcustom eshell-banner-message "Welcome to the Emacs shell\n\n"
@@ -61,10 +66,6 @@ This can be any sexp, and should end with at least two newlines."
61 66
62(put 'eshell-banner-message 'risky-local-variable t) 67(put 'eshell-banner-message 'risky-local-variable t)
63 68
64;;; Code:
65
66(require 'esh-util)
67
68(defcustom eshell-banner-load-hook '(eshell-banner-initialize) 69(defcustom eshell-banner-load-hook '(eshell-banner-initialize)
69 "*A list of functions to run when `eshell-banner' is loaded." 70 "*A list of functions to run when `eshell-banner' is loaded."
70 :type 'hook 71 :type 'hook
@@ -90,5 +91,7 @@ This can be any sexp, and should end with at least two newlines."
90 (goto-char (point-min)) 91 (goto-char (point-min))
91 (looking-at msg))) 92 (looking-at msg)))
92 93
94(provide 'em-banner)
95
93;;; arch-tag: e738b4ef-8671-42ae-a757-291779b92491 96;;; arch-tag: e738b4ef-8671-42ae-a757-291779b92491
94;;; em-banner.el ends here 97;;; em-banner.el ends here
diff --git a/lisp/eshell/em-basic.el b/lisp/eshell/em-basic.el
index 458f6918de4..57f9a094141 100644
--- a/lisp/eshell/em-basic.el
+++ b/lisp/eshell/em-basic.el
@@ -22,19 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-basic)
26
27(eval-when-compile (require 'esh-maint))
28
29(defgroup eshell-basic nil
30 "The \"basic\" code provides a set of convenience functions which
31are traditionally considered shell builtins. Since all of the
32functionality provided by them is accessible through Lisp, they are
33not really builtins at all, but offer a command-oriented way to do the
34same thing."
35 :tag "Basic shell commands"
36 :group 'eshell-module)
37
38;;; Commentary: 25;;; Commentary:
39 26
40;; There are very few basic Eshell commands -- so-called builtins. 27;; There are very few basic Eshell commands -- so-called builtins.
@@ -48,14 +35,6 @@ same thing."
48;; echo as an argument), or whether it should try to act like a normal 35;; echo as an argument), or whether it should try to act like a normal
49;; shell echo, and always result in a flat string being returned. 36;; shell echo, and always result in a flat string being returned.
50 37
51(defcustom eshell-plain-echo-behavior nil
52 "*If non-nil, `echo' tries to behave like an ordinary shell echo.
53This comes at some detriment to Lisp functionality. However, the Lisp
54equivalent of `echo' can always be achieved by using `identity'."
55 :type 'boolean
56 :group 'eshell-basic)
57
58;;;
59;; An example of the difference is the following: 38;; An example of the difference is the following:
60;; 39;;
61;; echo Hello world 40;; echo Hello world
@@ -83,8 +62,27 @@ equivalent of `echo' can always be achieved by using `identity'."
83 62
84;;; Code: 63;;; Code:
85 64
65(eval-when-compile
66 (require 'esh-util))
67
86(require 'esh-opt) 68(require 'esh-opt)
87 69
70(defgroup eshell-basic nil
71 "The \"basic\" code provides a set of convenience functions which
72are traditionally considered shell builtins. Since all of the
73functionality provided by them is accessible through Lisp, they are
74not really builtins at all, but offer a command-oriented way to do the
75same thing."
76 :tag "Basic shell commands"
77 :group 'eshell-module)
78
79(defcustom eshell-plain-echo-behavior nil
80 "*If non-nil, `echo' tries to behave like an ordinary shell echo.
81This comes at some detriment to Lisp functionality. However, the Lisp
82equivalent of `echo' can always be achieved by using `identity'."
83 :type 'boolean
84 :group 'eshell-basic)
85
88;;; Functions: 86;;; Functions:
89 87
90(defun eshell-echo (args &optional output-newline) 88(defun eshell-echo (args &optional output-newline)
@@ -180,8 +178,7 @@ or `eshell-printn' for display."
180 "Warning: umask changed for all new files created by Emacs.\n")) 178 "Warning: umask changed for all new files created by Emacs.\n"))
181 nil)) 179 nil))
182 180
183(eval-when-compile 181(provide 'em-basic)
184 (defvar print-func))
185 182
186;;; arch-tag: 385a31b1-cb95-46f0-9829-9d352ee77db8 183;;; arch-tag: 385a31b1-cb95-46f0-9829-9d352ee77db8
187;;; em-basic.el ends here 184;;; em-basic.el ends here
diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el
index 7247033a235..b5f666a6bf6 100644
--- a/lisp/eshell/em-cmpl.el
+++ b/lisp/eshell/em-cmpl.el
@@ -22,18 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-cmpl)
26
27(eval-when-compile (require 'esh-maint))
28(require 'esh-util)
29
30(defgroup eshell-cmpl nil
31 "This module provides a programmable completion function bound to
32the TAB key, which allows for completing command names, file names,
33variable names, arguments, etc."
34 :tag "Argument completion"
35 :group 'eshell-module)
36
37;;; Commentary: 25;;; Commentary:
38 26
39;; Eshell, by using the pcomplete package, provides a full 27;; Eshell, by using the pcomplete package, provides a full
@@ -82,6 +70,19 @@ variable names, arguments, etc."
82;; This only works well if the completion function has provided Eshell 70;; This only works well if the completion function has provided Eshell
83;; with sufficient pointers to locate the relevant help text. 71;; with sufficient pointers to locate the relevant help text.
84 72
73;;; Code:
74
75(eval-when-compile
76 (require 'eshell))
77(require 'esh-util)
78
79(defgroup eshell-cmpl nil
80 "This module provides a programmable completion function bound to
81the TAB key, which allows for completing command names, file names,
82variable names, arguments, etc."
83 :tag "Argument completion"
84 :group 'eshell-module)
85
85;;; User Variables: 86;;; User Variables:
86 87
87(defcustom eshell-cmpl-load-hook '(eshell-cmpl-initialize) 88(defcustom eshell-cmpl-load-hook '(eshell-cmpl-initialize)
@@ -296,7 +297,7 @@ to writing a completion function."
296 (define-key eshell-mode-map [tab] 'pcomplete) 297 (define-key eshell-mode-map [tab] 'pcomplete)
297 (define-key eshell-mode-map [(control ?i)] 'pcomplete) 298 (define-key eshell-mode-map [(control ?i)] 'pcomplete)
298 ;; jww (1999-10-19): Will this work on anything but X? 299 ;; jww (1999-10-19): Will this work on anything but X?
299 (if (eshell-under-xemacs-p) 300 (if (featurep 'xemacs)
300 (define-key eshell-mode-map [iso-left-tab] 'pcomplete-reverse) 301 (define-key eshell-mode-map [iso-left-tab] 'pcomplete-reverse)
301 (define-key eshell-mode-map [(shift iso-lefttab)] 'pcomplete-reverse) 302 (define-key eshell-mode-map [(shift iso-lefttab)] 'pcomplete-reverse)
302 (define-key eshell-mode-map [(shift control ?i)] 'pcomplete-reverse)) 303 (define-key eshell-mode-map [(shift control ?i)] 'pcomplete-reverse))
@@ -448,7 +449,7 @@ to writing a completion function."
448 (all-completions filename obarray 'functionp)) 449 (all-completions filename obarray 'functionp))
449 completions))))))) 450 completions)))))))
450 451
451;;; Code: 452(provide 'em-cmpl)
452 453
453;;; arch-tag: 0e914699-673a-45f8-8cbf-82e1dbc571bc 454;;; arch-tag: 0e914699-673a-45f8-8cbf-82e1dbc571bc
454;;; em-cmpl.el ends here 455;;; em-cmpl.el ends here
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index 02556661b1b..8a1e81621bc 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -22,20 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-dirs)
26
27(eval-when-compile (require 'esh-maint))
28(require 'eshell)
29
30(defgroup eshell-dirs nil
31 "Directory navigation involves changing directories, examining the
32current directory, maintaining a directory stack, and also keeping
33track of a history of the last directory locations the user was in.
34Emacs does provide standard Lisp definitions of `pwd' and `cd', but
35they lack somewhat in feel from the typical shell equivalents."
36 :tag "Directory navigation"
37 :group 'eshell-module)
38
39;;; Commentary: 25;;; Commentary:
40 26
41;; The only special feature that Eshell offers in the last-dir-ring. 27;; The only special feature that Eshell offers in the last-dir-ring.
@@ -57,9 +43,21 @@ they lack somewhat in feel from the typical shell equivalents."
57;; Eshell sessions. It is a separate mechanism from `pushd' and 43;; Eshell sessions. It is a separate mechanism from `pushd' and
58;; `popd', and the two may be used at the same time. 44;; `popd', and the two may be used at the same time.
59 45
46;;; Code:
47
48(require 'eshell)
60(require 'ring) 49(require 'ring)
61(require 'esh-opt) 50(require 'esh-opt)
62 51
52(defgroup eshell-dirs nil
53 "Directory navigation involves changing directories, examining the
54current directory, maintaining a directory stack, and also keeping
55track of a history of the last directory locations the user was in.
56Emacs does provide standard Lisp definitions of `pwd' and `cd', but
57they lack somewhat in feel from the typical shell equivalents."
58 :tag "Directory navigation"
59 :group 'eshell-module)
60
63;;; User Variables: 61;;; User Variables:
64 62
65(defcustom eshell-dirs-load-hook '(eshell-dirs-initialize) 63(defcustom eshell-dirs-load-hook '(eshell-dirs-initialize)
@@ -566,7 +564,7 @@ in the minibuffer:
566 (write-region (point-min) (point-max) file nil 564 (write-region (point-min) (point-max) file nil
567 'no-message)))))))) 565 'no-message))))))))
568 566
569;;; Code: 567(provide 'em-dirs)
570 568
571;;; arch-tag: 1e9c5a95-f1bd-45f8-ad36-55aac706e787 569;;; arch-tag: 1e9c5a95-f1bd-45f8-ad36-55aac706e787
572;;; em-dirs.el ends here 570;;; em-dirs.el ends here
diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el
index 2e95aaefae0..b08ddd77e19 100644
--- a/lisp/eshell/em-glob.el
+++ b/lisp/eshell/em-glob.el
@@ -22,19 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25;;; Code:
26
27(provide 'em-glob)
28
29(eval-when-compile (require 'esh-maint))
30(require 'esh-util)
31
32(defgroup eshell-glob nil
33 "This module provides extended globbing syntax, similar what is used
34by zsh for filename generation."
35 :tag "Extended filename globbing"
36 :group 'eshell-module)
37
38;;; Commentary: 25;;; Commentary:
39 26
40;; The globbing code used by Eshell closely follows the syntax used by 27;; The globbing code used by Eshell closely follows the syntax used by
@@ -63,6 +50,17 @@ by zsh for filename generation."
63;; owned by the user 'johnw'. See [Value modifiers and predicates], 50;; owned by the user 'johnw'. See [Value modifiers and predicates],
64;; for more information about argument predication. 51;; for more information about argument predication.
65 52
53;;; Code:
54
55(eval-when-compile (require 'eshell))
56(require 'esh-util)
57
58(defgroup eshell-glob nil
59 "This module provides extended globbing syntax, similar what is used
60by zsh for filename generation."
61 :tag "Extended filename globbing"
62 :group 'eshell-module)
63
66;;; User Variables: 64;;; User Variables:
67 65
68(defcustom eshell-glob-load-hook '(eshell-glob-initialize) 66(defcustom eshell-glob-load-hook '(eshell-glob-initialize)
@@ -356,5 +354,7 @@ the form:
356 (eshell-glob-entries (car rdirs) globs recurse-p) 354 (eshell-glob-entries (car rdirs) globs recurse-p)
357 (setq rdirs (cdr rdirs))))) 355 (setq rdirs (cdr rdirs)))))
358 356
357(provide 'em-glob)
358
359;;; arch-tag: d0548f54-fb7c-4978-a88e-f7c26f7f68ca 359;;; arch-tag: d0548f54-fb7c-4978-a88e-f7c26f7f68ca
360;;; em-glob.el ends here 360;;; em-glob.el ends here
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index 88e15423956..2dd2b31d34a 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -22,16 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-hist)
26
27(eval-when-compile (require 'esh-maint))
28(require 'eshell)
29
30(defgroup eshell-hist nil
31 "This module provides command history management."
32 :tag "History list management"
33 :group 'eshell-module)
34
35;;; Commentary: 25;;; Commentary:
36 26
37;; Eshell's history facility imitates the syntax used by bash 27;; Eshell's history facility imitates the syntax used by bash
@@ -70,6 +60,12 @@
70(require 'ring) 60(require 'ring)
71(require 'esh-opt) 61(require 'esh-opt)
72(require 'em-pred) 62(require 'em-pred)
63(require 'eshell)
64
65(defgroup eshell-hist nil
66 "This module provides command history management."
67 :tag "History list management"
68 :group 'eshell-module)
73 69
74;;; User Variables: 70;;; User Variables:
75 71
@@ -988,5 +984,7 @@ If N is negative, search backwards for the -Nth previous match."
988 (isearch-done) 984 (isearch-done)
989 (eshell-send-input)) 985 (eshell-send-input))
990 986
987(provide 'em-hist)
988
991;;; arch-tag: 1a847333-f864-4b96-9acd-b549d620b6c6 989;;; arch-tag: 1a847333-f864-4b96-9acd-b549d620b6c6
992;;; em-hist.el ends here 990;;; em-hist.el ends here
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
index d6b4f3aed29..01a6bb87a1f 100644
--- a/lisp/eshell/em-ls.el
+++ b/lisp/eshell/em-ls.el
@@ -22,9 +22,16 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-ls) 25;;; Commentary:
26
27;; Most of the command switches recognized by GNU's ls utility are
28;; supported ([(fileutils)ls invocation]).
26 29
27(eval-when-compile (require 'esh-maint)) 30;;; Code:
31
32(eval-when-compile (require 'eshell))
33(require 'esh-util)
34(require 'esh-opt)
28 35
29(defgroup eshell-ls nil 36(defgroup eshell-ls nil
30 "This module implements the \"ls\" utility fully in Lisp. If it is 37 "This module implements the \"ls\" utility fully in Lisp. If it is
@@ -35,14 +42,6 @@ properties to colorize its output based on the setting of
35 :tag "Implementation of `ls' in Lisp" 42 :tag "Implementation of `ls' in Lisp"
36 :group 'eshell-module) 43 :group 'eshell-module)
37 44
38;;; Commentary:
39
40;; Most of the command switches recognized by GNU's ls utility are
41;; supported ([(fileutils)ls invocation]).
42
43(require 'esh-util)
44(require 'esh-opt)
45
46;;; User Variables: 45;;; User Variables:
47 46
48(defvar eshell-ls-orig-insert-directory 47(defvar eshell-ls-orig-insert-directory
@@ -922,7 +921,7 @@ to use, and each member of which is the width of that column
922 (car file))))) 921 (car file)))))
923 (car file)) 922 (car file))
924 923
925;;; Code: 924(provide 'em-ls)
926 925
927;;; arch-tag: 9295181c-0cb2-499c-999b-89f5359842cb 926;;; arch-tag: 9295181c-0cb2-499c-999b-89f5359842cb
928;;; em-ls.el ends here 927;;; em-ls.el ends here
diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el
index a7f68e4e222..628b8b61143 100644
--- a/lisp/eshell/em-pred.el
+++ b/lisp/eshell/em-pred.el
@@ -22,18 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-pred)
26
27(eval-when-compile (require 'esh-maint))
28
29(defgroup eshell-pred nil
30 "This module allows for predicates to be applied to globbing
31patterns (similar to zsh), in addition to string modifiers which can
32be applied either to globbing results, variable references, or just
33ordinary strings."
34 :tag "Value modifiers and predicates"
35 :group 'eshell-module)
36
37;;; Commentary: 25;;; Commentary:
38 26
39;; Argument predication is used to affect which members of a list are 27;; Argument predication is used to affect which members of a list are
@@ -61,6 +49,16 @@ ordinary strings."
61 49
62;;; Code: 50;;; Code:
63 51
52(eval-when-compile (require 'eshell))
53
54(defgroup eshell-pred nil
55 "This module allows for predicates to be applied to globbing
56patterns (similar to zsh), in addition to string modifiers which can
57be applied either to globbing results, variable references, or just
58ordinary strings."
59 :tag "Value modifiers and predicates"
60 :group 'eshell-module)
61
64;;; User Variables: 62;;; User Variables:
65 63
66(defcustom eshell-pred-load-hook '(eshell-pred-initialize) 64(defcustom eshell-pred-load-hook '(eshell-pred-initialize)
@@ -602,5 +600,7 @@ that 'ls -l' will show in the first column of its display. "
602 (lambda (str) 600 (lambda (str)
603 (split-string str ,sep))) lst)))) 601 (split-string str ,sep))) lst))))
604 602
603(provide 'em-pred)
604
605;;; arch-tag: 8b5ce022-17f3-4c40-93c7-5faafaa63f31 605;;; arch-tag: 8b5ce022-17f3-4c40-93c7-5faafaa63f31
606;;; em-pred.el ends here 606;;; em-pred.el ends here
diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
index ddbf74f5c42..57a1da74177 100644
--- a/lisp/eshell/em-prompt.el
+++ b/lisp/eshell/em-prompt.el
@@ -22,9 +22,14 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-prompt) 25;;; Commentary:
26
27;; Most of the prompt navigation commands of `comint-mode' are
28;; supported, such as C-c C-n, C-c C-p, etc.
29
30;;; Code:
26 31
27(eval-when-compile (require 'esh-maint)) 32(eval-when-compile (require 'eshell))
28 33
29(defgroup eshell-prompt nil 34(defgroup eshell-prompt nil
30 "This module provides command prompts, and navigation between them, 35 "This module provides command prompts, and navigation between them,
@@ -32,11 +37,6 @@ as is common with most shells."
32 :tag "Command prompts" 37 :tag "Command prompts"
33 :group 'eshell-module) 38 :group 'eshell-module)
34 39
35;;; Commentary:
36
37;; Most of the prompt navigation commands of `comint-mode' are
38;; supported, such as C-c C-n, C-c C-p, etc.
39
40;;; User Variables: 40;;; User Variables:
41 41
42(defcustom eshell-prompt-load-hook '(eshell-prompt-initialize) 42(defcustom eshell-prompt-load-hook '(eshell-prompt-initialize)
@@ -173,7 +173,7 @@ If this takes us past the end of the current line, don't skip at all."
173 (<= (match-end 0) eol)) 173 (<= (match-end 0) eol))
174 (goto-char (match-end 0))))) 174 (goto-char (match-end 0)))))
175 175
176;;; Code: 176(provide 'em-prompt)
177 177
178;;; arch-tag: 01c1574b-ce70-4e89-bc38-e6619f61e208 178;;; arch-tag: 01c1574b-ce70-4e89-bc38-e6619f61e208
179;;; em-prompt.el ends here 179;;; em-prompt.el ends here
diff --git a/lisp/eshell/em-rebind.el b/lisp/eshell/em-rebind.el
index 898f0b9d301..b550016fbe1 100644
--- a/lisp/eshell/em-rebind.el
+++ b/lisp/eshell/em-rebind.el
@@ -22,9 +22,11 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-rebind) 25;;; Commentary:
26
27;;; Code:
26 28
27(eval-when-compile (require 'esh-maint)) 29(eval-when-compile (require 'eshell))
28 30
29(defgroup eshell-rebind nil 31(defgroup eshell-rebind nil
30 "This module allows for special keybindings that only take effect 32 "This module allows for special keybindings that only take effect
@@ -39,8 +41,6 @@ the behavior of normal shells while the user editing new input text."
39 :tag "Rebind keys at input" 41 :tag "Rebind keys at input"
40 :group 'eshell-module) 42 :group 'eshell-module)
41 43
42;;; Commentary:
43
44;;; User Variables: 44;;; User Variables:
45 45
46(defcustom eshell-rebind-load-hook '(eshell-rebind-initialize) 46(defcustom eshell-rebind-load-hook '(eshell-rebind-initialize)
@@ -242,7 +242,7 @@ input."
242 (eshell-life-is-too-much))) 242 (eshell-life-is-too-much)))
243 (eshell-delete-backward-char (- arg))))) 243 (eshell-delete-backward-char (- arg)))))
244 244
245;;; Code: 245(provide 'em-rebind)
246 246
247;;; arch-tag: 76d84f12-cc56-4d67-9b7d-c6b44ad20530 247;;; arch-tag: 76d84f12-cc56-4d67-9b7d-c6b44ad20530
248;;; em-rebind.el ends here 248;;; em-rebind.el ends here
diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el
index 50fdc3ccccc..0a83881c03f 100644
--- a/lisp/eshell/em-script.el
+++ b/lisp/eshell/em-script.el
@@ -22,9 +22,9 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-script) 25;;; Commentary:
26 26
27(eval-when-compile (require 'esh-maint)) 27;;; Code:
28 28
29(require 'eshell) 29(require 'eshell)
30 30
@@ -34,8 +34,6 @@ commands, as a script file."
34 :tag "Running script files." 34 :tag "Running script files."
35 :group 'eshell-module) 35 :group 'eshell-module)
36 36
37;;; Commentary:
38
39;;; User Variables: 37;;; User Variables:
40 38
41(defcustom eshell-script-load-hook '(eshell-script-initialize) 39(defcustom eshell-script-load-hook '(eshell-script-initialize)
@@ -137,7 +135,7 @@ environment, binding ARGS to $1, $2, etc.")
137 135
138(put 'eshell/. 'eshell-no-numeric-conversions t) 136(put 'eshell/. 'eshell-no-numeric-conversions t)
139 137
140;;; Code: 138(provide 'em-script)
141 139
142;;; arch-tag: a346439d-5ba8-4faf-ac2b-3aacfeaa4647 140;;; arch-tag: a346439d-5ba8-4faf-ac2b-3aacfeaa4647
143;;; em-script.el ends here 141;;; em-script.el ends here
diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el
index f99a64bd17d..ffb1b4a4d92 100644
--- a/lisp/eshell/em-smart.el
+++ b/lisp/eshell/em-smart.el
@@ -22,21 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-smart)
26
27(eval-when-compile (require 'esh-maint))
28
29(defgroup eshell-smart nil
30 "This module combines the facility of normal, modern shells with
31some of the edit/review concepts inherent in the design of Plan 9's
329term. See the docs for more details.
33
34Most likely you will have to turn this option on and play around with
35it to get a real sense of how it works."
36 :tag "Smart display of output"
37 ;; :link '(info-link "(eshell)Smart display of output")
38 :group 'eshell-module)
39
40;;; Commentary: 25;;; Commentary:
41 26
42;; The best way to get a sense of what this code is trying to do is by 27;; The best way to get a sense of what this code is trying to do is by
@@ -84,6 +69,21 @@ it to get a real sense of how it works."
84;; (such as pwd), where the screen is mostly full, consumption can 69;; (such as pwd), where the screen is mostly full, consumption can
85;; increase by orders of magnitude. 70;; increase by orders of magnitude.
86 71
72;;; Code:
73
74(eval-when-compile (require 'eshell))
75
76(defgroup eshell-smart nil
77 "This module combines the facility of normal, modern shells with
78some of the edit/review concepts inherent in the design of Plan 9's
799term. See the docs for more details.
80
81Most likely you will have to turn this option on and play around with
82it to get a real sense of how it works."
83 :tag "Smart display of output"
84 ;; :link '(info-link "(eshell)Smart display of output")
85 :group 'eshell-module)
86
87;;; User Variables: 87;;; User Variables:
88 88
89(defcustom eshell-smart-load-hook '(eshell-smart-initialize) 89(defcustom eshell-smart-load-hook '(eshell-smart-initialize)
@@ -322,7 +322,7 @@ and the end of the buffer are still visible."
322 (if clear 322 (if clear
323 (remove-hook 'pre-command-hook 'eshell-smart-display-move t)))) 323 (remove-hook 'pre-command-hook 'eshell-smart-display-move t))))
324 324
325;;; Code: 325(provide 'em-smart)
326 326
327;;; arch-tag: 8c0112c7-379c-4d54-9a1c-204d68786a4b 327;;; arch-tag: 8c0112c7-379c-4d54-9a1c-204d68786a4b
328;;; em-smart.el ends here 328;;; em-smart.el ends here
diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el
index 541773a4b5b..6ee698148da 100644
--- a/lisp/eshell/em-term.el
+++ b/lisp/eshell/em-term.el
@@ -22,19 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-term)
26
27(eval-when-compile (require 'esh-maint))
28
29(defgroup eshell-term nil
30 "This module causes visual commands (e.g., 'vi') to be executed by
31the `term' package, which comes with Emacs. This package handles most
32of the ANSI control codes, allowing curses-based applications to run
33within an Emacs window. The variable `eshell-visual-commands' defines
34which commands are considered visual in nature."
35 :tag "Running visual commands"
36 :group 'eshell-module)
37
38;;; Commentary: 25;;; Commentary:
39 26
40;; At the moment, eshell is stream-based in its interactive input and 27;; At the moment, eshell is stream-based in its interactive input and
@@ -45,8 +32,20 @@ which commands are considered visual in nature."
45;; buffer, giving the illusion that Eshell itself is allowing these 32;; buffer, giving the illusion that Eshell itself is allowing these
46;; visual processes to execute. 33;; visual processes to execute.
47 34
35;;; Code:
36
37(eval-when-compile (require 'eshell))
48(require 'term) 38(require 'term)
49 39
40(defgroup eshell-term nil
41 "This module causes visual commands (e.g., 'vi') to be executed by
42the `term' package, which comes with Emacs. This package handles most
43of the ANSI control codes, allowing curses-based applications to run
44within an Emacs window. The variable `eshell-visual-commands' defines
45which commands are considered visual in nature."
46 :tag "Running visual commands"
47 :group 'eshell-module)
48
50;;; User Variables: 49;;; User Variables:
51 50
52(defcustom eshell-term-load-hook '(eshell-term-initialize) 51(defcustom eshell-term-load-hook '(eshell-term-initialize)
@@ -264,7 +263,7 @@ allowed."
264; "Switch to line (\"cooked\") sub-mode of eshell-term mode." 263; "Switch to line (\"cooked\") sub-mode of eshell-term mode."
265; (use-local-map term-old-mode-map)) 264; (use-local-map term-old-mode-map))
266 265
267;;; Code: 266(provide 'em-term)
268 267
269;;; arch-tag: ab7c8fe4-3101-4257-925b-1354c6b2fe9d 268;;; arch-tag: ab7c8fe4-3101-4257-925b-1354c6b2fe9d
270;;; em-term.el ends here 269;;; em-term.el ends here
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index 33514d515af..e970c87f501 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -22,9 +22,22 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-unix) 25;;; Commentary:
26
27;; This file contains implementations of several UNIX command in Emacs
28;; Lisp, for several reasons:
29;;
30;; 1) it makes them available on all platforms where the Lisp
31;; functions used are available
32;;
33;; 2) it makes their functionality accessible and modified by the
34;; Lisp programmer.
35;;
36;; 3) it allows Eshell to refrain from having to invoke external
37;; processes for common operations.
38
39;;; Code:
26 40
27(eval-when-compile (require 'esh-maint))
28(require 'eshell) 41(require 'eshell)
29 42
30(defgroup eshell-unix nil 43(defgroup eshell-unix nil
@@ -40,20 +53,6 @@ by name)."
40 :tag "UNIX commands in Lisp" 53 :tag "UNIX commands in Lisp"
41 :group 'eshell-module) 54 :group 'eshell-module)
42 55
43;;; Commentary:
44
45;; This file contains implementations of several UNIX command in Emacs
46;; Lisp, for several reasons:
47;;
48;; 1) it makes them available on all platforms where the Lisp
49;; functions used are available
50;;
51;; 2) it makes their functionality accessible and modified by the
52;; Lisp programmer.
53;;
54;; 3) it allows Eshell to refrain from having to invoke external
55;; processes for common operations.
56
57(defcustom eshell-unix-load-hook '(eshell-unix-initialize) 56(defcustom eshell-unix-load-hook '(eshell-unix-initialize)
58 "*A list of functions to run when `eshell-unix' is loaded." 57 "*A list of functions to run when `eshell-unix' is loaded."
59 :type 'hook 58 :type 'hook
@@ -78,7 +77,7 @@ receiving side of a command pipeline."
78 :type 'boolean 77 :type 'boolean
79 :group 'eshell-unix) 78 :group 'eshell-unix)
80 79
81(defcustom eshell-plain-locate-behavior (eshell-under-xemacs-p) 80(defcustom eshell-plain-locate-behavior (featurep 'xemacs)
82 "*If non-nil, standalone \"locate\" commands will behave normally. 81 "*If non-nil, standalone \"locate\" commands will behave normally.
83Standalone in this context means not redirected, and not on the 82Standalone in this context means not redirected, and not on the
84receiving side of a command pipeline." 83receiving side of a command pipeline."
@@ -137,8 +136,6 @@ Otherwise, Emacs will attempt to use rsh to invoke du on the remote machine."
137 :type 'boolean 136 :type 'boolean
138 :group 'eshell-unix) 137 :group 'eshell-unix)
139 138
140(require 'esh-opt)
141
142;;; Functions: 139;;; Functions:
143 140
144(defun eshell-unix-initialize () 141(defun eshell-unix-initialize ()
@@ -169,7 +166,7 @@ Otherwise, Emacs will attempt to use rsh to invoke du on the remote machine."
169(put 'eshell/man 'eshell-no-numeric-conversions t) 166(put 'eshell/man 'eshell-no-numeric-conversions t)
170 167
171(defun eshell/info (&rest args) 168(defun eshell/info (&rest args)
172 "Runs the info command in-frame with the same behaviour as command-line `info', ie: 169 "Run the info command in-frame with the same behavior as command-line `info', ie:
173 'info' => goes to top info window 170 'info' => goes to top info window
174 'info arg1' => IF arg1 is a file, then visits arg1 171 'info arg1' => IF arg1 is a file, then visits arg1
175 'info arg1' => OTHERWISE goes to top info window and then menu item arg1 172 'info arg1' => OTHERWISE goes to top info window and then menu item arg1
@@ -1050,7 +1047,7 @@ Show wall-clock time elapsed during execution of COMMAND.")
1050 1047
1051(put 'eshell/occur 'eshell-no-numeric-conversions t) 1048(put 'eshell/occur 'eshell-no-numeric-conversions t)
1052 1049
1053;;; Code: 1050(provide 'em-unix)
1054 1051
1055;;; arch-tag: 2462edd2-a76a-4cf2-897d-92e9a82ac1c9 1052;;; arch-tag: 2462edd2-a76a-4cf2-897d-92e9a82ac1c9
1056;;; em-unix.el ends here 1053;;; em-unix.el ends here
diff --git a/lisp/eshell/em-xtra.el b/lisp/eshell/em-xtra.el
index bd48afb6bd6..f0a92eb0c60 100644
--- a/lisp/eshell/em-xtra.el
+++ b/lisp/eshell/em-xtra.el
@@ -22,9 +22,14 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'em-xtra) 25;;; Commentary:
26
27;;; Code:
26 28
27(eval-when-compile (require 'esh-maint)) 29(eval-when-compile
30 (require 'eshell)
31 (require 'pcomplete))
32(require 'compile)
28 33
29(defgroup eshell-xtra nil 34(defgroup eshell-xtra nil
30 "This module defines some extra alias functions which are entirely 35 "This module defines some extra alias functions which are entirely
@@ -34,10 +39,6 @@ naturally accessible within Emacs."
34 :tag "Extra alias functions" 39 :tag "Extra alias functions"
35 :group 'eshell-module) 40 :group 'eshell-module)
36 41
37;;; Commentary:
38
39(require 'compile)
40
41;;; Functions: 42;;; Functions:
42 43
43(defun eshell/expr (&rest args) 44(defun eshell/expr (&rest args)
@@ -117,7 +118,7 @@ naturally accessible within Emacs."
117 118
118(defalias 'pcomplete/bcc 'pcomplete/bcc32) 119(defalias 'pcomplete/bcc 'pcomplete/bcc32)
119 120
120;;; Code: 121(provide 'em-xtra)
121 122
122;;; arch-tag: f944cfda-a118-470c-a0d6-b41a3a5c99c7 123;;; arch-tag: f944cfda-a118-470c-a0d6-b41a3a5c99c7
123;;; em-xtra.el ends here 124;;; em-xtra.el ends here
diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el
index 011e2a55520..7db152d3604 100644
--- a/lisp/eshell/esh-arg.el
+++ b/lisp/eshell/esh-arg.el
@@ -22,9 +22,15 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25;;; Commentary:
26
27;; Parsing of arguments can be extended by adding functions to the
28;; hook `eshell-parse-argument-hook'. For a good example of this, see
29;; `eshell-parse-drive-letter', defined in eshell-dirs.el.
30
25(provide 'esh-arg) 31(provide 'esh-arg)
26 32
27(eval-when-compile (require 'esh-maint)) 33(eval-when-compile (require 'eshell))
28 34
29(defgroup eshell-arg nil 35(defgroup eshell-arg nil
30 "Argument parsing involves transforming the arguments passed on the 36 "Argument parsing involves transforming the arguments passed on the
@@ -33,12 +39,6 @@ yield the values intended."
33 :tag "Argument parsing" 39 :tag "Argument parsing"
34 :group 'eshell) 40 :group 'eshell)
35 41
36;;; Commentary:
37
38;; Parsing of arguments can be extended by adding functions to the
39;; hook `eshell-parse-argument-hook'. For a good example of this, see
40;; `eshell-parse-drive-letter', defined in eshell-dirs.el.
41
42(defcustom eshell-parse-argument-hook 42(defcustom eshell-parse-argument-hook
43 (list 43 (list
44 ;; a term such as #<buffer NAME>, or #<process NAME> is a buffer 44 ;; a term such as #<buffer NAME>, or #<process NAME> is a buffer
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index f999bdcdf6d..247d6c74604 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -22,18 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'esh-cmd)
26
27(eval-when-compile (require 'esh-maint))
28
29(defgroup eshell-cmd nil
30 "Executing an Eshell command is as simple as typing it in and
31pressing <RET>. There are several different kinds of commands,
32however."
33 :tag "Command invocation"
34 ;; :link '(info-link "(eshell)Command invocation")
35 :group 'eshell)
36
37;;; Commentary: 25;;; Commentary:
38 26
39;;;_* Invoking external commands 27;;;_* Invoking external commands
@@ -64,11 +52,6 @@ however."
64;; functions always take precedence, set 52;; functions always take precedence, set
65;; `eshell-prefer-lisp-functions' to t. 53;; `eshell-prefer-lisp-functions' to t.
66 54
67(defcustom eshell-prefer-lisp-functions nil
68 "*If non-nil, prefer Lisp functions to external commands."
69 :type 'boolean
70 :group 'eshell-cmd)
71
72;;;_* Alias functions 55;;;_* Alias functions
73;; 56;;
74;; Whenever a command is specified using a simple name, such as 'ls', 57;; Whenever a command is specified using a simple name, such as 'ls',
@@ -112,17 +95,44 @@ however."
112;; 95;;
113;; Lisp arguments are identified using the following regexp: 96;; Lisp arguments are identified using the following regexp:
114 97
98;;;_* Command hooks
99;;
100;; There are several hooks involved with command execution, which can
101;; be used either to change or augment Eshell's behavior.
102
103
104;;; Code:
105
106(require 'esh-util)
107(unless (featurep 'xemacs)
108 (require 'eldoc))
109(require 'esh-arg)
110(require 'esh-proc)
111(require 'esh-ext)
112
113(eval-when-compile
114 (require 'pcomplete))
115
116
117(defgroup eshell-cmd nil
118 "Executing an Eshell command is as simple as typing it in and
119pressing <RET>. There are several different kinds of commands,
120however."
121 :tag "Command invocation"
122 ;; :link '(info-link "(eshell)Command invocation")
123 :group 'eshell)
124
125(defcustom eshell-prefer-lisp-functions nil
126 "*If non-nil, prefer Lisp functions to external commands."
127 :type 'boolean
128 :group 'eshell-cmd)
129
115(defcustom eshell-lisp-regexp "\\([(`]\\|#'\\)" 130(defcustom eshell-lisp-regexp "\\([(`]\\|#'\\)"
116 "*A regexp which, if matched at beginning of an argument, means Lisp. 131 "*A regexp which, if matched at beginning of an argument, means Lisp.
117Such arguments will be passed to `read', and then evaluated." 132Such arguments will be passed to `read', and then evaluated."
118 :type 'regexp 133 :type 'regexp
119 :group 'eshell-cmd) 134 :group 'eshell-cmd)
120 135
121;;;_* Command hooks
122;;
123;; There are several hooks involved with command execution, which can
124;; be used either to change or augment Eshell's behavior.
125
126(defcustom eshell-pre-command-hook nil 136(defcustom eshell-pre-command-hook nil
127 "*A hook run before each interactive command is invoked." 137 "*A hook run before each interactive command is invoked."
128 :type 'hook 138 :type 'hook
@@ -219,15 +229,6 @@ return non-nil if the command is complex."
219 (function :tag "Predicate"))) 229 (function :tag "Predicate")))
220 :group 'eshell-cmd) 230 :group 'eshell-cmd)
221 231
222;;; Code:
223
224(require 'esh-util)
225(unless (eshell-under-xemacs-p)
226 (require 'eldoc))
227(require 'esh-arg)
228(require 'esh-proc)
229(require 'esh-ext)
230
231;;; User Variables: 232;;; User Variables:
232 233
233(defcustom eshell-cmd-load-hook '(eshell-cmd-initialize) 234(defcustom eshell-cmd-load-hook '(eshell-cmd-initialize)
@@ -394,6 +395,18 @@ hooks should be run before and after the command."
394 (list 'eshell-commands commands) 395 (list 'eshell-commands commands)
395 commands))) 396 commands)))
396 397
398(defun eshell-debug-command (tag subform)
399 "Output a debugging message to '*eshell last cmd*'."
400 (let ((buf (get-buffer-create "*eshell last cmd*"))
401 (text (eshell-stringify eshell-current-command)))
402 (save-excursion
403 (set-buffer buf)
404 (if (not tag)
405 (erase-buffer)
406 (insert "\n\C-l\n" tag "\n\n" text
407 (if subform
408 (concat "\n\n" (eshell-stringify subform)) ""))))))
409
397(defun eshell-debug-show-parsed-args (terms) 410(defun eshell-debug-show-parsed-args (terms)
398 "Display parsed arguments in the debug buffer." 411 "Display parsed arguments in the debug buffer."
399 (ignore 412 (ignore
@@ -956,18 +969,6 @@ at the moment are:
956 "Completion for the `debug' command." 969 "Completion for the `debug' command."
957 (while (pcomplete-here '("errors" "commands")))) 970 (while (pcomplete-here '("errors" "commands"))))
958 971
959(defun eshell-debug-command (tag subform)
960 "Output a debugging message to '*eshell last cmd*'."
961 (let ((buf (get-buffer-create "*eshell last cmd*"))
962 (text (eshell-stringify eshell-current-command)))
963 (save-excursion
964 (set-buffer buf)
965 (if (not tag)
966 (erase-buffer)
967 (insert "\n\C-l\n" tag "\n\n" text
968 (if subform
969 (concat "\n\n" (eshell-stringify subform)) ""))))))
970
971(defun eshell-invoke-directly (command input) 972(defun eshell-invoke-directly (command input)
972 (let ((base (cadr (nth 2 (nth 2 (cadr command))))) name) 973 (let ((base (cadr (nth 2 (nth 2 (cadr command))))) name)
973 (if (and (eq (car base) 'eshell-trap-errors) 974 (if (and (eq (car base) 'eshell-trap-errors)
@@ -1418,5 +1419,7 @@ messages, and errors."
1418 1419
1419(defalias 'eshell-lisp-command* 'eshell-lisp-command) 1420(defalias 'eshell-lisp-command* 'eshell-lisp-command)
1420 1421
1422(provide 'esh-cmd)
1423
1421;;; arch-tag: 8e4f3867-a0c5-441f-96ba-ddd142d94366 1424;;; arch-tag: 8e4f3867-a0c5-441f-96ba-ddd142d94366
1422;;; esh-cmd.el ends here 1425;;; esh-cmd.el ends here
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el
index 11090f97b83..b3fc5c30bbe 100644
--- a/lisp/eshell/esh-ext.el
+++ b/lisp/eshell/esh-ext.el
@@ -22,17 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'esh-ext)
26
27(eval-when-compile (require 'esh-maint))
28(require 'esh-util)
29
30(defgroup eshell-ext nil
31 "External commands are invoked when operating system executables are
32loaded into memory, thus beginning a new process."
33 :tag "External commands"
34 :group 'eshell)
35
36;;; Commentary: 25;;; Commentary:
37 26
38;; To force a command to invoked external, either provide an explicit 27;; To force a command to invoked external, either provide an explicit
@@ -43,6 +32,18 @@ loaded into memory, thus beginning a new process."
43;; /bin/grep ; will definitely invoke /bin/grep 32;; /bin/grep ; will definitely invoke /bin/grep
44;; *grep ; will also invoke /bin/grep 33;; *grep ; will also invoke /bin/grep
45 34
35(provide 'esh-ext)
36
37(eval-when-compile
38 (require 'esh-cmd))
39(require 'esh-util)
40
41(defgroup eshell-ext nil
42 "External commands are invoked when operating system executables are
43loaded into memory, thus beginning a new process."
44 :tag "External commands"
45 :group 'eshell)
46
46;;; User Variables: 47;;; User Variables:
47 48
48(defcustom eshell-ext-load-hook '(eshell-ext-initialize) 49(defcustom eshell-ext-load-hook '(eshell-ext-initialize)
@@ -211,7 +212,7 @@ causing the user to wonder if anything's really going on..."
211 (find-file-name-handler default-directory 212 (find-file-name-handler default-directory
212 'shell-command)))) 213 'shell-command))))
213 (if (and handler 214 (if (and handler
214 (not (and (eshell-under-xemacs-p) 215 (not (and (featurep 'xemacs)
215 (eq handler 'dired-handler-fn)))) 216 (eq handler 'dired-handler-fn))))
216 (eshell-remote-command handler command args)) 217 (eshell-remote-command handler command args))
217 (let ((interp (eshell-find-interpreter command))) 218 (let ((interp (eshell-find-interpreter command)))
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index 897f9942d47..15a4af86346 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -22,17 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'esh-io)
26
27(eval-when-compile (require 'esh-maint))
28
29(defgroup eshell-io nil
30 "Eshell's I/O management code provides a scheme for treating many
31different kinds of objects -- symbols, files, buffers, etc. -- as
32though they were files."
33 :tag "I/O management"
34 :group 'eshell)
35
36;;; Commentary: 25;;; Commentary:
37 26
38;; At the moment, only output redirection is supported in Eshell. To 27;; At the moment, only output redirection is supported in Eshell. To
@@ -68,6 +57,17 @@ though they were files."
68;; (+ 1 2) > a > b > c ; prints number to all three files 57;; (+ 1 2) > a > b > c ; prints number to all three files
69;; (+ 1 2) > a | wc ; prints to 'a', and pipes to 'wc' 58;; (+ 1 2) > a | wc ; prints to 'a', and pipes to 'wc'
70 59
60(provide 'esh-io)
61
62(eval-when-compile (require 'eshell))
63
64(defgroup eshell-io nil
65 "Eshell's I/O management code provides a scheme for treating many
66different kinds of objects -- symbols, files, buffers, etc. -- as
67though they were files."
68 :tag "I/O management"
69 :group 'eshell)
70
71;;; User Variables: 71;;; User Variables:
72 72
73(defcustom eshell-io-load-hook '(eshell-io-initialize) 73(defcustom eshell-io-load-hook '(eshell-io-initialize)
@@ -417,6 +417,10 @@ it defaults to `insert'."
417(defvar eshell-print-queue nil) 417(defvar eshell-print-queue nil)
418(defvar eshell-print-queue-count -1) 418(defvar eshell-print-queue-count -1)
419 419
420(defsubst eshell-print (object)
421 "Output OBJECT to the standard output handle."
422 (eshell-output-object object eshell-output-handle))
423
420(defun eshell-flush (&optional reset-p) 424(defun eshell-flush (&optional reset-p)
421 "Flush out any lines that have been queued for printing. 425 "Flush out any lines that have been queued for printing.
422Must be called before printing begins with -1 as its argument, and 426Must be called before printing begins with -1 as its argument, and
@@ -445,10 +449,6 @@ after all printing is over with no argument."
445 (concat eshell-print-queue (apply 'concat strings)) 449 (concat eshell-print-queue (apply 'concat strings))
446 eshell-print-queue-count (1+ eshell-print-queue-count)))) 450 eshell-print-queue-count (1+ eshell-print-queue-count))))
447 451
448(defsubst eshell-print (object)
449 "Output OBJECT to the standard output handle."
450 (eshell-output-object object eshell-output-handle))
451
452(defsubst eshell-error (object) 452(defsubst eshell-error (object)
453 "Output OBJECT to the standard error handle." 453 "Output OBJECT to the standard error handle."
454 (eshell-output-object object eshell-error-handle)) 454 (eshell-output-object object eshell-error-handle))
diff --git a/lisp/eshell/esh-maint.el b/lisp/eshell/esh-maint.el
index 61a4ef9510d..3398014ff55 100644
--- a/lisp/eshell/esh-maint.el
+++ b/lisp/eshell/esh-maint.el
@@ -26,6 +26,8 @@
26 26
27;;; Code: 27;;; Code:
28 28
29;; This cannot be moved to the end of the file without causing a
30;; recursive require during bootstrap.
29(provide 'esh-maint) 31(provide 'esh-maint)
30 32
31(and (fboundp 'font-lock-add-keywords) 33(and (fboundp 'font-lock-add-keywords)
@@ -35,11 +37,7 @@
35 ("(eshell-deftest\\>" . font-lock-keyword-face) 37 ("(eshell-deftest\\>" . font-lock-keyword-face)
36 ("(eshell-condition-case\\>" . font-lock-keyword-face)))) 38 ("(eshell-condition-case\\>" . font-lock-keyword-face))))
37 39
38(if (file-directory-p "../pcomplete") 40(require 'pcomplete nil t) ; why?
39 (add-to-list 'load-path "../pcomplete"))
40
41(if (locate-library "pcomplete")
42 (require 'pcomplete))
43 41
44(eval-when-compile 42(eval-when-compile
45 (require 'cl) 43 (require 'cl)
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 8b7338f8833..eb618f6b6b8 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -22,15 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'esh-mode)
26
27(eval-when-compile (require 'esh-maint))
28
29(defgroup eshell-mode nil
30 "This module contains code for handling input from the user."
31 :tag "User interface"
32 :group 'eshell)
33
34;;; Commentary: 25;;; Commentary:
35 26
36;; Basically, Eshell is used just like shell mode (<M-x shell>). The 27;; Basically, Eshell is used just like shell mode (<M-x shell>). The
@@ -68,11 +59,19 @@
68;; 59;;
69;; @ <C-c C-b> will move backward a complete shell argument. 60;; @ <C-c C-b> will move backward a complete shell argument.
70 61
62(provide 'esh-mode)
63
64(eval-when-compile (require 'esh-util))
71(require 'esh-module) 65(require 'esh-module)
72(require 'esh-cmd) 66(require 'esh-cmd)
73(require 'esh-io) 67(require 'esh-io)
74(require 'esh-var) 68(require 'esh-var)
75 69
70(defgroup eshell-mode nil
71 "This module contains code for handling input from the user."
72 :tag "User interface"
73 :group 'eshell)
74
76;;; User Variables: 75;;; User Variables:
77 76
78(defcustom eshell-mode-unload-hook nil 77(defcustom eshell-mode-unload-hook nil
@@ -222,11 +221,6 @@ This is used by `eshell-watch-for-password-prompt'."
222 221
223(define-abbrev-table 'eshell-mode-abbrev-table ()) 222(define-abbrev-table 'eshell-mode-abbrev-table ())
224 223
225(eval-when-compile
226 (unless (eshell-under-xemacs-p)
227 (defalias 'characterp 'ignore)
228 (defalias 'char-int 'ignore)))
229
230(if (not eshell-mode-syntax-table) 224(if (not eshell-mode-syntax-table)
231 (let ((i 0)) 225 (let ((i 0))
232 (setq eshell-mode-syntax-table (make-syntax-table)) 226 (setq eshell-mode-syntax-table (make-syntax-table))
@@ -269,7 +263,7 @@ This is used by `eshell-watch-for-password-prompt'."
269 (modify-syntax-entry ?\[ "(] " eshell-mode-syntax-table) 263 (modify-syntax-entry ?\[ "(] " eshell-mode-syntax-table)
270 (modify-syntax-entry ?\] ")[ " eshell-mode-syntax-table) 264 (modify-syntax-entry ?\] ")[ " eshell-mode-syntax-table)
271 ;; All non-word multibyte characters should be `symbol'. 265 ;; All non-word multibyte characters should be `symbol'.
272 (if (eshell-under-xemacs-p) 266 (if (featurep 'xemacs)
273 (map-char-table 267 (map-char-table
274 (function 268 (function
275 (lambda (key val) 269 (lambda (key val)
@@ -470,7 +464,7 @@ This is used by `eshell-watch-for-password-prompt'."
470 464
471(eshell-deftest mode command-running-p 465(eshell-deftest mode command-running-p
472 "Modeline shows no command running" 466 "Modeline shows no command running"
473 (or (eshell-under-xemacs-p) 467 (or (featurep 'xemacs)
474 (not eshell-status-in-modeline) 468 (not eshell-status-in-modeline)
475 (and (memq 'eshell-command-running-string mode-line-format) 469 (and (memq 'eshell-command-running-string mode-line-format)
476 (equal eshell-command-running-string "--")))) 470 (equal eshell-command-running-string "--"))))
diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el
index 17067197909..cf9c2595a87 100644
--- a/lisp/eshell/esh-module.el
+++ b/lisp/eshell/esh-module.el
@@ -23,11 +23,15 @@
23;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 23;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24;; Boston, MA 02110-1301, USA. 24;; Boston, MA 02110-1301, USA.
25 25
26;;; Code:
27
26(provide 'esh-module) 28(provide 'esh-module)
27 29
28(eval-when-compile 30(eval-when-compile
29 (require 'esh-maint) 31 (require 'cl)
30 (require 'cl)) 32 (require 'esh-util))
33
34(require 'esh-util)
31 35
32(defgroup eshell-module nil 36(defgroup eshell-module nil
33 "The `eshell-module' group is for Eshell extension modules, which 37 "The `eshell-module' group is for Eshell extension modules, which
@@ -36,10 +40,7 @@ customizing the variable `eshell-modules-list'."
36 :tag "Extension modules" 40 :tag "Extension modules"
37 :group 'eshell) 41 :group 'eshell)
38 42
39;;; Commentary: 43(eval-and-compile
40
41(require 'esh-util)
42
43(defun eshell-load-defgroups (&optional directory) 44(defun eshell-load-defgroups (&optional directory)
44 "Load `defgroup' statements from Eshell's module files." 45 "Load `defgroup' statements from Eshell's module files."
45 (let ((vc-handled-backends nil)) ; avoid VC fucking things up 46 (let ((vc-handled-backends nil)) ; avoid VC fucking things up
@@ -68,7 +69,9 @@ customizing the variable `eshell-modules-list'."
68 (if defgroup 69 (if defgroup
69 (insert defgroup "\n\n"))) 70 (insert defgroup "\n\n")))
70 (setq files (cdr files)))) 71 (setq files (cdr files))))
71 (save-buffer)))) 72 ;; Don't make backups, to avoid prompting the user if there are
73 ;; excess backup versions.
74 (save-buffer 0)))))
72 75
73;; load the defgroup's for the standard extension modules, so that 76;; load the defgroup's for the standard extension modules, so that
74;; documentation can be provided when the user customize's 77;; documentation can be provided when the user customize's
diff --git a/lisp/eshell/esh-opt.el b/lisp/eshell/esh-opt.el
index 66310895131..ec2279dff29 100644
--- a/lisp/eshell/esh-opt.el
+++ b/lisp/eshell/esh-opt.el
@@ -22,9 +22,11 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25;;; Commentary:
26
25(provide 'esh-opt) 27(provide 'esh-opt)
26 28
27(eval-when-compile (require 'esh-maint)) 29(eval-when-compile (require 'esh-ext))
28 30
29(defgroup eshell-opt nil 31(defgroup eshell-opt nil
30 "The options processing code handles command argument parsing for 32 "The options processing code handles command argument parsing for
@@ -32,8 +34,6 @@ Eshell commands implemented in Lisp."
32 :tag "Command options processing" 34 :tag "Command options processing"
33 :group 'eshell) 35 :group 'eshell)
34 36
35;;; Commentary:
36
37;;; User Functions: 37;;; User Functions:
38 38
39(defmacro eshell-eval-using-options (name macro-args 39(defmacro eshell-eval-using-options (name macro-args
diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el
index 7338756e3f8..c679ea7440a 100644
--- a/lisp/eshell/esh-proc.el
+++ b/lisp/eshell/esh-proc.el
@@ -22,9 +22,13 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25;;; Commentary:
26
25(provide 'esh-proc) 27(provide 'esh-proc)
26 28
27(eval-when-compile (require 'esh-maint)) 29(eval-when-compile
30 (require 'eshell)
31 (require 'esh-util))
28 32
29(defgroup eshell-proc nil 33(defgroup eshell-proc nil
30 "When Eshell invokes external commands, it always does so 34 "When Eshell invokes external commands, it always does so
@@ -33,8 +37,6 @@ finish."
33 :tag "Process management" 37 :tag "Process management"
34 :group 'eshell) 38 :group 'eshell)
35 39
36;;; Commentary:
37
38;;; User Variables: 40;;; User Variables:
39 41
40(defcustom eshell-proc-load-hook '(eshell-proc-initialize) 42(defcustom eshell-proc-load-hook '(eshell-proc-initialize)
diff --git a/lisp/eshell/esh-test.el b/lisp/eshell/esh-test.el
index b4d65fa1f5e..a8e029b629c 100644
--- a/lisp/eshell/esh-test.el
+++ b/lisp/eshell/esh-test.el
@@ -22,15 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'esh-test)
26
27(eval-when-compile (require 'esh-maint))
28
29(defgroup eshell-test nil
30 "This module is meant to ensure that Eshell is working correctly."
31 :tag "Eshell test suite"
32 :group 'eshell)
33
34;;; Commentary: 25;;; Commentary:
35 26
36;; The purpose of this module is to verify that Eshell works as 27;; The purpose of this module is to verify that Eshell works as
@@ -39,8 +30,16 @@
39 30
40;;; Code: 31;;; Code:
41 32
33(eval-when-compile
34 (require 'eshell)
35 (require 'esh-util))
42(require 'esh-mode) 36(require 'esh-mode)
43 37
38(defgroup eshell-test nil
39 "This module is meant to ensure that Eshell is working correctly."
40 :tag "Eshell test suite"
41 :group 'eshell)
42
44;;; User Variables: 43;;; User Variables:
45 44
46(defface eshell-test-ok 45(defface eshell-test-ok
@@ -236,5 +235,7 @@
236 "\n")))) 235 "\n"))))
237 nil t)) 236 nil t))
238 237
238(provide 'esh-test)
239
239;;; arch-tag: 6e32275a-8285-4a4e-b7cf-819aa7c86b8e 240;;; arch-tag: 6e32275a-8285-4a4e-b7cf-819aa7c86b8e
240;;; esh-test.el ends here 241;;; esh-test.el ends here
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 25afdc38506..50243e76032 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -22,19 +22,15 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'esh-util) 25;;; Commentary:
26 26
27(eval-when-compile (require 'esh-maint)) 27;;; Code:
28 28
29(defgroup eshell-util nil 29(defgroup eshell-util nil
30 "This is general utility code, meant for use by Eshell itself." 30 "This is general utility code, meant for use by Eshell itself."
31 :tag "General utilities" 31 :tag "General utilities"
32 :group 'eshell) 32 :group 'eshell)
33 33
34;;; Commentary:
35
36(require 'pp)
37
38;;; User Variables: 34;;; User Variables:
39 35
40(defcustom eshell-stringify-t t 36(defcustom eshell-stringify-t t
@@ -139,10 +135,6 @@ function `string-to-number'."
139 135
140;;; Functions: 136;;; Functions:
141 137
142(defsubst eshell-under-xemacs-p ()
143 "Return non-nil if we are running under XEmacs."
144 (boundp 'xemacs-logo))
145
146(defsubst eshell-under-windows-p () 138(defsubst eshell-under-windows-p ()
147 "Return non-nil if we are running under MS-DOS/Windows." 139 "Return non-nil if we are running under MS-DOS/Windows."
148 (memq system-type '(ms-dos windows-nt))) 140 (memq system-type '(ms-dos windows-nt)))
@@ -433,7 +425,9 @@ list."
433 ;; "args out of range" error in `sit-for', if this function 425 ;; "args out of range" error in `sit-for', if this function
434 ;; runs while point is in the minibuffer and the users attempt 426 ;; runs while point is in the minibuffer and the users attempt
435 ;; to use completion. Don't ask me. 427 ;; to use completion. Don't ask me.
436 (ignore-errors (sit-for 0 0))) 428 (condition-case nil
429 (sit-for 0 0)
430 (error nil)))
437 431
438(defun eshell-read-passwd-file (file) 432(defun eshell-read-passwd-file (file)
439 "Return an alist correlating gids to group names in FILE." 433 "Return an alist correlating gids to group names in FILE."
@@ -636,7 +630,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
636 (autoload 'parse-time-string "parse-time")) 630 (autoload 'parse-time-string "parse-time"))
637 631
638(eval-when-compile 632(eval-when-compile
639 (load "ange-ftp" t)) 633 (require 'ange-ftp nil t))
640 634
641(defun eshell-parse-ange-ls (dir) 635(defun eshell-parse-ange-ls (dir)
642 (let (entry) 636 (let (entry)
@@ -785,7 +779,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
785; (or result 779; (or result
786; (file-attributes filename)))) 780; (file-attributes filename))))
787 781
788;;; Code: 782(provide 'esh-util)
789 783
790;;; arch-tag: 70159778-5c7a-480a-bae4-3ad332fca19d 784;;; arch-tag: 70159778-5c7a-480a-bae4-3ad332fca19d
791;;; esh-util.el ends here 785;;; esh-util.el ends here
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index 7c04b5a942a..dbc8802a9c5 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -22,18 +22,6 @@
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25(provide 'esh-var)
26
27(eval-when-compile (require 'esh-maint))
28
29(defgroup eshell-var nil
30 "Variable interpolation is introduced whenever the '$' character
31appears unquoted in any argument (except when that argument is
32surrounded by single quotes). It may be used to interpolate a
33variable value, a subcommand, or even the result of a Lisp form."
34 :tag "Variable handling"
35 :group 'eshell)
36
37;;; Commentary: 25;;; Commentary:
38 26
39;; These are the possible variable interpolation syntaxes. Also keep 27;; These are the possible variable interpolation syntaxes. Also keep
@@ -118,9 +106,25 @@ variable value, a subcommand, or even the result of a Lisp form."
118;; contains the exit code of the last command (0 or 1 for Lisp 106;; contains the exit code of the last command (0 or 1 for Lisp
119;; functions, based on successful completion). 107;; functions, based on successful completion).
120 108
109(provide 'esh-var)
110
111(eval-when-compile
112 (require 'pcomplete)
113 (require 'esh-test)
114 (require 'esh-util)
115 (require 'esh-opt)
116 (require 'esh-mode))
121(require 'env) 117(require 'env)
122(require 'ring) 118(require 'ring)
123 119
120(defgroup eshell-var nil
121 "Variable interpolation is introduced whenever the '$' character
122appears unquoted in any argument (except when that argument is
123surrounded by single quotes). It may be used to interpolate a
124variable value, a subcommand, or even the result of a Lisp form."
125 :tag "Variable handling"
126 :group 'eshell)
127
124;;; User Variables: 128;;; User Variables:
125 129
126(defcustom eshell-var-load-hook '(eshell-var-initialize) 130(defcustom eshell-var-load-hook '(eshell-var-initialize)
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index 23e36149174..58bc72a3ea9 100644
--- a/lisp/eshell/eshell.el
+++ b/lisp/eshell/eshell.el
@@ -24,21 +24,6 @@
24;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 24;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25;; Boston, MA 02110-1301, USA. 25;; Boston, MA 02110-1301, USA.
26 26
27(provide 'eshell)
28
29(eval-when-compile (require 'esh-maint))
30
31(defgroup eshell nil
32 "Eshell is a command shell implemented entirely in Emacs Lisp. It
33invokes no external processes beyond those requested by the user. It
34is intended to be a functional replacement for command shells such as
35bash, zsh, rc, 4dos; since Emacs itself is capable of handling most of
36the tasks accomplished by such tools."
37 :tag "The Emacs shell"
38 :link '(info-link "(eshell)Top")
39 :version "21.1"
40 :group 'applications)
41
42;;; Commentary: 27;;; Commentary:
43 28
44;;;_* What does Eshell offer you? 29;;;_* What does Eshell offer you?
@@ -73,33 +58,9 @@ the tasks accomplished by such tools."
73;; @ Alias functions, both Lisp and Eshell-syntax 58;; @ Alias functions, both Lisp and Eshell-syntax
74;; @ Piping, sequenced commands, background jobs, etc... 59;; @ Piping, sequenced commands, background jobs, etc...
75;; 60;;
76;;;_* Eshell is free software
77;;
78;; Eshell is free software; you can redistribute it and/or modify it
79;; under the terms of the GNU General Public License as published by
80;; the Free Software Foundation; either version 3, or (at your option)
81;; any later version.
82;;
83;; This program is distributed in the hope that it will be useful, but
84;; WITHOUT ANY WARRANTY; without even the implied warranty of
85;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
86;; General Public License for more details.
87;;
88;; You should have received a copy of the GNU General Public License
89;; along with Eshell; see the file COPYING. If not, write to the Free
90;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
91;; MA 02110-1301, USA.
92;;
93;;;_* How to begin 61;;;_* How to begin
94;; 62;;
95;; To start using Eshell, add the following to your .emacs file: 63;; To start using Eshell, simply type `M-x eshell'.
96;;
97;; (load "eshell-auto")
98;;
99;; This will define all of the necessary autoloads.
100;;
101;; Now type `M-x eshell'. See the INSTALL file for full installation
102;; instructions.
103;; 64;;
104;;;_* Philosophy 65;;;_* Philosophy
105;; 66;;
@@ -263,12 +224,28 @@ the tasks accomplished by such tools."
263;; will only have to read in this one file, which will greatly speed 224;; will only have to read in this one file, which will greatly speed
264;; things up. 225;; things up.
265 226
227(eval-when-compile
228 (require 'cl)
229 (require 'esh-util))
230(require 'esh-util)
231(require 'esh-mode)
232
233(defgroup eshell nil
234 "Eshell is a command shell implemented entirely in Emacs Lisp. It
235invokes no external processes beyond those requested by the user. It
236is intended to be a functional replacement for command shells such as
237bash, zsh, rc, 4dos; since Emacs itself is capable of handling most of
238the tasks accomplished by such tools."
239 :tag "The Emacs shell"
240 :link '(info-link "(eshell)Top")
241 :version "21.1"
242 :group 'applications)
243
244
266;;;_* User Options 245;;;_* User Options
267;; 246;;
268;; The following user options modify the behavior of Eshell overall. 247;; The following user options modify the behavior of Eshell overall.
269 248(defvar eshell-buffer-name)
270(unless (featurep 'esh-util)
271 (load "esh-util" nil t))
272 249
273(defsubst eshell-add-to-window-buffer-names () 250(defsubst eshell-add-to-window-buffer-names ()
274 "Add `eshell-buffer-name' to `same-window-buffer-names'." 251 "Add `eshell-buffer-name' to `same-window-buffer-names'."
@@ -280,19 +257,19 @@ the tasks accomplished by such tools."
280 (delete eshell-buffer-name same-window-buffer-names))) 257 (delete eshell-buffer-name same-window-buffer-names)))
281 258
282(defcustom eshell-load-hook nil 259(defcustom eshell-load-hook nil
283 "*A hook run once Eshell has been loaded." 260 "A hook run once Eshell has been loaded."
284 :type 'hook 261 :type 'hook
285 :group 'eshell) 262 :group 'eshell)
286 263
287(defcustom eshell-unload-hook 264(defcustom eshell-unload-hook
288 '(eshell-remove-from-window-buffer-names 265 '(eshell-remove-from-window-buffer-names
289 eshell-unload-all-modules) 266 eshell-unload-all-modules)
290 "*A hook run when Eshell is unloaded from memory." 267 "A hook run when Eshell is unloaded from memory."
291 :type 'hook 268 :type 'hook
292 :group 'eshell) 269 :group 'eshell)
293 270
294(defcustom eshell-buffer-name "*eshell*" 271(defcustom eshell-buffer-name "*eshell*"
295 "*The basename used for Eshell buffers." 272 "The basename used for Eshell buffers."
296 :set (lambda (symbol value) 273 :set (lambda (symbol value)
297 ;; remove the old value of `eshell-buffer-name', if present 274 ;; remove the old value of `eshell-buffer-name', if present
298 (if (boundp 'eshell-buffer-name) 275 (if (boundp 'eshell-buffer-name)
@@ -309,7 +286,7 @@ the tasks accomplished by such tools."
309 (member eshell-buffer-name same-window-buffer-names)) 286 (member eshell-buffer-name same-window-buffer-names))
310 287
311(defcustom eshell-directory-name (convert-standard-filename "~/.eshell/") 288(defcustom eshell-directory-name (convert-standard-filename "~/.eshell/")
312 "*The directory where Eshell control files should be kept." 289 "The directory where Eshell control files should be kept."
313 :type 'directory 290 :type 'directory
314 :group 'eshell) 291 :group 'eshell)
315 292
@@ -356,10 +333,8 @@ buffer selected (or created)."
356 ;; `same-window-buffer-names', which is done when Eshell is loaded 333 ;; `same-window-buffer-names', which is done when Eshell is loaded
357 (assert (and buf (buffer-live-p buf))) 334 (assert (and buf (buffer-live-p buf)))
358 (pop-to-buffer buf) 335 (pop-to-buffer buf)
359 (if (fboundp 'eshell-mode) 336 (unless (eq major-mode 'eshell-mode)
360 (unless (eq major-mode 'eshell-mode) 337 (eshell-mode))
361 (eshell-mode))
362 (error "`eshell-auto' must be loaded before Eshell can be used"))
363 buf)) 338 buf))
364 339
365(defun eshell-return-exits-minibuffer () 340(defun eshell-return-exits-minibuffer ()
@@ -406,7 +381,6 @@ With prefix ARG, insert output into the current buffer at point."
406 (format " >>> #<buffer %s>" 381 (format " >>> #<buffer %s>"
407 (buffer-name (current-buffer)))))) 382 (buffer-name (current-buffer))))))
408 (save-excursion 383 (save-excursion
409 (require 'esh-mode)
410 (let ((buf (set-buffer (generate-new-buffer " *eshell cmd*"))) 384 (let ((buf (set-buffer (generate-new-buffer " *eshell cmd*")))
411 (eshell-non-interactive-p t)) 385 (eshell-non-interactive-p t))
412 (eshell-mode) 386 (eshell-mode)
@@ -465,7 +439,6 @@ corresponding to a successful execution."
465 (if (and status-var (symbolp status-var)) 439 (if (and status-var (symbolp status-var))
466 (set status-var 0))) 440 (set status-var 0)))
467 (with-temp-buffer 441 (with-temp-buffer
468 (require 'esh-mode)
469 (let ((eshell-non-interactive-p t)) 442 (let ((eshell-non-interactive-p t))
470 (eshell-mode) 443 (eshell-mode)
471 (let ((result (eshell-do-eval 444 (let ((result (eshell-do-eval
@@ -483,40 +456,12 @@ corresponding to a successful execution."
483 456
484;;;_* Reporting bugs 457;;;_* Reporting bugs
485;; 458;;
486;; Since Eshell has not yet been in use by a wide audience, and since 459;; If you do encounter a bug, on any system, please report
487;; the number of possible configurations is quite large, it is certain
488;; that many bugs slipped past the rigors of testing it was put
489;; through. If you do encounter a bug, on any system, please report
490;; it -- in addition to any particular oddities in your configuration 460;; it -- in addition to any particular oddities in your configuration
491;; -- so that the problem may be corrected for the benefit of others. 461;; -- so that the problem may be corrected for the benefit of others.
492 462
493(defconst eshell-report-bug-address "johnw@gnu.org"
494 "E-mail address to send Eshell bug reports to.")
495
496;;;###autoload 463;;;###autoload
497(defun eshell-report-bug (topic) 464(define-obsolete-function-alias 'eshell-report-bug 'report-emacs-bug "23.1")
498 "Report a bug in Eshell.
499Prompts for the TOPIC. Leaves you in a mail buffer.
500Please include any configuration details that might be involved."
501 (interactive "sBug Subject: ")
502 (compose-mail eshell-report-bug-address topic)
503 (goto-char (point-min))
504 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
505 (forward-line 1)
506 (let ((signature (buffer-substring (point) (point-max))))
507 ;; Discourage users from writing non-English text.
508 (set-buffer-multibyte nil)
509 (delete-region (point) (point-max))
510 (insert signature)
511 (backward-char (length signature)))
512 (insert "emacs-version: " (emacs-version))
513 (insert "\n\nThere appears to be a bug in Eshell.\n\n"
514 "Please describe exactly what actions "
515 "triggered the bug and the precise\n"
516 "symptoms of the bug:\n\n")
517 ;; This is so the user has to type something in order to send
518 ;; the report easily.
519 (use-local-map (nconc (make-sparse-keymap) (current-local-map))))
520 465
521;;; Code: 466;;; Code:
522 467
@@ -543,5 +488,7 @@ Emacs."
543 488
544(run-hooks 'eshell-load-hook) 489(run-hooks 'eshell-load-hook)
545 490
491(provide 'eshell)
492
546;;; arch-tag: 9d4d5214-0e4e-4e02-b349-39add640d63f 493;;; arch-tag: 9d4d5214-0e4e-4e02-b349-39add640d63f
547;;; eshell.el ends here 494;;; eshell.el ends here