aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRomain Francoise2005-09-17 18:20:40 +0000
committerRomain Francoise2005-09-17 18:20:40 +0000
commit77689ea32d7c1ae0f5268a4f02043f72e0a7147b (patch)
treea2e9c88031a0d4ca13a548e6b0b3e37da23ed585 /lisp
parent4ac3afdb5ad3e9b4cc85e3e92fa8f04ad5ffacb5 (diff)
downloademacs-77689ea32d7c1ae0f5268a4f02043f72e0a7147b.tar.gz
emacs-77689ea32d7c1ae0f5268a4f02043f72e0a7147b.zip
(shell-resync-dirs): Handle echoing processes more reliably. Don't
insert resync command if `comint-process-echoes' is non-nil.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/shell.el21
2 files changed, 20 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c43fe74793b..34e055cf5b0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12005-09-17 Romain Francoise <romain@orebokech.com>
2
3 * shell.el (shell-resync-dirs): Handle echoing processes more
4 reliably. Don't insert resync command if `comint-process-echoes'
5 is non-nil.
6
12005-09-17 Magnus Henoch <mange@freemail.hu> 72005-09-17 Magnus Henoch <mange@freemail.hu>
2 8
3 * textmodes/ispell.el (ispell-aspell-supports-utf8): New variable. 9 * textmodes/ispell.el (ispell-aspell-supports-utf8): New variable.
diff --git a/lisp/shell.el b/lisp/shell.el
index 0f71d8d8205..84de8efd8df 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -797,19 +797,26 @@ command again."
797 (let* ((proc (get-buffer-process (current-buffer))) 797 (let* ((proc (get-buffer-process (current-buffer)))
798 (pmark (process-mark proc))) 798 (pmark (process-mark proc)))
799 (goto-char pmark) 799 (goto-char pmark)
800 (insert shell-dirstack-query) (insert "\n") 800 ;; If the process echoes commands, don't insert a fake command in
801 ;; the buffer or it will appear twice.
802 (unless comint-process-echoes
803 (insert shell-dirstack-query) (insert "\n"))
801 (sit-for 0) ; force redisplay 804 (sit-for 0) ; force redisplay
802 (comint-send-string proc shell-dirstack-query) 805 (comint-send-string proc shell-dirstack-query)
803 (comint-send-string proc "\n") 806 (comint-send-string proc "\n")
804 (set-marker pmark (point)) 807 (set-marker pmark (point))
805 (let ((pt (point))) ; wait for 1 line 808 (let ((pt (point))
809 (regexp
810 (concat
811 (if comint-process-echoes
812 ;; Skip command echo if the process echoes
813 (concat "\\(" (regexp-quote shell-dirstack-query) "\n\\)")
814 "\\(\\)")
815 "\\(.+\n\\)")))
806 ;; This extra newline prevents the user's pending input from spoofing us. 816 ;; This extra newline prevents the user's pending input from spoofing us.
807 (insert "\n") (backward-char 1) 817 (insert "\n") (backward-char 1)
808 (while (not (looking-at 818 ;; Wait for one line.
809 (concat "\\(" ; skip literal echo in case of stty echo 819 (while (not (looking-at regexp))
810 (regexp-quote shell-dirstack-query)
811 "\n\\)?" ; skip if present
812 "\\(" ".+\n" "\\)")) ) ; what to actually look for
813 (accept-process-output proc) 820 (accept-process-output proc)
814 (goto-char pt))) 821 (goto-char pt)))
815 (goto-char pmark) (delete-char 1) ; remove the extra newline 822 (goto-char pmark) (delete-char 1) ; remove the extra newline