help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: how to get list of vectors with value from file content...


From: TheFlyingDutchman
Subject: Re: how to get list of vectors with value from file content...
Date: Wed, 08 Dec 2010 15:27:05 -0000
User-agent: G2/1.0

>
> (1) here's how i get the file content for each file:
>
>   (find-file "findreplace_01_A.txt" ) (setq findreplace_01_A (buffer-
> string)) (kill-buffer )
>   (find-file "findreplace_01_B.txt" ) (setq findreplace_01_B (buffer-
> string)) (kill-buffer )
>   (find-file "findreplace_02_A.txt" ) (setq findreplace_02_A (buffer-
> string)) (kill-buffer )
>   (find-file "findreplace_02_B.txt" ) (setq findreplace_02_B (buffer-
> string)) (kill-buffer )
>   (find-file "findreplace_03_A.txt" ) (setq findreplace_03_A (buffer-
> string)) (kill-buffer )
>   (find-file "findreplace_03_B.txt" ) (setq findreplace_03_B (buffer-
> string)) (kill-buffer )
>
> seems a kludge to me. Is there a better way?
>

With find-file, if the file doesn't exist (in this case it should)
there is no error. This way generates an error if a file is missing:

  (setq findreplace_01_A
      (with-temp-buffer
         (insert-file-contents "findreplace_01_A.txt")
         (buffer-string)
                ))



reply via email to

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