diff options
Diffstat (limited to 'lisp/eshell')
-rw-r--r-- | lisp/eshell/.gitignore | 13 | ||||
-rw-r--r-- | lisp/eshell/esh-io.el | 46 | ||||
-rw-r--r-- | lisp/eshell/esh-test.el | 8 |
3 files changed, 40 insertions, 27 deletions
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 @@ +COPYING +FEATURES +INSTALL +Makefile +NEWS +README +_darcs +_pkg.el +auto-autoloads.el esh-groups.el +esh-toggle.el +eshell-auto.el +eshell.info +eshell.texi 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'." (cond ((stringp target) (let ((redir (assoc target eshell-virtual-targets))) - (if redir - (if (nth 2 redir) - (funcall (nth 1 redir) mode) - (nth 1 redir)) - (let* ((exists (get-file-buffer target)) - (buf (find-file-noselect target t))) - (with-current-buffer buf - (if buffer-read-only - (error "Cannot write to read-only file `%s'" target)) - (set (make-local-variable 'eshell-output-file-buffer) - (if (eq exists buf) 0 t)) - (cond ((eq mode 'overwrite) - (erase-buffer)) - ((eq mode 'append) - (goto-char (point-max)))) - (point-marker)))))) + (if redir + (if (nth 2 redir) + (funcall (nth 1 redir) mode) + (nth 1 redir)) + (let* ((exists (get-file-buffer target)) + (buf (find-file-noselect target t))) + (with-current-buffer buf + (if buffer-read-only + (error "Cannot write to read-only file `%s'" target)) + (set (make-local-variable 'eshell-output-file-buffer) + (if (eq exists buf) 0 t)) + (cond ((eq mode 'overwrite) + (erase-buffer)) + ((eq mode 'append) + (goto-char (point-max)))) + (point-marker)))))) + ((or (bufferp target) (and (boundp 'eshell-buffer-shorthand) (symbol-value 'eshell-buffer-shorthand) @@ -363,15 +364,18 @@ it defaults to `insert'." ((eq mode 'append) (goto-char (point-max)))) (point-marker)))) - ((functionp target) - nil) + + ((functionp target) nil) + ((symbolp target) (if (eq mode 'overwrite) (set target nil)) target) + ((or (eshell-processp target) (markerp target)) target) + (t (error "Illegal redirection target: %s" (eshell-stringify target))))) @@ -481,7 +485,8 @@ Returns what was actually sent, or nil if nothing was sent." (let ((moving (= (point) target))) (save-excursion (goto-char target) - (setq object (eshell-stringify object)) + (unless (stringp object) + (setq object (eshell-stringify object))) (insert-and-inherit object) (set-marker target (point-marker))) (if moving @@ -489,7 +494,8 @@ Returns what was actually sent, or nil if nothing was sent." ((eshell-processp target) (when (eq (process-status target) 'run) - (setq object (eshell-stringify object)) + (unless (stringp object) + (setq object (eshell-stringify object))) (process-send-string target object))) ((consp target) 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 @@ (local-set-key [(control ?m)] 'eshell-test-goto-func) (local-set-key [return] 'eshell-test-goto-func) - (insert "Testing Eshell under " - (format "GNU Emacs %s (%s%s)" - emacs-version - system-configuration - (cond ((featurep 'motif) ", Motif") - ((featurep 'x-toolkit) ", X toolkit") - (t "")))) + (insert "Testing Eshell under " (emacs-version)) (switch-to-buffer test-buffer) (delete-other-windows)) (eshell-for funcname (sort (all-completions "eshell-test--" |