sacha/planner-add-recent

| emacs
(defun sacha/planner-add-recent ()
  "Add the current note to the list of recent entries, trimmed at 10."
  (interactive)
  (let* ((info (planner-current-note-info))
         (url (concat
               "http://sacha.free.net.ph/notebook/wiki/"
               (emacs-wiki-published-name (planner-note-page info))
               "#" (planner-note-anchor info))))
    (when info
      (with-current-buffer
          (find-file-noselect "/home/sacha/notebook/wiki/include/footer.inc.php")
        (goto-char (point-min))
        (when (re-search-forward "--recent--" nil t)
          (save-restriction
            (narrow-to-region (1+ (line-end-position))
                              (progn
                                (re-search-forward "--end of recent--" nil t)
                                (line-beginning-position)))
            (goto-char (point-min))
            (insert ""
                    (planner-note-title info)
                    "
\n") (forward-line 10) (delete-region (point) (point-max)) (save-buffer)))))))

../emacs/planner-config.el

You can comment with Disqus or you can e-mail me at sacha@sachachua.com.