diff options
| author | Craig Jennings <c@cjennings.net> | 2025-10-23 00:13:33 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-10-23 00:13:33 -0500 |
| commit | db5f40e21b3015c2ce09c9b94e1d14c4ae951b92 (patch) | |
| tree | fdaab72ea89c422b6bf1c4a67ab5c516966b7e45 /modules/org-contacts-config.el | |
| parent | f499ea3bf76fa552bccefbacf2644331f655fb29 (diff) | |
refactor:org-contacts-config: Update template and keymap bindings
Add birthday and website fields to the contact template while
removing duplicate template code. Comment out unused org-roam
linking function. Replace `define-key` and `global-set-key` with
`keymap-set` and `keymap-global-set` for cleaner keymap definitions
and bindings.
Diffstat (limited to 'modules/org-contacts-config.el')
| -rw-r--r-- | modules/org-contacts-config.el | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/modules/org-contacts-config.el b/modules/org-contacts-config.el index b27dee85..706412a2 100644 --- a/modules/org-contacts-config.el +++ b/modules/org-contacts-config.el @@ -45,21 +45,22 @@ :EMAIL: %(cj/org-contacts-template-email) :PHONE: %^{Phone(s) - separate multiple with commas} :ADDRESS: %^{Address} +:BIRTHDAY: %^{Birthday (YYYY-MM-DD)} :COMPANY: %^{Company} :TITLE: %^{Title/Position} -:BIRTHDAY: %^{Birthday (YYYY-MM-DD)} +:WEBSITE: %^{URL} :END: %^{Notes} -Added: %U" - :empty-lines 1))) - -(with-eval-after-load 'org-capture - (add-to-list 'org-capture-templates - '("C" "Contact" entry (file+headline contacts-file "Contacts") - "* %(cj/org-contacts-template-name) - Added: %U"))) +;; TASK: What purpose did this serve? +;; duplicate?!? +;; (with-eval-after-load 'org-capture +;; (add-to-list 'org-capture-templates +;; '("C" "Contact" entry (file+headline contacts-file "Contacts") +;; "* %(cj/org-contacts-template-name) +;; Added: %U"))) + (defun cj/org-contacts-template-name () "Get name for contact template from context." (let ((name (when (boundp 'cj/contact-name) cj/contact-name))) @@ -113,14 +114,14 @@ Added: %U"))) ;; (with-eval-after-load 'org-roam ;; (defun cj/org-contacts-link-to-roam () -;; "Link current contact to an org-roam node." -;; (interactive) -;; (when (eq major-mode 'org-mode) -;; (let ((contact-name (org-entry-get (point) "ITEM"))) -;; (org-set-property "ROAM_REFS" -;; (org-roam-node-id -;; (org-roam-node-read nil nil nil nil -;; :initial-input contact-name))))))) +;; "Link current contact to an org-roam node." +;; (interactive) +;; (when (eq major-mode 'org-mode) +;; (let ((contact-name (org-entry-get (point) "ITEM"))) +;; (org-set-property "ROAM_REFS" +;; (org-roam-node-id +;; (org-roam-node-read nil nil nil nil +;; :initial-input contact-name))))))) ;;; ----------------------------- Birthday Agenda -------------------------------- @@ -188,7 +189,6 @@ module provides more sophisticated completion." ;; Birthday and anniversary handling (setq org-contacts-birthday-format "It's %l's birthday today! 🎂") - (setq org-contacts-anniversary-format "%l's anniversary 💑") ;; Email address formatting (setq org-contacts-email-link-description-format "%s <%e>") @@ -207,15 +207,15 @@ module provides more sophisticated completion." ;; Keymap for `org-contacts' commands (defvar cj/org-contacts-map (let ((map (make-sparse-keymap))) - (define-key map "f" 'cj/org-contacts-find) ;; find contact - (define-key map "n" 'cj/org-contacts-new) ;; new contact - (define-key map "e" 'cj/insert-contact-email) ;; inserts email from org-contact - (define-key map "v" 'cj/org-contacts-view-all) ;; view all contacts + (keymap-set map "f" #'cj/org-contacts-find) ;; find contact + (keymap-set map "n" #'cj/org-contacts-new) ;; new contact + (keymap-set map "e" #'cj/insert-contact-email) ;; inserts email from org-contact + (keymap-set map "v" #'cj/org-contacts-view-all) ;; view all contacts map) "Keymap for `org-contacts' commands.") ;; Bind the org-contacts map to the C-c C prefix -(global-set-key (kbd "C-c C") cj/org-contacts-map) +(keymap-global-set "C-c C" cj/org-contacts-map) (provide 'org-contacts-config) ;;; org-contacts-config.el ends here |
