Are there things you critically need that are available in emacs, but that you would not get from using a Tk::Text widget for editing? Writing a PerlTk app to support editing a text buffer is pretty easy, and the text-editor widget does just about everything a normal user would want to do when editing text.

You can even enhance it to whatever extent you want, by adding extra type-in windows, menus, buttons and whatever the application might need.

The best thing about it for your requirements is that the data being edited never needs to go outside your perl process.

Meanwhile, trying to use emacs this way seems like a non-starter relatively more complicated and difficult. Emacs needs to open a data file, and load it into a buffer, in order to edit text data. If you have figured out a way to have emacs run as an interactive process using stdin and stdout (not a disk file) as the source and destination of text data for an editing buffer, I'd be curious to hear how you do that, because I've never seen it done (in over 15 years of using emacs).

update: Having just seen educated_foo's reply, that looks like a good approach, assuming there really are things in emacs that make it especially good for the task at hand. One thing that wasn't mentioned there (in case you're not familiar with emacsclient) is that you need a separate instance of emacs already running, and that instance needs to execute the "server-start" elisp command. It will then sit idle until an emacsclient process runs to give it something to do.


In reply to Re: In memory edit of perl data with emacs by graff
in thread In memory edit of perl data with emacs by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.