Re: Another silly hack
occ <[email protected]> Wed, 01 Mar 2006 23:54:36 +0000
| Newsgroups | gmane.comp.gnome.apps.pybliographer |
|---|---|
| Message-ID | <[email protected]> |
*oops i sent this prematurely by mistake* On Wed, 2006-03-01 at 22:20 +0100, Frederic Gobry wrote: > > As far as I know, the feature set for emacs 22 has frozen and the > > snapshot builds are relatively stable. > > > > As for when the release will be, i think it is anybodies guess "Some > > time in the future" is probably as close as i would want to tie it down. > > But if the feature set has frozen, it is probably safe to integrate this > for the forthcoming release (let's hope it's not in a few years from > now... Emacs 21.1 was released in 2001 :-) > > I find the fact of creating a file for inserting it a bit overkill. It > should be possible to simply call insert with the \cite text? Yes, the only reason i used "insert-file" as the emacs command was because this is the only elisp function that i could remember off the top of my head which would have this effect :-) Briefly looking at the elisp docs i find that there is an '(insert "some text")' function which does exactly the correct thing, doh!. I've quickly looked at the code for emacsclient and the protocol it uses to communicate with emacs (or at least the last process which started its server) is very simple. Doing it this way might be more consistent with the way that lyx works and also save having to worry about which version of emacsclient you are using. For emacs 22 the default socket address is /tmp/emacs$UID/server (in emacs 21 it is something else) and this is hard coded into emacsclient (guess you might want to make this configurable though). for a command like emacsclient.emacs-snapshot --no-wait --eval '(insert "foo")' emacsclient opens the socket and writes the string to it: -nowait -eval (insert&_\"foo\") \n the string is quoted and the substitution appears to be: ' '==>'&_' '\n'==>'&n' '&'==>'&&' (based on emacs/lib-src/emacsclient.c) -nowait just tells emacs not to bother sending a response , which it doesn't appear to do anyway, even when there is a failure (which i assume is a bug). owen -- --------------------------------------------------------------------- owen cliffe (postgraduate) Email: [email protected] Department of Computer Science Web: http://www.cs.bath.ac.uk/~occ Univ. Bath, Bath, England BA2 7AY Tel: (+44) 1225 386183 ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642