aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEli Zaretskii2020-04-18 12:01:26 +0300
committerEli Zaretskii2020-04-18 12:01:26 +0300
commit175c61c18bfaa1d75aa087ba4bd4de3ebfe1a1d6 (patch)
treedfbb644b07477429f7958c7a8c01998aa6e68cf6 /test
parent6b297519b580df27d8721943f55629689b4c83e0 (diff)
downloademacs-175c61c18bfaa1d75aa087ba4bd4de3ebfe1a1d6.tar.gz
emacs-175c61c18bfaa1d75aa087ba4bd4de3ebfe1a1d6.zip
Fix "C-u M-!" when 'shell-command-dont-erase-buffer' is non-nil
* lisp/simple.el (shell-command-dont-erase-buffer): Clarify the effect of the various values in the doc string. (shell-command-save-pos-or-erase, shell-command): Don't move or push point if the output will go to the current buffer. (Bug#40690) (shell-command): Mention 'shell-command-dont-erase-buffer' in the doc string. * test/lisp/simple-tests.el (with-shell-command-dont-erase-buffer): Don't is shell quoting 'like this', as it doesn't work on MS-Windows; quote "like this" instead. (simple-tests-shell-command-dont-erase-buffer): Adapt the test to the new modus operandi. * doc/emacs/misc.texi (Single Shell): Document the effect of the various values of 'shell-command-dont-erase-buffer'. * etc/NEWS: Expand and reword the entry regarding changes in 'shell-command-dont-erase-buffer'.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/simple-tests.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index 276df795fca..8c477165a4f 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -724,7 +724,7 @@ See Bug#21722."
724 (,output-buf (if ,output-buffer-is-current ,caller-buf 724 (,output-buf (if ,output-buffer-is-current ,caller-buf
725 (generate-new-buffer "output-buf"))) 725 (generate-new-buffer "output-buf")))
726 (emacs (expand-file-name invocation-name invocation-directory)) 726 (emacs (expand-file-name invocation-name invocation-directory))
727 (,command (format "%s -Q --batch --eval '(princ \"%s\")'" 727 (,command (format "%s -Q --batch --eval \"(princ \\\"%s\\\")\""
728 emacs ,str)) 728 emacs ,str))
729 (inhibit-message t)) 729 (inhibit-message t))
730 (unwind-protect 730 (unwind-protect
@@ -761,7 +761,7 @@ See Bug#21722."
761 (expected-point `((beg-last-out . ,(1+ (length str))) 761 (expected-point `((beg-last-out . ,(1+ (length str)))
762 (end-last-out . ,(1+ (* 2 (length str)))) 762 (end-last-out . ,(1+ (* 2 (length str))))
763 (save-point . 1)))) 763 (save-point . 1))))
764 (dolist (output-buffer-is-current '(t ni)) 764 (dolist (output-buffer-is-current '(nil))
765 (with-shell-command-dont-erase-buffer str output-buffer-is-current 765 (with-shell-command-dont-erase-buffer str output-buffer-is-current
766 (when (memq shell-command-dont-erase-buffer '(beg-last-out end-last-out save-point)) 766 (when (memq shell-command-dont-erase-buffer '(beg-last-out end-last-out save-point))
767 (should (= (point) (alist-get shell-command-dont-erase-buffer expected-point)))))))) 767 (should (= (point) (alist-get shell-command-dont-erase-buffer expected-point))))))))