(defun sacha/planner-create-task-from-buffer () (interactive) (let ((annotation (run-hook-with-args-until-success 'planner-annotation-functions)) (default-text "") task-text plan date (case-fold-search t)) (setq planner-default-page (if (and (planner-derived-mode-p 'planner-mode) (planner-page-name) (not (string-match planner-date-regexp (planner-page-name)))) (planner-page-name) planner-default-page)) ;; INTERESTING CODE STARTS HERE (save-excursion (goto-char (point-min)) (when (and (re-search-forward "^+++" nil t) (re-search-forward "^@@" nil t)) (setq default-text "Merge patch for "))) (setq task-text (read-string "Describe task: " default-text)) (when (or (string-match "planner" annotation) (string-match "planner" task-text)) (setq planner-default-page "PlannerModeMaintenance")) ;; END INTERESTING CODE (setq date (cond ;; Universal prefix means pick up from current page ((and current-prefix-arg (derived-mode-p 'planner-mode) (string-match planner-date-regexp (planner-page-name))) (planner-page-name)) ;; Date selected in calendar ((condition-case nil (calendar-cursor-to-date) (error nil)) (planner-date-to-filename (calendar-cursor-to-date))) ;; Prompt for date (t (let ((planner-expand-name-favor-future-p (or planner-expand-name-favor-future-p planner-task-dates-favor-future-p))) (planner-read-date))))) (setq plan (if (and current-prefix-arg (planner-derived-mode-p 'planner-mode) (not (string-match planner-date-regexp (planner-page-name)))) ;; Universal prefix means pick up from current page (planner-page-name) (planner-read-non-date-page (planner-file-alist)))) (planner-create-task-from-buffer task-text date plan)))
(defun sacha/planner-strip-task-numbers () (interactive) (while (re-search-forward "^#.\\([0-9]+\\)\\s-+.\\s-+" nil t) (replace-match "" t t nil 1)) (planner-align-tasks))
A bit of code thrashing in planner.el as I… err… committed silly
mistakes. How embarrassing. I’m so, so sorry. I hope no one caught
planner in the middle of broken-ness.
I would like to install FreeBSD, just for kicks. I need a primary
partition free, though. That means I’ll need to move my root partition
over, as everything else is on an extended partition.