diff --git a/custom/dwpost.el b/custom/dwpost.el new file mode 100644 index 0000000..aab92dc --- /dev/null +++ b/custom/dwpost.el @@ -0,0 +1,32 @@ +(defun dwpost (psubject) + (interactive "MPost title (REQUIRED): ") + (org-html-export-to-html) + (defvar newname (concat (file-name-base) ".html")) + (find-file-noselect newname) + (with-current-buffer newname + (goto-line 1) + (delete-region (line-beginning-position) (line-end-position)) + (write-file newname)) + (kill-buffer newname) + (compose-mail "tobli+0397@post.dreamwidth.org" psubject) + (with-current-buffer "*unsent mail to tobli*" + (insert-file-contents newname) + (message-send-and-exit)) + (kill-buffer "*sent mail to tobli*")) + +(defun dwpost-public (psubject) + (interactive "MPost title (REQUIRED): ") + (org-html-export-to-html) + (defvar newname (concat (file-name-base) ".html")) + (find-file-noselect newname) + (with-current-buffer newname + (goto-line 1) + (delete-region (line-beginning-position) (line-end-position)) + (write-file newname)) + (kill-buffer newname) + (compose-mail "tobli+0397@post.dreamwidth.org" psubject) + (with-current-buffer "*unsent mail to tobli*" + (insert "post-security: public\n\n") + (insert-file-contents newname) + (message-send-and-exit)) + (kill-buffer "*sent mail to tobli*")) diff --git a/init.el b/init.el index 88a6f5d..331e3f6 100644 --- a/init.el +++ b/init.el @@ -356,7 +356,8 @@ (setq org-export-with-section-numbers 'nil) (setq org-export-time-stamp-file 'nil) (setq org-export-with-toc 'nil) - (setq org-html-validation-link 'nil)) + (setq org-html-validation-link 'nil) + (load-file "~/.emacs.d/custom/dwpost.el")) ;; Aesthetics diff --git a/snippets/org-mode/dwcut b/snippets/org-mode/dwcut new file mode 100644 index 0000000..da7025f --- /dev/null +++ b/snippets/org-mode/dwcut @@ -0,0 +1,10 @@ +# name: dreamwidth-cut +# key: dwcut +# -- +#+BEGIN_EXPORT html + +#+END_EXPORT +$0 +#+BEGIN_EXPORT html + +#+END_EXPORT \ No newline at end of file