home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / emacs / help / 5549 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.8 KB  |  43 lines

  1. Newsgroups: gnu.emacs.help
  2. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!udel!bogus.sura.net!howland.reston.ans.net!spool.mu.edu!sgiblab!munnari.oz.au!newsroom.utas.edu.au!hilbert!piggy
  3. From: piggy@hilbert.cc.utas.edu.au (La Monte Yarroll)
  4. Subject: Seeking partial match for regexp.
  5. Message-ID: <piggy.728210161@newsroom.utas.edu.au>
  6. Summary: Want to ask "Could this match if it were longer?".
  7. Keywords: regexp, filter
  8. Sender: news@newsroom.utas.edu.au
  9. Organization: University of Tasmania, Australia.
  10. Date: Thu, 28 Jan 1993 08:36:01 GMT
  11. Lines: 30
  12.  
  13. I'm writing a filter for an emacs process which looks for commands in
  14. the output stream.  The commands are removed and executed.  Anything
  15. that is not a command just gets inserted into the buffer.
  16.  
  17. I'm using an accumulator-style filter where the filter just appends
  18. the new output to an accumulator, and calls a function to process the
  19. current accumulator.
  20.  
  21. I'd like to use a regexp like "cmd1\\|cmd2\\cmd3" to recognize
  22. commands in the accumulator.  I'd like to be able to find the first
  23. full or _partial_ match in the accumulator.  By partial match I mean a
  24. match that fails only because we got to the end of the accumulator.
  25. If the match was only partial, just insert the junk before the partial
  26. match, and then wait for the next invocation of the filter.
  27.  
  28. I think I could do this with the GNU regexp package, but I don't seem
  29. to have as much flexibility with the elisp regexp stuff.
  30.  
  31. Can somebody tell me how to check for a _partial_ match to a regexp?
  32.  
  33. Or can you suggest a better approach?
  34.  
  35. For the moment, I'll just pretend that a command will never be split
  36. across two different filter invocations, but I don't like this much.
  37.  
  38. --
  39. La Monte H. Yarroll    Home:        piggy@baqaqi.chi.il.us
  40.    Work:        piggy@hilbert.maths.utas.edu.au
  41.    AKA:            piggy@gargoyle.uchicago.edu
  42.    Once upon a time:    postmaster@clout.chi.il.us
  43.