/[emacs]/emacs/lisp/eshell/esh-io.el
ViewVC logotype

Diff of /emacs/lisp/eshell/esh-io.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6.4.2 by miles, Tue Oct 14 23:51:31 2003 UTC revision 1.6.4.3 by miles, Tue Jul 6 09:14:27 2004 UTC
# Line 333  it defaults to `insert'." Line 333  it defaults to `insert'."
333    (cond    (cond
334     ((stringp target)     ((stringp target)
335      (let ((redir (assoc target eshell-virtual-targets)))      (let ((redir (assoc target eshell-virtual-targets)))
336       (if redir        (if redir
337           (if (nth 2 redir)            (if (nth 2 redir)
338               (funcall (nth 1 redir) mode)                (funcall (nth 1 redir) mode)
339             (nth 1 redir))              (nth 1 redir))
340         (let* ((exists (get-file-buffer target))          (let* ((exists (get-file-buffer target))
341                (buf (find-file-noselect target t)))                 (buf (find-file-noselect target t)))
342           (with-current-buffer buf            (with-current-buffer buf
343             (if buffer-read-only              (if buffer-read-only
344                 (error "Cannot write to read-only file `%s'" target))                  (error "Cannot write to read-only file `%s'" target))
345             (set (make-local-variable 'eshell-output-file-buffer)              (set (make-local-variable 'eshell-output-file-buffer)
346                  (if (eq exists buf) 0 t))                   (if (eq exists buf) 0 t))
347             (cond ((eq mode 'overwrite)              (cond ((eq mode 'overwrite)
348                    (erase-buffer))                     (erase-buffer))
349                   ((eq mode 'append)                    ((eq mode 'append)
350                    (goto-char (point-max))))                     (goto-char (point-max))))
351             (point-marker))))))              (point-marker))))))
352    
353     ((or (bufferp target)     ((or (bufferp target)
354          (and (boundp 'eshell-buffer-shorthand)          (and (boundp 'eshell-buffer-shorthand)
355               (symbol-value 'eshell-buffer-shorthand)               (symbol-value 'eshell-buffer-shorthand)
# Line 363  it defaults to `insert'." Line 364  it defaults to `insert'."
364                ((eq mode 'append)                ((eq mode 'append)
365                 (goto-char (point-max))))                 (goto-char (point-max))))
366          (point-marker))))          (point-marker))))
367     ((functionp target)  
368      nil)     ((functionp target) nil)
369    
370     ((symbolp target)     ((symbolp target)
371      (if (eq mode 'overwrite)      (if (eq mode 'overwrite)
372          (set target nil))          (set target nil))
373      target)      target)
374    
375     ((or (eshell-processp target)     ((or (eshell-processp target)
376          (markerp target))          (markerp target))
377      target)      target)
378    
379     (t     (t
380      (error "Illegal redirection target: %s"      (error "Illegal redirection target: %s"
381             (eshell-stringify target)))))             (eshell-stringify target)))))
# Line 481  Returns what was actually sent, or nil i Line 485  Returns what was actually sent, or nil i
485            (let ((moving (= (point) target)))            (let ((moving (= (point) target)))
486              (save-excursion              (save-excursion
487                (goto-char target)                (goto-char target)
488                (setq object (eshell-stringify object))                (unless (stringp object)
489                    (setq object (eshell-stringify object)))
490                (insert-and-inherit object)                (insert-and-inherit object)
491                (set-marker target (point-marker)))                (set-marker target (point-marker)))
492              (if moving              (if moving
# Line 489  Returns what was actually sent, or nil i Line 494  Returns what was actually sent, or nil i
494    
495     ((eshell-processp target)     ((eshell-processp target)
496      (when (eq (process-status target) 'run)      (when (eq (process-status target) 'run)
497        (setq object (eshell-stringify object))        (unless (stringp object)
498            (setq object (eshell-stringify object)))
499        (process-send-string target object)))        (process-send-string target object)))
500    
501     ((consp target)     ((consp target)

Legend:
Removed from v.1.6.4.2  
changed lines
  Added in v.1.6.4.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26