Its been a long while since I did a post, but after neglecting this blog for quite a while I’ve decided to get back on doing regular posts again. While I’ve been away Emacs has rapidly become my editor of choice and this will be my first post on the subject.

So to the actual point of this post with my use of emacs has come the attitude that I should do as much as possible within it as it helps improve my skills and well emacs is awesome as everyone should know. To this avail I started looking for a way to post to a wordpress blog from within emacs. A quick search turned up org2blog as the best tool for the job. So in this post I’m going to give a quick overview of setting up org2blog in emacs and using it to make your first blog post like I am here.

What is org2blog/wp?

org2blog/wp is a tool to publish directly from Emacs’ org-mode to WordPress blogs. If your not familiar with org-mode then I’d suggest checking out this excellent Google Tech Talk given by Carsten Dominik, which gives a great overview of it.

Install and Setup with emacs-prelude ( Emacs 24 )

Currently I’m using emacs-prelude as a base of my emacs configuration. It only works with Emacs 24 which has not yet been released, but its very good and I’m yet to encounter any issues.

Installing org2blog with el-get

el-get is a tool that comes along with the emacs-prelude ( or you can install yourself ) that allows you to manage packages from within emacs. I find its very useful for quickly installing stuff and also being able to keep it up to date.

To get org2blog working you’ll need to install it using the el-get-install function and you’ll also need to install some other packages which I’ve detailed below.

  • el-get-install cedet – You need to install this. If not when you attempt to publish a post you’ll get an error in regards to not having sb-html which provides speedbar menu for html files.
  • el-get-install xml-rpc – Required for communicating with wordpress the org2blog install will fail if you don’t install this first.
  • el-get-install org2blog – Pretty obvious why you want to install this.

Setting up org2blog

You will want to create a new file to define your org2blog settings. With something like this.

(setq org2blog/wp-blog-alist
      '(("pablumfication"
         :url "http://pablumfication.co.uk/xmlrpc.php"
         :username "admin")))

Then place it some where that will get loaded every time you start emacs in my case I put it in ~/.emacs.d/personal/org2blog.el This initial time eval it ( M-x eval-buffer ) and your settings will be loaded without having to restart emacs.

Mine is a very basic setup if you want to see the full options that are available checkout the org2blog README.

Creating Your First Post

