     (shell-command (hateda-mkString `(,hateda-executable "draft" "get" ,id) " ") (current-buffer))
     (hateda-mode)))
 
-(defun anything-hateda-draft-open-file (description)
+(defun helm-hateda-draft-open-file (description)
   (message "Wait a moment....")
   (let ((entry (hateda-string-to-draft-entry description)))
     (hateda-draft-open-file (hateda-draft-entry-id entry) (hateda-draft-entry-title entry))))
 
-(defun anything-hateda-draft-rm (description)
+(defun helm-hateda-draft-rm (description)
   (message "Wait a moment....")
   (let ((entry (hateda-string-to-draft-entry description)))
     (hateda-draft-rm (hateda-draft-entry-id entry))))

;;  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

(require 'cl)
(require 'anything)
(require 'markdown-mode)

(defvar hateda-executable "~/bin/hateda")

(defun hateda-draft-rm (id)
  (shell-command (hateda-mkString `(,hateda-executable "draft" "rm" ,id) " ")))

(defun helm-hateda-draft-entries-get-candidates ()
  (message "Wait a moment....")
  (hateda-lines-to-list (hateda-draft-list)))

(define-helm-type-attribute 'hateda
  '((action ("Open" . helm-hateda-draft-open-file)
            ("Delete" . helm-hateda-draft-rm))))

(setq helm-c-source-hateda-draft-entries
  '((name . "hatena-diary")
    (candidates . helm-hateda-draft-entries-get-candidates)
    (requires-pattern . 0)
    (candidate-number-limit . 50)
    (type . hateda)))

(defun helm-hateda ()
  (interactive)
  (helm 'helm-c-source-hateda-draft-entries))

(define-generic-mode hateda-mode
  nil nil
