[Top][All Lists]

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

Re: Organized Learning

From: Kevin Rodgers
Subject: Re: Organized Learning
Date: Thu, 25 Sep 2003 09:20:41 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv: Gecko/20020406 Netscape6/6.2.2

Kevin Dziulko wrote:

Can I put this function into a .el file? I tried but I get a message that reads "Symbol's function definition is void: loop"

(require 'cl) before (defun totd ...)

Also, I use emacs just as an editor, and not as an environment, so how can I make it so it truely only gets displayed once a day, no matter how many times I start emacs?

You could write the buffer to a file, and then only run the function if there
is no file already written today:

(defadvice totd (after write-file activate)
  "Write the *Tip of the day* buffer to a file."
  (with-current-buffer "*Tip of the day*"
    (write-file "~")))

(or (and (file-exists-p "~/*Tip of the day*")
         ;; Do (... DAY MONTH YEAR DOW DST ZONE) match?
         (equal (nthcdr 3 (decode-time
                           (nth 5 (file-attributes "~/*Tip of the day*"))))
                (nthcdr 3 (decode-time (current-time)))))

Kevin Rodgers

reply via email to

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