Guest User

Untitled

a guest
Jun 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. (defun my-insert-dates ()
  2. "insert a bunch of dates"
  3. (interactive)
  4. (let* ((month 3)
  5. (day 1)
  6. (time (encode-time 1 1 0 day month 2009)))
  7. (while (= (nth 4 (decode-time time)) month)
  8. (insert (format-time-string "%D %a:n" time))
  9. (setq day (1+ day))
  10. (setq time (encode-time 1 1 0 day month 2009)))))
  11.  
  12. (require 'calendar)
  13. (defun display-a-month (day month year)
  14. (insert (format "%sn" (calendar-date-string (list month day year))))
  15. (if (< day 30)
  16. (display-a-month (+ day 1) month year)))
  17.  
  18. (defun my-insert-dates ()
  19. "insert the first day of each month"
  20. (interactive)
  21. (dotimes (mo 12)
  22. (insert (format-time-string "%D %a:n" (encode-time 1 1 0 1 (1+ mo) 2009)))))
Add Comment
Please, Sign In to add comment