* fix contacts-export, msg-graphs

This commit is contained in:
djcb
2012-01-22 11:44:52 +02:00
parent 3ea8b1fe8c
commit dec4ce8181
2 changed files with 7 additions and 20 deletions

View File

@ -29,20 +29,7 @@ exec guile -e main -s $0 $@
(< (mu:frequency c1) (mu:frequency c2)))
(define (sort-by-newness c1 c2)
(< (mu:timestamp c1) (mu:timestamp c2)))
(define (export-contact contact form)
"Convert CONTACT to a string in format FORM."
(let ((email (mu:email contact)) (name (mu:name contact)))
(if email ;; filter out anything *without* an email address
(cond
((string= form "org-contacts")
(format #t "* ~s\n:PROPERTIES:\n:EMAIL:~a\n:END:\n\n"
(or name email) email))
((string= form "plain")
(format #t "~a~a\n"
(or name "")
(if name (string-append " <" email ">") email)))))))
(< (mu:last-seen c1) (mu:last-seen c2)))
(define (main args)
(let* ((optionspec '( (muhome (value #t))
@ -54,7 +41,7 @@ exec guile -e main -s $0 $@
(options (getopt-long args optionspec))
(msg (string-append
"usage: contacts-export [--help] [--muhome=<muhome>] "
"--format=<org-contacts|wl|mutt-ab|plain(*)> "
"--format=<org-contact|mutt-alias|mutt-ab|wanderlust|plain(*)> "
"--sort-by=<frequency(*)|newness> [--revert] [--limit=<n>]\n"))
(help (option-ref options 'help #f))
(muhome (option-ref options 'muhome #f))
@ -89,7 +76,7 @@ exec guile -e main -s $0 $@
;; export!
(for-each
(lambda (c)
(export-contact c form))
(format #t "~a\n" (mu:contact->string c form)))
contacts))))))
;; Local Variables: