/[emacs]/emacs/lisp/calendar/cal-move.el
ViewVC logotype

Diff of /emacs/lisp/calendar/cal-move.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by gm, Sun Aug 3 13:55:46 2003 UTC revision 1.8 by gm, Sun Aug 17 22:49:46 2003 UTC
# Line 327  Moves forward if ARG is negative." Line 327  Moves forward if ARG is negative."
327    (calendar-cursor-to-visible-date date)    (calendar-cursor-to-visible-date date)
328    (run-hooks 'calendar-move-hook))    (run-hooks 'calendar-move-hook))
329    
330    (defun calendar-goto-day-of-year (year day &optional noecho)
331      "Move cursor to YEAR, DAY number; echo DAY/YEAR unless NOECHO is t.
332    Negative DAY counts backward from end of year."
333      (interactive
334       (let* ((year (calendar-read
335                     "Year (>0): "
336                     (lambda (x) (> x 0))
337                     (int-to-string (extract-calendar-year
338                                     (calendar-current-date)))))
339              (last (if (calendar-leap-year-p year) 366 365))
340              (day (calendar-read
341                    (format "Day number (+/- 1-%d): " last)
342                    '(lambda (x) (and (<= 1 (abs x)) (<= (abs x) last))))))
343         (list year day)))
344      (calendar-goto-date
345       (calendar-gregorian-from-absolute
346        (if (< 0 day)
347            (+ -1 day (calendar-absolute-from-gregorian (list 1 1 year)))
348          (+ 1 day (calendar-absolute-from-gregorian (list 12 31 year))))))
349      (or noecho (calendar-print-day-of-year)))
350    
351  (provide 'cal-move)  (provide 'cal-move)
352    
353  ;;; cal-move.el ends here  ;;; cal-move.el ends here

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26