From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: Can I build a dictionary in my Emacs? Date: Thu, 26 Nov 2009 12:00:30 +0100 Organization: Informatimago Message-ID: <87skc17dpt.fsf@galatea.local> References: <87vdgyx9lb.fsf@ymail.invalid> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1259235683 28902 80.91.229.12 (26 Nov 2009 11:41:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Nov 2009 11:41:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 26 12:41:16 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NDcik-0002bz-Gp for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Nov 2009 12:41:11 +0100 Original-Received: from localhost ([127.0.0.1]:36890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDcij-0002nQ-QQ for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Nov 2009 06:41:09 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 60 Original-X-Trace: individual.net T5khxyhA9jqvuApwmbAbRgW77WDHKNZcBD1Pbcn1BEflsXv1ch Cancel-Lock: sha1:Y2M3NTljNzQ3ZjA4NjdmNjQ3Mjg2YzgyYzQyY2VhMzgxZjdlNDFlOA== sha1:Rf2u1Sv0wzQVIpgDGJsD9PD1BxU= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin) Original-Xref: news.stanford.edu gnu.emacs.help:175071 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70141 Archived-At: Water Lin writes: > I want to build a dictionary in my Emacs. So I can put my specific > words, expressions and their meanings into it. > > By doing this, when I need them, I don't need to google them out again. > > I don't know if it is suitable to call it dictionary, but it likes > dictionary. > > Any good suggestions? Perhaps you could use EBD, the Emacs Data Base? But if you have a persistent internet connection, why don't you just use M-x dictionary RET? Also, using google shouldn't be a big deal from emacs: (require 'cl) (require 'w3m) (setf browse-url-browser-function (lambda (url &rest args) (other-frame 1) ; or (make-frame) (w3m-goto-url url))) (defun google-search (search-string) "Search a string with Google." (interactive "sGoogle Search: ") (setf search-string (shell-command-to-string (format "echo %s|iconv -f ISO8859-1 -t UTF-8" (shell-quote-argument search-string)))) (browse-url (format "http://www.google.com/search?as_q=%s&num=50&hl=en&ie=ISO8869-1&btnG=Google+Search&as_epq=&as_oq=&as_eq=&lr=&as_ft=i&as_filetype=&as_qdr=all&as_nlo=&as_nhi=&as_occt=any&as_dt=i&as_sitesearch=&safe=images" (apply (function concatenate) 'string (mapcar (lambda (ch) (if (or (and (<= ?0 ch) (<= ch ?9)) (and (<= ?A ch) (<= ch ?Z)) (and (<= ?a ch) (<= ch ?z))) (format "%c" ch) (format "%%%02x" ch))) (string-to-sequence search-string 'list)))))) (defun google-search-region (start end) "Search the text in the region with Google." (interactive "r") (google-search (buffer-substring-no-properties start end))) -- __Pascal Bourguignon__