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

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

Problem using with-temp-file


From: rgb
Subject: Problem using with-temp-file
Date: 7 Feb 2007 07:52:18 -0800
User-agent: G2/1.0

When I use with-temp-file I end up with an empty file although the
trace doesn't show me any good reason for the file being empty.

Does anyone see why I get an empty file?
I inserted the call to debug and looked at the temp buffer to be sure
the correct data really was in the buffer.  The arguments to write-
region seem to confirm that it's working against the correct
buffer....

Thanks

Debugger entered--entering a function:
* write-region(1 2943 "~/Data-2007-02-07-07:17.txt" nil 0)
* (save-current-buffer (set-buffer temp-buffer) (widen) (write-region
(point-min) (point-max) temp-file nil 0))
* (with-current-buffer temp-buffer (widen) (write-region (point-min)
(point-max) temp-file nil 0))
  (prog1 (with-current-buffer temp-buffer (insert ...) (debug)) (with-
current-buffer temp-buffer (widen) (write-region ... ... temp-file nil
0)))
  (unwind-protect (prog1 (with-current-buffer temp-buffer ... ...)
(with-current-buffer temp-buffer ... ...)) (and (buffer-name temp-
buffer) (kill-buffer temp-buffer)))
  (let ((temp-file my-data-file) (temp-buffer ...)) (unwind-protect
(prog1 ... ...) (and ... ...)))
  (with-temp-file my-data-file (insert (get-my-data)) (debug))
  eval((with-temp-file my-data-file (insert (get-my-data)) (debug)))
  eval-expression((with-temp-file my-data-file (insert (get-my-data))
(debug)) nil)
  call-interactively(eval-expression)



reply via email to

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