Mercurial > emacs
comparison lisp/calendar/cal-html.el @ 92963:9b1631fe02a8
(cal-html-insert-link-yearpage, (cal-html-htmlify-list): Doc fix.
(cal-html-htmlify-entry): Use nth.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 15 Mar 2008 02:57:42 +0000 |
parents | 65bc0cdc7f5f |
children | 3ff2b47de8f2 |
comparison
equal
deleted
inserted
replaced
92962:b3d9a4a54d89 | 92963:9b1631fe02a8 |
---|---|
180 (cal-html-monthpage-name month year)) | 180 (cal-html-monthpage-name month year)) |
181 (calendar-month-name month))))) | 181 (calendar-month-name month))))) |
182 | 182 |
183 | 183 |
184 (defun cal-html-insert-link-yearpage (month year) | 184 (defun cal-html-insert-link-yearpage (month year) |
185 "Insert a link to index page for four-digit YEAR, tagged using MONTH name." | 185 "Insert a link tagged with MONTH name, to index page for four-digit YEAR." |
186 (insert (cal-html-h1 | 186 (insert (cal-html-h1 |
187 (format "%s %s" | 187 (format "%s %s" |
188 (calendar-month-name month) | 188 (calendar-month-name month) |
189 (cal-html-href "index.html" (number-to-string year)))))) | 189 (cal-html-href "index.html" (number-to-string year)))))) |
190 | 190 |
312 | 312 |
313 (defun cal-html-htmlify-entry (entry) | 313 (defun cal-html-htmlify-entry (entry) |
314 "Convert a diary entry ENTRY to html with the appropriate class specifier." | 314 "Convert a diary entry ENTRY to html with the appropriate class specifier." |
315 (let ((start | 315 (let ((start |
316 (cond | 316 (cond |
317 ((string-match "block" (car (cddr entry))) "BLOCK") | 317 ((string-match "block" (nth 2 entry)) "BLOCK") |
318 ((string-match "anniversary" (car (cddr entry))) "ANN") | 318 ((string-match "anniversary" (nth 2 entry)) "ANN") |
319 ((not (string-match | 319 ((not (string-match |
320 (number-to-string (car (cddr (car entry)))) | 320 (number-to-string (nth 2 (car entry))) |
321 (car (cddr entry)))) | 321 (nth 2 entry))) |
322 "NO-YEAR") | 322 "NO-YEAR") |
323 (t "NORMAL")))) | 323 (t "NORMAL")))) |
324 (format "<span class=%s>%s</span>" start | 324 (format "<span class=%s>%s</span>" start |
325 (cal-html-htmlify-string (cadr entry))))) | 325 (cal-html-htmlify-string (cadr entry))))) |
326 | 326 |
327 | 327 |
328 (defun cal-html-htmlify-list (date-list date) | 328 (defun cal-html-htmlify-list (date-list date) |
329 "Return a string of concatenated, HTMLified diary entries. | 329 "Return a string of concatenated, HTML-ified diary entries. |
330 DATE-LIST is a list of diary entries. Return only those matching DATE." | 330 DATE-LIST is a list of diary entries. Return only those matching DATE." |
331 (mapconcat (lambda (x) (cal-html-htmlify-entry x)) | 331 (mapconcat (lambda (x) (cal-html-htmlify-entry x)) |
332 (let (result) | 332 (let (result) |
333 (dolist (p date-list (reverse result)) | 333 (dolist (p date-list (reverse result)) |
334 (and (car p) | 334 (and (car p) |