Re: [O] VCard export problems

2013-04-07 Thread Bastien
Hi Simon,

Simon Thum simon.t...@gmx.de writes:

 I now get:

This should be fixed by Feng patch that I just applied, thanks for
reporting it.

-- 
 Bastien



[O] VCard export problems

2013-04-06 Thread Simon Thum

Hi,

I just updates to the latest org and found the vcard export no longer 
works. I get


Exporting...
let*: Symbol's function definition is void: org-install-letbind

Debug gets me:

Debugger entered--Lisp error: (void-function org-install-letbind)
  (org-install-letbind)
  (let* ((filename (or file org-contacts-vcard-file)) (buffer (if 
to-buffer (get-buffer-create to-buffer) (find-file-noselect filename 
(message Exporting...) (set-buffer buffer) (let ((inhibit-read-only 
t)) (erase-buffer)) (fundamental-mode) (org-install-letbind) (when 
(fboundp (quote set-buffer-file-coding-system)) 
(set-buffer-file-coding-system coding-system-for-write)) (loop for 
contact in (org-contacts-filter name) do (insert 
(org-contacts-vcard-format contact))) (if to-buffer (current-buffer) 
(progn (save-buffer) (kill-buffer

  org-contacts-export-as-vcard()


I use make and emacs 24.2.1.

I'm not sure it's related but on my server I get the same error - after 
changing the invocation. I now use


emacs -batch -l ~/.emacs.d/init.el -f org-contacts-export-as-vcard --kill

leading to aforementioned error. Before the update, I had to invoke

emacs someOrgFile.org -batch -l ~/.emacs.d/init.el -f 
org-contacts-export-as-vcard --kill


because otherwise it would fail to load some stuff required by 
org-contacts. Other exporters never had this issue. I suspect some 
require is missing in org-contacts.


Anyway, if I invoke this line now it fails, although interactively 
things load fine with the org file on the command line:


emacs someOrg.org -batch -l ~/.emacs.d/init.el
[...]
Symbol's value as variable is void: org-list-allow-alphabetical

To me, all of this points to some incorrect dependencies of load logic 
to -batch. Unfortunately I don't know how to diagnose such problems.


It's not urgent but seems like a clear bug to me.

Cheers,

Simon



Re: [O] VCard export problems

2013-04-06 Thread Bastien
Hi Simon,

Simon Thum simon.t...@gmx.de writes:

 I suspect some require
 is missing in org-contacts.

In fact, `org-install-letbind' was called while not existing in
current Org.  So org-contacts.el tried to load the org-exp.el file
that comes with your Emacs and that we never want to load when
using pre-8.0.

I removed this function.

 Anyway, if I invoke this line now it fails, although interactively things
 load fine with the org file on the command line:

 emacs someOrg.org -batch -l ~/.emacs.d/init.el
 [...]
 Symbol's value as variable is void: org-list-allow-alphabetical

 To me, all of this points to some incorrect dependencies of load logic to
 -batch. Unfortunately I don't know how to diagnose such problems.

 It's not urgent but seems like a clear bug to me.

Indeed.  Thanks for reporting this.  Please test again and let me know
if something else needs to be fixed.

Best,

-- 
 Bastien



Re: [O] VCard export problems

2013-04-06 Thread Simon Thum

Hi Bastien,

Thanks for the fast response!

I now get:

Debugger entered--Lisp error: (void-variable tel)
  (if tel (progn (progn (setq phones-list (split-string tel [,;: ]+)) 
(setq result ) (while phones-list (setq result (concat result TEL: 
(car phones-list) \n)) (setq phones-list (cdr phones-list))) result)))
  (when tel (progn (setq phones-list (split-string tel [,;: ]+)) 
(setq result ) (while phones-list (setq result (concat result TEL: 
(car phones-list) \n)) (setq phones-list (cdr phones-list))) result))
  (concat head (when email (progn (setq emails-list (split-string email 
[,;: ]+)) (setq result ) (while emails-list (setq result (concat 
result EMAIL: (car emails-list) \n)) (setq emails-list (cdr 
emails-list))) result)) (when addr (format ADR:;;%s\n 
(replace-regexp-in-string \\, ? ; addr))) (when tel (progn (setq 
phones-list (split-string tel [,;: ]+)) (setq result ) (while 
phones-list (setq result (concat result TEL: (car phones-list) \n)) 
(setq phones-list (cdr phones-list))) result)) (when bday (let 
((cal-bday (calendar-gregorian-from-absolute 
(org-time-string-to-absolute bday (format BDAY:%04d-%02d-%02d\n 
(calendar-extract-year cal-bday) (calendar-extract-month cal-bday) 
(calendar-extract-day cal-bday (when nick (format NICKNAME:%s\n 
nick)) (when note (format NOTE:%s\n note)) END:VCARD\n\n)
  (let* ((properties (caddr contact)) (name (org-contacts-vcard-escape 
(car contact))) (n (org-contacts-vcard-encode-name name)) (email (cdr 
(assoc-string org-contacts-email-property properties))) (bday 
(org-contacts-vcard-escape (cdr (assoc-string 
org-contacts-birthday-property properties (addr (cdr (assoc-string 
org-contacts-address-property properties))) (nick 
(org-contacts-vcard-escape (cdr (assoc-string 
org-contacts-nickname-property properties (head (format 
BEGIN:VCARD\nVERSION:3.0\nN:%s\nFN:%s\n n name))) (concat head (when 
email (progn (setq emails-list (split-string email [,;: ]+)) (setq 
result ) (while emails-list (setq result (concat result EMAIL: (car 
emails-list) \n)) (setq emails-list (cdr emails-list))) result)) (when 
addr (format ADR:;;%s\n (replace-regexp-in-string \\, ? ; addr))) 
(when tel (progn (setq phones-list (split-string tel [,;: ]+)) (setq 
result ) (while phones-list (setq result (concat result TEL: (car 
phones-list) \n)) (setq phones-list (cdr phones-list))) result)) (when 
bday (let ((cal-bday (calendar-gregorian-from-absolute 
(org-time-string-to-absolute bday (format BDAY:%04d-%02d-%02d\n 
(calendar-extract-year cal-bday) (calendar-extract-month cal-bday) 
(calendar-extract-day cal-bday (when nick (format NICKNAME:%s\n 
nick)) (when note (format NOTE:%s\n note)) END:VCARD\n\n))

  org-contacts-vcard-format(...



On 04/06/2013 10:53 PM, Bastien wrote:

Hi Simon,

Simon Thum simon.t...@gmx.de writes:


I suspect some require
is missing in org-contacts.


In fact, `org-install-letbind' was called while not existing in
current Org.  So org-contacts.el tried to load the org-exp.el file
that comes with your Emacs and that we never want to load when
using pre-8.0.

I removed this function.


Anyway, if I invoke this line now it fails, although interactively things
load fine with the org file on the command line:

emacs someOrg.org -batch -l ~/.emacs.d/init.el
[...]
Symbol's value as variable is void: org-list-allow-alphabetical

To me, all of this points to some incorrect dependencies of load logic to
-batch. Unfortunately I don't know how to diagnose such problems.

It's not urgent but seems like a clear bug to me.


Indeed.  Thanks for reporting this.  Please test again and let me know
if something else needs to be fixed.

Best,