diff --git a/org-roam-log.el b/org-roam-log.el new file mode 100644 index 0000000..20bf88f --- /dev/null +++ b/org-roam-log.el @@ -0,0 +1,53 @@ +;;; org-roam-log.el --- Integrations with Org-log -*- coding: utf-8; lexical-binding: t; -*- + +;; Copyright © 2022-2022 Jethro Kuan + +;; Author: Jethro Kuan +;; URL: https://github.com/org-roam/org-roam +;; Keywords: org-mode, roam, convenience +;; Version: 2.2.1 +;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.4") (emacsql "3.0.0") (emacsql-sqlite "1.0.0") (magit-section "3.0.0")) + +;; This file is NOT part of GNU Emacs. + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: +;; +;; This module provides integrations with Org-log. +;; +;;; Code: +(require 'org-roam) + +(defcustom org-roam-log-setup-hook nil + "Hook run when a log for an Org-roam file is setup." + :group 'org-roam + :type 'hook) + +(defun org-roam-log-p () + "Return t if the log buffer is for an Org-roam file, nil otherwise." + (and org-log-note-marker + (org-roam-file-p (buffer-file-name (marker-buffer org-log-note-marker))))) + +(defun org-roam-log--setup () + "Run hooks in `org-roam-log-setup-hook'." + (run-hooks 'org-roam-log-setup-hook)) + +(add-hook 'org-roam-log-setup-hook #'org-roam--register-completion-functions-h) +(add-hook 'org-log-buffer-setup-hook #'org-roam-log--setup) + +(provide 'org-roam-log) +;;; org-roam-log.el ends here diff --git a/org-roam.el b/org-roam.el index 5206eac..534aeec 100644 --- a/org-roam.el +++ b/org-roam.el @@ -337,6 +337,7 @@ E.g. (\".org\") => (\"*.org\" \"*.org.gpg\")" (require 'org-roam-id) (require 'org-roam-capture) (require 'org-roam-mode) + (require 'org-roam-log) (require 'org-roam-migrate)) ;;; org-roam.el ends here