Set up dreamwidth posting function
parent
9f242e9ca6
commit
391cdeb78b
@ -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*"))
|
@ -0,0 +1,10 @@
|
|||||||
|
# name: dreamwidth-cut
|
||||||
|
# key: dwcut
|
||||||
|
# --
|
||||||
|
#+BEGIN_EXPORT html
|
||||||
|
<cut text="$1">
|
||||||
|
#+END_EXPORT
|
||||||
|
$0
|
||||||
|
#+BEGIN_EXPORT html
|
||||||
|
</cut>
|
||||||
|
#+END_EXPORT
|
Loading…
Reference in New Issue