all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Pascal J. Bourguignon" <pjb@informatimago.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to copy current buffer to a temporary buffer
Date: Fri, 16 May 2014 11:31:28 +0200	[thread overview]
Message-ID: <87ha4qjci7.fsf@kuiper.lan.informatimago.com> (raw)
In-Reply-To: 87y4y2cfxr.fsf@Equus.Decebal.nl

Cecil Westerhof <Cecil@decebal.nl> writes:

> I want to copy the current buffer to a temporary buffer, to do some
> edits on it. (Converting a text file to a html file.)


(let ((contents (buffer-substring (point-min) (point-max))))
  (with-temp-buffer
   (insert contents)
   (do-something)))


-- 
__Pascal Bourguignon__
http://www.informatimago.com/
"Le mercure monte ?  C'est le moment d'acheter !"


  reply	other threads:[~2014-05-16  9:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16  7:59 How to copy current buffer to a temporary buffer Cecil Westerhof
2014-05-16  9:31 ` Pascal J. Bourguignon [this message]
2014-05-16 10:13   ` Eli Zaretskii
     [not found]   ` <mailman.1456.1400235243.1147.help-gnu-emacs@gnu.org>
2014-05-16 11:49     ` Cecil Westerhof
2014-05-16 18:22       ` Pascal J. Bourguignon
2014-05-16 19:05       ` Thien-Thi Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ha4qjci7.fsf@kuiper.lan.informatimago.com \
    --to=pjb@informatimago.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.