pinoaffe / org-vcard

Export and import vCards from within GNU Emacs' Org mode.
61 stars 7 forks source link

Org-vcard doesn't work, because org-vcard--styles-dirs #39

Closed Cletip closed 2 years ago

Cletip commented 2 years ago

Hi, when I want to load org-vcard, I get this error (even if I make a emacs -Q), is due to this function (but I don't know why) : org-vcard--styles-dirs

GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2020-09-19 Org mode version 9.5.1 (9.5.1-g521c53 @ /home/msi/.emacs.d/straight/build/org/)

flexibeast commented 2 years ago

Could you please provide the full error? When did you last update org-vcard? Are there any stale org-vcard .elc files?

Cletip commented 2 years ago

The full error : `Debugger entered--Lisp error: (error "Malformed arglist: (let ((default (file-name-as-di...") signal(error ("Malformed arglist: (let ((default (file-name-as-di...")) error("Malformed arglist: %s" (let ((default (file-name-as-directory (concat org-vcard--elisp-dir "styles")))) (if org-vcard-custom-styles-dir (list default org-vcard-custom-styles-dir) (list default))))

f(compiled-function (name arglist &optional docstring decl &rest body) "Define NAME as a function.\nThe definition is (lambda ARGLIST [DOCSTRING] BODY...).\nSee also the function interactive'.\nDECL is a declaration, optional, of the form (declare DECLS...) where\nDECLS is a list of elements of the form (PROP . VALUES). These are\ninterpreted according todefun-declarations-alist'.\nThe return value is undefined." #<bytecode 0x1fdb0cd4612b>)(org-vcard--styles-dirs (let ((default (file-name-as-directory (concat org-vcard--elisp-dir "styles")))) (if org-vcard-custom-styles-dir (list default org-vcard-custom-styles-dir) (list default))) "List of directories containing org-vcard styles.")

(defun org-vcard--styles-dirs (let ((default (file-name-as-directory (concat org-vcard--elisp-dir "styles")))) (if org-vcard-custom-styles-dir (list default org-vcard-custom-styles-dir) (list default))) "List of directories containing org-vcard styles.") eval-buffer(#<buffer load> nil "/home/msi/.emacs.d/straight/build/org-vcard/org-vc..." nil t) ; Reading at buffer position 9626 load-with-code-conversion("/home/msi/.emacs.d/straight/build/org-vcard/org-vc..." "/home/msi/.emacs.d/straight/build/org-vcard/org-vc..." t t) require(org-vcard nil t) (not (require 'org-vcard nil t)) (if (not (require 'org-vcard nil t)) (display-warning 'use-package (format "Cannot load %s" 'org-vcard) :error)) (progn (condition-case err (setq org-vcard-default-version "3.0") ((debug error) (funcall use-package--warning69 :init err))) (if (not (require 'org-vcard nil t)) (display-warning 'use-package (format "Cannot load %s" 'org-vcard) :error))) (condition-case err (progn (condition-case err (setq org-vcard-default-version "3.0") ((debug error) (funcall use-package--warning69 :init err))) (if (not (require 'org-vcard nil t)) (display-warning 'use-package (format "Cannot load %s" 'org-vcard) :error))) ((debug error) (funcall use-package--warning69 :catch err))) (progn (straight-use-package 'org-vcard) (defvar use-package--warning69 #'(lambda (keyword err) (let ((msg (format "%s/%s: %s" ... keyword ...))) (display-warning 'use-package msg :error)))) (condition-case err (progn (condition-case err (setq org-vcard-default-version "3.0") ((debug error) (funcall use-package--warning69 :init err))) (if (not (require 'org-vcard nil t)) (display-warning 'use-package (format "Cannot load %s" 'org-vcard) :error))) ((debug error) (funcall use-package--warning69 :catch err)))) eval((progn (straight-use-package 'org-vcard) (defvar use-package--warning69 #'(lambda (keyword err) (let ((msg ...)) (display-warning 'use-package msg :error)))) (condition-case err (progn (condition-case err (setq org-vcard-default-version "3.0") ((debug error) (funcall use-package--warning69 :init err))) (if (not (require 'org-vcard nil t)) (display-warning 'use-package (format "Cannot load %s" 'org-vcard) :error))) ((debug error) (funcall use-package--warning69 :catch err)))) nil) elisp--eval-last-sexp(nil) eval-last-sexp(nil) funcall-interactively(eval-last-sexp nil) call-interactively(eval-last-sexp nil nil) command-execute(eval-last-sexp) `

Are there any stale org-vcard .elc files? Nop, I have the same repo of github (almost sure), because I use straight.

flexibeast commented 2 years ago

This should now be fixed via https://github.com/flexibeast/org-vcard/commit/bdaebcb4ef44c155a92d9c89a21a1d29019ee026; could you please check?

Cletip commented 2 years ago

It's perfect ! Thanks a lot ! By the way, I just looked at your code (I'm not very good at lisp) and I can't make a function like this: (defun org-vcard-export-bis (source destination) to automate the contact export by putting this function in my init.el

Do you have any idea how to make such a function?

flexibeast commented 2 years ago

Great! You're welcome. Closing this issue.

Unfortunately, the sort of use-case you describe isn't adequately supported at this point, sorry - cf. the issues raised in #34, which do need to be dealt with, but which require a non-trivial amount of work. i'm still hoping to find the resources for this as soon as i can.