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

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

Re: How can i write to file in background in elisp...


From: Deniz Dogan
Subject: Re: How can i write to file in background in elisp...
Date: Sat, 12 Nov 2011 00:54:44 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 2011-11-12 00:25, Oleksandr Gavenko wrote:
I write:

   (let (
         (coding-system-for-read 'utf-8)
         (coding-system-for-write 'utf-8)
         )
     (save-excursion
       (find-file stmcrblog-file)
       (beginning-of-buffer)
       (insert
        (format-time-string "%Y-%m-%d %H:%M" (current-time))
        " "  msg  "\n")
       (save-buffer)
       (kill-buffer)
       ))

but afraid that this is not correct way to write to file without splashing it
into to user...

How can i write to file in background in elisp?


You could try using:

(with-temp-buffer
  (insert "foo")
  (write-file "bar"))

I hope that helps!

Deniz




reply via email to

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