all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* File manipulation in elisp?
@ 2007-06-20 17:35 Trastabuga
  2007-06-20 19:05 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Trastabuga @ 2007-06-20 17:35 UTC (permalink / raw)
  To: help-gnu-emacs

Is there an API for file management in elisp without opening files in
buffers?
What I want to do is have some special file in a directory which would
give my elisp some post-compile commands for this particular
directory. So every time I compile a project, as a post-build step I
want to look for some pre-defined file in the directory, read its
content, evaluate the content into elisp and execute it.
All I could find was insert-file-contents which is not exactly what I
need. I need something like with-open-file macro.

Thank you,
Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: File manipulation in elisp?
  2007-06-20 17:35 File manipulation in elisp? Trastabuga
@ 2007-06-20 19:05 ` Stefan Monnier
  2007-06-20 20:19   ` Trastabuga
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2007-06-20 19:05 UTC (permalink / raw)
  To: help-gnu-emacs

> Is there an API for file management in elisp without opening files in
> buffers?

No.

> directory. So every time I compile a project, as a post-build step I
> want to look for some pre-defined file in the directory, read its
> content, evaluate the content into elisp and execute it.

How 'bout just using `load'?


        Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: File manipulation in elisp?
  2007-06-20 19:05 ` Stefan Monnier
@ 2007-06-20 20:19   ` Trastabuga
  2007-06-21  1:59     ` Barry Margolin
  0 siblings, 1 reply; 4+ messages in thread
From: Trastabuga @ 2007-06-20 20:19 UTC (permalink / raw)
  To: help-gnu-emacs

On Jun 20, 3:05 pm, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> > Is there an API for file management in elisp without opening files in
> > buffers?
>
> No.
>
> > directory. So every time I compile a project, as a post-build step I
> > want to look for some pre-defined file in the directory, read its
> > content, evaluate the content into elisp and execute it.
>
> How 'bout just using `load'?
>
>         Stefan

Thank you Stefan, that works.
I wonder is there any reason there is no such API for file
manipulation? No use for it?

Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: File manipulation in elisp?
  2007-06-20 20:19   ` Trastabuga
@ 2007-06-21  1:59     ` Barry Margolin
  0 siblings, 0 replies; 4+ messages in thread
From: Barry Margolin @ 2007-06-21  1:59 UTC (permalink / raw)
  To: help-gnu-emacs

In article <1182370747.377086.236690@a26g2000pre.googlegroups.com>,
 Trastabuga <lispercat@gmail.com> wrote:

> On Jun 20, 3:05 pm, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> > > Is there an API for file management in elisp without opening files in
> > > buffers?
> >
> > No.
> >
> > > directory. So every time I compile a project, as a post-build step I
> > > want to look for some pre-defined file in the directory, read its
> > > content, evaluate the content into elisp and execute it.
> >
> > How 'bout just using `load'?
> >
> >         Stefan
> 
> Thank you Stefan, that works.
> I wonder is there any reason there is no such API for file
> manipulation? No use for it?

Because it would be an enormous amount of work to replicate all the 
operations you can do on buffers in a file API.  And to implement most 
of these things would require copying the file into memory, just like 
opening the file into a buffer.  For instance, most filesystems don't 
provide any way to insert and delete directly in files, you can only 
overwrite them.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-06-21  1:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-20 17:35 File manipulation in elisp? Trastabuga
2007-06-20 19:05 ` Stefan Monnier
2007-06-20 20:19   ` Trastabuga
2007-06-21  1:59     ` Barry Margolin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.