all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* dict in Emacs
@ 2008-04-08  3:15 Evans Winner
  2008-04-08  4:11 ` Richard G Riley
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Evans Winner @ 2008-04-08  3:15 UTC (permalink / raw)
  To: help-gnu-emacs

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dict in Emacs
  2008-04-08  3:15 dict in Emacs Evans Winner
@ 2008-04-08  4:11 ` Richard G Riley
  2008-04-08  6:44 ` William Xu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Richard G Riley @ 2008-04-08  4:11 UTC (permalink / raw)
  To: help-gnu-emacs


Evans Winner <thorne@timbral.net> writes:

> 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.

I use dictem on debian.

http://sourceforge.net/projects/dictem

Here is the relevant stuff from my .emacs

,----
| (setq dictem-server "localhost")
| (require 'dictem)
| (dictem-initialize)
| (define-key mode-specific-map [?s] 'dictem-run-search)
| 
| 
| (define-key dictem-mode-map [tab] 'dictem-next-link)
| (define-key dictem-mode-map [(backtab)] 'dictem-previous-link)
| 
| 					; For creating hyperlinks on database names
| 					; and found matches.
| 					; Click on them with mouse-2
| (add-hook 'dictem-postprocess-match-hook
| 	  'dictem-postprocess-match)
| 
| 					; For highlighting the separator between the definitions found.
| 					; This also creates hyperlink on database names.
| (add-hook 'dictem-postprocess-definition-hook 
| 	  'dictem-postprocess-definition-separator)
| 
| 					; For creating hyperlinks in dictem buffer
| 					; that contains definitions.
| (add-hook 'dictem-postprocess-definition-hook 
| 	  'dictem-postprocess-definition-hyperlinks)
| 
| 					; For creating hyperlinks in dictem buffer
| 					; that contains information about a database.
| (add-hook 'dictem-postprocess-show-info-hook
| 	  'dictem-postprocess-definition-hyperlinks)
`----






^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dict in Emacs
  2008-04-08  3:15 dict in Emacs Evans Winner
  2008-04-08  4:11 ` Richard G Riley
@ 2008-04-08  6:44 ` William Xu
  2008-04-08 23:11 ` Jashy
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: William Xu @ 2008-04-08  6:44 UTC (permalink / raw)
  To: help-gnu-emacs

Evans Winner <thorne@timbral.net> writes:

> Can anyone recommend a good system for looking up the
> dictionary definition of a word at point?

I use dictionary.el and is very happy with it.  Besides running a local
dictd server, one can also use the public server "dict.org".  

  http://www.myrkr.in-berlin.de/dictionary/

-- 
William

http://williamxu.net9.org





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dict in Emacs
  2008-04-08  3:15 dict in Emacs Evans Winner
  2008-04-08  4:11 ` Richard G Riley
  2008-04-08  6:44 ` William Xu
@ 2008-04-08 23:11 ` Jashy
  2008-04-11 20:25 ` Xah Lee
  2008-04-14  8:23 ` Xah Lee
  4 siblings, 0 replies; 8+ messages in thread
From: Jashy @ 2008-04-08 23:11 UTC (permalink / raw)
  To: Help-gnu-emacs



Evans Winner wrote:
> 
> Can anyone recommend a good system for looking up the
> dictionary definition of a word at point? 
> 

I use sdcv. 
sdcv: http://sdcv.sourceforge.net/
sdcv mode: http://code.google.com/p/sdcv-mode/


-- 
View this message in context: http://www.nabble.com/dict-in-Emacs-tp16555466p16576018.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dict in Emacs
  2008-04-08  3:15 dict in Emacs Evans Winner
                   ` (2 preceding siblings ...)
  2008-04-08 23:11 ` Jashy
@ 2008-04-11 20:25 ` Xah Lee
  2008-04-14  7:06   ` Torben Knudsen
  2008-04-14  8:23 ` Xah Lee
  4 siblings, 1 reply; 8+ messages in thread
From: Xah Lee @ 2008-04-11 20:25 UTC (permalink / raw)
  To: help-gnu-emacs

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/^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dict in Emacs
  2008-04-11 20:25 ` Xah Lee
@ 2008-04-14  7:06   ` Torben Knudsen
  2008-04-14  8:02     ` Xah Lee
  0 siblings, 1 reply; 8+ messages in thread
From: Torben Knudsen @ 2008-04-14  7:06 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> "Xah" == Xah Lee <xah@xahlee.org> writes:

Xah> 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.

