sdcv-mode.el update: now keeps a sdcv process running

June 11, 2008 – 11:02 pm

Emacssdcv-mode.el is an extension that allows you to look up word in Emacs. It is a front end to the console version of StarDict(sdcv). It has rarely been updated since I wrote it in Dec 2006. Of course sdcv-mode.el isn’t perfect, but I think it just served well at its position. It is very handy to be just a front-end of sdcv.

However, one user opened a ticket recently complaining that sdcv-mode.el is very slow in NT Emacs because it start a new sdcv process each time when looking up a word. It will be slow especially when you have a lot of dictionaries installed. So I changed the strategy: instead of starting a new process each time, I keep a sdcv process running in the background.

A bit work is needed to support this strategy, but not too much. The original code is very short and easy to understand. Most of the code (like those to do prompting, window arranging and syntax highlighting) are kept unchanged. I write a helper function sdcv-do-lookup to send the word to the process running in the background, wait for the result and return it. Finally I replace the old code of starting a process and getting the standard output text with a call to sdcv-do-lookup.

If you are using sdcv-mode.el, you may check out the latest version and try see if the performance is better. I wish you enjoy it. :)

BTW: When I was trying to test the new sdcv-mode.el, I finally found the stupid mistake I made has destroyed my .emacs. :( But .emacs.elc is still there so I didn’t find it until just now. Is there any one know how to do a un-compile on the bytecode to recover my .emacs?

  1. 2 Responses to “sdcv-mode.el update: now keeps a sdcv process running”

  2. oh, dear. sorry to learn that message.
    neither i have any idea to uncompile .elc files. =(

    however, maybe you’ve post your .emacs somewhere in the cyberspace before you nuked it?

    By tchaikov on Jun 11, 2008

  3. @tchaikov,
    Yes, I’m sure I can find some (maybe a little older) version of my .emacs file. That’s still a good news. :)

    By pluskid on Jun 12, 2008

Post a Comment