aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJim Porter2023-01-08 13:05:59 -0800
committerJim Porter2023-01-14 11:09:02 -0800
commit54051c97f2e950eaa229b18f0cf209c727b2daa3 (patch)
tree6731fd8ed2a84064b871e7106e29409401f74c43 /test
parent558f04c39e036d2f681f72556627768d7bee9ab5 (diff)
downloademacs-54051c97f2e950eaa229b18f0cf209c727b2daa3.tar.gz
emacs-54051c97f2e950eaa229b18f0cf209c727b2daa3.zip
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')
-rw-r--r--test/lisp/eshell/eshell-tests.el15
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 @@
117 (with-temp-eshell 117 (with-temp-eshell
118 (eshell-insert-command "echo $(+ 1 (- 4 3)) \"alpha beta\" file" 'ignore) 118 (eshell-insert-command "echo $(+ 1 (- 4 3)) \"alpha beta\" file" 'ignore)
119 (let ((here (point)) begin valid) 119 (let ((here (point)) begin valid)
120 (eshell-bol) 120 (beginning-of-line)
121 (setq begin (point)) 121 (setq begin (point))
122 (eshell-forward-argument 4) 122 (eshell-forward-argument 4)
123 (setq valid (= here (point))) 123 (setq valid (= here (point)))
124 (eshell-backward-argument 4) 124 (eshell-backward-argument 4)
125 (prog1 125 (prog1
126 (and valid (= begin (point))) 126 (and valid (= begin (point)))
127 (eshell-bol) 127 (beginning-of-line)
128 (delete-region (point) (point-max)))))) 128 (delete-region (point) (point-max))))))
129 129
130(ert-deftest eshell-test/queue-input () 130(ert-deftest eshell-test/queue-input ()
@@ -148,12 +148,17 @@ insert the queued one at the next prompt, and finally run it."
148 (should (eshell-match-output 148 (should (eshell-match-output
149 (concat "^" (regexp-quote "*** output flushed ***\n") "$"))))) 149 (concat "^" (regexp-quote "*** output flushed ***\n") "$")))))
150 150
151(ert-deftest eshell-test/run-old-command () 151(ert-deftest eshell-test/get-old-input ()
152 "Re-run an old command" 152 "Test that we can get the input of a previous command."
153 (with-temp-eshell 153 (with-temp-eshell
154 (eshell-insert-command "echo alpha") 154 (eshell-insert-command "echo alpha")
155 (goto-char eshell-last-input-start) 155 (goto-char eshell-last-input-start)
156 (string= (eshell-get-old-input) "echo alpha"))) 156 (should (string= (eshell-get-old-input) "echo alpha"))
157 ;; Make sure that `eshell-get-old-input' works even if the point is
158 ;; inside the prompt.
159 (let ((inhibit-field-text-motion t))
160 (beginning-of-line))
161 (should (string= (eshell-get-old-input) "echo alpha"))))
157 162
158(provide 'eshell-tests) 163(provide 'eshell-tests)
159 164