emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: search files with conversion but fundamental mode, no handlers, no f


From: Eli Zaretskii
Subject: Re: search files with conversion but fundamental mode, no handlers, no file-local vars
Date: Thu, 20 Dec 2012 21:04:32 +0200

> From: "Drew Adams" <address@hidden>
> 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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]