unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* shell.el: M-x dirs can't cope with stty echo mode
@ 2003-06-05  6:32 era eriksson
  0 siblings, 0 replies; only message in thread
From: era eriksson @ 2003-06-05  6:32 UTC (permalink / raw)


[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 1778 bytes --]

This bug report will be sent to the Free Software Foundation,
 not to your local site managers!!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

In GNU Emacs 20.7.2 (i386-debian-linux-gnu, X toolkit)
 of Fri Apr  5 2002 on cyberhq modified by Debian
configured using `configure  i386-debian-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --with-x=yes --with-x-toolkit=yes'

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:


I find myself running shell under script(1) inside emacs a lot. In this
setting, getting a copy of my own typing into the typescript requires
that I issue a "stty echo" before I start script(1). [Maybe other
workarounds are possible. Any suggestions gratefully accepted.]

Unfortunately, the shell.el directory tracking is hardwired to always
read the first line of output from the `shell-dirstack-query' command;
however, when stty echo mode is active, the first line of apparent
output is of course the echo itself, not actual output from the
command.

I have created a small patch which teaches `shell-resync-dirs' to
tolerate an extra line of output before the list of directories from
`shell-dirstack-query'. It looks for, and ignores, a literal copy of
the value of shell-dirstack-query, which may not be general enough for
all cases, but it works for me.

The patch is against 20.7, which is of course not the newest version.
I checked on Savannah and it appears that this part of shell.el is
still the same in your CVS, although the line number offsets are
obviously likely to be different.

Hope this helps,

/* era */


[-- Attachment #2: patch against lisp/shell.el to fix stty echo problem --]
[-- Type: text/plain, Size: 932 bytes --]

--- 20.7/lisp/shell.el	Mon May 17 09:14:36 1999
+++ mine/lisp/shell.el	Thu Jun  5 09:29:11 2003
@@ -691,12 +691,16 @@
     (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 ".+\n"))
+      (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
     ;; That's the dirlist. grab it & parse it.
-    (let* ((dl (buffer-substring (match-beginning 0) (1- (match-end 0))))
+    (let* ((dl (buffer-substring (match-beginning 2) (1- (match-end 2))))
 	   (dl-len (length dl))
 	   (ds '())			; new dir stack
 	   (i 0))

[-- Attachment #3: .signature --]
[-- Type: text/plain, Size: 157 bytes --]


-- 
Join the civilized world -- ban spam like we did! <http://www.euro.cauce.org/>
   tee -a $HOME/.signature <$HOME/.plan >http://www.iki.fi/era/index.html

[-- Attachment #4: Type: text/plain, Size: 148 bytes --]

_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-06-05  6:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-05  6:32 shell.el: M-x dirs can't cope with stty echo mode era eriksson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).