* prospective multi-save function
@ 2006-12-02 3:16 B. T. Raven
2006-12-04 8:27 ` Mathias Dahl
0 siblings, 1 reply; 2+ messages in thread
From: B. T. Raven @ 2006-12-02 3:16 UTC (permalink / raw)
Since I don't understand or trust the backup process or vc capabilities of
emacs, I would like to have a way off saving the buffer to different
devices by issuing a single command. It seems that these
devices/directories could be fished out of a list and then passed to
save-buffer, save-current-buffer, write-file, etc. It would be useful (to
me at least) to save to the current working directory where the main file
associated with the buffer is, then to an external usb drive, one or more
flash drives, and even to a zip drive or floppy in some cases.
I notice that save-current-buffer has the docstring:
"
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? Does it have to go into an explicit (progn... ? Since this is a
special form is it not even avisable to muck around in this area? Why does
it even exist? The compiled lisp function save-buffer claims that it
"saves current buffer." Are there hooks to write and save functions?
Ed
--
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: prospective multi-save function
2006-12-02 3:16 prospective multi-save function B. T. Raven
@ 2006-12-04 8:27 ` Mathias Dahl
0 siblings, 0 replies; 2+ messages in thread
From: Mathias Dahl @ 2006-12-04 8:27 UTC (permalink / raw)
"B. T. Raven" <ecinmn@alcisp.com> 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.
))
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-12-04 8:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-02 3:16 prospective multi-save function B. T. Raven
2006-12-04 8:27 ` Mathias Dahl
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.