emacs lisp entering a carriage return into a shell

emacs lisp entering a carriage return into a shell

Post by Brian Palme » Sat, 12 Jul 2003 14:45:18



[note xpost, followups]


> Hello,

> I'm not sure if this is the correct newsgroup for this question if it is
> not could you please refer me to the appropriate place.

comp.emacs (or comp.emacs.xemacs) is probably somewhat better. I've
xposted, and set followups.

Quote:> I have an emacs lisp function that opens a shell then runs a shell script
> to initialize some environment variables that I need set inorder to 'make'
> my programs correctly, Here is the code
> (defun ldw-gnustep-shell()
>   "Opens a shell and executes the GNUstep.sh file
> in /usr/GNUstep/System/Makefiles/GNUstep.sh"
>   (interactive)
>   (shell)
>   (insert ". /usr/GNUstep/System/Makefiles/GNUstep.sh")
>   (comint-send-input))

That seems to work for me (well, I replace the command with 'echo hi',
and hi gets echoed).

Quote:

> My problem is I don't know if I am sending a carriage return properly
> after I have inserted the line
> ". /usr/GNUstep/System/Makefiles/GNUstep.sh"

You're thinking about this wrong. Go into the shell buffer, and type
C-h k RET
you'll see that when you press return, you don't actually insert a
newline. You call the function #'comint-send-input, which inserts a
newline, and sends the current line to the process.

So calling the function explicitly is probably the best way.
--
If you want divine justice, die.
                  -- Nick Seldon

 
 
 

emacs lisp entering a carriage return into a shell

Post by Liam Whale » Sat, 12 Jul 2003 20:19:57


Test

 
 
 

1. shell shows carriage returns

I've got a user who runs emacs in an xterm on his Solaris 7 machine (emacs
20.4) and runs a shell within the emacs window.  The shell echos his command
and shows ^M's after every line ala':

ls^M^M
file1     file2    file3^M

It's not a showstopper for him, but it's annoying.  Can anyone help me
with this?  (I'm rather green on emacs usage)

Thanks,
--
Bob Campbell                    Unix System Administrator
Scientific Computing Division   National Center for Atmospheric Research

2. TeX, dvips and dviOL? binaries for sun?

3. emacs/Bash carriage-return problem

4. TWAIN drivers for Win95 OSR2 , Where?

5. search in emacs including carriage return

6. PLEASE HELP! Searching an Access database with Drop Down Boxes.

7. lisp func to return output of shell command

8. Dial in from W2K

9. Ignoring carriage return

10. NT Xemacs, no carriage returns

11. DOS vs. Unix-style Carriage Returns

12. Displaying carriage returns

13. Showing carriage returns