Titus von der Malsburg <[email protected]> writes: > 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).
Sorry, my git push failed on network connectivity issue. I fixed now, the latest update including your `:set` code should be available on remote. >> 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 Included in latest commit now. Thanks for your patching. -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
signature.asc
Description: PGP signature
