From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: taashlo@sandia.gov Newsgroups: gmane.emacs.help Subject: Re: Elisp: Search a File Without Visiting? Date: 16 Jun 2003 13:47:17 -0600 Organization: Sandia National Laboratories, Albuquerque, NM USA Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <84wuflltt0.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1055793192 4722 80.91.224.249 (16 Jun 2003 19:53:12 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 16 Jun 2003 19:53:12 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 16 21:53:03 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19S02J-0001DQ-00 for ; Mon, 16 Jun 2003 21:53:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19S04d-0000Zj-Pj for gnu-help-gnu-emacs@m.gmane.org; Mon, 16 Jun 2003 15:55:27 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!enews.sgi.com!news.sandia.gov!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: sadl10553.sandia.gov Original-X-Trace: sass2141.sandia.gov 1055792821 10857 134.253.225.126 (16 Jun 2003 19:47:01 GMT) Original-X-Complaints-To: usenet@sass2141.sandia.gov Original-NNTP-Posting-Date: Mon, 16 Jun 2003 19:47:01 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Xref: shelby.stanford.edu gnu.emacs.help:114492 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10984 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10984 kai.grossjohann@gmx.net (Kai Großjohann) writes: > taashlo@sandia.gov writes: > > This currently works, but it relies on loading the entire thesaurus > > file into a buffer to search for the word. The problem is that the > > thesaurus file (mthesaur.txt[1]) is about 24MiB. > > > > My question: is it possible (using elisp) to search the contents of > > the thesaurus file *without* loading it into a buffer? > > I can think of two ways to do it. The first way is to write a > program which does the searching (or use grep) and to have Emacs > invoke that. The second way is to repeatedly call > insert-file-contents with the right BEG and END arguments to insert > parts of the file into a buffer. > > While using an external program makes sense, the other approach is > not useful IMHO. Emacs is really well optimized for working with > buffers, so why not go with the flow and do it the way it's easiest > in Emacs, why not do it the Emacs way? > > -- > This line is not blank. Thank you Kai! This is exactly the kind of idea I needed. I think that I can use grep to do the searching and return the results for my elisp to massage for displaying. My initial tests with grep show that it will not only use *much* less memory, but it is also *much* faster. Thanks again, Tad