emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emacs-wiki-discuss] Re: Note on task page but not day page


From: Alex Kavanagh
Subject: Re: [emacs-wiki-discuss] Re: Note on task page but not day page
Date: Thu, 11 Aug 2005 16:55:20 +0100
User-agent: Wanderlust/2.11.30 (Wonderwall) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)

At Wed, 10 Aug 2005 20:57:41 -0400,
Sacha Chua wrote:
> 
> Alex Kavanagh <address@hidden> writes:
> 
> > Nope, the function 'planner-create-note defaults to the current day
> > page, and I must admit that I couldn't work out how to make it use the
> 
> If you call it interactively, it should default to the current page.

Um, ok.  On my set if I do:

M-x planner-create-note

It creates a new note on today's dated page even if I'm on another
page.

My version of planner is a recent copy (<3 weeks) from your arch
stable.

My version of planner-create-note is:

(defun planner-create-note (&optional page)
  "Create a note to be remembered in PAGE (today if PAGE is nil).
If `planner-reverse-chronological-notes' is non-nil, create the
note at the beginning of the notes section; otherwise, add it to
the end.  Position point after the anchor."
  (interactive)
  (if page (planner-goto page) (planner-goto-today))
  (planner-seek-to-first 'notes)
  (save-restriction
    (when (planner-narrow-to-section 'notes)
      (let ((total 0))
        (goto-char (point-min))
        (while (re-search-forward "^\\.#[0-9]+\\s-+" nil t)
          (setq total (1+ total)))
        (if planner-reverse-chronological-notes
            (progn (goto-char (point-min))
                   (forward-line 1)
                   (skip-chars-forward "\n"))
          (goto-char (point-max))
          (skip-chars-backward "\n")
          (when (= (forward-line 1) 1) (insert "\n"))
          (when (= (forward-line 1) 1) (insert "\n")))
        (insert ".#" (number-to-string (1+ total)) " ")
        (unless (eobp) (save-excursion (insert "\n\n")))
        (1+ total)))))

I can see the (&optional page) bit but interactively I don't know how
to get to it.  Without it it defaults to (planner-goto-today) which is
today's page.

Does it need to be (interactive "s") or something like that - sorry
I'm an elisp noob and still learning how to hack it.

Cheers
Alex.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]