forked from EnigmaCurry/emacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ryan-wordpress.el
41 lines (33 loc) · 1.19 KB
/
ryan-wordpress.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
;; This is a completely NONWORKING and UNIMPLEMENTED wordpress mode.
;; I'll probably never finish this, as I started working
;; on Blogofile instead (http://www.blogofile.com)
(defun wordpress-mode ()
(kill-all-local-variables)
(buffer-disable-undo)
(setq buffer-read-only t)
(setq major-mode 'wordpress-mode
mode-name "Wordpress"
mode-line-process ""
truncate-lines t
line-move-visual nil))
(defun wordpress-get-posts ()
(xml-rpc-method-call wordpress-blog-url 'metaWeblog.getRecentPosts 0 wordpress-blog-user wordpress-blog-pass 0))
(defun wordpress ()
(interactive)
(let ((buf (get-buffer-create "*Wordpress-Posts*")))
(wordpress-login)
(save-excursion
(set-buffer buf)
(setq buffer-read-only nil)
(erase-buffer)
(loop for post in (pymacs-eval "wordpress_blog.get_titles_published()")
do
(let ((id (nth 0 post))
(title (nth 1 post)))
(put-text-property 0 (length title) 'post-id id title)
(insert (format "%s\n" title))))
(wordpress-mode)
)
(switch-to-buffer buf)))
(defun wordpress-open-post (post-id)
"Retrieve a blog post from the server and edit it in a new buffer"