[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
simple function to prepend a string to a file
From: |
ken |
Subject: |
simple function to prepend a string to a file |
Date: |
Fri, 17 Apr 2009 09:00:52 -0400 |
User-agent: |
Thunderbird 2.0.0.0 (X11/20070326) |
Often I want to put the string "<!-- -*- coding: utf-8; -*- -->\n" at
the top of the current buffer. However, I don't want to lose my place
(the point) or any defined region. Optimally, such a function would
know the mode of the current buffer and enclose the string in the
mode-appropriate comment characters. Is there such a function? If not
how would one code it?
Thanks for your solutions.
--
"To make an apple pie from scratch,
first create the universe."
-- Carl Sagan
- simple function to prepend a string to a file,
ken <=