Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!jarthur!ucivax!megatek!fridge!hollen From: hollen@megatek (Dion Hollenbeck) Newsgroups: comp.emacs Subject: Re: shell-send-input and the ">" character Message-ID: Date: 3 Dec 90 16:13:34 GMT References: Sender: hollen@megatek.UUCP Distribution: comp Organization: Megatek Corporation, San Diego, California Lines: 34 In-reply-to: rob@linkers.med.utah.edu's message of 1 Dec 90 00:31:26 GMT In article rob@linkers.med.utah.edu (Rob Sargent) writes: > > I use shells within emacs constantly. In particular a use Ingres. Thus > I frequently use the ">" character. Everything works fine... except > when I wish to re-do a quel command that has a ">" in it. ( I do this > by putting the cursor on the old command (which is of course somewhere > upstream from end-of-buffer), and then hitting return (which in > shell-mode is bound to shell-send-input. Invariable what gets sent is > only that part of the line after the ">"! I suspect shell-send-input > is treating everything to the left of the ">" as part of some supposed > prompt. Is there any way of undoing this special meaning of the ">" > vis shell-send-input. What is going on is controlled by shell-prompt-pattern which is a regular expression to be looked for and cast aside everything before and including it. My pattern is here and takes account of my "hostname ->" prompt dbx's ")" prompt, and the "#" promopt when I am root. Since I am not real good at regular expressions, I will not attempt to give you the correct one, but you should be able to come up with one which either will suit all types of prompts, or you can change the value of the constant as you move from system to system as appropriate. Here is mine as an example: (defconst shell-prompt-pattern "^.*[x-][>#)] *" "\ *Regexp used by Newline command in shell mode to match subshell prompts. Anything from beginning of line up to the end of what this pattern matches is deemed to be prompt, and is not reexecuted.") -- Dion Hollenbeck (619) 455-5590 x2814 Megatek Corporation, 9645 Scranton Road, San Diego, CA 92121 uunet!megatek!hollen or hollen@megatek.uucp Brought to you by Super Global Mega Corp .com