[slime-devel] Re: Handling ^M and ^H characters output from ext:run-program?

GP lisper spambait at CloudDancer.com
Sat Jul 16 05:13:27 UTC 2005


On Fri, 15 Jul 2005 14:44:44 -0700, <jeffrey at cunningham.net> wrote:
> On Fri Jul 15, 2005 at 02:01:45PM -0700, GP lisper wrote:
>> On Fri, 15 Jul 2005 04:33:26 -0700, <jeffrey at cunningham.net> wrote:
>> >
>> > "*STANDARD-OUTPUT* is bound to some Lisp stream maintained by SLIME,
>> > attached to an Emacs buffer.   cdrecord was not designed to attach
>> > to an Emacs buffer, or to anything other than a terminal (or some
>> > program which emulates a terminal by understandin the control codes
>> > for moving your cursor around"
>> >         
>> > Is there a way to still embed this program call within my lisp project
>> > so I can still run it in slime without this behavior?
>> 
>> a) Check cdrecord options for a 'quiet' mode, where only the bare
>> minimum is printed.  Never used it myself, but ^H^H^H^H sounds like an
>> updating bar graphic designed to display progress.  You don't need it.
>> 
>> b) expand your external system call to include a pipe into a filter.
>> 
>> c) did someone suggest CL-PPCRE (same as 'b actually)?
>> 
>> I've done something similar with NGREP, but I also hacked it's source
>> code to get what I wanted.  CDRECORD might be clean enough for you to
>> do that too.
>
>
> I'll play with the verbosity - don't know why I didn't think of
> that. I thought of hacking the source, but don't really want to have
> to do it everytime I update cdrecord. 

man diff
man patch


> I guess I don't understand (c). I use cl-ppcre all the time but how
> would I capture *standard-output* from cdrecord and pipe it through
> regex match? 

Read manual.

  (with-open-stream (rip (ext:process-output
			     (ext:run-program "cdrecord"
					      '("-blah" "-foo=" "fie")
					      :output :stream :wait nil :error nil)))

You might want a different :wait option.


-- 
[ingvar] Modelling forest damage by storms with regular expressions is...
  a curious idea.
[Xach] before: |||  after: //_
[Xach] seems easy enough to me




More information about the slime-devel mailing list