Xah> one solution is actually to use a browser. i.e. you hit a button
Xah> in emacs, and emacs switchs you to your browser showing the
Xah> 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)))
)

I tried to use this with http://www.dict.org/bin/Dict.  However, I
can't figure out what to do to look up a specific word i.e. something
similar to http://www.answers.com/main/ntquery?s=whatever.  

What do I need for dict?
-- 
Associate Prof. Ph.D Torben Knudsen	Mobile	: (+45) 2787 9826
Section of Automation and Control,	Email	: tk@es.aau.dk   
Department of Electronic Systems,	
Aalborg University 
Fredrik Bajersvej 7 
DK-9220 Aalborg Ø
Denmark 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dict in Emacs
  2008-04-14  7:06   ` Torben Knudsen
@ 2008-04-14  8:02     ` Xah Lee
  0 siblings, 0 replies; 8+ messages in thread
From: Xah Lee @ 2008-04-14  8:02 UTC (permalink / raw)
  To: help-gnu-emacs

Xah wrote:
«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)))
)

»

------------

Torben Knudsen wrote:
«I tried to use this with http://www.dict.org/bin/Dict.  However, I
can't figure out what to do to look up a specific word i.e. something
similar tohttp://www.answers.com/main/ntquery?s=whatever.  What do I
need for dict?»

Seems to be this (suppose confound is the word to lookup):

http://www.dict.org/bin/Dict?Form=Dict2&Database=*&Query=confound

--------------------------

Here are some example urls query for some other dict sites:

American Heritage Dictionary (AHD)
     http://www.answers.com/main/ntquery?s=confound

http://en.wiktionary.org/wiki/confound

Merriem Webster
 http://m-w.com/dictionary/confound

Compact Oxford Eng Dict
 http://www.askoxford.com/concise_oed/confound?view=uk

others, most of which uses AHD:

http://www.bartleby.com/cgi-bin/texis/webinator/sitesearch?FILTER=col61&query=confound

http://www.yourdictionary.com/ahd/search?p=confound

http://dictionary.reference.com/browse/confound

PS among all English dicts i've used in the past 2 decades, i like AHD
the most.

btw, there's also encarta dict online, and yahoo.com also hosts AHD if
i recall correctly.

-----------------
comp lang references and Wikipedia

Perl           http://perldoc.perl.org/search.html?q=confound

PHP            http://us.php.net/confound

LSL            http://wiki.secondlife.com/wiki/confound

Wikipedia      http://en.wikipedia.org/wiki/confound

-------------------

personally, i'd like to find one for java, python, and perhaps elisp
too.

  Xah
  xah@xahlee.org
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dict in Emacs
  2008-04-08  3:15 dict in Emacs Evans Winner
                   ` (3 preceding siblings ...)
  2008-04-11 20:25 ` Xah Lee
@ 2008-04-14  8:23 ` Xah Lee
  4 siblings, 0 replies; 8+ messages in thread
From: Xah Lee @ 2008-04-14  8:23 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 7, 8:15 pm, Evans Winner wrote:
«...but I found after looking up a few words that it had left a trail
of over a thousand buffers open...»

btw, you can close all those buffers with a few keystrokes.

if you use emacs 22, type “Alt+x ibuffer” then it'll switch you to a
buffer listing mode. Type “* M”, then whatever your mode's name, then
all those modes will be selected. Then, Type “D” to kill them all.

ibuffer is pretty much a modern version of list-buffer, with coloring
and all. I've been using ibuffer for like 2 or 3 years, and haven't
used list-buffer since.  You can mark and kill a bunch of buffers with
list-buffers though, just more difficult or less powerful.

You could set the same shortcut used for list-buffer for ibuffer, and
set ibuffer as a alias to list-buffer, so that it completely replaces
it.

e.g.

(defalias 'ibuffer 'list-buffer)
(global-set-key (kbd "C-x C-b") 'ibuffer)

How to Define Keyboard Shortcuts in Emacs
 http://xahlee.org/emacs/keyboard_shortcuts.html

  Xah
  xah@xahlee.org
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-04-14  8:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-08  3:15 dict in Emacs Evans Winner
2008-04-08  4:11 ` Richard G Riley
2008-04-08  6:44 ` William Xu
2008-04-08 23:11 ` Jashy
2008-04-11 20:25 ` Xah Lee
2008-04-14  7:06   ` Torben Knudsen
2008-04-14  8:02     ` Xah Lee
2008-04-14  8:23 ` Xah Lee

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.