1
1
I'd like to make an indirect control for Emacs (in Ubuntu Linux) so that I can swipe some text in an xterm with the cursor, cutting it into the X cut buffer, then run a macro in Emacs to parse the cut buffer text to look for text saying "line XXXX" where X is all digits, then go to that line in the current Emacs buffer.
I think this is possible by using emacsclient to get emacs to run a macro, then the macro parsing the cut buffer, then issuing a goto-line command to the number that's been parsed.
My problem is I don't know how to write the emacs script to read the X cut buffer and parse it.. I've been going through cookbook examples but none seem to fit.
My goal is to ease development. When I have an error/information/status message printed in an xterm, I want to swipe the error message which says something like "syntax error on line 2776" then press a keyboard shortcut which Ubuntu will interpret to launch emacsclient, which causes my already-open Emacs to grab that text, parse it, and go to the line number I just swiped. Only this last step of parsing is the hard part.
(Yes, I know you can run a shell INSIDE of emacs, but this is doesn't fit my workflow)
How would I make emacs look at that X cut buffer and parse out the line number and issue the "goto-line" command to the current buffer?
Thanks!
I like this idea.. do the parsing in a little Perl one-liner or something. Emacs is clearly powerful enough to do this, but it may be easier to use the launcher to parse. Now to figure out how to get the X cut buffer in Perl... – BobBanana – 2010-01-18T17:11:48.677