diff options
| author | Juanma Barranquero | 2005-07-21 15:13:47 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2005-07-21 15:13:47 +0000 |
| commit | d6ff789ca759f05e8e8ac0e2c2fd5ac374248241 (patch) | |
| tree | c6fb98d7190a3faa7981eae5f694f4604f50e874 | |
| parent | 538f78c3a818b0ed6feb6a54b8548026c6aceb46 (diff) | |
| download | emacs-d6ff789ca759f05e8e8ac0e2c2fd5ac374248241.tar.gz emacs-d6ff789ca759f05e8e8ac0e2c2fd5ac374248241.zip | |
(comint-use-prompt-regexp, comint-send-input, comint-source-default,
comint-extract-string, comint-get-source, comint-word, comint-completion,
comint-source, comint-prompt-read-only, comint-update-fence):
Fix typos in docstrings.
(comint-use-prompt-regexp-instead-of-fields, comint-kill-output):
Declare with define-obsolete-*-alias macros.
(comint-previous-matching-input-from-input,
comint-next-matching-input-from-input, comint-previous-matching-input,
comint-next-matching-input, comint-forward-matching-input):
Improve argument/docstring consistency.
| -rw-r--r-- | lisp/ChangeLog | 13 | ||||
| -rw-r--r-- | lisp/comint.el | 57 |
2 files changed, 40 insertions, 30 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b93f6d6af39..90c3bcea323 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -9,6 +9,19 @@ | |||
| 9 | 9 | ||
| 10 | 2005-07-21 Juanma Barranquero <lekktu@gmail.com> | 10 | 2005-07-21 Juanma Barranquero <lekktu@gmail.com> |
| 11 | 11 | ||
| 12 | * comint.el (comint-use-prompt-regexp, comint-send-input) | ||
| 13 | (comint-source-default, comint-extract-string) | ||
| 14 | (comint-get-source, comint-word, comint-completion) | ||
| 15 | (comint-source, comint-prompt-read-only, comint-update-fence): | ||
| 16 | Fix typos in docstrings. | ||
| 17 | (comint-use-prompt-regexp-instead-of-fields, comint-kill-output): | ||
| 18 | Declare with define-obsolete-*-alias macros. | ||
| 19 | (comint-previous-matching-input-from-input) | ||
| 20 | (comint-next-matching-input-from-input) | ||
| 21 | (comint-previous-matching-input, comint-next-matching-input) | ||
| 22 | (comint-forward-matching-input): | ||
| 23 | Improve argument/docstring consistency. | ||
| 24 | |||
| 12 | * desktop.el (desktop-clear-preserve-buffers-regexp): | 25 | * desktop.el (desktop-clear-preserve-buffers-regexp): |
| 13 | Also preserve the *server* buffer. | 26 | Also preserve the *server* buffer. |
| 14 | 27 | ||
diff --git a/lisp/comint.el b/lisp/comint.el index 99ea2c44436..ab0d41d6735 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -411,17 +411,15 @@ See `comint-send-input'." | |||
| 411 | "*If non-nil, use `comint-prompt-regexp' to recognize prompts. | 411 | "*If non-nil, use `comint-prompt-regexp' to recognize prompts. |
| 412 | If nil, then program output and user-input are given different `field' | 412 | If nil, then program output and user-input are given different `field' |
| 413 | properties, which Emacs commands can use to distinguish them (in | 413 | properties, which Emacs commands can use to distinguish them (in |
| 414 | particular, common movement commands such as begining-of-line respect | 414 | particular, common movement commands such as `beginning-of-line' |
| 415 | field boundaries in a natural way)." | 415 | respect field boundaries in a natural way)." |
| 416 | :type 'boolean | 416 | :type 'boolean |
| 417 | :group 'comint) | 417 | :group 'comint) |
| 418 | 418 | ||
| 419 | ;; Autoload is necessary for Custom to recognize old alias. | 419 | ;; Autoload is necessary for Custom to recognize old alias. |
| 420 | ;;;###autoload | 420 | ;;;###autoload |
| 421 | (defvaralias 'comint-use-prompt-regexp-instead-of-fields | 421 | (define-obsolete-variable-alias 'comint-use-prompt-regexp-instead-of-fields |
| 422 | 'comint-use-prompt-regexp) | 422 | 'comint-use-prompt-regexp "22.1") |
| 423 | (make-obsolete-variable 'comint-use-prompt-regexp-instead-of-fields | ||
| 424 | 'comint-use-prompt-regexp "22.1") | ||
| 425 | 423 | ||
| 426 | (defcustom comint-mode-hook nil | 424 | (defcustom comint-mode-hook nil |
| 427 | "Hook run upon entry to `comint-mode'. | 425 | "Hook run upon entry to `comint-mode'. |
| @@ -1079,14 +1077,14 @@ Moves relative to START, or `comint-input-ring-index'." | |||
| 1079 | (if (string-match regexp (ring-ref comint-input-ring n)) | 1077 | (if (string-match regexp (ring-ref comint-input-ring n)) |
| 1080 | n))) | 1078 | n))) |
| 1081 | 1079 | ||
| 1082 | (defun comint-previous-matching-input (regexp arg) | 1080 | (defun comint-previous-matching-input (regexp n) |
| 1083 | "Search backwards through input history for match for REGEXP. | 1081 | "Search backwards through input history for match for REGEXP. |
| 1084 | \(Previous history elements are earlier commands.) | 1082 | \(Previous history elements are earlier commands.) |
| 1085 | With prefix argument N, search for Nth previous match. | 1083 | With prefix argument N, search for Nth previous match. |
| 1086 | If N is negative, find the next or Nth next match." | 1084 | If N is negative, find the next or Nth next match." |
| 1087 | (interactive (comint-regexp-arg "Previous input matching (regexp): ")) | 1085 | (interactive (comint-regexp-arg "Previous input matching (regexp): ")) |
| 1088 | (setq arg (comint-search-arg arg)) | 1086 | (setq n (comint-search-arg n)) |
| 1089 | (let ((pos (comint-previous-matching-input-string-position regexp arg))) | 1087 | (let ((pos (comint-previous-matching-input-string-position regexp n))) |
| 1090 | ;; Has a match been found? | 1088 | ;; Has a match been found? |
| 1091 | (if (null pos) | 1089 | (if (null pos) |
| 1092 | (error "Not found") | 1090 | (error "Not found") |
| @@ -1099,15 +1097,15 @@ If N is negative, find the next or Nth next match." | |||
| 1099 | (point)) | 1097 | (point)) |
| 1100 | (insert (ring-ref comint-input-ring pos))))) | 1098 | (insert (ring-ref comint-input-ring pos))))) |
| 1101 | 1099 | ||
| 1102 | (defun comint-next-matching-input (regexp arg) | 1100 | (defun comint-next-matching-input (regexp n) |
| 1103 | "Search forwards through input history for match for REGEXP. | 1101 | "Search forwards through input history for match for REGEXP. |
| 1104 | \(Later history elements are more recent commands.) | 1102 | \(Later history elements are more recent commands.) |
| 1105 | With prefix argument N, search for Nth following match. | 1103 | With prefix argument N, search for Nth following match. |
| 1106 | If N is negative, find the previous or Nth previous match." | 1104 | If N is negative, find the previous or Nth previous match." |
| 1107 | (interactive (comint-regexp-arg "Next input matching (regexp): ")) | 1105 | (interactive (comint-regexp-arg "Next input matching (regexp): ")) |
| 1108 | (comint-previous-matching-input regexp (- arg))) | 1106 | (comint-previous-matching-input regexp (- n))) |
| 1109 | 1107 | ||
| 1110 | (defun comint-previous-matching-input-from-input (arg) | 1108 | (defun comint-previous-matching-input-from-input (n) |
| 1111 | "Search backwards through input history for match for current input. | 1109 | "Search backwards through input history for match for current input. |
| 1112 | \(Previous history elements are earlier commands.) | 1110 | \(Previous history elements are earlier commands.) |
| 1113 | With prefix argument N, search for Nth previous match. | 1111 | With prefix argument N, search for Nth previous match. |
| @@ -1124,15 +1122,15 @@ If N is negative, search forwards for the -Nth following match." | |||
| 1124 | comint-input-ring-index nil)) | 1122 | comint-input-ring-index nil)) |
| 1125 | (comint-previous-matching-input | 1123 | (comint-previous-matching-input |
| 1126 | (concat "^" (regexp-quote comint-matching-input-from-input-string)) | 1124 | (concat "^" (regexp-quote comint-matching-input-from-input-string)) |
| 1127 | arg)) | 1125 | n)) |
| 1128 | 1126 | ||
| 1129 | (defun comint-next-matching-input-from-input (arg) | 1127 | (defun comint-next-matching-input-from-input (n) |
| 1130 | "Search forwards through input history for match for current input. | 1128 | "Search forwards through input history for match for current input. |
| 1131 | \(Following history elements are more recent commands.) | 1129 | \(Following history elements are more recent commands.) |
| 1132 | With prefix argument N, search for Nth following match. | 1130 | With prefix argument N, search for Nth following match. |
| 1133 | If N is negative, search backwards for the -Nth previous match." | 1131 | If N is negative, search backwards for the -Nth previous match." |
| 1134 | (interactive "p") | 1132 | (interactive "p") |
| 1135 | (comint-previous-matching-input-from-input (- arg))) | 1133 | (comint-previous-matching-input-from-input (- n))) |
| 1136 | 1134 | ||
| 1137 | 1135 | ||
| 1138 | (defun comint-replace-by-expanded-history (&optional silent start) | 1136 | (defun comint-replace-by-expanded-history (&optional silent start) |
| @@ -1434,14 +1432,14 @@ If the interpreter is the csh, | |||
| 1434 | return the current line with any initial string matching the | 1432 | return the current line with any initial string matching the |
| 1435 | regexp `comint-prompt-regexp' removed. | 1433 | regexp `comint-prompt-regexp' removed. |
| 1436 | `comint-input-filter-functions' monitors input for \"cd\", \"pushd\", and | 1434 | `comint-input-filter-functions' monitors input for \"cd\", \"pushd\", and |
| 1437 | \"popd\" commands. When it sees one, it cd's the buffer. | 1435 | \"popd\" commands. When it sees one, it cd's the buffer. |
| 1438 | comint-input-filter is the default: returns t if the input isn't all white | 1436 | `comint-input-filter' is the default: returns t if the input isn't all white |
| 1439 | space. | 1437 | space. |
| 1440 | 1438 | ||
| 1441 | If the Comint is Lucid Common Lisp, | 1439 | If the Comint is Lucid Common Lisp, |
| 1442 | comint-get-old-input snarfs the sexp ending at point. | 1440 | `comint-get-old-input' snarfs the sexp ending at point. |
| 1443 | comint-input-filter-functions does nothing. | 1441 | `comint-input-filter-functions' does nothing. |
| 1444 | comint-input-filter returns nil if the input matches input-filter-regexp, | 1442 | `comint-input-filter' returns nil if the input matches input-filter-regexp, |
| 1445 | which matches (1) all whitespace (2) :a, :c, etc. | 1443 | which matches (1) all whitespace (2) :a, :c, etc. |
| 1446 | 1444 | ||
| 1447 | Similarly for Soar, Scheme, etc." | 1445 | Similarly for Soar, Scheme, etc." |
| @@ -2002,8 +2000,8 @@ Does not delete the prompt." | |||
| 2002 | (delete-region pmark (point)))) | 2000 | (delete-region pmark (point)))) |
| 2003 | ;; Output message and put back prompt | 2001 | ;; Output message and put back prompt |
| 2004 | (comint-output-filter proc replacement))) | 2002 | (comint-output-filter proc replacement))) |
| 2005 | (defalias 'comint-kill-output 'comint-delete-output) | 2003 | (define-obsolete-function-alias 'comint-kill-output |
| 2006 | (make-obsolete 'comint-kill-output 'comint-delete-output "21.1") | 2004 | 'comint-delete-output "21.1") |
| 2007 | 2005 | ||
| 2008 | (defun comint-write-output (filename &optional append mustbenew) | 2006 | (defun comint-write-output (filename &optional append mustbenew) |
| 2009 | "Write output from interpreter since last input to FILENAME. | 2007 | "Write output from interpreter since last input to FILENAME. |
| @@ -2169,7 +2167,7 @@ If N is negative, find the next or Nth next match." | |||
| 2169 | (goto-char pos)))) | 2167 | (goto-char pos)))) |
| 2170 | 2168 | ||
| 2171 | 2169 | ||
| 2172 | (defun comint-forward-matching-input (regexp arg) | 2170 | (defun comint-forward-matching-input (regexp n) |
| 2173 | "Search forward through buffer for input fields that match REGEXP. | 2171 | "Search forward through buffer for input fields that match REGEXP. |
| 2174 | If `comint-use-prompt-regexp' is non-nil, then input fields are identified | 2172 | If `comint-use-prompt-regexp' is non-nil, then input fields are identified |
| 2175 | by lines that match `comint-prompt-regexp'. | 2173 | by lines that match `comint-prompt-regexp'. |
| @@ -2177,7 +2175,7 @@ by lines that match `comint-prompt-regexp'. | |||
| 2177 | With prefix argument N, search for Nth following match. | 2175 | With prefix argument N, search for Nth following match. |
| 2178 | If N is negative, find the previous or Nth previous match." | 2176 | If N is negative, find the previous or Nth previous match." |
| 2179 | (interactive (comint-regexp-arg "Forward input matching (regexp): ")) | 2177 | (interactive (comint-regexp-arg "Forward input matching (regexp): ")) |
| 2180 | (comint-backward-matching-input regexp (- arg))) | 2178 | (comint-backward-matching-input regexp (- n))) |
| 2181 | 2179 | ||
| 2182 | 2180 | ||
| 2183 | (defun comint-next-prompt (n) | 2181 | (defun comint-next-prompt (n) |
| @@ -2388,7 +2386,7 @@ updated using `comint-update-fence', if necessary." | |||
| 2388 | (defun comint-source-default (previous-dir/file source-modes) | 2386 | (defun comint-source-default (previous-dir/file source-modes) |
| 2389 | "Compute the defaults for `load-file' and `compile-file' commands. | 2387 | "Compute the defaults for `load-file' and `compile-file' commands. |
| 2390 | 2388 | ||
| 2391 | PREVIOUS-DIR/FILE is a pair (directory . filename) from the last | 2389 | PREVIOUS-DIR/FILE is a pair (DIRECTORY . FILENAME) from the last |
| 2392 | source-file processing command, or nil if there hasn't been one yet. | 2390 | source-file processing command, or nil if there hasn't been one yet. |
| 2393 | SOURCE-MODES is a list used to determine what buffers contain source | 2391 | SOURCE-MODES is a list used to determine what buffers contain source |
| 2394 | files: if the major mode of the buffer is in SOURCE-MODES, it's source. | 2392 | files: if the major mode of the buffer is in SOURCE-MODES, it's source. |
| @@ -2409,7 +2407,7 @@ processing command (i.e., PREVIOUS-DIR/FILE). If this is the first time | |||
| 2409 | the command has been run (PREVIOUS-DIR/FILE is nil), the default directory | 2407 | the command has been run (PREVIOUS-DIR/FILE is nil), the default directory |
| 2410 | is the cwd, with no default file. (\"no default file\" = nil) | 2408 | is the cwd, with no default file. (\"no default file\" = nil) |
| 2411 | 2409 | ||
| 2412 | SOURCE-REGEXP is typically going to be something like (tea-mode) | 2410 | SOURCE-MODES is typically going to be something like (tea-mode) |
| 2413 | for T programs, (lisp-mode) for Lisp programs, (soar-mode lisp-mode) | 2411 | for T programs, (lisp-mode) for Lisp programs, (soar-mode lisp-mode) |
| 2414 | for Soar programs, etc. | 2412 | for Soar programs, etc. |
| 2415 | 2413 | ||
| @@ -2440,7 +2438,7 @@ the load or compile." | |||
| 2440 | (set-buffer old-buffer))))) | 2438 | (set-buffer old-buffer))))) |
| 2441 | 2439 | ||
| 2442 | (defun comint-extract-string () | 2440 | (defun comint-extract-string () |
| 2443 | "Return string around POINT, or nil." | 2441 | "Return string around point, or nil." |
| 2444 | (let ((syntax (syntax-ppss))) | 2442 | (let ((syntax (syntax-ppss))) |
| 2445 | (when (nth 3 syntax) | 2443 | (when (nth 3 syntax) |
| 2446 | (condition-case () | 2444 | (condition-case () |
| @@ -2460,7 +2458,7 @@ See `comint-source-default' for more on determining defaults. | |||
| 2460 | PROMPT is the prompt string. PREV-DIR/FILE is the (DIRECTORY . FILE) pair | 2458 | PROMPT is the prompt string. PREV-DIR/FILE is the (DIRECTORY . FILE) pair |
| 2461 | from the last source processing command. SOURCE-MODES is a list of major | 2459 | from the last source processing command. SOURCE-MODES is a list of major |
| 2462 | modes used to determine what file buffers contain source files. (These | 2460 | modes used to determine what file buffers contain source files. (These |
| 2463 | two arguments are used for determining defaults). If MUSTMATCH-P is true, | 2461 | two arguments are used for determining defaults.) If MUSTMATCH-P is true, |
| 2464 | then the filename reader will only accept a file that exists. | 2462 | then the filename reader will only accept a file that exists. |
| 2465 | 2463 | ||
| 2466 | A typical use: | 2464 | A typical use: |
| @@ -2618,8 +2616,7 @@ This is a good thing to set in mode hooks.") | |||
| 2618 | (defun comint-word (word-chars) | 2616 | (defun comint-word (word-chars) |
| 2619 | "Return the word of WORD-CHARS at point, or nil if none is found. | 2617 | "Return the word of WORD-CHARS at point, or nil if none is found. |
| 2620 | Word constituents are considered to be those in WORD-CHARS, which is like the | 2618 | Word constituents are considered to be those in WORD-CHARS, which is like the |
| 2621 | inside of a \"[...]\" (see `skip-chars-forward'), | 2619 | inside of a \"[...]\" (see `skip-chars-forward'), plus all non-ASCII characters." |
| 2622 | plus all non-ASCII characters." | ||
| 2623 | (save-excursion | 2620 | (save-excursion |
| 2624 | (let ((here (point)) | 2621 | (let ((here (point)) |
| 2625 | giveup) | 2622 | giveup) |