mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-26 07:33:47 +00:00
2004-05-15 John Wiegley <johnw@newartisans.com>
* eshell/esh-io.el (eshell-get-target): whitespace changes. (eshell-output-object-to-target): Improve output speed 20% by not calling `eshell-stringify' if something is already known to be a string.
This commit is contained in:
parent
e9e132edf5
commit
e1703ba9ac
@ -349,6 +349,7 @@ it defaults to `insert'."
|
|||||||
((eq mode 'append)
|
((eq mode 'append)
|
||||||
(goto-char (point-max))))
|
(goto-char (point-max))))
|
||||||
(point-marker))))))
|
(point-marker))))))
|
||||||
|
|
||||||
((or (bufferp target)
|
((or (bufferp target)
|
||||||
(and (boundp 'eshell-buffer-shorthand)
|
(and (boundp 'eshell-buffer-shorthand)
|
||||||
(symbol-value 'eshell-buffer-shorthand)
|
(symbol-value 'eshell-buffer-shorthand)
|
||||||
@ -363,15 +364,18 @@ it defaults to `insert'."
|
|||||||
((eq mode 'append)
|
((eq mode 'append)
|
||||||
(goto-char (point-max))))
|
(goto-char (point-max))))
|
||||||
(point-marker))))
|
(point-marker))))
|
||||||
((functionp target)
|
|
||||||
nil)
|
((functionp target) nil)
|
||||||
|
|
||||||
((symbolp target)
|
((symbolp target)
|
||||||
(if (eq mode 'overwrite)
|
(if (eq mode 'overwrite)
|
||||||
(set target nil))
|
(set target nil))
|
||||||
target)
|
target)
|
||||||
|
|
||||||
((or (eshell-processp target)
|
((or (eshell-processp target)
|
||||||
(markerp target))
|
(markerp target))
|
||||||
target)
|
target)
|
||||||
|
|
||||||
(t
|
(t
|
||||||
(error "Illegal redirection target: %s"
|
(error "Illegal redirection target: %s"
|
||||||
(eshell-stringify target)))))
|
(eshell-stringify target)))))
|
||||||
@ -481,7 +485,8 @@ Returns what was actually sent, or nil if nothing was sent."
|
|||||||
(let ((moving (= (point) target)))
|
(let ((moving (= (point) target)))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char target)
|
(goto-char target)
|
||||||
(setq object (eshell-stringify object))
|
(unless (stringp object)
|
||||||
|
(setq object (eshell-stringify object)))
|
||||||
(insert-and-inherit object)
|
(insert-and-inherit object)
|
||||||
(set-marker target (point-marker)))
|
(set-marker target (point-marker)))
|
||||||
(if moving
|
(if moving
|
||||||
@ -489,7 +494,8 @@ Returns what was actually sent, or nil if nothing was sent."
|
|||||||
|
|
||||||
((eshell-processp target)
|
((eshell-processp target)
|
||||||
(when (eq (process-status target) 'run)
|
(when (eq (process-status target) 'run)
|
||||||
(setq object (eshell-stringify object))
|
(unless (stringp object)
|
||||||
|
(setq object (eshell-stringify object)))
|
||||||
(process-send-string target object)))
|
(process-send-string target object)))
|
||||||
|
|
||||||
((consp target)
|
((consp target)
|
||||||
|
Loading…
Reference in New Issue
Block a user