aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1992-03-16 20:39:07 +0000
committerJim Blandy1992-03-16 20:39:07 +0000
commit49116ac071969bee7f129bf7ce725c7a5b0b0fc5 (patch)
tree60c249f15b04478367256fef95c6fd7557f263b9
parent3b4a6e271d44955328c39de1475e42cf0b4cd637 (diff)
downloademacs-49116ac071969bee7f129bf7ce725c7a5b0b0fc5.tar.gz
emacs-49116ac071969bee7f129bf7ce725c7a5b0b0fc5.zip
*** empty log message ***
-rw-r--r--lisp/abbrevlist.el7
-rw-r--r--lisp/calendar/holidays.el5
-rw-r--r--lisp/case-table.el19
-rw-r--r--lisp/chistory.el5
-rw-r--r--lisp/cl.el3
-rw-r--r--lisp/cmuscheme.el3
-rw-r--r--lisp/comint.el995
-rw-r--r--lisp/compare-w.el5
-rw-r--r--lisp/dabbrev.el5
-rw-r--r--lisp/diary-lib.el5
-rw-r--r--lisp/disp-table.el6
-rw-r--r--lisp/ehelp.el5
-rw-r--r--lisp/electric.el4
-rw-r--r--lisp/emacs-lisp/backquote.el5
-rw-r--r--lisp/emacs-lisp/float.el5
-rw-r--r--lisp/emacs-lisp/helper.el3
-rw-r--r--lisp/emacs-lisp/lisp-mode.el5
-rw-r--r--lisp/emulation/mlsupport.el5
-rw-r--r--lisp/env.el5
-rw-r--r--lisp/find-dired.el4
-rw-r--r--lisp/float-sup.el5
-rw-r--r--lisp/flow-ctrl.el4
-rw-r--r--lisp/frame.el6
-rw-r--r--lisp/gnus.el3
-rw-r--r--lisp/gnusmail.el3
-rw-r--r--lisp/gnusmisc.el3
-rw-r--r--lisp/gnuspost.el3
-rw-r--r--lisp/info.el5
-rw-r--r--lisp/mail/mail-utils.el5
-rw-r--r--lisp/mail/mailabbrev.el2
-rw-r--r--lisp/mail/rfc822.el4
-rw-r--r--lisp/mail/rmail.el5
-rw-r--r--lisp/mail/rmailsort.el3
-rw-r--r--lisp/mail/rnews.el5
-rw-r--r--lisp/mail/sendmail.el5
-rw-r--r--lisp/mhspool.el3
-rw-r--r--lisp/mim-mode.el5
-rw-r--r--lisp/mouse.el5
-rw-r--r--lisp/nnspool.el3
-rw-r--r--lisp/nntp.el5
-rw-r--r--lisp/play/gomoku.el5
-rw-r--r--lisp/play/life.el5
-rw-r--r--lisp/play/yow.el4
-rw-r--r--lisp/progmodes/etags.el5
-rw-r--r--lisp/progmodes/fortran.el4
-rw-r--r--lisp/progmodes/inf-lisp.el5
-rw-r--r--lisp/progmodes/scheme.el3
-rw-r--r--lisp/sort.el5
-rw-r--r--lisp/sun-curs.el4
-rw-r--r--lisp/sun-fns.el2
-rw-r--r--lisp/superyank.el4
-rw-r--r--lisp/tar-mode.el11
-rw-r--r--lisp/telnet.el5
-rw-r--r--lisp/term/bg-mouse.el4
-rw-r--r--lisp/term/sun-mouse.el5
-rw-r--r--lisp/terminal.el3
-rw-r--r--lisp/textmodes/bib-mode.el5
-rw-r--r--lisp/textmodes/bibtex.el7
-rw-r--r--lisp/textmodes/picture.el5
-rw-r--r--lisp/textmodes/refbib.el3
-rw-r--r--lisp/textmodes/tex-mode.el4
-rw-r--r--lisp/textmodes/texinfo.el4
-rw-r--r--lisp/textmodes/texnfo-upd.el5
-rw-r--r--lisp/timer.el1
-rw-r--r--lisp/view.el5
65 files changed, 924 insertions, 370 deletions
diff --git a/lisp/abbrevlist.el b/lisp/abbrevlist.el
index 554bacd645f..a7942248dde 100644
--- a/lisp/abbrevlist.el
+++ b/lisp/abbrevlist.el
@@ -1,5 +1,5 @@
1;; List one abbrev table alphabetically ordered. 1;; List one abbrev table alphabetically ordered.
2;; Copyright (C) 1986 Free Software Foundation, Inc. 2;; Copyright (C) 1986, 1992 Free Software Foundation, Inc.
3;; Suggested by a previous version by Gildea. 3;; Suggested by a previous version by Gildea.
4 4
5;; This file is part of GNU Emacs. 5;; This file is part of GNU Emacs.
@@ -19,8 +19,6 @@
19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 20
21 21
22(provide 'abbrevlist)
23
24(defun list-one-abbrev-table (abbrev-table output-buffer) 22(defun list-one-abbrev-table (abbrev-table output-buffer)
25 "Display alphabetical listing of ABBREV-TABLE in buffer OUTPUT-BUFFER." 23 "Display alphabetical listing of ABBREV-TABLE in buffer OUTPUT-BUFFER."
26 (with-output-to-temp-buffer output-buffer 24 (with-output-to-temp-buffer output-buffer
@@ -43,3 +41,6 @@
43 (insert (symbol-value (car abbrev-list))) 41 (insert (symbol-value (car abbrev-list)))
44 (setq first-column (+ first-column 40)) 42 (setq first-column (+ first-column 40))
45 (setq abbrev-list (cdr abbrev-list))))))) 43 (setq abbrev-list (cdr abbrev-list)))))))
44
45(provide 'abbrevlist)
46
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el
index 88185436778..ccc99f55eb2 100644
--- a/lisp/calendar/holidays.el
+++ b/lisp/calendar/holidays.el
@@ -33,8 +33,6 @@
33;; pages 899-928. 33;; pages 899-928.
34 34
35(require 'calendar) 35(require 'calendar)
36(provide 'holidays)
37
38(defun holidays () 36(defun holidays ()
39 "Display the holidays for last month, this month, and next month. 37 "Display the holidays for last month, this month, and next month.
40This function is suitable for execution in a .emacs file." 38This function is suitable for execution in a .emacs file."
@@ -585,3 +583,6 @@ checked. If nil, the holiday (car (cdr (cdr X))), if there, is checked."
585 (setq visible (append (list (car p)) visible))) 583 (setq visible (append (list (car p)) visible)))
586 (setq p (cdr p))) 584 (setq p (cdr p)))
587 visible)) 585 visible))
586
587(provide 'holidays)
588
diff --git a/lisp/case-table.el b/lisp/case-table.el
index f10580fe575..2de955de2cd 100644
--- a/lisp/case-table.el
+++ b/lisp/case-table.el
@@ -46,7 +46,7 @@
46 46
47(defun invert-case (count) 47(defun invert-case (count)
48 "Change the case of the character just after point and move over it. 48 "Change the case of the character just after point and move over it.
49With arg, applies to that many chars. 49With prefix arg, applies to that many chars.
50Negative arg inverts characters before point but does not move." 50Negative arg inverts characters before point but does not move."
51 (interactive "p") 51 (interactive "p")
52 (if (< count 0) 52 (if (< count 0)
@@ -63,9 +63,8 @@ Negative arg inverts characters before point but does not move."
63 63
64(defun set-case-syntax-delims (l r table) 64(defun set-case-syntax-delims (l r table)
65 "Make characters L and R a matching pair of non-case-converting delimiters. 65 "Make characters L and R a matching pair of non-case-converting delimiters.
66Sets the entries for L and R in standard-case-table, 66Sets the entries for L and R in `standard-case-table', `standard-syntax-table',
67standard-syntax-table, and text-mode-syntax-table to indicate 67and `text-mode-syntax-table' to indicate left and right delimiters."
68left and right delimiters."
69 (aset (car table) l l) 68 (aset (car table) l l)
70 (aset (car table) r r) 69 (aset (car table) r r)
71 (modify-syntax-entry l (concat "(" (char-to-string r) " ") 70 (modify-syntax-entry l (concat "(" (char-to-string r) " ")
@@ -79,10 +78,10 @@ left and right delimiters."
79 78
80(defun set-case-syntax-pair (uc lc table) 79(defun set-case-syntax-pair (uc lc table)
81 "Make characters UC and LC a pair of inter-case-converting letters. 80 "Make characters UC and LC a pair of inter-case-converting letters.
82Sets the entries for characters UC and LC in 81Sets the entries for characters UC and LC in `standard-case-table',
83standard-case-table, standard-syntax-table, and 82`standard-syntax-table' and `text-mode-syntax-table' to indicate an
84text-mode-syntax-table to indicate an (uppercase, lowercase) 83(uppercase, lowercase) pair of letters."
85pair of letters." 84
86 (aset (car table) uc lc) 85 (aset (car table) uc lc)
87 (modify-syntax-entry lc "w " (standard-syntax-table)) 86 (modify-syntax-entry lc "w " (standard-syntax-table))
88 (modify-syntax-entry lc "w " text-mode-syntax-table) 87 (modify-syntax-entry lc "w " text-mode-syntax-table)
@@ -91,8 +90,8 @@ pair of letters."
91 90
92(defun set-case-syntax (c syntax table) 91(defun set-case-syntax (c syntax table)
93 "Make characters C case-invariant with syntax SYNTAX. 92 "Make characters C case-invariant with syntax SYNTAX.
94Sets the entries for character C in standard-case-table, 93Sets the entries for character C in `standard-case-table',
95standard-syntax-table, and text-mode-syntax-table to indicate this. 94`standard-syntax-table' and `text-mode-syntax-table' to indicate this.
96SYNTAX should be \" \", \"w\", \".\" or \"_\"." 95SYNTAX should be \" \", \"w\", \".\" or \"_\"."
97 (aset (car table) c c) 96 (aset (car table) c c)
98 (modify-syntax-entry c syntax (standard-syntax-table)) 97 (modify-syntax-entry c syntax (standard-syntax-table))
diff --git a/lisp/chistory.el b/lisp/chistory.el
index 3a8bcb6d7c9..2dd78a1f558 100644
--- a/lisp/chistory.el
+++ b/lisp/chistory.el
@@ -19,8 +19,6 @@
19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 20
21 21
22(provide 'chistory)
23
24;; This really has nothing to do with list-command-history per se, but 22;; This really has nothing to do with list-command-history per se, but
25;; its a nice alternative to C-x ESC (repeat-complex-command) and 23;; its a nice alternative to C-x ESC (repeat-complex-command) and
26;; functions as a lister if given no pattern. It's not important 24;; functions as a lister if given no pattern. It's not important
@@ -165,3 +163,6 @@ The Command History listing is recomputed each time this mode is invoked."
165 (list-command-history) 163 (list-command-history)
166 (pop-to-buffer "*Command History*") 164 (pop-to-buffer "*Command History*")
167 (run-hooks 'command-history-hook)) 165 (run-hooks 'command-history-hook))
166
167(provide 'chistory)
168
diff --git a/lisp/cl.el b/lisp/cl.el
index a4386f3c8bb..723238aec2f 100644
--- a/lisp/cl.el
+++ b/lisp/cl.el
@@ -43,7 +43,6 @@
43;;;; Bug reports, suggestions and comments, 43;;;; Bug reports, suggestions and comments,
44;;;; to quiroz@cs.rochester.edu 44;;;; to quiroz@cs.rochester.edu
45 45
46(provide 'cl)
47(defvar cl-version "2.0 beta 29 October 1989") 46(defvar cl-version "2.0 beta 29 October 1989")
48 47
49 48
@@ -3135,3 +3134,5 @@ Common-Lisp codes."
3135 form) 3134 form)
3136 3135
3137;;;; end of cl.el 3136;;;; end of cl.el
3137
3138(provide 'cl)
diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el
index a2f4d0e7d88..b817b42e662 100644
--- a/lisp/cmuscheme.el
+++ b/lisp/cmuscheme.el
@@ -84,7 +84,6 @@
84;;; *or* just delete the autoload declaration from scheme.el altogether, 84;;; *or* just delete the autoload declaration from scheme.el altogether,
85;;; which will allow the autoload in your .emacs to have its say. 85;;; which will allow the autoload in your .emacs to have its say.
86 86
87(provide 'cmuscheme)
88(require 'scheme) 87(require 'scheme)
89(require 'comint) 88(require 'comint)
90 89
@@ -428,3 +427,5 @@ This is a good place to put keybindings.")
428;;; 3/12/90 Olin 427;;; 3/12/90 Olin
429;;; - scheme-load-file and scheme-compile-file no longer switch-to-scheme. 428;;; - scheme-load-file and scheme-compile-file no longer switch-to-scheme.
430;;; Tale suggested this. 429;;; Tale suggested this.
430
431(provide 'cmuscheme)
diff --git a/lisp/comint.el b/lisp/comint.el
index 31e8b40e1e7..ab52362b064 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1,6 +1,5 @@
1;;; -*-Emacs-Lisp-*- General command interpreter in a window stuff 1;;; -*-Emacs-Lisp-*- General command interpreter in a window stuff
2;;; Copyright (C) 1989 Free Software Foundation, Inc. 2;;; Copyright Olin Shivers (1988).
3;;; Original author: Olin Shivers <olin.shivers@cs.cmu.edu> Aug 1988
4 3
5;;; This file is part of GNU Emacs. 4;;; This file is part of GNU Emacs.
6 5
@@ -18,6 +17,13 @@
18;;; along with GNU Emacs; see the file COPYING. If not, write to 17;;; along with GNU Emacs; see the file COPYING. If not, write to
19;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 19
20;;; The changelog is at the end of this file.
21
22;;; Please send me bug reports, bug fixes, and extensions, so that I can
23;;; merge them into the master source.
24;;; - Olin Shivers (shivers@cs.cmu.edu)
25
26;;; This hopefully generalises shell mode, lisp mode, tea mode, soar mode,...
21;;; This file defines a general command-interpreter-in-a-buffer package 27;;; This file defines a general command-interpreter-in-a-buffer package
22;;; (comint mode). The idea is that you can build specific process-in-a-buffer 28;;; (comint mode). The idea is that you can build specific process-in-a-buffer
23;;; modes on top of comint mode -- e.g., lisp, shell, scheme, T, soar, .... 29;;; modes on top of comint mode -- e.g., lisp, shell, scheme, T, soar, ....
@@ -25,19 +31,55 @@
25;;; and a common set of bindings, which makes them easier to use (and 31;;; and a common set of bindings, which makes them easier to use (and
26;;; saves code, implementation time, etc., etc.). 32;;; saves code, implementation time, etc., etc.).
27 33
34;;; Several packages are already defined using comint mode:
35;;; - cmushell.el defines a shell-in-a-buffer mode.
36;;; - cmulisp.el defines a simple lisp-in-a-buffer mode.
37;;; Cmushell and cmulisp mode are similar to, and intended to replace,
38;;; their counterparts in the standard gnu emacs release (in shell.el).
39;;; These replacements are more featureful, robust, and uniform than the
40;;; released versions. The key bindings in lisp mode are also more compatible
41;;; with the bindings of Hemlock and Zwei (the Lisp Machine emacs).
42;;;
43;;; - The file cmuscheme.el defines a scheme-in-a-buffer mode.
44;;; - The file tea.el tunes scheme and inferior-scheme modes for T.
45;;; - The file soar.el tunes lisp and inferior-lisp modes for Soar.
46;;; - cmutex.el defines tex and latex modes that invoke tex, latex, bibtex,
47;;; previewers, and printers from within emacs.
48;;; - background.el allows csh-like job control inside emacs.
49;;; It is pretty easy to make new derived modes for other processes.
50
28;;; For documentation on the functionality provided by comint mode, and 51;;; For documentation on the functionality provided by comint mode, and
29;;; the hooks available for customising it, see the comments below. 52;;; the hooks available for customising it, see the comments below.
30;;; For further information on the standard derived modes (shell, 53;;; For further information on the standard derived modes (shell,
31;;; inferior-lisp, inferior-scheme, ...), see the relevant source files. 54;;; inferior-lisp, inferior-scheme, ...), see the relevant source files.
32 55
33;;; For hints on converting existing process modes to use comint-mode 56;;; For hints on converting existing process modes (e.g., tex-mode,
57;;; background, dbx, gdb, kermit, prolog, telnet) to use comint-mode
34;;; instead of shell-mode, see the notes at the end of this file. 58;;; instead of shell-mode, see the notes at the end of this file.
35 59
36(require 'history) 60(defconst comint-version "2.02")
37(provide 'comint)
38(defconst comint-version "2.01")
39 61
40 62
63;;; Brief Command Documentation:
64;;;============================================================================
65;;; Comint Mode Commands: (common to all derived modes, like cmushell & cmulisp
66;;; mode)
67;;;
68;;; m-p comint-previous-input Cycle backwards in input history
69;;; m-n comint-next-input Cycle forwards
70;;; m-s comint-previous-similar-input Previous similar input
71;;; c-c c-r comint-previous-input-matching Search backwards in input history
72;;; return comint-send-input
73;;; c-a comint-bol Beginning of line; skip prompt.
74;;; c-d comint-delchar-or-maybe-eof Delete char unless at end of buff.
75;;; c-c c-u comint-kill-input ^u
76;;; c-c c-w backward-kill-word ^w
77;;; c-c c-c comint-interrupt-subjob ^c
78;;; c-c c-z comint-stop-subjob ^z
79;;; c-c c-\ comint-quit-subjob ^\
80;;; c-c c-o comint-kill-output Delete last batch of process output
81;;; c-c c-r comint-show-output Show last batch of process output
82;;;
41;;; Not bound by default in comint-mode 83;;; Not bound by default in comint-mode
42;;; send-invisible Read a line w/o echo, and send to proc 84;;; send-invisible Read a line w/o echo, and send to proc
43;;; (These are bound in shell-mode) 85;;; (These are bound in shell-mode)
@@ -45,33 +87,26 @@
45;;; comint-dynamic-list-completions List completions in help buffer. 87;;; comint-dynamic-list-completions List completions in help buffer.
46;;; comint-replace-by-expanded-filename Expand and complete filename at point; 88;;; comint-replace-by-expanded-filename Expand and complete filename at point;
47;;; replace with expanded/completed name. 89;;; replace with expanded/completed name.
48(defvar comint-mode-map nil) 90;;; comint-kill-subjob No mercy.
91;;; comint-continue-subjob Send CONT signal to buffer's process
92;;; group. Useful if you accidentally
93;;; suspend your process (with C-c C-z).
94;;;
95;;; These used to be bound for RMS -- I prefer the input history stuff,
96;;; but you might like 'em.
97;;; m-P comint-msearch-input Search backwards for prompt
98;;; m-N comint-psearch-input Search forwards for prompt
99;;; C-cR comint-msearch-input-matching Search backwards for prompt & string
100
101;;; comint-mode-hook is the comint mode hook. Basically for your keybindings.
102;;; comint-load-hook is run after loading in this package.
49 103
50(if comint-mode-map
51 nil
52 (setq comint-mode-map (make-sparse-keymap))
53 (define-key comint-mode-map "\C-a" 'comint-bol)
54 (define-key comint-mode-map "\C-d" 'comint-delchar-or-maybe-eof)
55 (define-key comint-mode-map "\C-m" 'comint-send-input)
56 (define-key comint-mode-map "\M-p" 'comint-previous-input)
57 (define-key comint-mode-map "\M-n" 'comint-next-input)
58 (define-key comint-mode-map "\M-s" 'comint-previous-similar-input)
59 (define-key comint-mode-map "\C-c\C-c" 'comint-interrupt-subjob) ; tty ^C
60 (define-key comint-mode-map "\C-c\C-f" 'comint-continue-subjob) ; shell "fg"
61 (define-key comint-mode-map "\C-c\C-l" 'comint-show-output)
62 (define-key comint-mode-map "\C-c\C-o" 'comint-flush-output) ; tty ^O
63 (define-key comint-mode-map "\C-c\C-r" 'comint-history-search-backward)
64 (define-key comint-mode-map "\C-c\C-s" 'comint-history-search-forward)
65 (define-key comint-mode-map "\C-c\C-u" 'comint-kill-input) ; tty ^U
66 (define-key comint-mode-map "\C-c\C-w" 'backward-kill-word) ; tty ^W
67 (define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob) ; tty ^Z
68 (define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob)) ; tty ^\
69 104
70;;; Buffer Local Variables: 105;;; Buffer Local Variables:
71;;;============================================================================ 106;;;============================================================================
72;;; Comint mode buffer local variables: 107;;; Comint mode buffer local variables:
73;;; comint-prompt-regexp - string comint-bol uses to match prompt. 108;;; comint-prompt-regexp - string comint-bol uses to match prompt.
74;;; comint-last-input-end - marker For comint-flush-output command 109;;; comint-last-input-end - marker For comint-kill-output command
75;;; input-ring-size - integer For the input history 110;;; input-ring-size - integer For the input history
76;;; input-ring - ring mechanism 111;;; input-ring - ring mechanism
77;;; input-ring-index - marker ... 112;;; input-ring-index - marker ...
@@ -82,57 +117,78 @@
82;;; comint-input-send - function 117;;; comint-input-send - function
83;;; comint-eol-on-send - boolean 118;;; comint-eol-on-send - boolean
84 119
85(make-variable-buffer-local 120(defvar comint-prompt-regexp "^"
86 (defvar comint-prompt-regexp "^" 121 "Regexp to recognise prompts in the inferior process.
87 "*Regexp to recognise prompts in the inferior process. Defaults to \"^\". 122Defaults to \"^\", the null string at BOL.
88 123
89Good choices: 124Good choices:
90 Canonical Lisp: \"^[^> \n]*>+:? *\" (Lucid, Franz, KCL, T, cscheme, oaklisp) 125 Canonical Lisp: \"^[^> ]*>+:? *\" (Lucid, franz, kcl, T, cscheme, oaklisp)
91 Lucid Common Lisp: \"^\\(>\\|\\(->\\)+\\) *\" 126 Lucid Common Lisp: \"^\\(>\\|\\(->\\)+\\) *\"
92 Franz: \"^\\(->\\|<[0-9]*>:\\) *\" 127 franz: \"^\\(->\\|<[0-9]*>:\\) *\"
93 KCL and T: \"^>+ *\" 128 kcl: \"^>+ *\"
94 shell: \"^[^#$%>\n]*[#$%>] *\" 129 shell: \"^[^#$%>]*[#$%>] *\"
130 T: \"^>+ *\"
95 131
96This is a good thing to set in mode hooks.")) 132This is a good thing to set in mode hooks.")
97 133
98(make-variable-buffer-local 134(defvar input-ring-size 30
99 (defvar input-ring-size 30 "Size of input history ring.")) 135 "Size of input history ring.")
100 136
101;;; Here are the per-interpreter hooks. 137;;; Here are the per-interpreter hooks.
102(make-variable-buffer-local 138(defvar comint-get-old-input (function comint-get-old-input-default)
103 (defvar comint-get-old-input (function comint-get-old-input-default) 139 "Function that submits old text in comint mode.
104 "Function that submits old text in comint mode.
105This function is called when return is typed while the point is in old text. 140This function is called when return is typed while the point is in old text.
106It returns the text to be submitted as process input. The default is 141It returns the text to be submitted as process input. The default is
107comint-get-old-input-default, which grabs the current line, and strips off 142comint-get-old-input-default, which grabs the current line, and strips off
108leading text matching comint-prompt-regexp.")) 143leading text matching comint-prompt-regexp")
109 144
110(make-variable-buffer-local 145(defvar comint-input-sentinel (function ignore)
111 (defvar comint-input-sentinel (function ignore) 146 "Called on each input submitted to comint mode process by comint-send-input.
112 "Called on each input submitted to comint mode process by comint-send-input. 147Thus it can, for instance, track cd/pushd/popd commands issued to the csh.")
113Thus it can, for instance, track cd/pushd/popd commands issued to the csh."))
114 148
115(make-variable-buffer-local 149(defvar comint-input-filter
116 (defvar comint-input-filter 150 (function (lambda (str) (not (string-match "\\`\\s *\\'" str))))
117 (function (lambda (str) (not (string-match "\\`\\s *\\'" str)))) 151 "Predicate for filtering additions to input history.
118 "Predicate for filtering additions to input history.
119Only inputs answering true to this function are saved on the input 152Only inputs answering true to this function are saved on the input
120history list. Default is to save anything that isn't all whitespace")) 153history list. Default is to save anything that isn't all whitespace")
154
155(defvar comint-input-sender (function comint-simple-send)
156 "Function to actually send to PROCESS the STRING submitted by user.
157Usually this is just 'comint-simple-send, but if your mode needs to
158massage the input string, this is your hook. This is called from
159the user command comint-send-input. comint-simple-send just sends
160the string plus a newline.")
161
162(defvar comint-eol-on-send 'T
163 "If non-nil, then jump to the end of the line before sending input to process.
164See comint-send-input")
121 165
122(defvar comint-mode-hook '() 166(defvar comint-mode-hook '()
123 "Called upon entry into comint-mode") 167 "Called upon entry into comint-mode
168This is run before the process is cranked up.")
169
170(defvar comint-exec-hook '()
171 "Called each time a process is exec'd by comint-exec.
172This is called after the process is cranked up. It is useful for things that
173must be done each time a process is executed in a comint-mode buffer (e.g.,
174(process-kill-without-query)). In contrast, the comint-mode-hook is only
175executed once when the buffer is created.")
176
177(defvar comint-mode-map nil)
124 178
125(defun comint-mode () 179(defun comint-mode ()
126 "Major mode for interacting with an inferior interpreter. 180 "Major mode for interacting with an inferior interpreter.
127Interpreter name is same as buffer name, sans the asterisks. 181Interpreter name is same as buffer name, sans the asterisks.
128Return at end of buffer sends line as input. 182Return at end of buffer sends line as input.
129Return not at end copies rest of line to end and sends it. 183Return not at end copies rest of line to end and sends it.
184Setting mode variable comint-eol-on-send means jump to the end of the line
185before submitting new input.
130 186
131This mode is typically customised to create inferior-lisp-mode, 187This mode is typically customised to create inferior-lisp-mode,
132shell-mode, et cetera. This can be done by setting the hooks 188shell-mode, etc.. This can be done by setting the hooks
133comint-input-sentinel, comint-input-filter, and comint-get-old-input 189comint-input-sentinel, comint-input-filter, comint-input-sender and
134to appropriate functions, and the variable comint-prompt-regexp 190comint-get-old-input to appropriate functions, and the variable
135to the appropriate regular expression. 191comint-prompt-regexp to the appropriate regular expression.
136 192
137An input history is maintained of size input-ring-size, and 193An input history is maintained of size input-ring-size, and
138can be accessed with the commands comint-next-input [\\[comint-next-input]] and 194can be accessed with the commands comint-next-input [\\[comint-next-input]] and
@@ -145,58 +201,121 @@ to continue it.
145 201
146\\{comint-mode-map} 202\\{comint-mode-map}
147 203
148Entry to this mode runs the hooks on comint-mode-hook." 204Entry to this mode runs the hooks on comint-mode-hook"
149 (interactive) 205 (interactive)
150 (kill-all-local-variables) 206 (let ((old-ring (and (assq 'input-ring (buffer-local-variables))
151 (setq major-mode 'comint-mode 207 (boundp 'input-ring)
152 mode-name "Comint" 208 input-ring))
153 mode-line-process '(": %s")) 209 (old-ptyp comint-ptyp)) ; preserve across local var kill. gross.
154 (use-local-map comint-mode-map) 210; (kill-all-local-variables) ; Removed 1/15/90 Olin
155 (set (make-local-variable 'input-ring) (make-ring input-ring-size)) 211 (setq major-mode 'comint-mode)
156 (put 'input-ring 'preserved t) 212 (setq mode-name "Comint")
157 (set (make-local-variable 'comint-last-input-match) "") 213 (setq mode-line-process '(": %s"))
158 (set (make-local-variable 'comint-last-similar--string) "") 214 (use-local-map comint-mode-map)
159 (set (make-local-variable 'input-ring-index) 0) 215 (make-local-variable 'comint-last-input-end)
160 (set (make-local-variable 'comint-last-input-end) (make-marker)) 216 (setq comint-last-input-end (make-marker))
161 (set-marker comint-last-input-end (point-max)) 217 (make-local-variable 'comint-last-input-match)
162 (run-hooks 'comint-mode-hook)) 218 (setq comint-last-input-match "")
163 219 (make-local-variable 'comint-prompt-regexp) ; Don't set; default
164(defun comint-check-proc (buffer-name) 220 (make-local-variable 'input-ring-size) ; ...to global val.
165 "True if there is a running or stopped process associated with BUFFER." 221 (make-local-variable 'input-ring)
166 (let ((proc (get-buffer-process buffer-name))) 222 (make-local-variable 'input-ring-index)
167 (and proc (memq (process-status proc) '(run stop))))) 223 (setq input-ring-index 0)
224 (make-local-variable 'comint-get-old-input)
225 (make-local-variable 'comint-input-sentinel)
226 (make-local-variable 'comint-input-filter)
227 (make-local-variable 'comint-input-sender)
228 (make-local-variable 'comint-eol-on-send)
229 (make-local-variable 'comint-ptyp)
230 (setq comint-ptyp old-ptyp)
231 (run-hooks 'comint-mode-hook)
232 ;Do this after the hook so the user can mung INPUT-RING-SIZE w/his hook.
233 ;The test is so we don't lose history if we run comint-mode twice in
234 ;a buffer.
235 (setq input-ring (if (ring-p old-ring) old-ring
236 (make-ring input-ring-size)))))
237
238;;; The old-ptyp stuff above is because we have to preserve the value of
239;;; comint-ptyp across calls to comint-mode, in spite of the
240;;; kill-all-local-variables that it does. Blech. Hopefully, this will all
241;;; go away when a later release fixes the signalling bug.
242;;; (Later: I removed the kill-all-local-variables, but have left this
243;;; other code in place just in case I reverse myself.)
168 244
169(defun comint-mark () 245(if comint-mode-map
170 ;; Returns the process-mark of the current-buffer 246 nil
171 (process-mark (get-buffer-process (current-buffer)))) 247 (setq comint-mode-map (make-sparse-keymap))
248 (define-key comint-mode-map "\ep" 'comint-previous-input)
249 (define-key comint-mode-map "\en" 'comint-next-input)
250 (define-key comint-mode-map "\es" 'comint-previous-similar-input)
251 (define-key comint-mode-map "\C-m" 'comint-send-input)
252 (define-key comint-mode-map "\C-d" 'comint-delchar-or-maybe-eof)
253 (define-key comint-mode-map "\C-a" 'comint-bol)
254 (define-key comint-mode-map "\C-c\C-u" 'comint-kill-input)
255 (define-key comint-mode-map "\C-c\C-w" 'backward-kill-word)
256 (define-key comint-mode-map "\C-c\C-c" 'comint-interrupt-subjob)
257 (define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob)
258 (define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob)
259 (define-key comint-mode-map "\C-c\C-o" 'comint-kill-output)
260 (define-key comint-mode-map "\C-\M-r" 'comint-previous-input-matching)
261 (define-key comint-mode-map "\C-c\C-r" 'comint-show-output)
262 ;;; prompt-search commands commented out 3/90 -Olin
263; (define-key comint-mode-map "\eP" 'comint-msearch-input)
264; (define-key comint-mode-map "\eN" 'comint-psearch-input)
265; (define-key comint-mode-map "\C-cR" 'comint-msearch-input-matching)
266 )
267
268
269;;; This function is used to make a full copy of the comint mode map,
270;;; so that client modes won't interfere with each other. This function
271;;; isn't necessary in emacs 18.5x, but we keep it around for 18.4x versions.
272(defun full-copy-sparse-keymap (km)
273 "Recursively copy the sparse keymap KM"
274 (cond ((consp km)
275 (cons (full-copy-sparse-keymap (car km))
276 (full-copy-sparse-keymap (cdr km))))
277 (t km)))
278
279(defun comint-check-proc (buffer)
280 "True if there is a process associated w/buffer BUFFER, and
281it is alive (status RUN or STOP). BUFFER can be either a buffer or the
282name of one"
283 (let ((proc (get-buffer-process buffer)))
284 (and proc (memq (process-status proc) '(run stop)))))
172 285
173;;; Note that this guy, unlike shell.el's make-shell, barfs if you pass it () 286;;; Note that this guy, unlike shell.el's make-shell, barfs if you pass it ()
174;;; for the second argument (program). 287;;; for the second argument (program).
175(defun make-comint (name program &optional startfile &rest switches) 288(defun make-comint (name program &optional startfile &rest switches)
176 (let* ((buffer (get-buffer-create (concat "*" name "*"))) 289 (let ((buffer (get-buffer-create (concat "*" name "*"))))
177 (proc (get-buffer-process buffer)))
178 ;; If no process, or nuked process, crank up a new one and put buffer in 290 ;; If no process, or nuked process, crank up a new one and put buffer in
179 ;; comint mode. Otherwise, leave buffer and existing process alone. 291 ;; comint mode. Otherwise, leave buffer and existing process alone.
180 (cond ((not (comint-check-proc buffer)) 292 (cond ((not (comint-check-proc buffer))
181 (save-excursion 293 (save-excursion
182 (set-buffer buffer) 294 (set-buffer buffer)
183 (comint-mode)) ; Install local vars, mode, keymap, ... 295 (comint-mode)) ; Install local vars, mode, keymap, ...
184 (comint-exec buffer name program startfile switches))) 296 (comint-exec buffer name program startfile switches)))
185 buffer)) 297 buffer))
186 298
299(defvar comint-ptyp t
300 "True if communications via pty; false if by pipe. Buffer local.
301This is to work around a bug in emacs process signalling.")
302
187(defun comint-exec (buffer name command startfile switches) 303(defun comint-exec (buffer name command startfile switches)
188 "Fires up a process in buffer for comint modes. 304 "Fires up a process in buffer for comint modes.
189Blasts any old process running in the buffer. Doesn't set the buffer mode. 305Blasts any old process running in the buffer. Doesn't set the buffer mode.
190You can use this to cheaply run a series of processes in the same buffer." 306You can use this to cheaply run a series of processes in the same comint
191 (or command (error "No program for comint process")) 307buffer. The hook comint-exec-hook is run after each exec."
192 (save-excursion 308 (save-excursion
193 (set-buffer buffer) 309 (set-buffer buffer)
194 (let ((proc (get-buffer-process buffer))) ; Blast any old process. 310 (let ((proc (get-buffer-process buffer))) ; Blast any old process.
195 (if proc (delete-process proc))) 311 (if proc (delete-process proc)))
196 ;; Crank up a new process 312 ;; Crank up a new process
197 (let ((proc (comint-exec-1 name buffer command switches))) 313 (let ((proc (comint-exec-1 name buffer command switches)))
314 (make-local-variable 'comint-ptyp)
315 (setq comint-ptyp process-connection-type) ; T if pty, NIL if pipe.
198 ;; Jump to the end, and set the process mark. 316 ;; Jump to the end, and set the process mark.
199 (set-marker (comint-mark) (goto-char (point-max))) 317 (goto-char (point-max))
318 (set-marker (process-mark proc) (point)))
200 ;; Feed it the startfile. 319 ;; Feed it the startfile.
201 (cond (startfile 320 (cond (startfile
202 ;;This is guaranteed to wait long enough 321 ;;This is guaranteed to wait long enough
@@ -209,7 +328,8 @@ You can use this to cheaply run a series of processes in the same buffer."
209 (insert-file-contents startfile) 328 (insert-file-contents startfile)
210 (setq startfile (buffer-substring (point) (point-max))) 329 (setq startfile (buffer-substring (point) (point-max)))
211 (delete-region (point) (point-max)) 330 (delete-region (point) (point-max))
212 (comint-send-string proc startfile)))) 331 (comint-send-string proc startfile)))
332 (run-hooks 'comint-exec-hook)
213 buffer)) 333 buffer))
214 334
215;;; This auxiliary function cranks up the process for comint-exec in 335;;; This auxiliary function cranks up the process for comint-exec in
@@ -228,6 +348,7 @@ You can use this to cheaply run a series of processes in the same buffer."
228 "TERM=emacs" 348 "TERM=emacs"
229 "EMACS=t")))) 349 "EMACS=t"))))
230 (apply 'start-process name buffer command switches)) 350 (apply 'start-process name buffer command switches))
351
231 (let ((tcapv (getenv "TERMCAP")) 352 (let ((tcapv (getenv "TERMCAP"))
232 (termv (getenv "TERM")) 353 (termv (getenv "TERM"))
233 (emv (getenv "EMACS"))) 354 (emv (getenv "EMACS")))
@@ -240,6 +361,8 @@ You can use this to cheaply run a series of processes in the same buffer."
240 (setenv "TERMCAP" tcapv) 361 (setenv "TERMCAP" tcapv)
241 (setenv "TERM" termv) 362 (setenv "TERM" termv)
242 (setenv "EMACS" emv))))) 363 (setenv "EMACS" emv)))))
364
365
243 366
244;; This is just (append new old-env) that compresses out shadowed entries. 367;; This is just (append new old-env) that compresses out shadowed entries.
245;; It's also pretty ugly, mostly due to elisp's horrible iteration structures. 368;; It's also pretty ugly, mostly due to elisp's horrible iteration structures.
@@ -254,42 +377,166 @@ You can use this to cheaply run a series of processes in the same buffer."
254 (var (and (string-match "^[^=]*=" vv) 377 (var (and (string-match "^[^=]*=" vv)
255 (substring vv 0 (match-end 0))))) 378 (substring vv 0 (match-end 0)))))
256 (setq old-env (cdr old-env)) 379 (setq old-env (cdr old-env))
257 (cond ((not (and var (member var vars))) 380 (cond ((not (and var (comint-mem var vars)))
258 (if var (setq var (cons var vars))) 381 (if var (setq var (cons var vars)))
259 (setq ans (cons vv ans)))))) 382 (setq ans (cons vv ans))))))
260 (nreverse ans))) 383 (nreverse ans)))
384
385;;; This should be in emacs, but it isn't.
386(defun comint-mem (item list &optional elt=)
387 "Test to see if ITEM is equal to an item in LIST.
388Option comparison function ELT= defaults to equal."
389 (let ((elt= (or elt= (function equal)))
390 (done nil))
391 (while (and list (not done))
392 (if (funcall elt= item (car list))
393 (setq done list)
394 (setq list (cdr list))))
395 done))
396
261 397
398;;; Ring Code
399;;;============================================================================
400;;; This code defines a ring data structure. A ring is a
401;;; (hd-index tl-index . vector)
402;;; list. You can insert to, remove from, and rotate a ring. When the ring
403;;; fills up, insertions cause the oldest elts to be quietly dropped.
404;;;
405;;; HEAD = index of the newest item on the ring.
406;;; TAIL = index of the oldest item on the ring.
407;;;
408;;; These functions are used by the input history mechanism, but they can
409;;; be used for other purposes as well.
410
411(defun ring-p (x)
412 "T if X is a ring; NIL otherwise."
413 (and (consp x) (integerp (car x))
414 (consp (cdr x)) (integerp (car (cdr x)))
415 (vectorp (cdr (cdr x)))))
416
417(defun make-ring (size)
418 "Make a ring that can contain SIZE elts"
419 (cons 1 (cons 0 (make-vector (+ size 1) nil))))
420
421(defun ring-plus1 (index veclen)
422 "INDEX+1, with wraparound"
423 (let ((new-index (+ index 1)))
424 (if (= new-index veclen) 0 new-index)))
425
426(defun ring-minus1 (index veclen)
427 "INDEX-1, with wraparound"
428 (- (if (= 0 index) veclen index) 1))
429
430(defun ring-length (ring)
431 "Number of elts in the ring."
432 (let ((hd (car ring)) (tl (car (cdr ring))) (siz (length (cdr (cdr ring)))))
433 (let ((len (if (<= hd tl) (+ 1 (- tl hd)) (+ 1 tl (- siz hd)))))
434 (if (= len siz) 0 len))))
435
436(defun ring-empty-p (ring)
437 (= 0 (ring-length ring)))
438
439(defun ring-insert (ring item)
440 "Insert a new item onto the ring. If the ring is full, dump the oldest
441item to make room."
442 (let* ((vec (cdr (cdr ring))) (len (length vec))
443 (new-hd (ring-minus1 (car ring) len)))
444 (setcar ring new-hd)
445 (aset vec new-hd item)
446 (if (ring-empty-p ring) ;overflow -- dump one off the tail.
447 (setcar (cdr ring) (ring-minus1 (car (cdr ring)) len)))))
448
449(defun ring-remove (ring)
450 "Remove the oldest item retained on the ring."
451 (if (ring-empty-p ring) (error "Ring empty")
452 (let ((tl (car (cdr ring))) (vec (cdr (cdr ring))))
453 (set-car (cdr ring) (ring-minus1 tl (length vec)))
454 (aref vec tl))))
455
456;;; This isn't actually used in this package. I just threw it in in case
457;;; someone else wanted it. If you want rotating-ring behavior on your history
458;;; retrieval (analagous to kill ring behavior), this function is what you
459;;; need. I should write the yank-input and yank-pop-input-or-kill to go with
460;;; this, and not bind it to a key by default, so it would be available to
461;;; people who want to bind it to a key. But who would want it? Blech.
462(defun ring-rotate (ring n)
463 (if (not (= n 0))
464 (if (ring-empty-p ring) ;Is this the right error check?
465 (error "ring empty")
466 (let ((hd (car ring)) (tl (car (cdr ring))) (vec (cdr (cdr ring))))
467 (let ((len (length vec)))
468 (while (> n 0)
469 (setq tl (ring-plus1 tl len))
470 (aset ring tl (aref ring hd))
471 (setq hd (ring-plus1 hd len))
472 (setq n (- n 1)))
473 (while (< n 0)
474 (setq hd (ring-minus1 hd len))
475 (aset vec hd (aref vec tl))
476 (setq tl (ring-minus1 tl len))
477 (setq n (- n 1))))
478 (set-car ring hd)
479 (set-car (cdr ring) tl)))))
480
481(defun comint-mod (n m)
482 "Returns N mod M. M is positive. Answer is guaranteed to be non-negative,
483and less than m."
484 (let ((n (% n m)))
485 (if (>= n 0) n
486 (+ n
487 (if (>= m 0) m (- m)))))) ; (abs m)
488
489(defun ring-ref (ring index)
490 (let ((numelts (ring-length ring)))
491 (if (= numelts 0) (error "indexed empty ring")
492 (let* ((hd (car ring)) (tl (car (cdr ring))) (vec (cdr (cdr ring)))
493 (index (comint-mod index numelts))
494 (vec-index (comint-mod (+ index hd)
495 (length vec))))
496 (aref vec vec-index)))))
497
498
262;;; Input history retrieval commands 499;;; Input history retrieval commands
263;;; M-p -- previous input M-n -- next input 500;;; M-p -- previous input M-n -- next input
264;;; C-c r -- previous input matching 501;;; M-C-r -- previous input matching
265;;; =========================================================================== 502;;; ===========================================================================
266 503
267(defun comint-previous-input (arg) 504(defun comint-previous-input (arg)
268 "Cycle backwards through input history." 505 "Cycle backwards through input history."
269 (interactive "*p") 506 (interactive "*p")
270 (let ((len (ring-length input-ring))) 507 (let ((len (ring-length input-ring)))
271 (if (<= len 0) (error "Empty input ring")) 508 (cond ((<= len 0)
272 (if (< (point) (comint-mark)) 509 (message "Empty input ring")
273 (delete-region (comint-mark) (goto-char (point-max)))) 510 (ding))
274 (cond ((eq last-command 'comint-previous-input) 511 ((not (comint-after-pmark-p))
275 (delete-region (mark) (point))) 512 (message "Not after process mark")
276 ((eq last-command 'comint-previous-similar-input) 513 (ding))
277 (delete-region (comint-mark) (point))) 514 (t
278 (t 515 (cond ((eq last-command 'comint-previous-input)
279 (setq input-ring-index 516 (delete-region (mark) (point)))
280 (if (> arg 0) -1 517 ((eq last-command 'comint-previous-similar-input)
281 (if (< arg 0) 1 0))) 518 (delete-region
282 (push-mark (point)))) 519 (process-mark (get-buffer-process (current-buffer)))
283 (setq input-ring-index (comint-mod (+ input-ring-index arg) len)) 520 (point)))
284 (message "%d" (1+ input-ring-index)) 521 (t
285 (insert (ring-ref input-ring input-ring-index)) 522 (setq input-ring-index
286 (setq this-command 'comint-previous-input))) 523 (if (> arg 0) -1
287 524 (if (< arg 0) 1 0)))
525 (push-mark (point))))
526 (setq input-ring-index (comint-mod (+ input-ring-index arg) len))
527 (message "%d" (1+ input-ring-index))
528 (insert (ring-ref input-ring input-ring-index))
529 (setq this-command 'comint-previous-input)))))
530
288(defun comint-next-input (arg) 531(defun comint-next-input (arg)
289 "Cycle forwards through input history." 532 "Cycle forwards through input history."
290 (interactive "*p") 533 (interactive "*p")
291 (comint-previous-input (- arg))) 534 (comint-previous-input (- arg)))
292 535
536(defvar comint-last-input-match ""
537 "Last string searched for by comint input history search, for defaulting.
538Buffer local variable.")
539
293(defun comint-previous-input-matching (str) 540(defun comint-previous-input-matching (str)
294 "Searches backwards through input history for substring match." 541 "Searches backwards through input history for substring match."
295 (interactive (let* ((last-command last-command) ; preserve around r-f-m 542 (interactive (let* ((last-command last-command) ; preserve around r-f-m
@@ -310,24 +557,84 @@ You can use this to cheaply run a series of processes in the same buffer."
310 (comint-previous-input (- n input-ring-index))) 557 (comint-previous-input (- n input-ring-index)))
311 (t (if (eq last-command 'comint-previous-input) 558 (t (if (eq last-command 'comint-previous-input)
312 (setq this-command 'comint-previous-input)) 559 (setq this-command 'comint-previous-input))
313 (error "Not found"))))) 560 (message "Not found.")
561 (ding)))))
562
563
564;;; These next three commands are alternatives to the input history commands
565;;; -- comint-next-input, comint-previous-input and
566;;; comint-previous-input-matching. They search through the process buffer
567;;; text looking for occurrences of the prompt. Bound to M-P, M-N, and C-c R
568;;; (uppercase P, N, and R) for now. Try'em out. Go with what you like...
569
570;;; comint-msearch-input-matching prompts for a string, not a regexp.
571;;; This could be considered to be the wrong thing. I decided to keep it
572;;; simple, and not make the user worry about regexps. This, of course,
573;;; limits functionality.
574
575;;; These commands were deemed non-winning and have been commented out.
576;;; Feel free to re-enable them if you like. -Olin 3/91
577
578;(defun comint-psearch-input ()
579; "Search forwards for next occurrence of prompt and skip to end of line.
580;\(prompt is anything matching regexp comint-prompt-regexp)"
581; (interactive)
582; (if (re-search-forward comint-prompt-regexp (point-max) t)
583; (end-of-line)
584; (error "No occurrence of prompt found")))
585;
586;(defun comint-msearch-input ()
587; "Search backwards for previous occurrence of prompt and skip to end of line.
588;Search starts from beginning of current line."
589; (interactive)
590; (let ((p (save-excursion
591; (beginning-of-line)
592; (cond ((re-search-backward comint-prompt-regexp (point-min) t)
593; (end-of-line)
594; (point))
595; (t nil)))))
596; (if p (goto-char p)
597; (error "No occurrence of prompt found"))))
598;
599;(defun comint-msearch-input-matching (str)
600; "Search backwards for occurrence of prompt followed by STRING.
601;STRING is prompted for, and is NOT a regular expression."
602; (interactive (let ((s (read-from-minibuffer
603; (format "Command (default %s): "
604; comint-last-input-match))))
605; (list (if (string= s "") comint-last-input-match s))))
606;; (interactive "sCommand: ")
607; (setq comint-last-input-match str) ; update default
608; (let* ((r (concat comint-prompt-regexp (regexp-quote str)))
609; (p (save-excursion
610; (beginning-of-line)
611; (cond ((re-search-backward r (point-min) t)
612; (end-of-line)
613; (point))
614; (t nil)))))
615; (if p (goto-char p)
616; (error "No match"))))
314 617
315;;; 618;;;
316;;; Similar input -- contributed by ccm and highly winning. 619;;; Similar input -- contributed by ccm and highly winning.
317;;; 620;;;
318;;; Reenter input, removing back to the last insert point if it exists. 621;;; Reenter input, removing back to the last insert point if it exists.
319;;; 622;;;
623(defvar comint-last-similar-string ""
624 "The string last used in a similar string search.")
320(defun comint-previous-similar-input (arg) 625(defun comint-previous-similar-input (arg)
321 "Reenters the last input that matches the string typed so far. If repeated 626 "Reenters the last input that matches the string typed so far. If repeated
322successively older inputs are reentered. If arg is 1, it will go back 627successively older inputs are reentered. If arg is 1, it will go back
323in the history, if -1 it will go forward." 628in the history, if -1 it will go forward."
324 (interactive "p") 629 (interactive "p")
325 (if (< (point) (comint-mark)) 630 (if (not (comint-after-pmark-p))
326 (error "Not after process mark")) 631 (error "Not after process mark"))
327 (if (not (eq last-command 'comint-previous-similar-input)) 632 (if (not (eq last-command 'comint-previous-similar-input))
328 (setq input-ring-index -1 633 (setq input-ring-index -1
329 comint-last-similar-string 634 comint-last-similar-string
330 (buffer-substring (comint-mark) (point)))) 635 (buffer-substring
636 (process-mark (get-buffer-process (current-buffer)))
637 (point))))
331 (let* ((size (length comint-last-similar-string)) 638 (let* ((size (length comint-last-similar-string))
332 (len (ring-length input-ring)) 639 (len (ring-length input-ring))
333 (n (+ input-ring-index arg)) 640 (n (+ input-ring-index arg))
@@ -340,101 +647,139 @@ in the history, if -1 it will go forward."
340 (cond ((< n len) 647 (cond ((< n len)
341 (setq input-ring-index n) 648 (setq input-ring-index n)
342 (if (eq last-command 'comint-previous-similar-input) 649 (if (eq last-command 'comint-previous-similar-input)
343 (delete-region (comint-mark) (point))) 650 (delete-region (mark) (point)) ; repeat
651 (push-mark (point))) ; 1st time
344 (insert (substring entry size))) 652 (insert (substring entry size)))
345 (t (error "Not found"))))) 653 (t (message "Not found.") (ding) (sit-for 1)))
654 (message "%d" (1+ input-ring-index))))
655
346 656
347(defun comint-send-input (&optional terminator delete) 657(defun comint-send-input ()
348 "Send input to process, followed by a linefeed or optional TERMINATOR. 658 "Send input to process. After the process output mark, sends all text
349After the process output mark, sends all text from the process mark to 659from the process mark to point as input to the process. Before the process
350end of buffer as input to the process. Before the process output mark, calls 660output mark, calls value of variable comint-get-old-input to retrieve old
351value of variable comint-get-old-input to retrieve old input, replaces it in 661input, copies it to the process mark, and sends it. A terminal newline is
352the input region (from the end of process output to the end of the buffer) and 662also inserted into the buffer and sent to the process. In either case, value
353then sends it. In either case, the value of variable comint-input-sentinel is 663of variable comint-input-sentinel is called on the input before sending it.
354called on the input before sending it. The input is entered into the input 664The input is entered into the input history ring, if the value of variable
355history ring, if value of variable comint-input-filter returns non-nil when 665comint-input-filter returns non-nil when called on the input.
356called on the input. 666
357 667If variable comint-eol-on-send is non-nil, then point is moved to the end of
358If optional second argument DELETE is non-nil, then the input is deleted from 668line before sending the input.
359the end of the buffer. This is useful if the process unconditionally echoes
360input. Processes which use TERMINATOR or DELETE should have a command wrapper
361which provides them bound to RET; see telnet.el for an example.
362 669
363comint-get-old-input, comint-input-sentinel, and comint-input-filter are chosen 670comint-get-old-input, comint-input-sentinel, and comint-input-filter are chosen
364according to the command interpreter running in the buffer. For example, 671according to the command interpreter running in the buffer. E.g.,
365
366If the interpreter is the csh, 672If the interpreter is the csh,
367 comint-get-old-input defaults: takes the current line, discard any 673 comint-get-old-input is the default: take the current line, discard any
368 initial string matching regexp comint-prompt-regexp. 674 initial string matching regexp comint-prompt-regexp.
369 comint-input-sentinel: monitors input for \"cd\", \"pushd\", and \"popd\" 675 comint-input-sentinel monitors input for \"cd\", \"pushd\", and \"popd\"
370 commands. When it sees one, it changes the default directory of the buffer. 676 commands. When it sees one, it cd's the buffer.
371 comint-input-filter defaults: returns t if the input isn't all whitespace. 677 comint-input-filter is the default: returns T if the input isn't all white
678 space.
372 679
373If the comint is Lucid Common Lisp, 680If the comint is Lucid Common Lisp,
374 comint-get-old-input: snarfs the sexp ending at point. 681 comint-get-old-input snarfs the sexp ending at point.
375 comint-input-sentinel: does nothing. 682 comint-input-sentinel does nothing.
376 comint-input-filter: returns nil if the input matches input-filter-regexp, 683 comint-input-filter returns NIL if the input matches input-filter-regexp,
377 which matches (1) all whitespace (2) :a, :c, etc. 684 which matches (1) all whitespace (2) :a, :c, etc.
378 685
379Similar functions are used for other process modes." 686Similarly for Soar, Scheme, etc.."
380 (interactive) 687 (interactive)
381 ;; Note that the input string does not include its terminal newline. 688 ;; Note that the input string does not include its terminal newline.
382 (if (not (get-buffer-process (current-buffer))) 689 (let ((proc (get-buffer-process (current-buffer))))
383 (error "Current buffer has no process") 690 (if (not proc) (error "Current buffer has no process")
384 (let* ((pmark (comint-mark)) 691 (let* ((pmark (process-mark proc))
385 (input (if (>= (point) pmark) 692 (pmark-val (marker-position pmark))
386 (buffer-substring pmark (goto-char (point-max))) 693 (input (if (>= (point) pmark-val)
387 (let ((copy (funcall comint-get-old-input))) 694 (progn (if comint-eol-on-send (end-of-line))
388 (delete-region pmark (goto-char (point-max))) 695 (buffer-substring pmark (point)))
389 (insert copy) 696 (let ((copy (funcall comint-get-old-input)))
390 copy)))) 697 (goto-char pmark)
391 (set-marker comint-last-input-end (point)) 698 (insert copy)
392 (setq input-ring-index 0) 699 copy))))
393 (if (funcall comint-input-filter input) (ring-insert input-ring input)) 700 (insert ?\n)
394 (funcall comint-input-sentinel input) 701 (if (funcall comint-input-filter input) (ring-insert input-ring input))
395 (comint-send-string nil (concat input (or terminator "\n"))) 702 (funcall comint-input-sentinel input)
396 (if delete (delete-region mark (point)) 703 (funcall comint-input-sender proc input)
397 (insert "\n")) 704 (set-marker (process-mark proc) (point))
398 (set-marker (comint-mark) (point))))) 705 (set-marker comint-last-input-end (point))))))
399 706
400(defun comint-get-old-input-default () 707(defun comint-get-old-input-default ()
401 "Default for comint-get-old-input: use the current line sans prompt." 708 "Default for comint-get-old-input: take the current line, and discard
709any initial text matching comint-prompt-regexp."
402 (save-excursion 710 (save-excursion
403 (comint-bol) 711 (beginning-of-line)
404 (buffer-substring (point) (progn (end-of-line) (point))))) 712 (comint-skip-prompt)
713 (let ((beg (point)))
714 (end-of-line)
715 (buffer-substring beg (point)))))
716
717(defun comint-skip-prompt ()
718 "Skip past the text matching regexp comint-prompt-regexp.
719If this takes us past the end of the current line, don't skip at all."
720 (let ((eol (save-excursion (end-of-line) (point))))
721 (if (and (looking-at comint-prompt-regexp)
722 (<= (match-end 0) eol))
723 (goto-char (match-end 0)))))
724
725
726(defun comint-after-pmark-p ()
727 "Is point after the process output marker?"
728 ;; Since output could come into the buffer after we looked at the point
729 ;; but before we looked at the process marker's value, we explicitly
730 ;; serialise. This is just because I don't know whether or not emacs
731 ;; services input during execution of lisp commands.
732 (let ((proc-pos (marker-position
733 (process-mark (get-buffer-process (current-buffer))))))
734 (<= proc-pos (point))))
735
736(defun comint-simple-send (proc string)
737 "Default function for sending to PROC input STRING.
738This just sends STRING plus a newline. To override this,
739set the hook COMINT-INPUT-SENDER."
740 (comint-send-string proc string)
741 (comint-send-string proc "\n"))
405 742
406(defun comint-bol (arg) 743(defun comint-bol (arg)
407 "Goes to the beginning of line, then skips past the prompt, if any. 744 "Goes to the beginning of line, then skips past the prompt, if any.
408With a prefix argument, (\\[universal-argument]), then doesn't skip prompt. 745If a prefix argument is given (\\[universal-argument]), then no prompt skip
746-- go straight to column 0.
409 747
410The prompt skip is done by passing over text matching the regular expression 748The prompt skip is done by skipping text matching the regular expression
411comint-prompt-regexp, a buffer local variable." 749comint-prompt-regexp, a buffer local variable.
750
751If you don't like this command, reset c-a to beginning-of-line
752in your hook, comint-mode-hook."
412 (interactive "P") 753 (interactive "P")
413 (beginning-of-line) 754 (beginning-of-line)
414 (or arg (if (looking-at comint-prompt-regexp) (goto-char (match-end 0))))) 755 (if (null arg) (comint-skip-prompt)))
415 756
416;;; These two functions are for entering text you don't want echoed or 757;;; These two functions are for entering text you don't want echoed or
417;;; saved -- typically passwords to ftp, telnet, or somesuch. 758;;; saved -- typically passwords to ftp, telnet, or somesuch.
418;;; Just enter M-x send-invisible and type in your line. 759;;; Just enter m-x send-invisible and type in your line.
760
419(defun comint-read-noecho (prompt) 761(defun comint-read-noecho (prompt)
420 "Prompting with PROMPT, read a single line of text without echoing. 762 "Prompt the user with argument PROMPT. Read a single line of text
421The text can still be recovered (temporarily) with \\[view-lossage]. This 763without echoing, and return it. Note that the keystrokes comprising
764the text can still be recovered (temporarily) with \\[view-lossage]. This
422may be a security bug for some applications." 765may be a security bug for some applications."
423 (let ((echo-keystrokes 0) 766 (let ((echo-keystrokes 0)
424 (answ "") 767 (answ "")
425 tem) 768 tem)
426 (if (and (stringp prompt) (not (string= (message prompt) ""))) 769 (if (and (stringp prompt) (not (string= (message prompt) "")))
427 (message prompt)) 770 (message prompt))
428 (while (not (or (= (setq tem (read-char)) ?\^m) 771 (while (not(or (= (setq tem (read-char)) ?\^m)
429 (= tem ?\n))) 772 (= tem ?\n)))
430 (setq answ (concat answ (char-to-string tem)))) 773 (setq answ (concat answ (char-to-string tem))))
431 (message "") 774 (message "")
432 answ)) 775 answ))
433 776
434(defun send-invisible (str) 777(defun send-invisible (str)
435 "Read a string without echoing, and send it to the current buffer's process. 778 "Read a string without echoing, and send it to the process running
436A newline is also sent. String is not saved on comint input history list. 779in the current buffer. A new-line is additionally sent. String is not
437Security bug: your string can still be temporarily recovered with \\[view-lossage]." 780saved on comint input history list.
781Security bug: your string can still be temporarily recovered with
782\\[view-lossage]."
438; (interactive (list (comint-read-noecho "Enter non-echoed text"))) 783; (interactive (list (comint-read-noecho "Enter non-echoed text")))
439 (interactive "P") ; Defeat snooping via C-x esc 784 (interactive "P") ; Defeat snooping via C-x esc
440 (let ((proc (get-buffer-process (current-buffer)))) 785 (let ((proc (get-buffer-process (current-buffer))))
@@ -475,79 +820,72 @@ your process from hanging on long inputs. See comint-send-string."
475 820
476;;; Random input hackage 821;;; Random input hackage
477 822
478(defun comint-flush-output () 823(defun comint-kill-output ()
479 "Kill all output from interpreter since last input." 824 "Kill all output from interpreter since last input."
480 (interactive) 825 (interactive)
481 (save-excursion 826 (let ((pmark (process-mark (get-buffer-process (current-buffer)))))
482 (goto-char (comint-mark)) 827 (kill-region comint-last-input-end pmark)
483 (beginning-of-line) 828 (goto-char pmark)
484 (delete-region (1+ comint-last-input-end) (point)) 829 (insert "*** output flushed ***\n")
485 (insert "*** output flushed ***\n"))) 830 (set-marker pmark (point))))
486 831
487(defun comint-show-output () 832(defun comint-show-output ()
488 "Start display of the current window at line preceding start of last output. 833 "Display start of this batch of interpreter output at top of window.
489\"Last output\" is considered to start at the line following the last command 834Also put cursor there."
490entered to the process."
491 (interactive) 835 (interactive)
492 (goto-char comint-last-input-end) 836 (goto-char comint-last-input-end)
837 (backward-char)
493 (beginning-of-line) 838 (beginning-of-line)
494 (set-window-start (selected-window) (point)) 839 (set-window-start (selected-window) (point))
495 (comint-bol)) 840 (end-of-line))
496 841
497(defun comint-interrupt-subjob () 842(defun comint-interrupt-subjob ()
498 "Sent an interrupt signal to the current subprocess. 843 "Interrupt the current subjob."
499If the process-connection-type is via ptys, the signal is sent to the current
500process group of the pseudoterminal which Emacs is using to communicate with
501the subprocess. If the process is a job-control shell, this means the
502shell's current subjob. If the process connection is via pipes, the signal is
503sent to the immediate subprocess."
504 (interactive) 844 (interactive)
505 (interrupt-process nil t)) 845 (interrupt-process nil comint-ptyp))
506 846
507(defun comint-kill-subjob () 847(defun comint-kill-subjob ()
508 "Send a kill signal to the current subprocess. 848 "Send kill signal to the current subjob."
509See comint-interrupt-subjob for a description of \"current subprocess\"."
510 (interactive) 849 (interactive)
511 (kill-process nil t)) 850 (kill-process nil comint-ptyp))
512 851
513(defun comint-quit-subjob () 852(defun comint-quit-subjob ()
514 "Send a quit signal to the current subprocess. 853 "Send quit signal to the current subjob."
515See comint-interrupt-subjob for a description of \"current subprocess\"."
516 (interactive) 854 (interactive)
517 (quit-process nil t)) 855 (quit-process nil comint-ptyp))
518 856
519(defun comint-stop-subjob () 857(defun comint-stop-subjob ()
520 "Stop the current subprocess. 858 "Stop the current subjob.
521See comint-interrupt-subjob for a description of \"current subprocess\".
522
523WARNING: if there is no current subjob, you can end up suspending 859WARNING: if there is no current subjob, you can end up suspending
524the top-level process running in the buffer. If you accidentally do 860the top-level process running in the buffer. If you accidentally do
525this, use \\[comint-continue-subjob] to resume the process. (This is not a 861this, use \\[comint-continue-subjob] to resume the process. (This
526problem with most shells, since they ignore this signal.)" 862is not a problem with most shells, since they ignore this signal.)"
527 (interactive) 863 (interactive)
528 (stop-process nil t)) 864 (stop-process nil comint-ptyp))
529 865
530(defun comint-continue-subjob () 866(defun comint-continue-subjob ()
531 "Send a continue signal to current subprocess. 867 "Send CONT signal to process buffer's process group.
532See comint-interrupt-subjob for a description of \"current subprocess\".
533Useful if you accidentally suspend the top-level process." 868Useful if you accidentally suspend the top-level process."
534 (interactive) 869 (interactive)
535 (continue-process nil t)) 870 (continue-process nil comint-ptyp))
536 871
537(defun comint-kill-input () 872(defun comint-kill-input ()
538 "Kill from current command through point." 873 "Kill all text from last stuff output by interpreter to point."
539 (interactive) 874 (interactive)
540 (let ((pmark (comint-mark))) 875 (let* ((pmark (process-mark (get-buffer-process (current-buffer))))
541 (if (> (point) pmark) 876 (p-pos (marker-position pmark)))
542 (kill-region pmark (point)) 877 (if (> (point) p-pos)
543 (error "Nothing to kill")))) 878 (kill-region pmark (point)))))
544 879
545(defun comint-delchar-or-maybe-eof (arg) 880(defun comint-delchar-or-maybe-eof (arg)
546 "Delete ARG characters forward, or send an EOF to process if at end of buffer." 881 "Delete ARG characters forward, or send an EOF to process if at end of buffer."
547 (interactive "p") 882 (interactive "p")
548 (if (eobp) 883 (if (eobp)
549 (process-send-eof) 884 (process-send-eof)
550 (delete-char arg))) 885 (delete-char arg)))
886
887
888
551 889
552;;; Support for source-file processing commands. 890;;; Support for source-file processing commands.
553;;;============================================================================ 891;;;============================================================================
@@ -582,7 +920,7 @@ Useful if you accidentally suspend the top-level process."
582;;; (COMINT-SOURCE-DEFAULT previous-dir/file source-modes) 920;;; (COMINT-SOURCE-DEFAULT previous-dir/file source-modes)
583;;;============================================================================ 921;;;============================================================================
584;;; This function computes the defaults for the load-file and compile-file 922;;; This function computes the defaults for the load-file and compile-file
585;;; commands for tea, soar, lisp, and scheme modes. 923;;; commands for tea, soar, cmulisp, and cmuscheme modes.
586;;; 924;;;
587;;; - PREVIOUS-DIR/FILE is a pair (directory . filename) from the last 925;;; - PREVIOUS-DIR/FILE is a pair (directory . filename) from the last
588;;; source-file processing command. NIL if there hasn't been one yet. 926;;; source-file processing command. NIL if there hasn't been one yet.
@@ -619,9 +957,10 @@ Useful if you accidentally suspend the top-level process."
619 (t 957 (t
620 (cons default-directory nil)))) 958 (cons default-directory nil))))
621 959
960
622;;; (COMINT-CHECK-SOURCE fname) 961;;; (COMINT-CHECK-SOURCE fname)
623;;;============================================================================ 962;;;============================================================================
624;;; Prior to loading or compiling (or otherwise processing) a file (in the 963;;; Prior to loading or compiling (or otherwise processing) a file (in the CMU
625;;; process-in-a-buffer modes), this function can be called on the filename. 964;;; process-in-a-buffer modes), this function can be called on the filename.
626;;; If the file is loaded into a buffer, and the buffer is modified, the user 965;;; If the file is loaded into a buffer, and the buffer is modified, the user
627;;; is queried to see if he wants to save the buffer before proceeding with 966;;; is queried to see if he wants to save the buffer before proceeding with
@@ -639,6 +978,7 @@ Useful if you accidentally suspend the top-level process."
639 (save-buffer) 978 (save-buffer)
640 (set-buffer old-buffer))))) 979 (set-buffer old-buffer)))))
641 980
981
642;;; (COMINT-GET-SOURCE prompt prev-dir/file source-modes mustmatch-p) 982;;; (COMINT-GET-SOURCE prompt prev-dir/file source-modes mustmatch-p)
643;;;============================================================================ 983;;;============================================================================
644;;; COMINT-GET-SOURCE is used to prompt for filenames in command-interpreter 984;;; COMINT-GET-SOURCE is used to prompt for filenames in command-interpreter
@@ -679,7 +1019,9 @@ Useful if you accidentally suspend the top-level process."
679 (let* ((def (comint-source-default prev-dir/file source-modes)) 1019 (let* ((def (comint-source-default prev-dir/file source-modes))
680 (stringfile (comint-extract-string)) 1020 (stringfile (comint-extract-string))
681 (sfile-p (and stringfile 1021 (sfile-p (and stringfile
682 (file-exists-p stringfile) 1022 (condition-case ()
1023 (file-exists-p stringfile)
1024 (error nil))
683 (not (file-directory-p stringfile)))) 1025 (not (file-directory-p stringfile))))
684 (defdir (if sfile-p (file-name-directory stringfile) 1026 (defdir (if sfile-p (file-name-directory stringfile)
685 (car def))) 1027 (car def)))
@@ -693,6 +1035,14 @@ Useful if you accidentally suspend the top-level process."
693 mustmatch-p))) 1035 mustmatch-p)))
694 (list (expand-file-name (substitute-in-file-name ans))))) 1036 (list (expand-file-name (substitute-in-file-name ans)))))
695 1037
1038;;; I am somewhat divided on this string-default feature. It seems
1039;;; to violate the principle-of-least-astonishment, in that it makes
1040;;; the default harder to predict, so you actually have to look and see
1041;;; what the default really is before choosing it. This can trip you up.
1042;;; On the other hand, it can be useful, I guess. I would appreciate feedback
1043;;; on this.
1044;;; -Olin
1045
696 1046
697;;; Simple process query facility. 1047;;; Simple process query facility.
698;;; =========================================================================== 1048;;; ===========================================================================
@@ -742,23 +1092,37 @@ Useful if you accidentally suspend the top-level process."
742;;; replace with expanded/completed name. 1092;;; replace with expanded/completed name.
743 1093
744;;; These are not installed in the comint-mode keymap. But they are 1094;;; These are not installed in the comint-mode keymap. But they are
745;;; available for people who want them. Shell-mode-map uses them, though. 1095;;; available for people who want them. Shell-mode installs them:
1096;;; (define-key cmushell-mode-map "\M-\t" 'comint-dynamic-complete)
1097;;; (define-key cmushell-mode-map "\M-?" 'comint-dynamic-list-completions)))
1098;;;
1099;;; Commands like this are fine things to put in load hooks if you
1100;;; want them present in specific modes. Example:
1101;;; (setq cmushell-load-hook
1102;;; '((lambda () (define-key lisp-mode-map "\M-\t"
1103;;; 'comint-replace-by-expanded-filename))))
1104;;;
1105
746 1106
747(defun comint-match-partial-pathname () 1107(defun comint-match-partial-pathname ()
748 "Returns the string of an existing filename or causes an error." 1108 "Returns the filename at point or causes an error."
749 (if (save-excursion (backward-char 1) (looking-at "\\s ")) "" 1109 (save-excursion
750 (save-excursion 1110 (if (re-search-backward "[^~/A-Za-z0-9---_.$#,=]" nil 'move)
751 (re-search-backward "[^~/A-Za-z0-9---_.$#,]+") 1111 (forward-char 1))
752 (re-search-forward "[~/A-Za-z0-9---_.$#,]+") 1112 ;; Anchor the search forwards.
753 (substitute-in-file-name 1113 (if (not (looking-at "[~/A-Za-z0-9---_.$#,=]")) (error ""))
754 (buffer-substring (match-beginning 0) (match-end 0)))))) 1114 (re-search-forward "[~/A-Za-z0-9---_.$#,=]+")
1115 (substitute-in-file-name
1116 (buffer-substring (match-beginning 0) (match-end 0)))))
1117
755 1118
756(defun comint-replace-by-expanded-filename () 1119(defun comint-replace-by-expanded-filename ()
757 "Replace the filename at point with its expanded, canonicalised completion. 1120"Replace the filename at point with an expanded, canonicalised, and
1121completed replacement.
758\"Expanded\" means environment variables (e.g., $HOME) and ~'s are 1122\"Expanded\" means environment variables (e.g., $HOME) and ~'s are
759replaced with the corresponding directories. \"Canonicalised\" means .. 1123replaced with the corresponding directories. \"Canonicalised\" means ..
760and . are removed, and the filename is made absolute instead of relative. 1124and \. are removed, and the filename is made absolute instead of relative.
761See functions expand-file-name and substitute-in-file-name. See also 1125See functions expand-file-name and substitute-in-file-name. See also
762comint-dynamic-complete." 1126comint-dynamic-complete."
763 (interactive) 1127 (interactive)
764 (let* ((pathname (comint-match-partial-pathname)) 1128 (let* ((pathname (comint-match-partial-pathname))
@@ -767,15 +1131,17 @@ comint-dynamic-complete."
767 (completion (file-name-completion pathnondir 1131 (completion (file-name-completion pathnondir
768 (or pathdir default-directory)))) 1132 (or pathdir default-directory))))
769 (cond ((null completion) 1133 (cond ((null completion)
770 (error "No completions")) 1134 (message "No completions of %s." pathname)
1135 (ding))
771 ((eql completion t) 1136 ((eql completion t)
772 (message "Sole completion")) 1137 (message "Unique completion."))
773 (t ; this means a string was returned. 1138 (t ; this means a string was returned.
774 (delete-region (match-beginning 0) (match-end 0)) 1139 (delete-region (match-beginning 0) (match-end 0))
775 (insert (expand-file-name (concat pathdir completion))))))) 1140 (insert (expand-file-name (concat pathdir completion)))))))
776 1141
1142
777(defun comint-dynamic-complete () 1143(defun comint-dynamic-complete ()
778 "Complete the filename at point. 1144 "Dynamically complete the filename at point.
779This function is similar to comint-replace-by-expanded-filename, except 1145This function is similar to comint-replace-by-expanded-filename, except
780that it won't change parts of the filename already entered in the buffer; 1146that it won't change parts of the filename already entered in the buffer;
781it just adds completion characters to the end of the filename." 1147it just adds completion characters to the end of the filename."
@@ -783,18 +1149,19 @@ it just adds completion characters to the end of the filename."
783 (let* ((pathname (comint-match-partial-pathname)) 1149 (let* ((pathname (comint-match-partial-pathname))
784 (pathdir (file-name-directory pathname)) 1150 (pathdir (file-name-directory pathname))
785 (pathnondir (file-name-nondirectory pathname)) 1151 (pathnondir (file-name-nondirectory pathname))
786 (completion (file-name-completion pathnondir 1152 (completion (file-name-completion pathnondir
787 (or pathdir default-directory)))) 1153 (or pathdir default-directory))))
788 (cond ((null completion) 1154 (cond ((null completion)
789 (error "No completions")) 1155 (message "No completions of %s." pathname)
1156 (ding))
790 ((eql completion t) 1157 ((eql completion t)
791 (error "Sole completion")) 1158 (message "Unique completion."))
792 (t ; this means a string was returned. 1159 (t ; this means a string was returned.
793 (goto-char (match-end 0)) 1160 (goto-char (match-end 0))
794 (insert (substring completion (length pathnondir))))))) 1161 (insert (substring completion (length pathnondir)))))))
795 1162
796(defun comint-dynamic-list-completions () 1163(defun comint-dynamic-list-completions ()
797 "List all possible completions of the filename at point." 1164 "List in help buffer all possible completions of the filename at point."
798 (interactive) 1165 (interactive)
799 (let* ((pathname (comint-match-partial-pathname)) 1166 (let* ((pathname (comint-match-partial-pathname))
800 (pathdir (file-name-directory pathname)) 1167 (pathdir (file-name-directory pathname))
@@ -803,10 +1170,11 @@ it just adds completion characters to the end of the filename."
803 (file-name-all-completions pathnondir 1170 (file-name-all-completions pathnondir
804 (or pathdir default-directory)))) 1171 (or pathdir default-directory))))
805 (cond ((null completions) 1172 (cond ((null completions)
806 (error "No completions")) 1173 (message "No completions of %s." pathname)
1174 (ding))
807 (t 1175 (t
808 (let ((conf (current-window-configuration))) 1176 (let ((conf (current-window-configuration)))
809 (with-output-to-temp-buffer " *Completions*" 1177 (with-output-to-temp-buffer "*Help*"
810 (display-completion-list completions)) 1178 (display-completion-list completions))
811 (sit-for 0) 1179 (sit-for 0)
812 (message "Hit space to flush.") 1180 (message "Hit space to flush.")
@@ -815,22 +1183,32 @@ it just adds completion characters to the end of the filename."
815 (set-window-configuration conf) 1183 (set-window-configuration conf)
816 (setq unread-command-char ch)))))))) 1184 (setq unread-command-char ch))))))))
817 1185
1186; Ergo bindings
1187; (global-set-key "\M-\t" 'comint-replace-by-expanded-filename)
1188; (global-set-key "\M-?" 'comint-dynamic-list-completions)
1189; (define-key shell-mode-map "\M-\t" 'comint-dynamic-complete)
818 1190
819;;; Converting process modes to use comint mode 1191;;; Converting process modes to use comint mode
820;;; =========================================================================== 1192;;; ===========================================================================
1193;;; Several gnu packages (tex-mode, background, dbx, gdb, kermit, prolog,
1194;;; telnet are some) use the shell package as clients. Most of them would
1195;;; be better off using the comint package, but they predate it.
1196;;;
1197;;; Altering these packages to use comint mode should greatly
1198;;; improve their functionality, and is fairly easy.
1199;;;
821;;; Renaming variables 1200;;; Renaming variables
822;;; Most of the work is renaming variables and functions. 1201;;; Most of the work is renaming variables and functions. These are the common
823;;; These are the common ones. 1202;;; ones:
824 1203;;; Local variables:
825;;; Local variables -- 1204;;; last-input-end comint-last-input-end
826;;; last-input-end comint-last-input-end 1205;;; last-input-start <unnecessary>
827;;; last-input-start <unnecessary> 1206;;; shell-prompt-pattern comint-prompt-regexp
828;;; shell-prompt-pattern comint-prompt-regexp 1207;;; shell-set-directory-error-hook <no equivalent>
829;;; shell-set-directory-error-hook <no equivalent> 1208;;; Miscellaneous:
830;;; Miscellaneous --
831;;; shell-set-directory <unnecessary> 1209;;; shell-set-directory <unnecessary>
832;;; shell-mode-map comint-mode-map 1210;;; shell-mode-map comint-mode-map
833;;; Commands -- 1211;;; Commands:
834;;; shell-send-input comint-send-input 1212;;; shell-send-input comint-send-input
835;;; shell-send-eof comint-delchar-or-maybe-eof 1213;;; shell-send-eof comint-delchar-or-maybe-eof
836;;; kill-shell-input comint-kill-input 1214;;; kill-shell-input comint-kill-input
@@ -857,10 +1235,147 @@ it just adds completion characters to the end of the filename."
857;;; (comint-prompt-regexp, comint-input-filter, comint-input-sentinel, 1235;;; (comint-prompt-regexp, comint-input-filter, comint-input-sentinel,
858;;; comint-get-old-input) that need to be different from the defaults. Call 1236;;; comint-get-old-input) that need to be different from the defaults. Call
859;;; foo-mode-hook, and you're done. Don't run the comint-mode hook yourself; 1237;;; foo-mode-hook, and you're done. Don't run the comint-mode hook yourself;
860;;; comint-mode will take care of it. 1238;;; comint-mode will take care of it. The following example, from cmushell.el,
1239;;; is typical:
1240;;;
1241;;; (defun shell-mode ()
1242;;; (interactive)
1243;;; (comint-mode)
1244;;; (setq comint-prompt-regexp shell-prompt-pattern)
1245;;; (setq major-mode 'shell-mode)
1246;;; (setq mode-name "Shell")
1247;;; (cond ((not shell-mode-map)
1248;;; (setq shell-mode-map (full-copy-sparse-keymap comint-mode-map))
1249;;; (define-key shell-mode-map "\M-\t" 'comint-dynamic-complete)
1250;;; (define-key shell-mode-map "\M-?"
1251;;; 'comint-dynamic-list-completions)))
1252;;; (use-local-map shell-mode-map)
1253;;; (make-local-variable 'shell-directory-stack)
1254;;; (setq shell-directory-stack nil)
1255;;; (setq comint-input-sentinel 'shell-directory-tracker)
1256;;; (run-hooks 'shell-mode-hook))
1257;;;
861;;; 1258;;;
862;;; Note that make-comint is different from make-shell in that it 1259;;; Note that make-comint is different from make-shell in that it
863;;; doesn't have a default program argument. If you give make-shell 1260;;; doesn't have a default program argument. If you give make-shell
864;;; a program name of NIL, it cleverly chooses one of explicit-shell-name, 1261;;; a program name of NIL, it cleverly chooses one of explicit-shell-name,
865;;; $ESHELL, $SHELL, or /bin/sh. If you give make-comint a program argument 1262;;; $ESHELL, $SHELL, or /bin/sh. If you give make-comint a program argument
866;;; of NIL, it barfs. Adjust your code accordingly... 1263;;; of NIL, it barfs. Adjust your code accordingly...
1264;;;
1265
1266;;; Do the user's customisation...
1267
1268(defvar comint-load-hook nil
1269 "This hook is run when comint is loaded in.
1270This is a good place to put keybindings.")
1271
1272(run-hooks 'comint-load-hook)
1273
1274;;; Change log:
1275;;; 9/12/89
1276;;; - Souped up the filename expansion procedures.
1277;;; Doc strings are much clearer and more detailed.
1278;;; Fixed a bug where doing a filename completion when the point
1279;;; was in the middle of the filename instead of at the end would lose.
1280;;;
1281;;; 2/17/90
1282;;; - Souped up the command history stuff so that text inserted
1283;;; by comint-previous-input-matching is removed by following
1284;;; command history recalls. comint-next/previous-input-matching
1285;;; is now much more smoothly integrated w/the command history stuff.
1286;;; - Added comint-eol-on-send flag and comint-input-sender hook.
1287;;; Comint-input-sender based on code contributed by Jeff Peck
1288;;; (peck@sun.com).
1289;;;
1290;;; 3/13/90 ccm@cmu.cs.edu
1291;;; - Added comint-previous-similar-input for looking up similar inputs.
1292;;; - Added comint-send-and-get-output to allow snarfing input from
1293;;; buffer.
1294;;; - Added the ability to pick up a source file by positioning over
1295;;; a string in comint-get-source.
1296;;; - Added add-hook to make it a little easier for the user to use
1297;;; multiple hooks.
1298;;;
1299;;; 5/22/90 shivers
1300;;; - Moved Chris' multiplexed ipc stuff to comint-ipc.el.
1301;;; - Altered Chris' comint-get-source string feature. The string
1302;;; is only offered as a default if it names an existing file.
1303;;; - Changed comint-exec to directly crank up the process, instead
1304;;; of calling the env program. This made background.el happy.
1305;;; - Added new buffer-local var comint-ptyp. The problem is that
1306;;; the signalling functions don't work as advertised. If you are
1307;;; communicating via pipes, the CURRENT-GROUP arg is supposed to
1308;;; be ignored, but, unfortunately it seems to be the case that you
1309;;; must pass a NIL for this arg in the pipe case. COMINT-PTYP
1310;;; is a flag that tells whether the process is communicating
1311;;; via pipes or a pty. The comint signalling functions use it
1312;;; to determine the necessary CURRENT-GROUP arg value. The bug
1313;;; has been reported to the Gnu folks.
1314;;; - comint-dynamic-complete flushes the help window if you hit space
1315;;; after you execute it.
1316;;; - Added functions comint-send-string, comint-send-region and var
1317;;; comint-input-chunk-size. comint-send-string tries to prevent processes
1318;;; from hanging when you send them long strings by breaking them into
1319;;; chunks and allowing process output between chunks. I got the idea from
1320;;; Eero Simoncelli's Common Lisp package. Note that using
1321;;; comint-send-string means that the process buffer's contents can change
1322;;; during a call! If you depend on process output only happening between
1323;;; toplevel commands, this could be a problem. In such a case, use
1324;;; process-send-string instead. If this is a problem for people, I'd like
1325;;; to hear about it.
1326;;; - Added comint-proc-query as a simple mechanism for commands that
1327;;; want to query an inferior process and display its response. For a
1328;;; typical use, see lisp-show-arglist in cmulisp.el.
1329;;; - Added constant comint-version, which is now "2.01".
1330;;;
1331;;; 6/14/90 shivers
1332;;; - Had comint-update-env defined twice. Removed extra copy. Also
1333;;; renamed mem to be comint-mem, for modularity. The duplication
1334;;; was reported by Michael Meissner.
1335;;; 6/16/90 shivers
1336;;; - Emacs has two different mechanisms for maintaining the process
1337;;; environment, determined at compile time by the MAINTAIN-ENVIRONMENT
1338;;; #define. One uses the process-environment global variable, and
1339;;; one uses a getenv/setenv interface. comint-exec assumed the
1340;;; process-environment interface; it has been generalised (with
1341;;; comint-exec-1) to handle both cases. Pretty bogus. We could,
1342;;; of course, skip all this and just use the etc/env program to
1343;;; handle the environment tweaking, but that obscures process
1344;;; queries that other modules (like background.el) depend on. etc/env
1345;;; is also fairly bogus. This bug, and some of the fix code was
1346;;; reported by Dan Pierson.
1347;;;
1348;;; 9/5/90 shivers
1349;;; - Changed make-variable-buffer-local's to make-local-variable's.
1350;;; This leaves non-comint-mode buffers alone. Stephane Payrard
1351;;; reported the sloppy useage.
1352;;; - You can now go from comint-previous-similar-input to
1353;;; comint-previous-input with no problem.
1354;;;
1355;;; 12/21/90 shivers
1356;;; - Added a condition-case to comint-get-source. Bogus strings
1357;;; beginning with ~ were making the file-exists-p barf.
1358;;; - Added "=" to the set of chars recognised by file completion
1359;;; as constituting a filename.
1360;;;
1361;;; 1/90 shivers
1362;;; These changes comprise release 2.02:
1363;;; - Removed the kill-all-local-variables in comint-mode. This
1364;;; made it impossible for client modes to set things before calling
1365;;; comint-mode. (In particular, it messed up ilisp.el) In general,
1366;;; the client mode should be responsible for a k-a-l-v's.
1367;;; - Fixed comint-match-partial-pathname so that it works in
1368;;; more cases: if the filename begins at the start-of-buffer;
1369;;; if point is on the first char of the filename. Just a question
1370;;; of getting the tricky bits right.
1371;;; - Added a hook, comint-exec-hook that is run each time a process
1372;;; is cranked up. Useful for things like process-kill-without-query.
1373;;;
1374;;; - Improved the doc string in comint-send-input a little bit.
1375;;; - Tweaked make-comint to check process status with comint-check-proc
1376;;; instead of equivalent inline code.
1377;;; These two were pointed out by tale.
1378;;; - Prompt-search history commands have been commented out. I never
1379;;; liked them; I don't think anyone used them.
1380
1381(provide 'comint)
diff --git a/lisp/compare-w.el b/lisp/compare-w.el
index 0ae9f37673b..b3dbf0e47c3 100644
--- a/lisp/compare-w.el
+++ b/lisp/compare-w.el
@@ -17,8 +17,6 @@
17;; along with GNU Emacs; see the file COPYING. If not, write to 17;; along with GNU Emacs; see the file COPYING. If not, write to
18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20(provide 'compare-w)
21
22(defvar compare-windows-whitespace " \t\n" 20(defvar compare-windows-whitespace " \t\n"
23 "*String of characters considered whitespace for \\[compare-windows]. 21 "*String of characters considered whitespace for \\[compare-windows].
24Changes in whitespace are optionally ignored. 22Changes in whitespace are optionally ignored.
@@ -127,3 +125,6 @@ If `compare-ignore-case' is non-nil, changes in case are also ignored."
127 (set-window-point w2 p2) 125 (set-window-point w2 p2)
128 (if (= (point) opoint1) 126 (if (= (point) opoint1)
129 (ding)))) 127 (ding))))
128
129(provide 'compare-w)
130
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 51e7d4954cb..e488e385b06 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -38,8 +38,6 @@
38;; (interactive) 38;; (interactive)
39;; (&info "emacs" "dabbrevs") ; Select the specific info node. 39;; (&info "emacs" "dabbrevs") ; Select the specific info node.
40;; ) 40;; )
41(provide 'dabbrevs)
42
43(defvar dabbrevs-limit nil 41(defvar dabbrevs-limit nil
44 "*Limits region searched by `dabbrevs-expand' to this many chars away.") 42 "*Limits region searched by `dabbrevs-expand' to this many chars away.")
45(make-variable-buffer-local 'dabbrevs-limit) 43(make-variable-buffer-local 'dabbrevs-limit)
@@ -256,3 +254,6 @@ with the next possible expansion not yet tried."
256 (= (point) beg)) 254 (= (point) beg))
257 (setq result (downcase result)))))) 255 (setq result (downcase result))))))
258 result))) 256 result)))
257
258(provide 'dabbrevs)
259
diff --git a/lisp/diary-lib.el b/lisp/diary-lib.el
index 26aa7f5d478..b196707f09f 100644
--- a/lisp/diary-lib.el
+++ b/lisp/diary-lib.el
@@ -28,8 +28,6 @@
28;; Urbana, Illinois 61801 28;; Urbana, Illinois 61801
29 29
30(require 'calendar) 30(require 'calendar)
31(provide 'diary)
32
33(defun diary (&optional arg) 31(defun diary (&optional arg)
34 "Generate the diary window for ARG days starting with the current date. 32 "Generate the diary window for ARG days starting with the current date.
35If no argument is provided, the number of days of diary entries is governed 33If no argument is provided, the number of days of diary entries is governed
@@ -2125,3 +2123,6 @@ to the date indicated by point. Prefix arg will make the entry nonmarking."
2125 (or (calendar-cursor-to-date) 2123 (or (calendar-cursor-to-date)
2126 (error "Cursor is not on a date!")))))) 2124 (error "Cursor is not on a date!"))))))
2127 arg))) 2125 arg)))
2126
2127(provide 'diary)
2128
diff --git a/lisp/disp-table.el b/lisp/disp-table.el
index c0fe4dfe8af..524bc80cd3f 100644
--- a/lisp/disp-table.el
+++ b/lisp/disp-table.el
@@ -31,7 +31,7 @@
31 (setq i (1+ i))))) 31 (setq i (1+ i)))))
32 32
33(defun describe-display-table (DT) 33(defun describe-display-table (DT)
34 "Describe the display-table DT in a help buffer." 34 "Describe the display table DT in a help buffer."
35 (with-output-to-temp-buffer "*Help*" 35 (with-output-to-temp-buffer "*Help*"
36 (princ "\nTruncation glyf: ") 36 (princ "\nTruncation glyf: ")
37 (prin1 (aref dt 256)) 37 (prin1 (aref dt 256))
@@ -56,7 +56,7 @@
56 (print-help-return-message))) 56 (print-help-return-message)))
57 57
58(defun describe-current-display-table () 58(defun describe-current-display-table ()
59 "Describe the display-table in use in the selected window and buffer." 59 "Describe the display table in use in the selected window and buffer."
60 (interactive) 60 (interactive)
61 (describe-display-table 61 (describe-display-table
62 (or (window-display-table (selected-window)) 62 (or (window-display-table (selected-window))
@@ -67,7 +67,7 @@
67 (make-vector 261 nil)) 67 (make-vector 261 nil))
68 68
69(defun standard-display-8bit (l h) 69(defun standard-display-8bit (l h)
70 "Display characters in the range [L, H] literally." 70 "Display characters in the range L to H literally."
71 (while (<= l h) 71 (while (<= l h)
72 (if (and (>= l ?\ ) (< l 127)) 72 (if (and (>= l ?\ ) (< l 127))
73 (if standard-display-table (aset standard-display-table l nil)) 73 (if standard-display-table (aset standard-display-table l nil))
diff --git a/lisp/ehelp.el b/lisp/ehelp.el
index 9755bf07b7c..69f2fd4e8af 100644
--- a/lisp/ehelp.el
+++ b/lisp/ehelp.el
@@ -17,8 +17,6 @@
17;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 17;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 18
19(require 'electric) 19(require 'electric)
20(provide 'ehelp)
21
22(defvar electric-help-map () 20(defvar electric-help-map ()
23 "Keymap defining commands available in `electric-help-mode'.") 21 "Keymap defining commands available in `electric-help-mode'.")
24 22
@@ -305,3 +303,6 @@ will select it.)"
305 (fset 'ehelp-command map))) 303 (fset 'ehelp-command map)))
306 304
307;; Do (define-key global-map "\C-h" 'ehelp-command) if you want to win 305;; Do (define-key global-map "\C-h" 'ehelp-command) if you want to win
306
307(provide 'ehelp)
308
diff --git a/lisp/electric.el b/lisp/electric.el
index be992c60f0d..eab8cd135ed 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -19,7 +19,7 @@
19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 20
21 21
22(provide 'electric) ; zaaaaaaap 22; zaaaaaaap
23 23
24;; perhaps this should be in subr.el... 24;; perhaps this should be in subr.el...
25(defun shrink-window-if-larger-than-buffer (window) 25(defun shrink-window-if-larger-than-buffer (window)
@@ -179,3 +179,5 @@
179 (enlarge-window (- target-height (window-height win))))) 179 (enlarge-window (- target-height (window-height win)))))
180 (goto-char (point-min)) 180 (goto-char (point-min))
181 win))) 181 win)))
182
183(provide 'electric) \ No newline at end of file
diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el
index 82cd99a114a..0b5283ca819 100644
--- a/lisp/emacs-lisp/backquote.el
+++ b/lisp/emacs-lisp/backquote.el
@@ -57,8 +57,6 @@
57 ;;; this or changing the syntax to ... ,(<form>). RMS: opinion? 57 ;;; this or changing the syntax to ... ,(<form>). RMS: opinion?
58 58
59 59
60(provide 'backquote)
61
62;;; a raft of general-purpose macros follows. See the nearest 60;;; a raft of general-purpose macros follows. See the nearest
63 ;;; Commonlisp manual. 61 ;;; Commonlisp manual.
64(defmacro bq-push (v l) 62(defmacro bq-push (v l)
@@ -353,3 +351,6 @@ for making the list so far."
353(defun bq-splicenil (form) 351(defun bq-splicenil (form)
354 (setq state 'append 352 (setq state 'append
355 tailmaker (list form))) 353 tailmaker (list form)))
354
355(provide 'backquote)
356
diff --git a/lisp/emacs-lisp/float.el b/lisp/emacs-lisp/float.el
index 68b88f41ecc..3c2921c506f 100644
--- a/lisp/emacs-lisp/float.el
+++ b/lisp/emacs-lisp/float.el
@@ -46,8 +46,6 @@
46;; June 20, 1986 46;; June 20, 1986
47;; 47;;
48 48
49(provide 'float)
50
51;; fundamental implementation constants 49;; fundamental implementation constants
52(defconst exp-base 2 50(defconst exp-base 2
53 "Base of exponent in this floating point representation.") 51 "Base of exponent in this floating point representation.")
@@ -446,3 +444,6 @@ are recognized."
446 (funcall func exponent (aref powers-of-10 tens))))) 444 (funcall func exponent (aref powers-of-10 tens)))))
447 445
448 _f0)) ; if invalid, return 0 446 _f0)) ; if invalid, return 0
447
448(provide 'float)
449
diff --git a/lisp/emacs-lisp/helper.el b/lisp/emacs-lisp/helper.el
index c718e94be30..0064bc66e07 100644
--- a/lisp/emacs-lisp/helper.el
+++ b/lisp/emacs-lisp/helper.el
@@ -21,7 +21,7 @@
21;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 21;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 22
23 23
24(provide 'helper) ; hey, here's a helping hand. 24; hey, here's a helping hand.
25 25
26;; Bind this to a string for <blank> in "... Other keys <blank>". 26;; Bind this to a string for <blank> in "... Other keys <blank>".
27;; Helper-help uses this to construct help string when scrolling. 27;; Helper-help uses this to construct help string when scrolling.
@@ -147,3 +147,4 @@
147 (ding) 147 (ding)
148 (setq continue nil)))))) 148 (setq continue nil))))))
149 149
150(provide 'helper) \ No newline at end of file
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 0f9193a71c7..78310112c10 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -17,8 +17,6 @@
17;; along with GNU Emacs; see the file COPYING. If not, write to 17;; along with GNU Emacs; see the file COPYING. If not, write to
18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20(provide 'lisp-mode)
21
22(defvar lisp-mode-syntax-table nil "") 20(defvar lisp-mode-syntax-table nil "")
23(defvar emacs-lisp-mode-syntax-table nil "") 21(defvar emacs-lisp-mode-syntax-table nil "")
24(defvar lisp-mode-abbrev-table nil "") 22(defvar lisp-mode-abbrev-table nil "")
@@ -613,3 +611,6 @@ means don't indent that line."
613 (progn 611 (progn
614 (forward-line 1) (point)) 612 (forward-line 1) (point))
615 nil nil state)))))) 613 nil nil state))))))
614
615(provide 'lisp-mode)
616
diff --git a/lisp/emulation/mlsupport.el b/lisp/emulation/mlsupport.el
index 14e7a3c9557..521b64ce281 100644
--- a/lisp/emulation/mlsupport.el
+++ b/lisp/emulation/mlsupport.el
@@ -18,8 +18,6 @@
18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20 20
21(provide 'mlsupport)
22
23(defmacro ml-defun (&rest defs) 21(defmacro ml-defun (&rest defs)
24 (list 'ml-defun-1 (list 'quote defs))) 22 (list 'ml-defun-1 (list 'quote defs)))
25 23
@@ -403,3 +401,6 @@
403 (if (< from 0) (setq from (+ from length))) 401 (if (< from 0) (setq from (+ from length)))
404 (if (< to 0) (setq to (+ to length))) 402 (if (< to 0) (setq to (+ to length)))
405 (substring string from (+ from to)))) 403 (substring string from (+ from to))))
404
405(provide 'mlsupport)
406
diff --git a/lisp/env.el b/lisp/env.el
index 6adc9ec7c0c..3e494645610 100644
--- a/lisp/env.el
+++ b/lisp/env.el
@@ -17,8 +17,6 @@
17;;; along with GNU Emacs; see the file COPYING. If not, write to 17;;; along with GNU Emacs; see the file COPYING. If not, write to
18;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20(provide 'setenv)
21
22(defun setenv (variable value) 20(defun setenv (variable value)
23 "Set the value of the environment variable named VARIABLE to VALUE. 21 "Set the value of the environment variable named VARIABLE to VALUE.
24VARIABLE and VALUE should both be strings. 22VARIABLE and VALUE should both be strings.
@@ -35,3 +33,6 @@ This function works by modifying process-environment."
35 ((null (setq scan (cdr scan))) 33 ((null (setq scan (cdr scan)))
36 (setq process-environment 34 (setq process-environment
37 (cons (concat variable "=" value) process-environment)))))))) 35 (cons (concat variable "=" value) process-environment))))))))
36
37(provide 'setenv)
38
diff --git a/lisp/find-dired.el b/lisp/find-dired.el
index 472797b15dc..2afb4b435d4 100644
--- a/lisp/find-dired.el
+++ b/lisp/find-dired.el
@@ -46,8 +46,6 @@
46;; in your ~/.emacs. 46;; in your ~/.emacs.
47 47
48(require 'dired) 48(require 'dired)
49(provide 'find-dired)
50
51;;;###autoload 49;;;###autoload
52(defvar find-ls-option (if (eq system-type 'berkeley-unix) "-ls" 50(defvar find-ls-option (if (eq system-type 'berkeley-unix) "-ls"
53 "-exec ls -ldi {} \\;") 51 "-exec ls -ldi {} \\;")
@@ -200,3 +198,5 @@ Wildcards and redirection are handle as usual in the shell."
200 (start-process name buffer shell-file-name "-c" 198 (start-process name buffer shell-file-name "-c"
201 (concat "exec " (mapconcat 'identity args " ")))))) 199 (concat "exec " (mapconcat 'identity args " "))))))
202 200
201(provide 'find-dired)
202
diff --git a/lisp/float-sup.el b/lisp/float-sup.el
index d7b756238d3..f784ef2bf3c 100644
--- a/lisp/float-sup.el
+++ b/lisp/float-sup.el
@@ -27,8 +27,6 @@
27 (error "Floating point was disabled at compile time")) 27 (error "Floating point was disabled at compile time"))
28 28
29;; provide an easy hook to tell if we are running with floats or not. 29;; provide an easy hook to tell if we are running with floats or not.
30(provide 'lisp-float-type)
31
32;; define pi and e via math-lib calls. (much less prone to killer typos.) 30;; define pi and e via math-lib calls. (much less prone to killer typos.)
33(defconst pi (* 4 (atan 1)) "The value of Pi (3.1415926...)") 31(defconst pi (* 4 (atan 1)) "The value of Pi (3.1415926...)")
34(defconst e (exp 1) "The value of e (2.7182818...)") 32(defconst e (exp 1) "The value of e (2.7182818...)")
@@ -50,3 +48,6 @@
50(defmacro radians-to-degrees (x) 48(defmacro radians-to-degrees (x)
51 "Convert ARG from radians to degrees." 49 "Convert ARG from radians to degrees."
52 (list '* (/ 180.0 pi) x)) 50 (list '* (/ 180.0 pi) x))
51
52(provide 'lisp-float-type)
53
diff --git a/lisp/flow-ctrl.el b/lisp/flow-ctrl.el
index 1e010e8133d..bcd2c152b4f 100644
--- a/lisp/flow-ctrl.el
+++ b/lisp/flow-ctrl.el
@@ -80,7 +80,7 @@ and C-q characters to OS."
80 (and (memstr= term losing-terminal-types) (evade-flow-control))) 80 (and (memstr= term losing-terminal-types) (evade-flow-control)))
81 ) 81 )
82 82
83(provide 'flow-ctrl)
84
85;;; flow-ctrl.el ends here 83;;; flow-ctrl.el ends here
86 84
85(provide 'flow-ctrl)
86
diff --git a/lisp/frame.el b/lisp/frame.el
index 8a24cc81e51..930baab6ce1 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1,5 +1,5 @@
1;;;; Multi-screen management that is independent of window systems. 1;;;; Multi-screen management that is independent of window systems.
2;;;; Copyright (C) 1990 Free Software Foundation, Inc. 2;;;; Copyright (C) 1990, 1992 Free Software Foundation, Inc.
3 3
4;;; This file is part of GNU Emacs. 4;;; This file is part of GNU Emacs.
5;;; 5;;;
@@ -17,8 +17,6 @@
17;;; along with GNU Emacs; see the file COPYING. If not, write to 17;;; along with GNU Emacs; see the file COPYING. If not, write to
18;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20(provide 'screen)
21
22(defvar screen-creation-function nil 20(defvar screen-creation-function nil
23 "Window-system dependent function to call to create a new screen. 21 "Window-system dependent function to call to create a new screen.
24The window system startup file should set this to its screen creation 22The window system startup file should set this to its screen creation
@@ -270,3 +268,5 @@ under the X Window System."
270 268
271(define-key ctl-x-3-map "2" 'new-screen) 269(define-key ctl-x-3-map "2" 'new-screen)
272(define-key ctl-x-3-map "0" 'delete-screen) 270(define-key ctl-x-3-map "0" 'delete-screen)
271
272(provide 'screen)
diff --git a/lisp/gnus.el b/lisp/gnus.el
index d37072dd6a6..977b0444f08 100644
--- a/lisp/gnus.el
+++ b/lisp/gnus.el
@@ -48,7 +48,6 @@
48;; (3) Multi-GNUS (Talking to many hosts same time). 48;; (3) Multi-GNUS (Talking to many hosts same time).
49;; (4) Asynchronous transmission of large messages. 49;; (4) Asynchronous transmission of large messages.
50 50
51(provide 'gnus)
52(require 'nntp) 51(require 'nntp)
53(require 'mail-utils) 52(require 'mail-utils)
54 53
@@ -6079,3 +6078,5 @@ Range of OBJ is expressed as `((beg1 . end1) (beg2 . end2) ...)."
6079;;Local variables: 6078;;Local variables:
6080;;eval: (put 'gnus-eval-in-buffer-window 'lisp-indent-function 1) 6079;;eval: (put 'gnus-eval-in-buffer-window 'lisp-indent-function 1)
6081;;end: 6080;;end:
6081
6082(provide 'gnus)
diff --git a/lisp/gnusmail.el b/lisp/gnusmail.el
index 9bfedc89173..ad09ee98197 100644
--- a/lisp/gnusmail.el
+++ b/lisp/gnusmail.el
@@ -19,7 +19,6 @@
19;; file named COPYING. Among other things, the copyright notice 19;; file named COPYING. Among other things, the copyright notice
20;; and this notice must be preserved on all copies. 20;; and this notice must be preserved on all copies.
21 21
22(provide 'gnusmail)
23(require 'gnus) 22(require 'gnus)
24 23
25;; Provides mail reply and mail other window command using usual mail 24;; Provides mail reply and mail other window command using usual mail
@@ -146,3 +145,5 @@ The command \\[mh-yank-cur-msg] yanks the original message into current buffer."
146 (mh-send-other-window to cc subject) 145 (mh-send-other-window to cc subject)
147 (setq mh-sent-from-folder (current-buffer)) 146 (setq mh-sent-from-folder (current-buffer))
148 (setq mh-sent-from-msg 1))) 147 (setq mh-sent-from-msg 1)))
148
149(provide 'gnusmail)
diff --git a/lisp/gnusmisc.el b/lisp/gnusmisc.el
index d133b63a30c..17238369da0 100644
--- a/lisp/gnusmisc.el
+++ b/lisp/gnusmisc.el
@@ -20,7 +20,6 @@
20;; file named COPYING. Among other things, the copyright notice 20;; file named COPYING. Among other things, the copyright notice
21;; and this notice must be preserved on all copies. 21;; and this notice must be preserved on all copies.
22 22
23(provide 'gnusmisc)
24(require 'gnus) 23(require 'gnus)
25 24
26;;; 25;;;
@@ -212,3 +211,5 @@ inserting it before the newsgroup on the line containging point."
212 (forward-line -1) 211 (forward-line -1)
213 (search-forward ":" nil t) 212 (search-forward ":" nil t)
214 )) 213 ))
214
215(provide 'gnusmisc)
diff --git a/lisp/gnuspost.el b/lisp/gnuspost.el
index d40982d1def..9538aeaea91 100644
--- a/lisp/gnuspost.el
+++ b/lisp/gnuspost.el
@@ -20,7 +20,6 @@
20;; file named COPYING. Among other things, the copyright notice 20;; file named COPYING. Among other things, the copyright notice
21;; and this notice must be preserved on all copies. 21;; and this notice must be preserved on all copies.
22 22
23(provide 'gnuspost)
24(require 'gnus) 23(require 'gnus)
25 24
26(defvar gnus-organization-file "/usr/lib/news/organization" 25(defvar gnus-organization-file "/usr/lib/news/organization"
@@ -670,3 +669,5 @@ containing the organization."
670 ))) 669 )))
671 (t organization)) 670 (t organization))
672 )) 671 ))
672
673(provide 'gnuspost)
diff --git a/lisp/info.el b/lisp/info.el
index 020ec32395d..8ab04955db9 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -17,8 +17,6 @@
17;; along with GNU Emacs; see the file COPYING. If not, write to 17;; along with GNU Emacs; see the file COPYING. If not, write to
18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20(provide 'info)
21
22(defvar Info-history nil 20(defvar Info-history nil
23 "List of info nodes user has visited. 21 "List of info nodes user has visited.
24Each element of list is a list (FILENAME NODENAME BUFFERPOS).") 22Each element of list is a list (FILENAME NODENAME BUFFERPOS).")
@@ -994,3 +992,6 @@ Interactively, if the binding is execute-extended-command, a command is read."
994 (Info-goto-emacs-command-node command))))) 992 (Info-goto-emacs-command-node command)))))
995;;;###autoload 993;;;###autoload
996(define-key help-map "\C-k" 'Info-goto-emacs-key-command-node) 994(define-key help-map "\C-k" 'Info-goto-emacs-key-command-node)
995
996(provide 'info)
997
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index 4f97f1d3508..b25edf5cb5e 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -18,8 +18,6 @@
18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20 20
21(provide 'mail-utils)
22
23;;; We require lisp-mode to make sure that lisp-mode-syntax-table has 21;;; We require lisp-mode to make sure that lisp-mode-syntax-table has
24;;; been initialized. 22;;; been initialized.
25(require 'lisp-mode) 23(require 'lisp-mode)
@@ -199,3 +197,6 @@ If third arg ALL is non-nil, concatenate all such fields with commas between."
199 "\\|" 197 "\\|"
200 (substring labels (match-end 0)))))) 198 (substring labels (match-end 0))))))
201 labels) 199 labels)
200
201(provide 'mail-utils)
202
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index 5efa9eadd4b..d48d8e80767 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -427,6 +427,6 @@ mail-mode-syntax-table is used when the cursor is not in an address header.")
427 t)))) 427 t))))
428 (setq mail-aliases nil) 428 (setq mail-aliases nil)
429 (build-mail-aliases file)) 429 (build-mail-aliases file))
430 430
431(provide 'mail-abbrevs) 431(provide 'mail-abbrevs)
432 432
diff --git a/lisp/mail/rfc822.el b/lisp/mail/rfc822.el
index b7e43f62cda..ac63ce63687 100644
--- a/lisp/mail/rfc822.el
+++ b/lisp/mail/rfc822.el
@@ -18,8 +18,6 @@
18;; along with GNU Emacs; see the file COPYING. If not, write to 18;; along with GNU Emacs; see the file COPYING. If not, write to
19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 20
21(provide 'rfc822)
22
23;; uses address-start free, throws to address 21;; uses address-start free, throws to address
24(defun rfc822-bad-address (reason) 22(defun rfc822-bad-address (reason)
25 (save-restriction 23 (save-restriction
@@ -304,3 +302,5 @@
304 (nreverse list))) 302 (nreverse list)))
305 (and buf (kill-buffer buf)))))) 303 (and buf (kill-buffer buf))))))
306 304
305(provide 'rfc822)
306
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 8c966ce9604..ace3498a13b 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -24,8 +24,6 @@
24;; expunging by dispatch table, sticky options for file commands. 24;; expunging by dispatch table, sticky options for file commands.
25 25
26(require 'mail-utils) 26(require 'mail-utils)
27(provide 'rmail)
28
29; These variables now declared paths.el 27; These variables now declared paths.el
30;(defvar rmail-spool-directory "/usr/spool/mail/" 28;(defvar rmail-spool-directory "/usr/spool/mail/"
31; "This is the name of the directory used by the system mailer for\n\ 29; "This is the name of the directory used by the system mailer for\n\
@@ -1605,3 +1603,6 @@ buffer visiting that file."
1605 "Break up a digest message into its constituent messages. 1603 "Break up a digest message into its constituent messages.
1606Leaves original message, deleted, before the undigestified messages." 1604Leaves original message, deleted, before the undigestified messages."
1607 t) 1605 t)
1606
1607(provide 'rmail)
1608
diff --git a/lisp/mail/rmailsort.el b/lisp/mail/rmailsort.el
index e1f01ad2f8f..3bc00ddbf1b 100644
--- a/lisp/mail/rmailsort.el
+++ b/lisp/mail/rmailsort.el
@@ -19,7 +19,6 @@
19;; file named COPYING. Among other things, the copyright notice 19;; file named COPYING. Among other things, the copyright notice
20;; and this notice must be preserved on all copies. 20;; and this notice must be preserved on all copies.
21 21
22(provide 'rmailsort)
23(require 'rmail) 22(require 'rmail)
24(require 'sort) 23(require 'sort)
25 24
@@ -201,3 +200,5 @@ Arguments are MSG and FIELD."
201 (if (<= (length year-string) 2) 200 (if (<= (length year-string) 2)
202 (concat "19" year-string) 201 (concat "19" year-string)
203 year-string)) 202 year-string))
203
204(provide 'rmailsort)
diff --git a/lisp/mail/rnews.el b/lisp/mail/rnews.el
index 64b98ca407b..d96738af30f 100644
--- a/lisp/mail/rnews.el
+++ b/lisp/mail/rnews.el
@@ -42,8 +42,7 @@
42;; tower@prep Oct 29 1986 42;; tower@prep Oct 29 1986
43;; added caesar-region, rename news-caesar-buffer-body, hacked accordingly 43;; added caesar-region, rename news-caesar-buffer-body, hacked accordingly
44;; tower@prep Nov 21 1986 44;; tower@prep Nov 21 1986
45;; added (provide 'rnews) tower@prep 22 Apr 87 45;; added tower@prep 22 Apr 87
46(provide 'rnews)
47(require 'mail-utils) 46(require 'mail-utils)
48 47
49(autoload 'rmail-output "rmailout" 48(autoload 'rmail-output "rmailout"
@@ -977,3 +976,5 @@ Mail and USENET news headers are not rotated."
977 (goto-char (point-max)) 976 (goto-char (point-max))
978 (caesar-region rotnum) 977 (caesar-region rotnum)
979 (setq buffer-read-only buffer-status)))) 978 (setq buffer-read-only buffer-status))))
979
980(provide 'rnews) (provide 'rnews)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index c22d7d85c07..24824dfc0f9 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -18,8 +18,6 @@
18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20 20
21(provide 'sendmail)
22
23;;;###autoload 21;;;###autoload
24(defconst mail-self-blind nil "\ 22(defconst mail-self-blind nil "\
25Non-nil means insert BCC to self in messages to be sent. 23Non-nil means insert BCC to self in messages to be sent.
@@ -660,3 +658,6 @@ The seventh argument ACTIONS is a list of actions to take
660 658
661 659
662;;; Do not add anything but external entries on this page. 660;;; Do not add anything but external entries on this page.
661
662(provide 'sendmail)
663
diff --git a/lisp/mhspool.el b/lisp/mhspool.el
index 4801579ecf7..f9ad802ec56 100644
--- a/lisp/mhspool.el
+++ b/lisp/mhspool.el
@@ -20,7 +20,6 @@
20;; file named COPYING. Among other things, the copyright notice 20;; file named COPYING. Among other things, the copyright notice
21;; and this notice must be preserved on all copies. 21;; and this notice must be preserved on all copies.
22 22
23(provide 'mhspool)
24(require 'nntp) 23(require 'nntp)
25 24
26;; This package enables you to read mail or articles in MH folders, or 25;; This package enables you to read mail or articles in MH folders, or
@@ -402,3 +401,5 @@ If the stream is opened, return T, otherwise return NIL."
402 (setq idx (1+ idx))) 401 (setq idx (1+ idx)))
403 string 402 string
404 )) 403 ))
404
405(provide 'mhspool)
diff --git a/lisp/mim-mode.el b/lisp/mim-mode.el
index 43e0c0118b4..b7aae0a6d19 100644
--- a/lisp/mim-mode.el
+++ b/lisp/mim-mode.el
@@ -19,8 +19,6 @@
19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 20
21 21
22(provide 'mim-mode)
23
24(autoload 'fast-syntax-check-mim "mim-syntax" 22(autoload 'fast-syntax-check-mim "mim-syntax"
25 "Checks Mim syntax quickly. 23 "Checks Mim syntax quickly.
26Answers correct or incorrect, cannot point out the error context." 24Answers correct or incorrect, cannot point out the error context."
@@ -839,3 +837,6 @@ You need type only enough of the name to be unambiguous."
839(defun next-char (direction) 837(defun next-char (direction)
840 "Returns preceding-char if DIRECTION < 0, otherwise following-char." 838 "Returns preceding-char if DIRECTION < 0, otherwise following-char."
841 (if (>= direction 0) (following-char) (preceding-char))) 839 (if (>= direction 0) (following-char) (preceding-char)))
840
841(provide 'mim-mode)
842
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 2fa8cecf9e6..41940cb6221 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -17,8 +17,6 @@
17;;; along with GNU Emacs; see the file COPYING. If not, write to 17;;; along with GNU Emacs; see the file COPYING. If not, write to
18;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20(provide 'mouse)
21
22 20
23;;; Utility functions. 21;;; Utility functions.
24 22
@@ -454,3 +452,6 @@ This does not delete the region; it acts like \\[kill-ring-save]."
454(global-set-key [mouse-1] 'mouse-set-point) 452(global-set-key [mouse-1] 'mouse-set-point)
455(global-set-key [S-mouse-1] 'mouse-set-mark) 453(global-set-key [S-mouse-1] 'mouse-set-mark)
456(global-set-key [mouse-3] 'mouse-delete-other-windows) 454(global-set-key [mouse-3] 'mouse-delete-other-windows)
455
456(provide 'mouse)
457
diff --git a/lisp/nnspool.el b/lisp/nnspool.el
index 8c5a36ca6ba..0cfa097d2f5 100644
--- a/lisp/nnspool.el
+++ b/lisp/nnspool.el
@@ -20,7 +20,6 @@
20;; file named COPYING. Among other things, the copyright notice 20;; file named COPYING. Among other things, the copyright notice
21;; and this notice must be preserved on all copies. 21;; and this notice must be preserved on all copies.
22 22
23(provide 'nnspool)
24(require 'nntp) 23(require 'nntp)
25 24
26(defvar nnspool-inews-program news-inews-program 25(defvar nnspool-inews-program news-inews-program
@@ -372,3 +371,5 @@ If the stream is opened, return T, otherwise return NIL."
372 (setq idx (1+ idx))) 371 (setq idx (1+ idx)))
373 string 372 string
374 )) 373 ))
374
375(provide 'nnspool)
diff --git a/lisp/nntp.el b/lisp/nntp.el
index 6bb7a741076..dd33902be77 100644
--- a/lisp/nntp.el
+++ b/lisp/nntp.el
@@ -42,8 +42,6 @@
42;; system, please send me the diffs. I'll include some of them in the 42;; system, please send me the diffs. I'll include some of them in the
43;; future releases. 43;; future releases.
44 44
45(provide 'nntp)
46
47(defvar nntp-server-hook nil 45(defvar nntp-server-hook nil
48 "*Hooks for the NNTP server. 46 "*Hooks for the NNTP server.
49If the kanji code of the NNTP server is different from the local kanji 47If the kanji code of the NNTP server is different from the local kanji
@@ -665,3 +663,6 @@ defining this function as macro."
665 (signal (car errorcode) (cdr errorcode)))) 663 (signal (car errorcode) (cdr errorcode))))
666 )) 664 ))
667 )) 665 ))
666
667(provide 'nntp)
668
diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el
index c40c108895f..a3783e63c5e 100644
--- a/lisp/play/gomoku.el
+++ b/lisp/play/gomoku.el
@@ -23,9 +23,6 @@
23;;; with precious advices from J.-F. Rit. 23;;; with precious advices from J.-F. Rit.
24;;; This has been tested with GNU Emacs 18.50. 24;;; This has been tested with GNU Emacs 18.50.
25 25
26(provide 'gomoku)
27
28
29;; RULES: 26;; RULES:
30;; 27;;
31;; Gomoku is a game played between two players on a rectangular board. Each 28;; Gomoku is a game played between two players on a rectangular board. Each
@@ -1158,4 +1155,6 @@ If the game is finished, this command requests for another game."
1158 (gomoku-move-down) 1155 (gomoku-move-down)
1159 (gomoku-move-left)) 1156 (gomoku-move-left))
1160 1157
1158(provide 'gomoku)
1159
1161 1160
diff --git a/lisp/play/life.el b/lisp/play/life.el
index 059bf350fd4..0aceb065609 100644
--- a/lisp/play/life.el
+++ b/lisp/play/life.el
@@ -18,8 +18,6 @@
18;; along with GNU Emacs; see the file COPYING. If not, write to 18;; along with GNU Emacs; see the file COPYING. If not, write to
19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 20
21(provide 'life)
22
23(defconst life-patterns 21(defconst life-patterns
24 [("@@@" " @@" "@@@") 22 [("@@@" " @@" "@@@")
25 ("@@@ @@@" "@@ @@ " "@@@ @@@") 23 ("@@@ @@@" "@@ @@ " "@@@ @@@")
@@ -272,3 +270,6 @@ generations (this defaults to 1)."
272 270
273(put 'life-extinct 'error-conditions '(life-extinct quit)) 271(put 'life-extinct 'error-conditions '(life-extinct quit))
274(put 'life-extinct 'error-message "All life has perished") 272(put 'life-extinct 'error-message "All life has perished")
273
274(provide 'life)
275
diff --git a/lisp/play/yow.el b/lisp/play/yow.el
index a4d33d3609f..0f1c51b23fe 100644
--- a/lisp/play/yow.el
+++ b/lisp/play/yow.el
@@ -16,8 +16,6 @@
16;; along with GNU Emacs; see the file COPYING. If not, write to 16;; along with GNU Emacs; see the file COPYING. If not, write to
17;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 17;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 18
19(provide 'yow)
20
21; Randomize the seed in the random number generator. 19; Randomize the seed in the random number generator.
22(random t) 20(random t)
23 21
@@ -86,3 +84,5 @@
86 (doctor-ret-or-read 1) 84 (doctor-ret-or-read 1)
87 (doctor-ret-or-read 1))) 85 (doctor-ret-or-read 1)))
88 86
87(provide 'yow)
88
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 92e0173a2a5..3b74be87cc6 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -18,8 +18,6 @@
18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20 20
21(provide 'etags)
22
23;;;###autoload 21;;;###autoload
24(defvar tags-file-name nil "\ 22(defvar tags-file-name nil "\
25*File name of tag table. 23*File name of tag table.
@@ -354,3 +352,6 @@ unless it has one in the tag table."
354 (forward-line 1))))) 352 (forward-line 1)))))
355 353
356;; etags.el ends here 354;; etags.el ends here
355
356(provide 'etags)
357
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index 33a2da4b182..6ed3645ec9e 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -89,8 +89,6 @@
89 89
90;;; Bugs to bug-fortran-mode@erl.mit.edu 90;;; Bugs to bug-fortran-mode@erl.mit.edu
91 91
92(provide 'fortran)
93
94;;;###autoload 92;;;###autoload
95(defvar fortran-tab-mode-default nil 93(defvar fortran-tab-mode-default nil
96 "*Default tabbing/carriage control style for empty files in fortran mode. 94 "*Default tabbing/carriage control style for empty files in fortran mode.
@@ -995,3 +993,5 @@ character format style."
995 '(fortran-tab-mode-string fortran-tab-mode-string) 993 '(fortran-tab-mode-string fortran-tab-mode-string)
996 minor-mode-alist))) 994 minor-mode-alist)))
997 995
996(provide 'fortran)
997
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index 7f78c28d970..f3e3ce606d1 100644
--- a/lisp/progmodes/inf-lisp.el
+++ b/lisp/progmodes/inf-lisp.el
@@ -48,8 +48,6 @@
48;;; text to the process? Switch selectable? 48;;; text to the process? Switch selectable?
49 49
50(require 'comint) 50(require 'comint)
51(provide 'cmulisp)
52
53;; YOUR .EMACS FILE 51;; YOUR .EMACS FILE
54;;============================================================================= 52;;=============================================================================
55;; Some suggestions for your .emacs file. 53;; Some suggestions for your .emacs file.
@@ -599,3 +597,6 @@ This is a good place to put keybindings.")
599;;; 3/12/90 Olin 597;;; 3/12/90 Olin
600;;; - lisp-load-file and lisp-compile-file no longer switch-to-lisp. 598;;; - lisp-load-file and lisp-compile-file no longer switch-to-lisp.
601;;; Tale suggested this. 599;;; Tale suggested this.
600
601(provide 'cmulisp)
602
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index 111f74c5532..2f333527942 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -25,7 +25,6 @@
25 25
26;;; $Header: scheme.el,v 1.7 88/07/15 20:20:00 GMT cph Exp $ 26;;; $Header: scheme.el,v 1.7 88/07/15 20:20:00 GMT cph Exp $
27 27
28(provide 'scheme)
29 28
30(defvar scheme-mode-syntax-table nil "") 29(defvar scheme-mode-syntax-table nil "")
31(if (not scheme-mode-syntax-table) 30(if (not scheme-mode-syntax-table)
@@ -498,3 +497,5 @@ of the start of the containing expression."
498 (if (/= (current-column) this-indent) 497 (if (/= (current-column) this-indent)
499 (progn (delete-region bol (point)) 498 (progn (delete-region bol (point))
500 (indent-to this-indent))))))))) 499 (indent-to this-indent)))))))))
500
501(provide 'scheme)
diff --git a/lisp/sort.el b/lisp/sort.el
index f5ad0765dc2..002a899f7e8 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -17,8 +17,6 @@
17;; along with GNU Emacs; see the file COPYING. If not, write to 17;; along with GNU Emacs; see the file COPYING. If not, write to
18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20(provide 'sort)
21
22;; Original version of most of this contributed by Howie Kaye 20;; Original version of most of this contributed by Howie Kaye
23 21
24(defun sort-subr (reverse nextrecfun endrecfun &optional startkeyfun endkeyfun) 22(defun sort-subr (reverse nextrecfun endrecfun &optional startkeyfun endkeyfun)
@@ -444,3 +442,6 @@ From a program takes two point or marker arguments, BEG and END."
444 (insert (car ll) "\n") 442 (insert (car ll) "\n")
445 (setq ll (cdr ll))) 443 (setq ll (cdr ll)))
446 (insert (car ll))))) 444 (insert (car ll)))))
445
446(provide 'sort)
447
diff --git a/lisp/sun-curs.el b/lisp/sun-curs.el
index f290e1b3a76..ec5ffc8442c 100644
--- a/lisp/sun-curs.el
+++ b/lisp/sun-curs.el
@@ -23,8 +23,6 @@
23;;; 23;;;
24;;; 9-dec-86 Jeff Peck, Sun Microsystems Inc. <peck@sun.com> 24;;; 9-dec-86 Jeff Peck, Sun Microsystems Inc. <peck@sun.com>
25 25
26(provide 'sm-cursors)
27
28(defvar sc::cursors nil "List of known cursors") 26(defvar sc::cursors nil "List of known cursors")
29 27
30(defmacro defcursor (name x y string) 28(defmacro defcursor (name x y string)
@@ -205,3 +203,5 @@ Otherwise, ICON should be a vector or the name of a vector of [x y 32-chars]"
205 (setq char (1+ (lsh char 1)))) 203 (setq char (1+ (lsh char 1))))
206 (if (not (eolp))(forward-char))) 204 (if (not (eolp))(forward-char)))
207 205
206(provide 'sm-cursors)
207
diff --git a/lisp/sun-fns.el b/lisp/sun-fns.el
index b2ca59203f6..b628565d38e 100644
--- a/lisp/sun-fns.el
+++ b/lisp/sun-fns.el
@@ -24,7 +24,6 @@
24;;; GoodIdeas Feb. 1987, Steve Greenbaum 24;;; GoodIdeas Feb. 1987, Steve Greenbaum
25;;; & UpClicks Reasoning Systems, Inc. 25;;; & UpClicks Reasoning Systems, Inc.
26;;; 26;;;
27(provide 'sun-fns)
28(require 'sun-mouse) 27(require 'sun-mouse)
29;;; 28;;;
30;;; Functions for manipulating via the mouse and mouse-map definitions 29;;; Functions for manipulating via the mouse and mouse-map definitions
@@ -628,3 +627,4 @@ To unmark a buffer marked for deletion, select it with LEFT."
628(global-set-mouse '(minibuffer shift control meta right) 'mouse-help-region) 627(global-set-mouse '(minibuffer shift control meta right) 'mouse-help-region)
629(global-set-mouse '(minibuffer double control meta right) 'mouse-help-region) 628(global-set-mouse '(minibuffer double control meta right) 'mouse-help-region)
630 629
630(provide 'sun-fns)
diff --git a/lisp/superyank.el b/lisp/superyank.el
index 4d16e6b5e5b..6319f9078d6 100644
--- a/lisp/superyank.el
+++ b/lisp/superyank.el
@@ -88,8 +88,6 @@
88;; require and provide features 88;; require and provide features
89;; 89;;
90(require 'sendmail) 90(require 'sendmail)
91(provide 'superyank)
92
93;; 91;;
94;; ====================================================================== 92;; ======================================================================
95;; 93;;
@@ -1210,3 +1208,5 @@ inserts that many newlines."
1210 (forward-line 1) 1208 (forward-line 1)
1211 (setq arg (- arg 1)))))) 1209 (setq arg (- arg 1))))))
1212 1210
1211(provide 'superyank)
1212
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index c690385064a..ce70c275668 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -66,9 +66,6 @@
66;;; know how to print an arbitrary date, and I don't really want to have to 66;;; know how to print an arbitrary date, and I don't really want to have to
67;;; implement decode-universal-time. 67;;; implement decode-universal-time.
68;;; 68;;;
69;;; o There's code to update the datestamp of edited subfiles, but we set it
70;;; to zero because I don't know how to get the current time as an integer.
71;;;
72;;; o The code is less efficient that it could be - in a lot of places, I 69;;; o The code is less efficient that it could be - in a lot of places, I
73;;; pull a 512-character string out of the buffer and parse it, when I could 70;;; pull a 512-character string out of the buffer and parse it, when I could
74;;; be parsing it in place, not garbaging a string. Should redo that. 71;;; be parsing it in place, not garbaging a string. Should redo that.
@@ -108,11 +105,7 @@ tar file will update its datestamp. If false, the datestamp is unchanged.
108You may or may not want this - it is good in that you can tell when a file 105You may or may not want this - it is good in that you can tell when a file
109in a tar archive has been changed, but it is bad for the same reason that 106in a tar archive has been changed, but it is bad for the same reason that
110editing a file in the tar archive at all is bad - the changed version of 107editing a file in the tar archive at all is bad - the changed version of
111the file never exists on disk. 108the file never exists on disk.")
112
113## This doesn't work yet because there's no way to get the current time as
114## an integer - if this var is true, then editing a file sets its date to
115## December 31, 1969 (which happens to be what 0 encodes).")
116 109
117 110
118 111
@@ -978,7 +971,7 @@ to make your changes permanent."
978 nil 971 nil
979 (goto-char (+ header-start tar-time-offset)) 972 (goto-char (+ header-start tar-time-offset))
980 (delete-region (point) (+ (point) 12)) 973 (delete-region (point) (+ (point) 12))
981 (insert (format "%11o" 0)) ; ## oops - how to get it?? 974 (insert (format "%11o" (current-time)))
982 (insert ? )) 975 (insert ? ))
983 ;; 976 ;;
984 ;; compute a new checksum and insert it. 977 ;; compute a new checksum and insert it.
diff --git a/lisp/telnet.el b/lisp/telnet.el
index c3513f61056..2f96d16db9f 100644
--- a/lisp/telnet.el
+++ b/lisp/telnet.el
@@ -27,8 +27,6 @@
27;; manner 27;; manner
28 28
29(require 'comint) 29(require 'comint)
30(provide 'telnet)
31
32(defvar telnet-new-line "\r") 30(defvar telnet-new-line "\r")
33(defvar telnet-mode-map nil) 31(defvar telnet-mode-map nil)
34(defvar telnet-prompt-pattern "^[^#$%>]*[#$%>] *") 32(defvar telnet-prompt-pattern "^[^#$%>]*[#$%>] *")
@@ -179,3 +177,6 @@ Bugs:
179 (setq quit-flag nil)) 177 (setq quit-flag nil))
180 (setq answ (concat answ (char-to-string tem)))) 178 (setq answ (concat answ (char-to-string tem))))
181 answ)) 179 answ))
180
181(provide 'telnet)
182
diff --git a/lisp/term/bg-mouse.el b/lisp/term/bg-mouse.el
index 9b83f5f6c2a..8e3a546709a 100644
--- a/lisp/term/bg-mouse.el
+++ b/lisp/term/bg-mouse.el
@@ -22,8 +22,6 @@
22;;; Original version by John Robinson (jr@bbn-unix.arpa, bbncca!jr), Oct 1985 22;;; Original version by John Robinson (jr@bbn-unix.arpa, bbncca!jr), Oct 1985
23;;; Modularized and enhanced by gildea@bbn.com Nov 1987 23;;; Modularized and enhanced by gildea@bbn.com Nov 1987
24 24
25(provide 'bg-mouse)
26
27;;; User customization option: 25;;; User customization option:
28 26
29(defvar bg-mouse-fast-select-window nil 27(defvar bg-mouse-fast-select-window nil
@@ -302,3 +300,5 @@ X and Y are 0-based character positions on the screen."
302(bind-bg-mouse-click (+ bg-in-minibuf bg-button-m) 'suspend-emacs) 300(bind-bg-mouse-click (+ bg-in-minibuf bg-button-m) 'suspend-emacs)
303(bind-bg-mouse-click (+ bg-in-minibuf bg-button-r) 'eval-expression) 301(bind-bg-mouse-click (+ bg-in-minibuf bg-button-r) 'eval-expression)
304 302
303(provide 'bg-mouse)
304
diff --git a/lisp/term/sun-mouse.el b/lisp/term/sun-mouse.el
index bed2b416c1f..3df2da43b61 100644
--- a/lisp/term/sun-mouse.el
+++ b/lisp/term/sun-mouse.el
@@ -20,8 +20,6 @@
20;;; Jeff Peck, Sun Microsystems, Jan 1987. 20;;; Jeff Peck, Sun Microsystems, Jan 1987.
21;;; Original idea by Stan Jefferson 21;;; Original idea by Stan Jefferson
22 22
23(provide 'sun-mouse)
24
25;;; 23;;;
26;;; Modelled after the GNUEMACS keymap interface. 24;;; Modelled after the GNUEMACS keymap interface.
27;;; 25;;;
@@ -666,3 +664,6 @@ just close the window, and wait for reopening."
666(make-variable-buffer-local 'current-local-mousemap) 664(make-variable-buffer-local 'current-local-mousemap)
667(setq-default current-local-mousemap nil) 665(setq-default current-local-mousemap nil)
668(defvar current-global-mousemap (make-mousemap)) 666(defvar current-global-mousemap (make-mousemap))
667
668(provide 'sun-mouse)
669
diff --git a/lisp/terminal.el b/lisp/terminal.el
index de4b22d3b88..bae0d4c5639 100644
--- a/lisp/terminal.el
+++ b/lisp/terminal.el
@@ -26,7 +26,6 @@
26;;>> One probably wants to do setenv MORE -c when running with 26;;>> One probably wants to do setenv MORE -c when running with
27;;>> more-processing enabled. 27;;>> more-processing enabled.
28 28
29(provide 'terminal)
30(require 'ehelp) 29(require 'ehelp)
31 30
32(defvar terminal-escape-char ?\C-^ 31(defvar terminal-escape-char ?\C-^
@@ -1228,3 +1227,5 @@ of the terminal-emulator"
1228 (1+ end))) 1227 (1+ end)))
1229 start (1+ end))) 1228 start (1+ end)))
1230 (concat "\"" harder "\""))))) 1229 (concat "\"" harder "\"")))))
1230
1231(provide 'terminal)
diff --git a/lisp/textmodes/bib-mode.el b/lisp/textmodes/bib-mode.el
index af6f2ded3f0..14ef2045a7b 100644
--- a/lisp/textmodes/bib-mode.el
+++ b/lisp/textmodes/bib-mode.el
@@ -24,8 +24,6 @@
24;; bibliography file. Keys are automagically inserted as you type, 24;; bibliography file. Keys are automagically inserted as you type,
25;; and appropriate keys are presented for various kinds of entries. 25;; and appropriate keys are presented for various kinds of entries.
26 26
27(provide 'bib-mode)
28
29(defvar bib-file "~/my-bibliography.bib" 27(defvar bib-file "~/my-bibliography.bib"
30 "Default name of file used by `addbib'.") 28 "Default name of file used by `addbib'.")
31 29
@@ -231,3 +229,6 @@ in the title).")
231 (insert s) 229 (insert s)
232 (capitalize-title-region (point-min) (point-max)) 230 (capitalize-title-region (point-min) (point-max))
233 (buffer-string))) 231 (buffer-string)))
232
233(provide 'bib-mode)
234
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 4be2935fc26..d008fe99b3c 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -69,7 +69,7 @@
69;;; Bengt Martensson, March 6 69;;; Bengt Martensson, March 6
70;;; Adapted to Bibtex 0.99 by updating the optional fields according 70;;; Adapted to Bibtex 0.99 by updating the optional fields according
71;;; to the document BibTeXing, Oren Patashnik, dated January 31, 1988. 71;;; to the document BibTeXing, Oren Patashnik, dated January 31, 1988.
72;;; Updated documentation strings accordingly. Added (provide 'bibtex). 72;;; Updated documentation strings accordingly. Added .
73;;; If bibtex-include-OPT-crossref is non-nil, every entry will have 73;;; If bibtex-include-OPT-crossref is non-nil, every entry will have
74;;; an OPTcrossref field, analogously for bibtex-include-OPTkey and 74;;; an OPTcrossref field, analogously for bibtex-include-OPTkey and
75;;; bibtex-include-OPTannote. Added bibtex-preamble, bound to ^C^EP, 75;;; bibtex-include-OPTannote. Added bibtex-preamble, bound to ^C^EP,
@@ -139,8 +139,6 @@
139;;; Trouble is, in Emacs 18.44 you can't have a mode-specific mouse binding, 139;;; Trouble is, in Emacs 18.44 you can't have a mode-specific mouse binding,
140;;; so it will remain active in all windows. Yuck! 140;;; so it will remain active in all windows. Yuck!
141 141
142(provide 'bibtex)
143
144(defvar bibtex-mode-syntax-table nil "") 142(defvar bibtex-mode-syntax-table nil "")
145(defvar bibtex-mode-abbrev-table nil "") 143(defvar bibtex-mode-abbrev-table nil "")
146(define-abbrev-table 'bibtex-mode-abbrev-table ()) 144(define-abbrev-table 'bibtex-mode-abbrev-table ())
@@ -1101,3 +1099,6 @@ an undefined location.
1101)) ; matches (if... 1099)) ; matches (if...
1102 1100
1103;;; ------------- end bibtex-mode.el ------------------------------- 1101;;; ------------- end bibtex-mode.el -------------------------------
1102
1103(provide 'bibtex)(provide 'bibtex)
1104
diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el
index 2c1ab18bef2..a72dee496ae 100644
--- a/lisp/textmodes/picture.el
+++ b/lisp/textmodes/picture.el
@@ -19,8 +19,6 @@
19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 20
21 21
22(provide 'picture)
23
24(defun move-to-column-force (column) 22(defun move-to-column-force (column)
25 "Move to column COLUMN in current line. 23 "Move to column COLUMN in current line.
26Differs from `move-to-column' in that it creates or modifies whitespace 24Differs from `move-to-column' in that it creates or modifies whitespace
@@ -558,3 +556,6 @@ With no argument strips whitespace from end of every line in Picture buffer
558 (goto-char (point-min)) 556 (goto-char (point-min))
559 (while (re-search-forward "[ \t][ \t]*$" nil t) 557 (while (re-search-forward "[ \t][ \t]*$" nil t)
560 (delete-region (match-beginning 0) (point))))) 558 (delete-region (match-beginning 0) (point)))))
559
560(provide 'picture)
561
diff --git a/lisp/textmodes/refbib.el b/lisp/textmodes/refbib.el
index 149c2f7e5c6..cba3a2ba0f5 100644
--- a/lisp/textmodes/refbib.el
+++ b/lisp/textmodes/refbib.el
@@ -44,7 +44,6 @@
44; modified 3/1/89, fixed capitialize-title for first words all caps 44; modified 3/1/89, fixed capitialize-title for first words all caps
45; modified 3/15/89, allow use of " to delimit fields 45; modified 3/15/89, allow use of " to delimit fields
46; modified 4/18/89, properly "quote" special characters on output 46; modified 4/18/89, properly "quote" special characters on output
47(provide 'refer-to-bibtex)
48;********************************************************** 47;**********************************************************
49; User Parameters 48; User Parameters
50 49
@@ -708,3 +707,5 @@ To see this message again, perform
708 (r2b-help)) 707 (r2b-help))
709 708
710(message "r2b loaded") 709(message "r2b loaded")
710
711(provide 'refer-to-bibtex)
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 3f0a062a11d..eb5ff51e932 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -33,8 +33,6 @@
33;; The code for finding matching $ needs to be fixed. 33;; The code for finding matching $ needs to be fixed.
34 34
35(require 'oshell) 35(require 'oshell)
36(provide 'tex-mode)
37
38(defvar tex-directory "./" 36(defvar tex-directory "./"
39 "*Directory in which to run TeX subjob. Temporary files are created here.") 37 "*Directory in which to run TeX subjob. Temporary files are created here.")
40 38
@@ -803,3 +801,5 @@ Runs the shell command defined by tex-show-queue-command."
803 (concat tex-bibtex-command " \"" tex-out-file "\"\n"))) 801 (concat tex-bibtex-command " \"" tex-out-file "\"\n")))
804 (tex-recenter-output-buffer 0)) 802 (tex-recenter-output-buffer 0))
805 803
804(provide 'tex-mode)
805
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index 9a7192ac673..edb72a8ed54 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -23,8 +23,6 @@
23 23
24(require 'texnfo-upd) 24(require 'texnfo-upd)
25(require 'tex-mode) 25(require 'tex-mode)
26(provide 'texinfo)
27
28(defvar texinfo-mode-syntax-table nil) 26(defvar texinfo-mode-syntax-table nil)
29 27
30(if texinfo-mode-syntax-table 28(if texinfo-mode-syntax-table
@@ -413,3 +411,5 @@ Runs the shell command defined by tex-dvi-print-command."
413 " " tex-zap-file ".dvi" "\n")) 411 " " tex-zap-file ".dvi" "\n"))
414 (tex-recenter-output-buffer nil)) 412 (tex-recenter-output-buffer nil))
415 413
414(provide 'texinfo)
415
diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el
index c236d791846..6954952ca61 100644
--- a/lisp/textmodes/texnfo-upd.el
+++ b/lisp/textmodes/texnfo-upd.el
@@ -21,8 +21,6 @@
21;; along with GNU Emacs; see the file COPYING. If not, write to 21;; along with GNU Emacs; see the file COPYING. If not, write to
22;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 22;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23 23
24(provide 'texnfo-upd)
25
26 24
27;;;; Summary 25;;;; Summary
28 26
@@ -1724,3 +1722,6 @@ chapter."
1724 (message "Multiple files updated.")) 1722 (message "Multiple files updated."))
1725 1723
1726;;;;;;;;;;;;;;;; end texnfo-upd.el ;;;;;;;;;;;;;;;; 1724;;;;;;;;;;;;;;;; end texnfo-upd.el ;;;;;;;;;;;;;;;;
1725
1726(provide 'texnfo-upd)
1727
diff --git a/lisp/timer.el b/lisp/timer.el
index 7f71f784de9..905706f3ab7 100644
--- a/lisp/timer.el
+++ b/lisp/timer.el
@@ -25,6 +25,7 @@
25 ;; rescheduling or people who otherwise expect to use the process frequently 25 ;; rescheduling or people who otherwise expect to use the process frequently
26 "If non-nil, don't exit the timer process when no more events are pending.") 26 "If non-nil, don't exit the timer process when no more events are pending.")
27 27
28;;;###autoload
28(defun run-at-time (time repeat function &rest args) 29(defun run-at-time (time repeat function &rest args)
29 "Run a function at a time, and optionally on a regular interval. 30 "Run a function at a time, and optionally on a regular interval.
30Arguments are TIME, REPEAT, FUNCTION &rest ARGS. 31Arguments are TIME, REPEAT, FUNCTION &rest ARGS.
diff --git a/lisp/view.el b/lisp/view.el
index f8e13959813..3307ba8ce03 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -19,8 +19,6 @@
19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 20
21 21
22(provide 'view)
23
24(defvar view-mode-map nil) 22(defvar view-mode-map nil)
25(if view-mode-map 23(if view-mode-map
26 nil 24 nil
@@ -438,3 +436,6 @@ invocations return to earlier marks."
438 436
439;;;###autoload 437;;;###autoload
440(define-key ctl-x-4-map "v" 'view-file-other-window) 438(define-key ctl-x-4-map "v" 'view-file-other-window)
439
440(provide 'view)
441