unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: era eriksson <era@iki.fi>
Subject: shell.el: M-x dirs can't cope with stty echo mode
Date: Thu, 5 Jun 2003 09:32:53 +0300	[thread overview]
Message-ID: <16094.58389.443845.502597@there.afraid.org> (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

                 reply	other threads:[~2003-06-05  6:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16094.58389.443845.502597@there.afraid.org \
    --to=era@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).