aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/.arch-inventory4
-rw-r--r--lisp/eshell/.gitignore13
-rw-r--r--lisp/eshell/em-alias.el3
-rw-r--r--lisp/eshell/em-dirs.el3
-rw-r--r--lisp/eshell/em-glob.el15
-rw-r--r--lisp/eshell/em-hist.el1
-rw-r--r--lisp/eshell/em-unix.el3
-rw-r--r--lisp/eshell/esh-cmd.el5
-rw-r--r--lisp/eshell/esh-io.el46
-rw-r--r--lisp/eshell/esh-module.el53
-rw-r--r--lisp/eshell/esh-test.el8
11 files changed, 87 insertions, 67 deletions
diff --git a/lisp/eshell/.arch-inventory b/lisp/eshell/.arch-inventory
new file mode 100644
index 00000000000..b5d82cdd6fc
--- /dev/null
+++ b/lisp/eshell/.arch-inventory
@@ -0,0 +1,4 @@
1# Generated files
2precious ^(esh-groups)\.el$
3
4# arch-tag: 8dc7bfaa-6ca6-4be0-915a-1e539c3dabfb
diff --git a/lisp/eshell/.gitignore b/lisp/eshell/.gitignore
index 16ccfcc8c0c..e1d7683a723 100644
--- a/lisp/eshell/.gitignore
+++ b/lisp/eshell/.gitignore
@@ -1 +1,14 @@
1COPYING
2FEATURES
3INSTALL
4Makefile
5NEWS
6README
7_darcs
8_pkg.el
9auto-autoloads.el
1esh-groups.el 10esh-groups.el
11esh-toggle.el
12eshell-auto.el
13eshell.info
14eshell.texi
diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el
index 0312f9d7ada..02af7531b3f 100644
--- a/lisp/eshell/em-alias.el
+++ b/lisp/eshell/em-alias.el
@@ -1,6 +1,6 @@
1;;; em-alias.el --- creation and management of command aliases 1;;; em-alias.el --- creation and management of command aliases
2 2
3;; Copyright (C) 1999, 2000 Free Software Foundation 3;; Copyright (C) 1999, 2000, 2004 Free Software Foundation
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6 6
@@ -24,6 +24,7 @@
24(provide 'em-alias) 24(provide 'em-alias)
25 25
26(eval-when-compile (require 'esh-maint)) 26(eval-when-compile (require 'esh-maint))
27(require 'eshell)
27 28
28(defgroup eshell-alias nil 29(defgroup eshell-alias nil
29 "Command aliases allow for easy definition of alternate commands." 30 "Command aliases allow for easy definition of alternate commands."
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index 73837c324a5..7b74069454b 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -1,6 +1,6 @@
1;;; em-dirs.el --- directory navigation commands 1;;; em-dirs.el --- directory navigation commands
2 2
3;; Copyright (C) 1999, 2000 Free Software Foundation 3;; Copyright (C) 1999, 2000, 2004 Free Software Foundation
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6 6
@@ -24,6 +24,7 @@
24(provide 'em-dirs) 24(provide 'em-dirs)
25 25
26(eval-when-compile (require 'esh-maint)) 26(eval-when-compile (require 'esh-maint))
27(require 'eshell)
27 28
28(defgroup eshell-dirs nil 29(defgroup eshell-dirs nil
29 "Directory navigation involves changing directories, examining the 30 "Directory navigation involves changing directories, examining the
diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el
index 24447c3e66d..c84962e66b0 100644
--- a/lisp/eshell/em-glob.el
+++ b/lisp/eshell/em-glob.el
@@ -122,10 +122,6 @@ This option slows down recursive glob processing by quite a bit."
122 :type '(repeat (cons character (choice regexp function))) 122 :type '(repeat (cons character (choice regexp function)))
123 :group 'eshell-glob) 123 :group 'eshell-glob)
124 124
125;;; Internal Variables:
126
127(defvar eshell-glob-chars-regexp nil)
128
129;;; Functions: 125;;; Functions:
130 126
131(defun eshell-glob-initialize () 127(defun eshell-glob-initialize ()
@@ -134,8 +130,6 @@ This option slows down recursive glob processing by quite a bit."
134 (when (boundp 'eshell-special-chars-outside-quoting) 130 (when (boundp 'eshell-special-chars-outside-quoting)
135 (set (make-local-variable 'eshell-special-chars-outside-quoting) 131 (set (make-local-variable 'eshell-special-chars-outside-quoting)
136 (append eshell-glob-chars-list eshell-special-chars-outside-quoting))) 132 (append eshell-glob-chars-list eshell-special-chars-outside-quoting)))
137 (set (make-local-variable 'eshell-glob-chars-regexp)
138 (format "[%s]+" (apply 'string eshell-glob-chars-list)))
139 (add-hook 'eshell-parse-argument-hook 'eshell-parse-glob-chars t t) 133 (add-hook 'eshell-parse-argument-hook 'eshell-parse-glob-chars t t)
140 (add-hook 'eshell-pre-rewrite-command-hook 134 (add-hook 'eshell-pre-rewrite-command-hook
141 'eshell-no-command-globbing nil t)) 135 'eshell-no-command-globbing nil t))
@@ -184,6 +178,8 @@ interpretation."
184 (buffer-substring-no-properties (1- (point)) (1+ end)) 178 (buffer-substring-no-properties (1- (point)) (1+ end))
185 (goto-char (1+ end)))))))))) 179 (goto-char (1+ end))))))))))
186 180
181(defvar eshell-glob-chars-regexp nil)
182
187(defun eshell-glob-regexp (pattern) 183(defun eshell-glob-regexp (pattern)
188 "Convert glob-pattern PATTERN to a regular expression. 184 "Convert glob-pattern PATTERN to a regular expression.
189The basic syntax is: 185The basic syntax is:
@@ -204,8 +200,11 @@ set to true, then these characters will match themselves in the
204resulting regular expression." 200resulting regular expression."
205 (let ((matched-in-pattern 0) ; How much of PATTERN handled 201 (let ((matched-in-pattern 0) ; How much of PATTERN handled
206 regexp) 202 regexp)
207 (while (string-match eshell-glob-chars-regexp 203 (while (string-match
208 pattern matched-in-pattern) 204 (or eshell-glob-chars-regexp
205 (set (make-local-variable 'eshell-glob-chars-regexp)
206 (format "[%s]+" (apply 'string eshell-glob-chars-list))))
207 pattern matched-in-pattern)
209 (let* ((op-begin (match-beginning 0)) 208 (let* ((op-begin (match-beginning 0))
210 (op-char (aref pattern op-begin))) 209 (op-char (aref pattern op-begin)))
211 (setq regexp 210 (setq regexp
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index b38c7a519ec..f4bfea798e0 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -24,6 +24,7 @@
24(provide 'em-hist) 24(provide 'em-hist)
25 25
26(eval-when-compile (require 'esh-maint)) 26(eval-when-compile (require 'esh-maint))
27(require 'eshell)
27 28
28(defgroup eshell-hist nil 29(defgroup eshell-hist nil
29 "This module provides command history management." 30 "This module provides command history management."
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index 8446eb1aa9d..43d3c9c4e5e 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -1,6 +1,6 @@
1;;; em-unix.el --- UNIX command aliases 1;;; em-unix.el --- UNIX command aliases
2 2
3;; Copyright (C) 1999, 2000, 2001 Free Software Foundation 3;; Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6 6
@@ -24,6 +24,7 @@
24(provide 'em-unix) 24(provide 'em-unix)
25 25
26(eval-when-compile (require 'esh-maint)) 26(eval-when-compile (require 'esh-maint))
27(require 'eshell)
27 28
28(defgroup eshell-unix nil 29(defgroup eshell-unix nil
29 "This module defines many of the more common UNIX utilities as 30 "This module defines many of the more common UNIX utilities as
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 9b4f54ce8bf..477d8b410ec 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -1246,9 +1246,8 @@ be finished later after the completion of an asynchronous subprocess."
1246 (setq program (eshell-search-path name)) 1246 (setq program (eshell-search-path name))
1247 (let* ((esym (eshell-find-alias-function name)) 1247 (let* ((esym (eshell-find-alias-function name))
1248 (sym (or esym (intern-soft name)))) 1248 (sym (or esym (intern-soft name))))
1249 (if (and sym (fboundp sym) 1249 (if (and (or esym (and sym (fboundp sym)))
1250 (or esym eshell-prefer-lisp-functions 1250 (or eshell-prefer-lisp-functions (not direct)))
1251 (not program)))
1252 (let ((desc (let ((inhibit-redisplay t)) 1251 (let ((desc (let ((inhibit-redisplay t))
1253 (save-window-excursion 1252 (save-window-excursion
1254 (prog1 1253 (prog1
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index 8d1036b736e..d832fa9cd03 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -333,22 +333,23 @@ it defaults to `insert'."
333 (cond 333 (cond
334 ((stringp target) 334 ((stringp target)
335 (let ((redir (assoc target eshell-virtual-targets))) 335 (let ((redir (assoc target eshell-virtual-targets)))
336 (if redir 336 (if redir
337 (if (nth 2 redir) 337 (if (nth 2 redir)
338 (funcall (nth 1 redir) mode) 338 (funcall (nth 1 redir) mode)
339 (nth 1 redir)) 339 (nth 1 redir))
340 (let* ((exists (get-file-buffer target)) 340 (let* ((exists (get-file-buffer target))
341 (buf (find-file-noselect target t))) 341 (buf (find-file-noselect target t)))
342 (with-current-buffer buf 342 (with-current-buffer buf
343 (if buffer-read-only 343 (if buffer-read-only
344 (error "Cannot write to read-only file `%s'" target)) 344 (error "Cannot write to read-only file `%s'" target))
345 (set (make-local-variable 'eshell-output-file-buffer) 345 (set (make-local-variable 'eshell-output-file-buffer)
346 (if (eq exists buf) 0 t)) 346 (if (eq exists buf) 0 t))
347 (cond ((eq mode 'overwrite) 347 (cond ((eq mode 'overwrite)
348 (erase-buffer)) 348 (erase-buffer))
349 ((eq mode 'append) 349 ((eq mode 'append)
350 (goto-char (point-max)))) 350 (goto-char (point-max))))
351 (point-marker)))))) 351 (point-marker))))))
352
352 ((or (bufferp target) 353 ((or (bufferp target)
353 (and (boundp 'eshell-buffer-shorthand) 354 (and (boundp 'eshell-buffer-shorthand)
354 (symbol-value 'eshell-buffer-shorthand) 355 (symbol-value 'eshell-buffer-shorthand)
@@ -363,15 +364,18 @@ it defaults to `insert'."
363 ((eq mode 'append) 364 ((eq mode 'append)
364 (goto-char (point-max)))) 365 (goto-char (point-max))))
365 (point-marker)))) 366 (point-marker))))
366 ((functionp target) 367
367 nil) 368 ((functionp target) nil)
369
368 ((symbolp target) 370 ((symbolp target)
369 (if (eq mode 'overwrite) 371 (if (eq mode 'overwrite)
370 (set target nil)) 372 (set target nil))
371 target) 373 target)
374
372 ((or (eshell-processp target) 375 ((or (eshell-processp target)
373 (markerp target)) 376 (markerp target))
374 target) 377 target)
378
375 (t 379 (t
376 (error "Illegal redirection target: %s" 380 (error "Illegal redirection target: %s"
377 (eshell-stringify target))))) 381 (eshell-stringify target)))))
@@ -481,7 +485,8 @@ Returns what was actually sent, or nil if nothing was sent."
481 (let ((moving (= (point) target))) 485 (let ((moving (= (point) target)))
482 (save-excursion 486 (save-excursion
483 (goto-char target) 487 (goto-char target)
484 (setq object (eshell-stringify object)) 488 (unless (stringp object)
489 (setq object (eshell-stringify object)))
485 (insert-and-inherit object) 490 (insert-and-inherit object)
486 (set-marker target (point-marker))) 491 (set-marker target (point-marker)))
487 (if moving 492 (if moving
@@ -489,7 +494,8 @@ Returns what was actually sent, or nil if nothing was sent."
489 494
490 ((eshell-processp target) 495 ((eshell-processp target)
491 (when (eq (process-status target) 'run) 496 (when (eq (process-status target) 'run)
492 (setq object (eshell-stringify object)) 497 (unless (stringp object)
498 (setq object (eshell-stringify object)))
493 (process-send-string target object))) 499 (process-send-string target object)))
494 500
495 ((consp target) 501 ((consp target)
diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el
index 4c8ffceef78..dcbf77364f4 100644
--- a/lisp/eshell/esh-module.el
+++ b/lisp/eshell/esh-module.el
@@ -1,6 +1,6 @@
1;;; esh-module.el --- Eshell modules 1;;; esh-module.el --- Eshell modules
2 2
3;; Copyright (C) 1999, 2000 Free Software Foundation 3;; Copyright (C) 1999, 2000, 2004 Free Software Foundation
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6;; Keywords: processes 6;; Keywords: processes
@@ -41,32 +41,33 @@ customizing the variable `eshell-modules-list'."
41 41
42(defun eshell-load-defgroups (&optional directory) 42(defun eshell-load-defgroups (&optional directory)
43 "Load `defgroup' statements from Eshell's module files." 43 "Load `defgroup' statements from Eshell's module files."
44 (with-current-buffer 44 (let ((vc-handled-backends nil)) ; avoid VC fucking things up
45 (find-file-noselect (expand-file-name "esh-groups.el" directory)) 45 (with-current-buffer
46 (erase-buffer) 46 (find-file-noselect (expand-file-name "esh-groups.el" directory))
47 (insert ";;; do not modify this file; it is auto-generated -*- no-byte-compile: t -*-\n\n") 47 (erase-buffer)
48 (let ((files (directory-files (or directory 48 (insert ";;; do not modify this file; it is auto-generated -*- no-byte-compile: t -*-\n\n")
49 (car command-line-args-left)) 49 (let ((files (directory-files (or directory
50 nil "\\`em-.*\\.el\\'"))) 50 (car command-line-args-left))
51 (while files 51 nil "\\`em-.*\\.el\\'")))
52 (message "Loading defgroup from `%s'" (car files)) 52 (while files
53 (let (defgroup) 53 (message "Loading defgroup from `%s'" (car files))
54 (catch 'handled 54 (let (defgroup)
55 (with-current-buffer (find-file-noselect (car files)) 55 (catch 'handled
56 (goto-char (point-min)) 56 (with-current-buffer (find-file-noselect (car files))
57 (while t 57 (goto-char (point-min))
58 (forward-sexp) 58 (while t
59 (if (eobp) (throw 'handled t))
60 (backward-sexp)
61 (let ((begin (point))
62 (defg (looking-at "(defgroup")))
63 (forward-sexp) 59 (forward-sexp)
64 (if defg 60 (if (eobp) (throw 'handled t))
65 (setq defgroup (buffer-substring begin (point)))))))) 61 (backward-sexp)
66 (if defgroup 62 (let ((begin (point))
67 (insert defgroup "\n\n"))) 63 (defg (looking-at "(defgroup")))
68 (setq files (cdr files)))) 64 (forward-sexp)
69 (save-buffer))) 65 (if defg
66 (setq defgroup (buffer-substring begin (point))))))))
67 (if defgroup
68 (insert defgroup "\n\n")))
69 (setq files (cdr files))))
70 (save-buffer))))
70 71
71;; load the defgroup's for the standard extension modules, so that 72;; load the defgroup's for the standard extension modules, so that
72;; documentation can be provided when the user customize's 73;; documentation can be provided when the user customize's
diff --git a/lisp/eshell/esh-test.el b/lisp/eshell/esh-test.el
index 54edf5e35ab..076505da14e 100644
--- a/lisp/eshell/esh-test.el
+++ b/lisp/eshell/esh-test.el
@@ -167,13 +167,7 @@
167 (local-set-key [(control ?m)] 'eshell-test-goto-func) 167 (local-set-key [(control ?m)] 'eshell-test-goto-func)
168 (local-set-key [return] 'eshell-test-goto-func) 168 (local-set-key [return] 'eshell-test-goto-func)
169 169
170 (insert "Testing Eshell under " 170 (insert "Testing Eshell under " (emacs-version))
171 (format "GNU Emacs %s (%s%s)"
172 emacs-version
173 system-configuration
174 (cond ((featurep 'motif) ", Motif")
175 ((featurep 'x-toolkit) ", X toolkit")
176 (t ""))))
177 (switch-to-buffer test-buffer) 171 (switch-to-buffer test-buffer)
178 (delete-other-windows)) 172 (delete-other-windows))
179 (eshell-for funcname (sort (all-completions "eshell-test--" 173 (eshell-for funcname (sort (all-completions "eshell-test--"