From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.help Subject: Re: Something like read-file-into-string needed Date: Fri, 05 Jan 2007 20:06:39 +0000 Message-ID: References: <1168023456.119091.38300@51g2000cwl.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1168027639 20505 80.91.229.12 (5 Jan 2007 20:07:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 5 Jan 2007 20:07:19 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 05 21:07:16 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H2vLQ-0003uh-ET for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Jan 2007 21:07:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H2vLP-0006ZP-Rz for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Jan 2007 15:07:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H2vL0-0006XR-Vh for help-gnu-emacs@gnu.org; Fri, 05 Jan 2007 15:06:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H2vKx-0006V3-V6 for help-gnu-emacs@gnu.org; Fri, 05 Jan 2007 15:06:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H2vKx-0006Uu-Gx for help-gnu-emacs@gnu.org; Fri, 05 Jan 2007 15:06:47 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H2vKw-0007gZ-W6 for help-gnu-emacs@gnu.org; Fri, 05 Jan 2007 15:06:47 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1H2vKs-0007I3-RB for help-gnu-emacs@gnu.org; Fri, 05 Jan 2007 21:06:43 +0100 Original-Received: from sl392.st-edmunds.cam.ac.uk ([131.111.223.202]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 05 Jan 2007 21:06:42 +0100 Original-Received: from sdl.web by sl392.st-edmunds.cam.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 05 Jan 2007 21:06:42 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 27 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: sl392.st-edmunds.cam.ac.uk Face: iVBORw0KGgoAAAANSUhEUgAAAC0AAAAtBAMAAADINP+pAAAAMFBMVEUALGQLNGsEPX4ePG4M S5EvT30XVqJTa5E/erhrgaKKnriouczCzt3W3+fl6+/9//y5jpouAAAAAWJLR0QAiAUdSAAAAAlw SFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YLFgIUE6OFLiUAAAINSURBVDjLddQ/aBNRHAfw78u1 hNYOEWqgm0JxPhErioEOcpNDBkEoWpsSfnQsuBXBzcXBihSxtPY2aUENiB3a4QYpKNim4FDEhgwO 4mIORKSa3PP93p+7S9G3XO6Td9/83rvfC6Qdn5/4uLCwZ+9imGvy3AePUyt9nizBDu9u3t+UkH7x LPNPyI3ByHmv6uzGUxV4wvlPF7GqbnZKiIwnvvU1zuwRho1/tTykS+hSzWtqD63fVo9+T97RLKbZ ey4m4nqvE9Uxxv7LcrHDiaJMdNprKn9rXf3aI3URRJNYU75ofUR29arPUg2VGGl8Rf6G8+EYf5D6 kb6WlRdjHP3LxT5+HHfOEQ18zNxUHNAMEOL1sfkFVT8wj0a/i4CoxK53x7+0vPFSdtfXl8Z5H4Aq uxfMua6Qm8Tx8NknaK5jOdmkOq9a56jItvP7dAbWR4nowW6rI5NW6/3Vk7qIReUTvIPALa6nIExx DYRqY2v59eoO2EfokYnM+2CMcEAX3O9D//ErykdNvKjIb6nf0/Nn9efptAPgRXp+3Xab60cUpcnn lYum/JJtbazr52VdljJ9FZH2gB/grp/PGlU5Buih3rOem75qHMEr7Qduett6WXu3mjsdMVR7Fq5x ymM7/aY5d7wYb+HD1h3LUx3j/LjINniq7c7vwTkhSvpVe+cvvsj9Dxxum7G1vZckzv8CCp6RI1SU vzAAAAAASUVORK5CYII= User-Agent: Gnus v5.11, Emacs/23.0.0.1 (2007-01-01), Fedora 6 gnu/linux Cancel-Lock: sha1:ZMDrQCenpcVDQ53QfHfixhv4l/Q= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:40162 Archived-At: * Haws (2007-01-05 10:57 -0800) said: ^^^^ > Hello everyone! > > I've been trying out the snippet.el package which lets you insert > templates nicely. But now I have a "big" template (like 100 lines) > that I don't want to put inline in my lisp function. Instead, I'd > like to have it in a file, and read this file contents into a > string. Once in a string, I could use the regular command, > snippet-insert, to insert my template. I've found no way to do that > (only to insert the file into a buffer, which doesn't solve my > problem.) > > Any tips, ideas? > > Thanks in advance, > > Hugo (defun read-file-into-string (file) (interactive "f") (with-temp-buffer (insert-file-contents file) (buffer-string))) -- Leo (GPG Key: 9283AA3F)