diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el index fe7a79cf952..a940eb5cd36 100644 --- a/lisp/eshell/em-cmpl.el +++ b/lisp/eshell/em-cmpl.el @@ -297,16 +297,19 @@ to writing a completion function." (define-key eshell-mode-map [(meta tab)] 'eshell-complete-lisp-symbol) (define-key eshell-mode-map [(meta control ?i)] 'eshell-complete-lisp-symbol) (define-key eshell-command-map [(meta ?h)] 'eshell-completion-help) + (define-key eshell-command-map [tab] 'pcomplete-expand-and-complete) (define-key eshell-command-map [(control ?i)] 'pcomplete-expand-and-complete) (define-key eshell-command-map [space] 'pcomplete-expand) (define-key eshell-command-map [? ] 'pcomplete-expand) - (define-key eshell-mode-map [(control ?i)] 'pcomplete) + (define-key eshell-mode-map [tab] 'eshell-pcomplete) + (define-key eshell-mode-map [(control ?i)] 'eshell-pcomplete) (add-hook 'completion-at-point-functions #'pcomplete-completions-at-point nil t) ;; jww (1999-10-19): Will this work on anything but X? - (define-key eshell-mode-map (if (featurep 'xemacs) [iso-left-tab] [backtab]) - 'pcomplete-reverse) + (if (featurep 'xemacs) + (define-key eshell-mode-map [iso-left-tab] 'pcomplete-reverse) + (define-key eshell-mode-map [backtab] 'pcomplete-reverse)) (define-key eshell-mode-map [(meta ??)] 'pcomplete-list)) (defun eshell-completion-command-name () @@ -455,7 +458,16 @@ to writing a completion function." (all-completions filename obarray 'functionp)) completions))))))) -(define-obsolete-function-alias 'eshell-pcomplete 'completion-at-point) +(defun eshell-pcomplete (&optional interactively) + "Eshell wrapper for `pcomplete'." + (interactive "p") + ;; Pretend to be pcomplete so that cycling works (bug#13293). + (setq this-command 'pcomplete) + (condition-case nil + (if interactively + (call-interactively 'pcomplete) + (pcomplete)) + (text-read-only (completion-at-point)))) ; Workaround for bug#12838. (provide 'em-cmpl) diff --git a/test/ChangeLog b/test/ChangeLog index 3e42e18b2b4..0587373144a 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2013-09-12 Glenn Morris + + * automated/eshell.el (with-temp-eshell): Avoid hangs in batch mode + due to "has a running process; kill it?" prompts. + 2013-09-12 Stefan Monnier * automated/eshell.el: Rename from eshell.el. diff --git a/test/automated/eshell.el b/test/automated/eshell.el index a7df2945424..a78c34e4f39 100644 --- a/test/automated/eshell.el +++ b/test/automated/eshell.el @@ -34,7 +34,8 @@ (unwind-protect (with-current-buffer eshell-buffer ,@body) - (kill-buffer eshell-buffer)))) + (let (kill-buffer-query-functions) + (kill-buffer eshell-buffer))))) (defun eshell-insert-command (text &optional func) "Insert a command at the end of the buffer."