Commit eaeeece9 authored by Stefan Monnier's avatar Stefan Monnier

* lisp/shell.el (shell--parse-pcomplete-arguments): Stop at semi-colon

* test/lisp/shell-tests.el (shell-tests-completion-before-semi):
New corresponding test.
parent f745cf8c
Pipeline #200 failed with stage
in 22 minutes and 24 seconds
......@@ -426,7 +426,7 @@ Thus, this does not include the shell's current directory.")
(while (looking-at
......@@ -490,7 +490,7 @@ Shell buffers. It implements `shell-completion-execonly' for
(setq comint-input-autoexpand shell-input-autoexpand)
;; Not needed in shell-mode because it's inherited from comint-mode, but
;; placed here for read-shell-command.
(add-hook 'completion-at-point-functions 'comint-completion-at-point nil t))
(add-hook 'completion-at-point-functions #'comint-completion-at-point nil t))
(put 'shell-mode 'mode-class 'special)
......@@ -606,7 +606,7 @@ buffer."
;; Bypass a bug in certain versions of bash.
(when (string-equal shell "bash")
(add-hook 'comint-preoutput-filter-functions
'shell-filter-ctrl-a-ctrl-b nil t)))
#'shell-filter-ctrl-a-ctrl-b nil t)))
(comint-read-input-ring t)))
(defun shell-apply-ansi-color (beg end face)
......@@ -751,7 +751,7 @@ Otherwise, one argument `-i' is passed to the shell.
(xargs-name (intern-soft (concat "explicit-" name "-args"))))
(unless (file-exists-p startfile)
(setq startfile (concat user-emacs-directory "init_" name ".sh")))
(apply 'make-comint-in-buffer "shell" buffer prog
(apply #'make-comint-in-buffer "shell" buffer prog
(if (file-exists-p startfile) startfile)
(if (and xargs-name (boundp xargs-name))
(symbol-value xargs-name)
......@@ -973,10 +973,10 @@ this feature; see the function `dirtrack-mode'."
nil nil nil
(setq list-buffers-directory (if shell-dirtrack-mode default-directory))
(if shell-dirtrack-mode
(add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t)
(remove-hook 'comint-input-filter-functions 'shell-directory-tracker t)))
(add-hook 'comint-input-filter-functions #'shell-directory-tracker nil t)
(remove-hook 'comint-input-filter-functions #'shell-directory-tracker t)))
(define-obsolete-function-alias 'shell-dirtrack-toggle 'shell-dirtrack-mode
(define-obsolete-function-alias 'shell-dirtrack-toggle #'shell-dirtrack-mode
(defun shell-cd (dir)
......@@ -30,4 +30,12 @@
"Test problem found by Filipp Gunbin in emacs-devel."
(should (equal (car (shell--unquote&requote-argument "te'st" 2)) "test")))
(ert-deftest shell-tests-completion-before-semi ()
(insert "cd ba;")
(forward-char -1)
(should (equal (shell--parse-pcomplete-arguments)
'(("cd" "ba") 1 4)))))
;;; shell-tests.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment