From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: search files with conversion but fundamental mode, no handlers, no file-local vars Date: Thu, 20 Dec 2012 21:04:32 +0200 Message-ID: <83txrgmtof.fsf@gnu.org> References: <3D2A507FA3EE44909DF7CA025897BFC3@us.oracle.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1356030265 16528 80.91.229.3 (20 Dec 2012 19:04:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Dec 2012 19:04:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 20 20:04:40 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TllQ8-0007dG-21 for ged-emacs-devel@m.gmane.org; Thu, 20 Dec 2012 20:04:40 +0100 Original-Received: from localhost ([::1]:34623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TllPt-0004Zg-T9 for ged-emacs-devel@m.gmane.org; Thu, 20 Dec 2012 14:04:25 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TllPn-0004ZL-C0 for emacs-devel@gnu.org; Thu, 20 Dec 2012 14:04:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TllPj-0006nb-Dw for emacs-devel@gnu.org; Thu, 20 Dec 2012 14:04:19 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:42556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TllPj-0006nM-3u for emacs-devel@gnu.org; Thu, 20 Dec 2012 14:04:15 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MFC00M00FKRJA00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Thu, 20 Dec 2012 21:04:13 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MFC00MCPFN1A180@a-mtaout20.012.net.il>; Thu, 20 Dec 2012 21:04:13 +0200 (IST) In-reply-to: <3D2A507FA3EE44909DF7CA025897BFC3@us.oracle.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155694 Archived-At: > From: "Drew Adams" > Date: Thu, 20 Dec 2012 10:57:19 -0800 > > Suppose I want to check a set of files for one or more occurrences of a given > string. I want the files to be code-converted, but not put in any mode other > than fundamental mode, not fontified, not handled by a file handler, and not > using any file-local variables. Just a simple search of the file text (after > code conversion). > > I thought there would be a simple, straightforward way to do this, but I didn't > find it. A RAW-FILE arg to `find-file-noselect' is out, for instance, since > that bypasses code conversion. > > I tried a few things and finally ended up using `find-buffer-visiting' or > `create-file-buffer', followed by `with-current-buffer' with a call to > `mm-insert-file-contents'. > > That seems to work, but is there a simpler approach? Am I missing something > obvious? What's wrong with insert-file-contents?