help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dict in Emacs


From: Xah Lee
Subject: Re: dict in Emacs
Date: Fri, 11 Apr 2008 13:25:31 -0700 (PDT)
User-agent: G2/1.0

On Apr 7, 8:15 pm, Evans Winner <tho...@timbral.net> wrote:
> Can anyone recommend a good system for looking up the
> dictionary definition of a word at point?  I found a dict.el
> on EmacsWiki and it more or less works, but I found after
> looking up a few words that it had left a trail of over a
> thousand buffers open -- and I'm not sure how to debug it.
> It also gives me results from, eg., English to Arabic
> dictionaries.  I am thinking, there is probably a more
> convenient solution, and someone here is liable to know what
> it is.

one solution is actually to use a browser. i.e. you hit a button in
emacs, and emacs switchs you to your browser showing the definition
using a online dictionary. Here's the code:

(defun word-definition-lookup ()
"Look up the word under cursor in a browser."
 (interactive)
 (browse-url
  (concat "http://www.answers.com/main/ntquery?s=";
          (thing-at-point 'word)))
)

The advantage is that you can have access to voice recorded
pronunciation, and a commerical dictionary that is more professional
than OpenSource ones.

You could have emacs switch to a particular browser that is setup
specifically for the purpose of word lookup, e.g. with flash, cookies,
images turned off. (personallly, i almast always have 3 different
browsers open at any time, each has different setup for different
purposes. (they are FireFox, Safari, Opera (and sometimes also Camino
and iCab)))

Also, this code can work with any reference or computer language that
has a url based search. e.g. wikipedia, or when coding PHP, Perl, you
can hit a key and emacs switchs you to the browser showing article or
the function's definition.

Also, you can define function keys or special application keys that
appear on modern PC keyboards, system-wide, so that one key press
swiches you to emacs, another keypress switches you to a browser.

Also related, that in my emacs, i can press a key to kill current
buffer, and press modifier+← to switch to previous/next user buffer,
or press modifier+shift+← to switch to previous/next emacs buffer
(emacs buffers are those starting and ending with *).

All the above helps makes the whole system work.

For some detail and other useful short elisp code, see
 http://xahlee.org/emacs/elisp_examples.html

• A Review of 3 Dictionaries
 http://xahlee.org/Periodic_dosage_dir/bangu/dict_review.html

  Xah
  xah@xahlee.org
∑ http://xahlee.org/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]