unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Obtaining a Lisp form from a file
@ 2017-07-25 17:20 Udyant Wig
  2017-07-25 17:31 ` John Mastro
  2017-07-25 18:22 ` Emanuel Berg
  0 siblings, 2 replies; 4+ messages in thread
From: Udyant Wig @ 2017-07-25 17:20 UTC (permalink / raw)
  To: help-gnu-emacs

Is there a better way to write this?

(let ((foo-buffer (get-buffer-create "*foo*"))
      foo-form)
  (with-current-buffer foo-buffer
    (insert-file-contents foo-file))
  (setq foo-form (read foo-buffer))
  (kill-buffer foo-buffer)
  foo-form)

-- 
... while the ways of art are hard at the best, they will break you if
you go unsustained by belief in what you are trying to do.
                                -- Arthur Quiller-Couch



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

end of thread, other threads:[~2017-07-26  7:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-25 17:20 Obtaining a Lisp form from a file Udyant Wig
2017-07-25 17:31 ` John Mastro
2017-07-26  7:22   ` Udyant Wig
2017-07-25 18:22 ` Emanuel Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).