From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kai.grossjohann@gmx.net (=?iso-8859-1?q?Kai_Gro=DFjohann?=) Newsgroups: gmane.emacs.help Subject: Re: Elisp: Search a File Without Visiting? Date: Mon, 16 Jun 2003 21:13:31 +0200 Organization: University of Duisburg, Germany Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <84wuflltt0.fsf@lucy.is.informatik.uni-duisburg.de> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1055791362 26302 80.91.224.249 (16 Jun 2003 19:22:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 16 Jun 2003 19:22:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 16 21:22:40 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 19RzYu-0006q4-00 for ; Mon, 16 Jun 2003 21:22:40 +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 19RzSW-00050y-RX for gnu-help-gnu-emacs@m.gmane.org; Mon, 16 Jun 2003 15:16:04 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.r-kom.de!fu-berlin.de!uni-berlin.de!p508777cd.dip.t-dialin.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Original-NNTP-Posting-Host: p508777cd.dip.t-dialin.net (80.135.119.205) Original-X-Trace: fu-berlin.de 1055790849 21660715 80.135.119.205 (16 [73968]) Mail-Copies-To: never User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:Eko/10nRa2m5pItASzu4U7wFBBk= Original-Xref: shelby.stanford.edu gnu.emacs.help:114491 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:10983 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10983 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.