aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/comint.el40
1 files changed, 20 insertions, 20 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 382b15f4a74..296d5b64f14 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1894,32 +1894,32 @@ Does not delete the prompt."
1894(defalias 'comint-kill-output 'comint-delete-output) 1894(defalias 'comint-kill-output 'comint-delete-output)
1895(make-obsolete 'comint-kill-output 'comint-delete-output "21.1") 1895(make-obsolete 'comint-kill-output 'comint-delete-output "21.1")
1896 1896
1897(defun comint-write-output (filename &optional mustbenew) 1897(defun comint-write-output (filename &optional append mustbenew)
1898 "Write output from interpreter since last input to FILENAME. 1898 "Write output from interpreter since last input to FILENAME.
1899Any prompt at the end of the output is not written. 1899Any prompt at the end of the output is not written.
1900 1900
1901If the optional argument MUSTBENEW (the prefix argument when interactive), 1901If the optional argument APPEND (the prefix argument when interactive)
1902is non-nil, check for an existing file with the same name. If MUSTBENEW 1902is non-nil, the output is appended to the file instead.
1903is `excl', that means to get an error if the file already exists; never 1903
1904overwrite. If MUSTBENEW is neither nil nor `excl', that means ask for 1904If the optional argument MUSTBENEW is non-nil, check for an existing
1905confirmation before overwriting, but do go ahead and overwrite the file 1905file with the same name. If MUSTBENEW is `excl', that means to get an
1906if the user confirms." 1906error if the file already exists; never overwrite. If MUSTBENEW is
1907 (interactive "FWrite output to file: \np") 1907neither nil nor `excl', that means ask for confirmation before
1908overwriting, but do go ahead and overwrite the file if the user
1909confirms. When interactive, MUSTBENEW is nil when appending, and t
1910otherwise."
1911 (interactive
1912 (list (read-file-name
1913 (if current-prefix-arg
1914 "Append output to file: "
1915 "Write output to file: "))
1916 current-prefix-arg
1917 (not current-prefix-arg)))
1908 (save-excursion 1918 (save-excursion
1909 (goto-char (process-mark (get-buffer-process (current-buffer)))) 1919 (goto-char (process-mark (get-buffer-process (current-buffer))))
1910 (forward-line 0) 1920 (forward-line 0)
1911 (write-region comint-last-input-end (point) 1921 (write-region comint-last-input-end (point) filename
1912 filename nil nil nil mustbenew))) 1922 append nil nil mustbenew)))
1913
1914(defun comint-append-output-to-file (filename)
1915 "Append output from interpreter since last input to FILENAME.
1916Any prompt at the end of the output is not written."
1917 (interactive "FAppend output to file: ")
1918 (save-excursion
1919 (goto-char (process-mark (get-buffer-process (current-buffer))))
1920 (forward-line 0)
1921 (write-region comint-last-input-end (point) filename t)))
1922
1923 1923
1924(defun comint-show-output () 1924(defun comint-show-output ()
1925 "Display start of this batch of interpreter output at top of window. 1925 "Display start of this batch of interpreter output at top of window.