Hi stardiviner,

thanks for the quick response.

> I added ;;;###autoload cookie in front of `org-contacts-capf-completing`. The 
> problem should be fixed now.

This change doesn’t seem to be pushed yet.  The latest commit is still a9a29e6 
(2026-09-15).

> The `org-contacts-anniversaries` function also has ;;;###autoload
> cookie. I don't understand why it's missing. Can your show the backtrace?

Sorry, this is a misunderstanding.  Loading stops at the first error, i.e. at 
the (when ...) form, so the autoloads after it, including 
org-contacts-anniversaries, are never evaluated.

> I don't know `:set` for `defcustom`. If you want to patch it. That's welcome.

With the :set function below, the autoloaded (when ...) form can be removed 
entirely.  :set runs when the defcustom is evaluated and whenever the option is 
changed via setopt or Customize, and adds or removes the hook accordingly.  
Limitation: A plain setq after org-contacts is loaded bypasses :set and has no 
effect.  A setq before loading works as before.  Not sure what’s the best 
solution.

;;;###autoload
(defcustom org-contacts-capf-completing nil
  "Whether add `org-contacts-complete-contact' into 
`completion-at-point-functions' in org-mode local."
  :type 'boolean
  :safe #'booleanp
  :set (lambda (symbol value)
         (set-default-toplevel-value symbol value)
         (if value
             (add-hook 'org-mode-hook #'org-contacts-completion-setup)
           (remove-hook 'org-mode-hook #'org-contacts-completion-setup))))

Best,

  Titus


Attachment: signature.asc
Description: PGP signature

Reply via email to