Automatically Export Emacs SES Files to TSV
Automatically Export Emacs SES Files to TSV - Lemmy.World
I thought this might be useful for anyone who might want to use the Simple Emacs Spreadsheet [https://www.gnu.org/software/emacs/manual/html_mono/ses.html]. Since .ses files are only useful in Emacs and many would likely wish to access the data from other tools, you can set up Emacs to automatically export the data to tab-separated values with the following: First, Add a hook to the after-save-hook (here with use-package: :hook (after-save-hook . my/ses-export) Second, add this function to your Emacs init file(s): (defun my/ses-export () (interactive) (when (eq major-mode 'ses-mode) (mark-whole-buffer) (ses-export-tsv (point-min) (point-max)) (let ((save-name (concat (file-name-sans-extension (buffer-file-name (current-buffer))) ".tsv"))) (with-temp-buffer (yank) (write-file save-name))))) And there you have it, your .ses files will always have a human-readable .tsv file exported on each save.