emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/shell.el


From: Romain Francoise
Subject: [Emacs-diffs] Changes to emacs/lisp/shell.el
Date: Sat, 17 Sep 2005 14:20:42 -0400

Index: emacs/lisp/shell.el
diff -c emacs/lisp/shell.el:1.132 emacs/lisp/shell.el:1.133
*** emacs/lisp/shell.el:1.132   Mon Aug 29 11:08:04 2005
--- emacs/lisp/shell.el Sat Sep 17 18:20:40 2005
***************
*** 797,815 ****
    (let* ((proc (get-buffer-process (current-buffer)))
         (pmark (process-mark proc)))
      (goto-char pmark)
!     (insert shell-dirstack-query) (insert "\n")
      (sit-for 0) ; force redisplay
      (comint-send-string proc shell-dirstack-query)
      (comint-send-string proc "\n")
      (set-marker pmark (point))
!     (let ((pt (point))) ; wait for 1 line
        ;; This extra newline prevents the user's pending input from spoofing 
us.
        (insert "\n") (backward-char 1)
!       (while (not (looking-at
!                  (concat "\\(" ; skip literal echo in case of stty echo
!                          (regexp-quote shell-dirstack-query)
!                          "\n\\)?" ; skip if present
!                          "\\(" ".+\n" "\\)")) ) ; what to actually look for
        (accept-process-output proc)
        (goto-char pt)))
      (goto-char pmark) (delete-char 1) ; remove the extra newline
--- 797,822 ----
    (let* ((proc (get-buffer-process (current-buffer)))
         (pmark (process-mark proc)))
      (goto-char pmark)
!     ;; If the process echoes commands, don't insert a fake command in
!     ;; the buffer or it will appear twice.
!     (unless comint-process-echoes
!       (insert shell-dirstack-query) (insert "\n"))
      (sit-for 0) ; force redisplay
      (comint-send-string proc shell-dirstack-query)
      (comint-send-string proc "\n")
      (set-marker pmark (point))
!     (let ((pt (point))
!         (regexp
!          (concat
!           (if comint-process-echoes
!               ;; Skip command echo if the process echoes
!               (concat "\\(" (regexp-quote shell-dirstack-query) "\n\\)")
!             "\\(\\)")
!           "\\(.+\n\\)")))
        ;; This extra newline prevents the user's pending input from spoofing 
us.
        (insert "\n") (backward-char 1)
!       ;; Wait for one line.
!       (while (not (looking-at regexp))
        (accept-process-output proc)
        (goto-char pt)))
      (goto-char pmark) (delete-char 1) ; remove the extra newline




reply via email to

[Prev in Thread] Current Thread [Next in Thread]