summaryrefslogtreecommitdiff
path: root/lisp/eshell/esh-cmd.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2007-12-05 07:05:27 +0000
committerGlenn Morris <rgm@gnu.org>2007-12-05 07:05:27 +0000
commit56590d2f240be9c7eea448e3369ce7a5bc9a15c0 (patch)
tree8381bec1266a10d54acbfc2666130ceaa23d414a /lisp/eshell/esh-cmd.el
parenta08a17657936df860c733d50b73c6dfb54f12895 (diff)
downloademacs-56590d2f240be9c7eea448e3369ce7a5bc9a15c0.tar.gz
Require individual files if needed when compiling, rather than
esh-maint. Collect any require statements. Leave provide at start. Move any commentary to start. (eshell-debug-command): Move definition before use.
Diffstat (limited to 'lisp/eshell/esh-cmd.el')
-rw-r--r--lisp/eshell/esh-cmd.el89
1 files changed, 46 insertions, 43 deletions
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 8738ceb39b6..247d6c74604 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -22,18 +22,6 @@
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
-(provide 'esh-cmd)
-
-(eval-when-compile (require 'esh-maint))
-
-(defgroup eshell-cmd nil
- "Executing an Eshell command is as simple as typing it in and
-pressing <RET>. There are several different kinds of commands,
-however."
- :tag "Command invocation"
- ;; :link '(info-link "(eshell)Command invocation")
- :group 'eshell)
-
;;; Commentary:
;;;_* Invoking external commands
@@ -64,11 +52,6 @@ however."
;; functions always take precedence, set
;; `eshell-prefer-lisp-functions' to t.
-(defcustom eshell-prefer-lisp-functions nil
- "*If non-nil, prefer Lisp functions to external commands."
- :type 'boolean
- :group 'eshell-cmd)
-
;;;_* Alias functions
;;
;; Whenever a command is specified using a simple name, such as 'ls',
@@ -112,17 +95,44 @@ however."
;;
;; Lisp arguments are identified using the following regexp:
+;;;_* Command hooks
+;;
+;; There are several hooks involved with command execution, which can
+;; be used either to change or augment Eshell's behavior.
+
+
+;;; Code:
+
+(require 'esh-util)
+(unless (featurep 'xemacs)
+ (require 'eldoc))
+(require 'esh-arg)
+(require 'esh-proc)
+(require 'esh-ext)
+
+(eval-when-compile
+ (require 'pcomplete))
+
+
+(defgroup eshell-cmd nil
+ "Executing an Eshell command is as simple as typing it in and
+pressing <RET>. There are several different kinds of commands,
+however."
+ :tag "Command invocation"
+ ;; :link '(info-link "(eshell)Command invocation")
+ :group 'eshell)
+
+(defcustom eshell-prefer-lisp-functions nil
+ "*If non-nil, prefer Lisp functions to external commands."
+ :type 'boolean
+ :group 'eshell-cmd)
+
(defcustom eshell-lisp-regexp "\\([(`]\\|#'\\)"
"*A regexp which, if matched at beginning of an argument, means Lisp.
Such arguments will be passed to `read', and then evaluated."
:type 'regexp
:group 'eshell-cmd)
-;;;_* Command hooks
-;;
-;; There are several hooks involved with command execution, which can
-;; be used either to change or augment Eshell's behavior.
-
(defcustom eshell-pre-command-hook nil
"*A hook run before each interactive command is invoked."
:type 'hook
@@ -219,15 +229,6 @@ return non-nil if the command is complex."
(function :tag "Predicate")))
:group 'eshell-cmd)
-;;; Code:
-
-(require 'esh-util)
-(unless (featurep 'xemacs)
- (require 'eldoc))
-(require 'esh-arg)
-(require 'esh-proc)
-(require 'esh-ext)
-
;;; User Variables:
(defcustom eshell-cmd-load-hook '(eshell-cmd-initialize)
@@ -394,6 +395,18 @@ hooks should be run before and after the command."
(list 'eshell-commands commands)
commands)))
+(defun eshell-debug-command (tag subform)
+ "Output a debugging message to '*eshell last cmd*'."
+ (let ((buf (get-buffer-create "*eshell last cmd*"))
+ (text (eshell-stringify eshell-current-command)))
+ (save-excursion
+ (set-buffer buf)
+ (if (not tag)
+ (erase-buffer)
+ (insert "\n\C-l\n" tag "\n\n" text
+ (if subform
+ (concat "\n\n" (eshell-stringify subform)) ""))))))
+
(defun eshell-debug-show-parsed-args (terms)
"Display parsed arguments in the debug buffer."
(ignore
@@ -956,18 +969,6 @@ at the moment are:
"Completion for the `debug' command."
(while (pcomplete-here '("errors" "commands"))))
-(defun eshell-debug-command (tag subform)
- "Output a debugging message to '*eshell last cmd*'."
- (let ((buf (get-buffer-create "*eshell last cmd*"))
- (text (eshell-stringify eshell-current-command)))
- (save-excursion
- (set-buffer buf)
- (if (not tag)
- (erase-buffer)
- (insert "\n\C-l\n" tag "\n\n" text
- (if subform
- (concat "\n\n" (eshell-stringify subform)) ""))))))
-
(defun eshell-invoke-directly (command input)
(let ((base (cadr (nth 2 (nth 2 (cadr command))))) name)
(if (and (eq (car base) 'eshell-trap-errors)
@@ -1418,5 +1419,7 @@ messages, and errors."
(defalias 'eshell-lisp-command* 'eshell-lisp-command)
+(provide 'esh-cmd)
+
;;; arch-tag: 8e4f3867-a0c5-441f-96ba-ddd142d94366
;;; esh-cmd.el ends here