;;;Authorizing-Users: Ray Nickson ;;;To use, just M-x carbon-buffer-to-file to the remote file name when ;;;you find the local one (or vice versa). ;;;(I had to chamge it for distribution; hope it still works) ;;;You can also put the call in the file's Local Variables section with ;;;an eval, or just set buffer-carbon-file-names there. (defvar buffer-carbon-file-names nil "List of files to carbon-copy this buffer into.") (make-variable-buffer-local 'buffer-carbon-file-names) (defun carbon-buffer-to-file (file) "Make FILE be a carbon-copy of the file visited by this buffer. Any time you save the buffer, changes will go both to the buffer's own file and to FILE. Yes, you can carbon to many files at once; the list of files being carbonned to is in the variable buffer-carbon-file-names." (interactive "FCarbon to file: ") (setq buffer-carbon-file-names (cons file buffer-carbon-file-names))) (defun write-carbon-files () "A write-file-hook. See \\[carbon-buffer-to-file]." (save-restriction (widen) (mapcar (function (lambda (file) (write-region (point-min) (point-max) file))) buffer-carbon-file-names)) nil) ; hook must return nil (add-hook 'write-file-hooks 'write-carbon-files)