Jeff Abrahamson on Sat, 30 Aug 2003 22:41:05 -0400


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

Re: [PLUG] dict is cool


On Sat, Aug 30, 2003 at 07:37:31PM -0400, Stephen Gran wrote:
>   [26 lines, 132 words, 1031 characters]  Top characters: -etairch
> 
> On Sat, Aug 30, 2003 at 03:50:44PM -0400, Paul said:
> > Which packages does it require?
> 
> Debian sid:
> 
> steve@gashuffer:~$ apt-cache showsrc dict
> Package: dictd
> Binary: dictd, dictfmt, dict, dictzip
>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

And you probably want to install dict-gcide or dict-wn, as per the
dictd entry. Doing an apt-cache search on dictd returns a bunch of
useful packages.

It gets better:

I added the following to my sawfish rc file:

    (bind-keys global-keymap "C-S-d" (lambda ()
		   ((let ((dictword (prompt-for-string "Find word: ")))
		      (print-command-to-screen (concat "dict -m " dictword))))))
    (bind-keys global-keymap "C-S-e" (lambda ()
		   ((let ((dictword (prompt-for-string "Define word: ")))
		      (print-command-to-screen (concat "dict " dictword))))))

because I have recently discovered that writing lisp code to control
my window manager is the most erudite time wasting activity I have
ever found.

Note that for the above to work, I had to first say

    (autoload 'prompt-for-string "sawfish/wm/util/prompt-extras")
    (require 'sawfish.wm.util.prompt)

    (defun my_readfile (file-name)
      (setq definition nil)
      (let ((fd (open-file file-name 'read)) (reading t))
	    (while reading
		(let ((line (read-line fd)))
		      (if line
			(setq definition (concat definition line "\n"))
			(progn (setq reading nil) (close-file fd))))))
      definition)

    (defun print-command-to-screen (string_command)
	(system (concat string_command " > /tmp/.sawfish.out 2> /tmp/.sawfish.err"))
	(display-message (my_readfile "/tmp/.sawfish.out")))

Oh, and it's useful to have

    (bind-keys global-keymap "C-S-n" (lambda () (display-message nil)))


> And, for Jeff:
> lookup-el - Search interface to electronic dictionaries by Emacs.
> presumably they mean _for_ emacs, but whatever.

Excellent! Thanks!

I also just found dict.el:

    jeff@asterix:jeff $ apt-cache search dict | grep emacs
    emacs-goodies-extra-el - Miscellaneous add-ons for Emacs -- extra
    jeff@asterix:jeff $

-- 
 Jeff

 Jeff Abrahamson  <http://www.purple.com/jeff/>
 GPG fingerprint: 1A1A BA95 D082 A558 A276  63C6 16BF 8C4C 0D1D AE4B

Attachment: pgpqB3M65vmR8.pgp
Description: PGP signature