From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Can I build a dictionary in my Emacs? Date: Thu, 3 Dec 2009 10:22:01 -0800 Message-ID: <7C74616E923245BE8B95D9035BF91966@us.oracle.com> References: <87vdgyx9lb.fsf@ymail.invalid> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1259864648 25741 80.91.229.12 (3 Dec 2009 18:24:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Dec 2009 18:24:08 +0000 (UTC) To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 03 19:24:01 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 1NGGLQ-00089B-I3 for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Dec 2009 19:24:00 +0100 Original-Received: from localhost ([127.0.0.1]:41636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGGLQ-0003ZI-0K for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Dec 2009 13:24:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGGK9-0002Zc-6v for help-gnu-emacs@gnu.org; Thu, 03 Dec 2009 13:22:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGGK4-0002SQ-Cp for help-gnu-emacs@gnu.org; Thu, 03 Dec 2009 13:22:40 -0500 Original-Received: from [199.232.76.173] (port=53571 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGGK4-0002S6-68 for help-gnu-emacs@gnu.org; Thu, 03 Dec 2009 13:22:36 -0500 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:25336 helo=rgminet11.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NGGK3-0003gI-TE for help-gnu-emacs@gnu.org; Thu, 03 Dec 2009 13:22:36 -0500 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nB3IMjZt007621 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 3 Dec 2009 18:22:47 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nB2KGEh1012499 for ; Thu, 3 Dec 2009 18:22:36 GMT Original-Received: from abhmt019.oracle.com by acsmt355.oracle.com with ESMTP id 781219631259864521; Thu, 03 Dec 2009 10:22:01 -0800 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 03 Dec 2009 10:22:00 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Acpv3IiszwK9UvNRSY2LXOAjxf8oQAEZfZHw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt357.oracle.com [141.146.40.157] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.4B1801E7.0109:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:70359 Archived-At: > > I want to build a dictionary in my Emacs. So I can put my specific > > words, expressions and their meanings into it. > > Why not just use a plain text file, with one definition per line. > Set it up with (setq word-wrap t) and (setq wrap-prefix " "). > Then just search with C-s and add definitions in the obvious way. 1. I second that. If this is for your own personal use and you don't expect to have a large number of definitions, then this is a great way to go. It has the advantages of simplicity, easy update, and variety of access/navigation methods. 2. If you will have lots of definitions or you want to create a dictionary for others to use, then you might also want to look at the Emacs tags feature. A tag is essentially just a definition. A tag file is an index to definitions. Tags do not have to be definitions, but they typically are. The definitions are typically code definitions (of function, variables, etc.), but they don't have to be. The advantages of using Emacs tags for definitions are (a) distribution: the definitions can be scattered over any number of files and directories, and (b) performance. The disadvantage is that you will need to create (and maintain/update) the TAGS file, either by hand or by writing some code to do that. http://www.emacswiki.org/emacs/EmacsTags http://www.gnu.org/software/emacs/manual/html_node/emacs/Tags.html#Tags 3. You might also consider using Imenu. In a way, this is halfway between #1 and #2. Imenu parses a buffer, collecting the positions of any definitions contained in it, and then it presents those definitions to users in a menu (or via completion etc.). Again, the definitions are typically code definitions (of functions, variables, etc.), but they do not have to be. To use Imenu, you will need to come up with a regexp that recognizes a definition, which means that you need to decide on a definition format. E.g. `DEFINITION foo = ...' with a regexp that looks for "DEFINITION" followed by the defined term followed by " = ". Or some such. The regexp variable to set is `imenu-generic-expression'. http://www.emacswiki.org/emacs/ImenuMode http://www.gnu.org/software/emacs/manual/html_node/emacs/Imenu.html#Imenu 4. I don't think this is what you want, but I mention it anyway: Library `synonyms.el' provides a navigable thesaurus. It uses a (large) file that defines classes of English synonyms. You can use it to navigate among synonyms in various ways. Dunno if a similar approach would be feasible for a dictionary. http://www.emacswiki.org/emacs/Synonyms