From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: Obtaining a Lisp form from a file Date: Tue, 25 Jul 2017 10:31:46 -0700 Message-ID: References: <03ed89e8-1a56-a328-0487-0d3eccec170f@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1501003961 6749 195.159.176.226 (25 Jul 2017 17:32:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Jul 2017 17:32:41 +0000 (UTC) Cc: Udyant Wig To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 25 19:32:37 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1da3hA-0001HH-Hr for geh-help-gnu-emacs@m.gmane.org; Tue, 25 Jul 2017 19:32:32 +0200 Original-Received: from localhost ([::1]:33805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da3hF-0002WL-UY for geh-help-gnu-emacs@m.gmane.org; Tue, 25 Jul 2017 13:32:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da3gn-0002WD-Ax for help-gnu-emacs@gnu.org; Tue, 25 Jul 2017 13:32:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da3gm-0006d1-Oj for help-gnu-emacs@gnu.org; Tue, 25 Jul 2017 13:32:09 -0400 Original-Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]:38846) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1da3gm-0006ct-KO for help-gnu-emacs@gnu.org; Tue, 25 Jul 2017 13:32:08 -0400 Original-Received: by mail-qk0-x232.google.com with SMTP id x191so6329186qka.5 for ; Tue, 25 Jul 2017 10:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LaGHGaLekzB+Itu1qhjYCrl2moggbM/1Cn9oE/zlbVQ=; b=oIy0lgpH3pYGilO4dkUP1zX3HRFVw4K9LaOwhFVqR7XXgtdzrMz+1ZPCJ2Oc9mvFF5 +JTS9obggVoZvAy7J/shj5BQQux2zdzMav7VA5+8fFRHZbSexPbKRmGzOJGDeNAR7JJr 9bFHyBRtow4Yx/1Mj6AK4iuerJbALGrJnFTVDQh/lUxQnoQ+3RTS3xIbwg4mqAT0yFU3 gLCIlIncP8SXGfzHiyC0MIr5XVWw7ZQaJgDeB/tGByEfkvV9Mr7HVmHD0tL2k9c+aQs5 jckMEPTfxS4AnIhHDEgdXeye71YR5chEGvx5otqvsWXXsm8O1A0Nykte0B6Ka/essePh dizQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LaGHGaLekzB+Itu1qhjYCrl2moggbM/1Cn9oE/zlbVQ=; b=UDun8p3bQ8rmp1oBaPvn4PD4R17DXNAX8080FgNJfbJ2E9YEx962aUIyxkHKgZ0bhs 3EUfBaKn2AHhgGD4P5qghqcXDRkpEo75ilY/OM1jTG/qoQe/idb0BELHXB9rm3E7N88m JxsUYmH04jCPjqHee9uQOaXyFxrKxjExHVqCA8sp+KbMOecMcBpi9bF0UBeIaERwq0rk BbjwkQxcY7Ph9Bzku9limzuXnbUWda3yXsq6cW5r+iYPGoEwPfGN33mapL0robHBVpOs KB/9bFKif4FN5mnqOzzTArukYuhitHDTco0o/08xs00RRsD+7BqnW1tCQk8rNnLU7fD0 pX5Q== X-Gm-Message-State: AIVw1109TjokbL0AfiU8w7LvnEh1zqWjTwDQ6WzW/nM9tAHc2G75EvIs fy+sww/gAhwo6kIDlg2pQsYgwQ899gqfJu0= X-Received: by 10.55.103.146 with SMTP id b140mr24351647qkc.329.1501003927592; Tue, 25 Jul 2017 10:32:07 -0700 (PDT) Original-Received: by 10.237.48.241 with HTTP; Tue, 25 Jul 2017 10:31:46 -0700 (PDT) In-Reply-To: <03ed89e8-1a56-a328-0487-0d3eccec170f@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::232 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113862 Archived-At: Udyant Wig wrote: > 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) (with-temp-buffer (insert-file-contents file) (read (current-buffer))) Hope that helps John