diff options
author | Jim Porter <jporterbugs@gmail.com> | 2023-01-08 13:05:59 -0800 |
---|---|---|
committer | Jim Porter <jporterbugs@gmail.com> | 2023-01-14 11:09:02 -0800 |
commit | 54051c97f2e950eaa229b18f0cf209c727b2daa3 (patch) | |
tree | 6731fd8ed2a84064b871e7106e29409401f74c43 /test/lisp/eshell/eshell-tests.el | |
parent | 558f04c39e036d2f681f72556627768d7bee9ab5 (diff) | |
download | emacs-54051c97f2e950eaa229b18f0cf209c727b2daa3.tar.gz |
Make 'eshell-bol' obsolete
Now that Eshell uses fields for its output, 'eshell-bol' is no longer
needed, and we can just use 'beginning-of-line'.
* lisp/eshell/esh-mode.el (eshell-bol): Mark obsolete.
(eshell-mode-map): Remove 'C-a' mapping.
(eshell-command-map): Use 'move-beginning-of-line'.
(eshell-move-argument, eshell-kill-input): Use 'beginning-of-line'.
(eshell-get-old-input): Remove unnecessary call to
'eshell-skip-prompt-function'.
* lisp/eshell/em-rebind.el (eshell-rebind-keys-alist): Remove 'C-a'
and '<home>' mappings; the global mapping for these
('move-beginning-of-line') does the same thing now.
* lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments):
* lisp/eshell/em-elecslash.el (eshell-electric-forward-slash):
* lisp/eshell/em-hist.el (eshell-hist-word-reference)
(eshell-previous-matching-input-from-input, eshell-test-imatch):
* lisp/eshell/em-prompt.el (eshell-backward-matching-input):
* lisp/eshell/em-rebind.el (eshell-point-within-input-p):
* test/lisp/eshell/eshell-tests.el (eshell-test/forward-arg): Use
'beginning-of-line'.
* test/lisp/eshell/eshell-tests.el (eshell-test/run-old-command):
Rename to...
(eshell-test/get-old-input): ... this, and expand the test.
Diffstat (limited to 'test/lisp/eshell/eshell-tests.el')
-rw-r--r-- | test/lisp/eshell/eshell-tests.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index be968e1558f..776cfb9b92f 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -117,14 +117,14 @@ (with-temp-eshell (eshell-insert-command "echo $(+ 1 (- 4 3)) \"alpha beta\" file" 'ignore) (let ((here (point)) begin valid) - (eshell-bol) + (beginning-of-line) (setq begin (point)) (eshell-forward-argument 4) (setq valid (= here (point))) (eshell-backward-argument 4) (prog1 (and valid (= begin (point))) - (eshell-bol) + (beginning-of-line) (delete-region (point) (point-max)))))) (ert-deftest eshell-test/queue-input () @@ -148,12 +148,17 @@ insert the queued one at the next prompt, and finally run it." (should (eshell-match-output (concat "^" (regexp-quote "*** output flushed ***\n") "$"))))) -(ert-deftest eshell-test/run-old-command () - "Re-run an old command" +(ert-deftest eshell-test/get-old-input () + "Test that we can get the input of a previous command." (with-temp-eshell (eshell-insert-command "echo alpha") (goto-char eshell-last-input-start) - (string= (eshell-get-old-input) "echo alpha"))) + (should (string= (eshell-get-old-input) "echo alpha")) + ;; Make sure that `eshell-get-old-input' works even if the point is + ;; inside the prompt. + (let ((inhibit-field-text-motion t)) + (beginning-of-line)) + (should (string= (eshell-get-old-input) "echo alpha")))) (provide 'eshell-tests) |