aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/comint.el33
2 files changed, 38 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f4f51ec5e90..a2638f6a728 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12000-10-19 Miles Bader <miles@lsi.nec.co.jp>
2
3 * comint.el (comint-write-output, comint-append-output-to-file):
4 New functions.
5 (comint-mode-map): Add them to the menu.
6
12000-10-18 Gerd Moellmann <gerd@gnu.org> 72000-10-18 Gerd Moellmann <gerd@gnu.org>
2 8
3 * startup.el (fancy-splash-screens): Set buffer-undo-list to t. 9 * startup.el (fancy-splash-screens): Set buffer-undo-list to t.
diff --git a/lisp/comint.el b/lisp/comint.el
index 318e1566b0d..2569ce434d9 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -574,6 +574,10 @@ Entry to this mode runs the hooks on `comint-mode-hook'."
574 (cons "In/Out" (make-sparse-keymap "In/Out"))) 574 (cons "In/Out" (make-sparse-keymap "In/Out")))
575 (define-key comint-mode-map [menu-bar inout delete-output] 575 (define-key comint-mode-map [menu-bar inout delete-output]
576 '("Delete Current Output Group" . comint-delete-output)) 576 '("Delete Current Output Group" . comint-delete-output))
577 (define-key comint-mode-map [menu-bar inout write-output]
578 '("Write Current Output Group to File" . comint-write-output))
579 (define-key comint-mode-map [menu-bar inout append-output-to-file]
580 '("Append Current Output Group to File" . comint-append-output-to-file))
577 (define-key comint-mode-map [menu-bar inout next-prompt] 581 (define-key comint-mode-map [menu-bar inout next-prompt]
578 '("Forward Output Group" . comint-next-prompt)) 582 '("Forward Output Group" . comint-next-prompt))
579 (define-key comint-mode-map [menu-bar inout previous-prompt] 583 (define-key comint-mode-map [menu-bar inout previous-prompt]
@@ -1870,7 +1874,7 @@ This function could be in the list `comint-output-filter-functions'."
1870;; Random input hackage 1874;; Random input hackage
1871 1875
1872(defun comint-delete-output () 1876(defun comint-delete-output ()
1873 "Kill all output from interpreter since last input. 1877 "Delete all output from interpreter since last input.
1874Does not delete the prompt." 1878Does not delete the prompt."
1875 (interactive) 1879 (interactive)
1876 (let ((proc (get-buffer-process (current-buffer))) 1880 (let ((proc (get-buffer-process (current-buffer)))
@@ -1889,6 +1893,33 @@ Does not delete the prompt."
1889(defalias 'comint-kill-output 'comint-delete-output) 1893(defalias 'comint-kill-output 'comint-delete-output)
1890(make-obsolete 'comint-kill-output 'comint-delete-output "21.1") 1894(make-obsolete 'comint-kill-output 'comint-delete-output "21.1")
1891 1895
1896(defun comint-write-output (filename &optional mustbenew)
1897 "Write output from interpreter since last input to FILENAME.
1898Any prompt at the end of the output is not written.
1899
1900If the optional argument MUSTBENEW (the prefix argument when interactive),
1901is non-nil, check for an existing file with the same name. If MUSTBENEW
1902is `excl', that means to get an error if the file already exists; never
1903overwrite. If MUSTBENEW is neither nil nor `excl', that means ask for
1904confirmation before overwriting, but do go ahead and overwrite the file
1905if the user confirms."
1906 (interactive "FWrite output to file: \np")
1907 (save-excursion
1908 (goto-char (process-mark (get-buffer-process (current-buffer))))
1909 (forward-line 0)
1910 (write-region comint-last-input-end (point)
1911 filename nil nil nil mustbenew)))
1912
1913(defun comint-append-output-to-file (filename)
1914 "Append output from interpreter since last input to FILENAME.
1915Any prompt at the end of the output is not written."
1916 (interactive "FAppend output to file: ")
1917 (save-excursion
1918 (goto-char (process-mark (get-buffer-process (current-buffer))))
1919 (forward-line 0)
1920 (write-region comint-last-input-end (point) filename t)))
1921
1922
1892(defun comint-show-output () 1923(defun comint-show-output ()
1893 "Display start of this batch of interpreter output at top of window. 1924 "Display start of this batch of interpreter output at top of window.
1894Sets mark to the value of point when this command is run." 1925Sets mark to the value of point when this command is run."