/[emacs]/emacs/lisp/shell.el
ViewVC logotype

Diff of /emacs/lisp/shell.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.132 by lektu, Mon Aug 29 11:08:04 2005 UTC revision 1.133 by rfrancoise, Sat Sep 17 18:20:40 2005 UTC
# Line 797  command again." Line 797  command again."
797    (let* ((proc (get-buffer-process (current-buffer)))    (let* ((proc (get-buffer-process (current-buffer)))
798           (pmark (process-mark proc)))           (pmark (process-mark proc)))
799      (goto-char pmark)      (goto-char pmark)
800      (insert shell-dirstack-query) (insert "\n")      ;; 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"))
804      (sit-for 0) ; force redisplay      (sit-for 0) ; force redisplay
805      (comint-send-string proc shell-dirstack-query)      (comint-send-string proc shell-dirstack-query)
806      (comint-send-string proc "\n")      (comint-send-string proc "\n")
807      (set-marker pmark (point))      (set-marker pmark (point))
808      (let ((pt (point))) ; wait for 1 line      (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\\)")))
816        ;; This extra newline prevents the user's pending input from spoofing us.        ;; This extra newline prevents the user's pending input from spoofing us.
817        (insert "\n") (backward-char 1)        (insert "\n") (backward-char 1)
818        (while (not (looking-at        ;; Wait for one line.
819                     (concat "\\(" ; skip literal echo in case of stty echo        (while (not (looking-at regexp))
                            (regexp-quote shell-dirstack-query)  
                            "\n\\)?" ; skip if present  
                            "\\(" ".+\n" "\\)")) ) ; what to actually look for  
820          (accept-process-output proc)          (accept-process-output proc)
821          (goto-char pt)))          (goto-char pt)))
822      (goto-char pmark) (delete-char 1) ; remove the extra newline      (goto-char pmark) (delete-char 1) ; remove the extra newline

Legend:
Removed from v.1.132  
changed lines
  Added in v.1.133

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26