;;; org-blosxom.el -- Blosxom story export for Org-mode ;; Copyright (C) 2013 David Meyer (require 'org) (defcustom org-blosxom-extension "txt" "File extension for Blosxom story files.") (defun org-export-as-blosxom-story (&optional file to-file) "Export buffer contents to Blosxom story file. 1. ERROR if buffer not associated with file. 2. Find file with same name as source file and extension org-blosxom-story-extension. 3. Clear contents of destination buffer. 4. Copy contents of source buffer to destination. 5. Set region from second line to end of dest. buffer. 6. Call org-replace-region-by-html. 7. Save dest. buffer. 8. Kill dest. buffer, return to source buffer. Also support batch mode export from file to to-file. * Prototype 1: assume interactive invocation from source file buffer." (interactive) (let* ((to-file (concat (file-name-sans-extension (buffer-file-name)) "." org-blosxom-extension)) (work-buffer "*Org Blosxom Export*")) (save-excursion (copy-to-buffer work-buffer (point-min) (point-max)) (goto-line 2 work-buffer) (org-replace-region-by-html (point) (point-max)) (write-file to-file nil) (kill-buffer nil)))) (provide 'org-blosxom)