all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Can I use Emacs as pipe-thru formatter?
@ 2003-08-05 14:18 Irving Kimura
  2003-08-05 15:00 ` Barry Margolin
  2003-08-05 15:32 ` Kevin Rodgers
  0 siblings, 2 replies; 4+ messages in thread
From: Irving Kimura @ 2003-08-05 14:18 UTC (permalink / raw)




I'm writing a Perl script that, among other things, needs to pretty
print JavaScript code.  The formatting produced by the Emacs module
javascript-mode.el would be adequate for my purposes, but I don't
know how to apply it from within a Perl program.

(I'm sure that this is trivial to do from within an Emacs Lisp
script, but I am not very handy in this language, and besides, the
task is part of a much larger Perl program, so I would prefer to
do this from within Perl.)

Since, under Unix at least, it's not too difficult for a Perl script
to pipe a string through an external program, one possible way to
do what I want to do would be to write an "Emacs pipe" that somehow
uses javascript-mode.el to pretty print its stdin and spits the
results to stdout:

  % cat ugly.js | emacs_js_pretty_printer > pretty.js

But I have no idea about how to write such a pipe.  I would greatly
appreciate any help or advice on how to do this, or any other ideas
on how to tackle this problem.

Many thanks!

	-Irv

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-08-05 16:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-05 14:18 Can I use Emacs as pipe-thru formatter? Irving Kimura
2003-08-05 15:00 ` Barry Margolin
2003-08-05 16:21   ` Oliver Scholz
2003-08-05 15:32 ` Kevin Rodgers

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.