Creating your post really could not be simpler

  1. M-x org2blog/wp-login – To Login to your blog.
  2. M-x org2blog/wp-new-post – To create a new post.
  3. Make your changes in the file.
  4. C-x C-s – To save the changes
  5. C-c d – To run the command org2blog/wp-post-buffer which if everything has worked successfully will post your post to your blog as a draft. You’ll notice that POSTID (‘#+POSTID: 00000′) will have been prepended to the file.
  6. You’ll also be prompted asking if you want to open you’ll new post in the browser. Pressing ‘y’ will do this and if everything has gone well you should see your post.
  7. Make changes till your happy with your post.
  8. C-c p – To publish your post to be visible to all.

Thats it your done.

Closing Points

I hope that this post has gives a very quick overview of how to get going with org2blog the readme is excellent if your at all confused with any of the steps I’ve outlined. But hopefully this will be fine if your using el-get. Finally in the following sections I’ve included my final file for this post and some other useful links on org2blog, org mode and emacs for further reading. As usual any questions, comments I’d love to hear them.

My Final File

The below is my final file for this post ( included using org mode pretty cool right? ) hopefully give an idea of the org syntax needed if your not familiar with it.

#+POSTID: 1675
#+DATE:[2012-01-15 Sun 17:53]
#+TAGS: Emacs, org2blog, el-get, emacs-prelude
#+TITLE:Blog Posting with Emacs using org2blog

Its been a long while since I did a post, but after neglecting this
blog for quite a while I've decided to get back on doing regular posts
again. While I've been away Emacs has rapidly become my editor of
choice and this will be my first post on the subject.

So to the actual point of this post with my use of emacs has come the
attitude that I should do as much as possible within it as it helps
improve my skills and well emacs is awesome as everyone should know.
To this avail I started looking for a way to post to a wordpress blog
from within emacs. A quick search turned up org2blog as the best tool
for the job. So in this post I'm going to give a quick overview of
setting up org2blog in emacs and using it to make your first blog
post like I am here. 

* What is org2blog/wp?

org2blog/wp is a tool to publish directly from Emacs' org-mode to
WordPress blogs. If your not familiar with org-mode then I'd suggest
checking out this excellent Google Tech Talk given by Carsten Dominik,
which gives a great overview of it. 

* Install and Setup with emacs-prelude ( Emacs 24 )

Currently I'm using emacs-prelude as a base of my emacs
configuration. It only works with Emacs 24 which has not yet been
released, but its very good and I'm yet to encounter any issues. 

** Installing org2blog with el-get

el-get is a tool that comes along with the emacs-prelude ( or you can
install yourself ) that allows you to manage packages from within
emacs. I find its very useful for quickly installing stuff and also
being able to keep it up to date. 

To get org2blog working you'll need to install it using the
el-get-install function and you'll also need to install some other
packages which I've detailed below. 

- *el-get-install cedet* - You need to install this. If not when you
  attempt to publish a post you'll get an error in regards to not
  having sb-html which provides speedbar menu for html files.
- *el-get-install xml-rpc* - Required for communicating with wordpress
  the org2blog install will fail if you don't install this first.
- *el-get-install org2blog* - Pretty obvious why you want to install
  this. 

** Setting up org2blog 

You will want to create a new file to define your org2blog settings.
With something like this.

#+INCLUDE: "~/.emacs.d/personal/org2blog.el" src

Then place it some where that will get loaded every time you start
emacs in my case I put it in ~/.emacs.d/personal/org2blog.el
This initial time eval it ( M-x eval-buffer ) and your
settings will be loaded without having to restart emacs.

Mine is a very basic setup if you want to see the full options that
are available checkout the org2blog README.

* Creating Your First Post

Creating your post really could not be simpler

1. M-x org2blog/wp-login - To Login to your blog.
1. M-x org2blog/wp-new-post - To create a new post.
1. Make your changes in the file.
1. C-x C-s - To save the changes
1. C-c d - To run the command org2blog/wp-post-buffer which if
   everything has worked successfully will post your post to your
   blog as a draft. You'll notice that POSTID ('#+POSTID:
   00000') will have been prepended to the file.
1. You'll also be prompted asking if you want to open you'll new post
   in the browser. Pressing 'y' will do this and if everything has
   gone well you should see your post.
1. Make changes till your happy with your post.
1. C-c p - To publish your post to be visible to all. 

Thats it your done. 

* Closing Points

I hope that this post has gives a very quick overview of how to get
going with org2blog the readme is excellent if your at all confused
with any of the steps I've outlined. But hopefully this will be fine
if your using el-get. Finally in the following sections I've included
my final file for this post and some other useful links on org2blog,
org mode and emacs for further reading. As usual any questions,
comments I'd love to hear them. 

** My Final File

The below is my final file for this post ( included using org mode
pretty cool right? ) hopefully give an idea of the org syntax needed
if your not familiar with it.

#+INCLUDE "~/Personal Documents/pablumfication-blog/org2blog.org" src org

** Useful Links

- Emacs
- el-get
- emacs-prelude
- The Org Manual
- Org-Mode Reference Card
- org2blog
Share this post

9 Comments

  1. [...] could be a first – a post from a cross country train – with grateful thanks to this post for clearing up  the steps required Like this:LikeBe the first to like this. Comments [...]

  2. [...] org2blog howto [...]

  3. [...] or keyboard commands, because it’s easy to set up syntax highlighting or add teletype text. Here’s an interesting self-referential example of org2blog’s power that uses #INCLUDE to include the Org blog post source in the post [...]

  4. […] 7 Please remark that I’ve hot-re-included the same document, just giving a line range. I’ve got that idea from this blogposting here. […]

  5. […] of all, let me point you to this wonderful link, which list down the way to make emacs and org-mode work with wodpress and make this post […]

Leave a Reply


+ 2 = four