help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: prospective multi-save function


From: Mathias Dahl
Subject: Re: prospective multi-save function
Date: Mon, 04 Dec 2006 09:27:33 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.90 (windows-nt)

"B. T. Raven" <address@hidden> writes:

> "
> save-current-buffer is a special form.
> (save-current-buffer &rest BODY)
>
> Save the current buffer; execute BODY; restore the current buffer.
> Executes BODY just like `progn'.  "
>
> Could the code for saving the buffer in other places be put into
> this BODY?

Most probably. An example:

(defun foo ()
  (interactive)
  (save-current-buffer
    ;; Do whatever you want here
    (write-region (point-min) (point-max) my-backup-file)
    ;; And maybe here too. Use whatever means you like to
    ;; save the buffer where you like.
    ))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]