org-roam-log.el (1958B)
1 ;;; org-roam-log.el --- Integrations with Org-log -*- coding: utf-8; lexical-binding: t; -*- 2 3 ;; Copyright © 2022-2022 Jethro Kuan <jethrokuan95@gmail.com> 4 5 ;; Author: Jethro Kuan <jethrokuan95@gmail.com> 6 ;; URL: https://github.com/org-roam/org-roam 7 ;; Keywords: org-mode, roam, convenience 8 ;; Version: 2.2.2 9 ;; 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")) 10 11 ;; This file is NOT part of GNU Emacs. 12 13 ;; This program is free software; you can redistribute it and/or modify 14 ;; it under the terms of the GNU General Public License as published by 15 ;; the Free Software Foundation; either version 3, or (at your option) 16 ;; any later version. 17 ;; 18 ;; This program is distributed in the hope that it will be useful, 19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 ;; GNU General Public License for more details. 22 ;; 23 ;; You should have received a copy of the GNU General Public License 24 ;; along with GNU Emacs; see the file COPYING. If not, write to the 25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 26 ;; Boston, MA 02110-1301, USA. 27 28 ;;; Commentary: 29 ;; 30 ;; This module provides integrations with Org-log. 31 ;; 32 ;;; Code: 33 (require 'org-roam) 34 35 (defcustom org-roam-log-setup-hook nil 36 "Hook run when a log for an Org-roam file is setup." 37 :group 'org-roam 38 :type 'hook) 39 40 (defun org-roam-log-p () 41 "Return t if the log buffer is for an Org-roam file, nil otherwise." 42 (and org-log-note-marker 43 (org-roam-file-p (buffer-file-name (marker-buffer org-log-note-marker))))) 44 45 (defun org-roam-log--setup () 46 "Run hooks in `org-roam-log-setup-hook'." 47 (run-hooks 'org-roam-log-setup-hook)) 48 49 (add-hook 'org-roam-log-setup-hook #'org-roam--register-completion-functions-h) 50 (add-hook 'org-log-buffer-setup-hook #'org-roam-log--setup) 51 52 (provide 'org-roam-log) 53 ;;; org-roam-log.el ends here