diff options
| author | Eric M. Ludlam | 2000-11-02 02:25:27 +0000 |
|---|---|---|
| committer | Eric M. Ludlam | 2000-11-02 02:25:27 +0000 |
| commit | 936c15f6ec47e302d1ece475778af80d5e4f51bf (patch) | |
| tree | 7e8c7e62758d7ea9b459a1a352ce522df2c91e3e | |
| parent | 973a3104fd5cc71116d29d8e52ba033d43aa7606 (diff) | |
| download | emacs-936c15f6ec47e302d1ece475778af80d5e4f51bf.tar.gz emacs-936c15f6ec47e302d1ece475778af80d5e4f51bf.zip | |
(comint-add-to-input-history): New function.
(comint-send-input): Use `comint-add-to-input-history'.
| -rw-r--r-- | lisp/comint.el | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 0b2de4aca8a..b0ae6d081bb 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -1331,6 +1331,16 @@ Argument 0 is the command name." | |||
| 1331 | ;; | 1331 | ;; |
| 1332 | ;; Input processing stuff | 1332 | ;; Input processing stuff |
| 1333 | ;; | 1333 | ;; |
| 1334 | (defun comint-add-to-input-history (cmd) | ||
| 1335 | "Add CMD to the input history. | ||
| 1336 | Ignore duplicates if `comint-input-ignoredups' is non-nil." | ||
| 1337 | (if (and (funcall comint-input-filter cmd) | ||
| 1338 | (or (null comint-input-ignoredups) | ||
| 1339 | (not (ring-p comint-input-ring)) | ||
| 1340 | (ring-empty-p comint-input-ring) | ||
| 1341 | (not (string-equal (ring-ref comint-input-ring 0) | ||
| 1342 | cmd)))) | ||
| 1343 | (ring-insert comint-input-ring cmd))) | ||
| 1334 | 1344 | ||
| 1335 | (defun comint-send-input () | 1345 | (defun comint-send-input () |
| 1336 | "Send input to process. | 1346 | "Send input to process. |
| @@ -1406,13 +1416,7 @@ Similarly for Soar, Scheme, etc." | |||
| 1406 | (delete-region pmark (point)) | 1416 | (delete-region pmark (point)) |
| 1407 | (insert ?\n)) | 1417 | (insert ?\n)) |
| 1408 | 1418 | ||
| 1409 | (if (and (funcall comint-input-filter history) | 1419 | (comint-add-to-input-history history) |
| 1410 | (or (null comint-input-ignoredups) | ||
| 1411 | (not (ring-p comint-input-ring)) | ||
| 1412 | (ring-empty-p comint-input-ring) | ||
| 1413 | (not (string-equal (ring-ref comint-input-ring 0) | ||
| 1414 | history)))) | ||
| 1415 | (ring-insert comint-input-ring history)) | ||
| 1416 | 1420 | ||
| 1417 | (run-hook-with-args 'comint-input-filter-functions | 1421 | (run-hook-with-args 'comint-input-filter-functions |
| 1418 | (concat input "\n")) | 1422 | (concat input "\n")) |