changeset 623: |
a304c9713a51 |
child: |
6c0e4a44c082 |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Sun, 25 Aug 2024 00:14:17 -0400 |
permissions: |
-rw-r--r-- |
description: |
init graph.el |
1 ;;; graph.el --- Graph-oriented Extensions -*- lexical-binding: t; -*- 3 ;; Copyright (C) 2024 The Compiler Company 5 ;; Author: Richard Westhaver <richard.westhaver@gmail.com> 6 ;; Keywords: docs, maint, outlines, extensions 8 ;; This program is free software; you can redistribute it and/or modify 9 ;; it under the terms of the GNU General Public License as published by 10 ;; the Free Software Foundation, either version 3 of the License, or 11 ;; (at your option) any later version. 13 ;; This program is distributed in the hope that it will be useful, 14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ;; GNU General Public License for more details. 18 ;; You should have received a copy of the GNU General Public License 19 ;; along with this program. If not, see <https://www.gnu.org/licenses/>. 34 (defcustom org-graph-db-directory (join-paths user-org-stash-directory "graph") 35 "graph database storage directory." 39 (defcustom org-graph-locations (list (join-paths company-org-directory "notes")) 40 "List of directories to check for nodes." 41 :type '(list directory) 44 (defcustom org-graph-include-agenda-files nil 45 "When non-nil, include `org-agenda-files' in the graph." 49 (defcustom org-graph-include-archive nil 50 "When non-nil, include `org-arhive-location' in the graph." 54 (defcustom org-graph-include-org-directory nil 55 "When non-nil, include `org-directory' files in the graph." 59 (defcustom org-graph-compaction-hook nil 60 "Hook run when a graph is compacted to `org-graph-db'." 64 (defcustom org-graph-capture-hook nil 65 "Hook run when a node is added to the graph." 69 (defvar-local org-graph nil 70 "The currently active graph of org nodes.") 72 (defcustom org-graph-db-init-script (join-paths company-source-directory "infra/scripts/org-db-init.lisp") 73 "Path to a lisp script responsible for initializing the `org-graph-db-directory'.") 75 (cl-defstruct org-graph-db-handle 85 (defcustom org-graph-db (make-org-graph-db-handle) 86 "A handle to the database backend which stores nodes and edges." 87 :type 'org-graph-db-handle 90 (defun org-graph-from-id-locations () 91 "Populate the `org-graph' from `org-id-locations', filtering out any 92 entries not under a member of `org-graph-locations'." 93 (setq-local org-graph (copy-hash-table (org-id-locations-load))) 98 (unless (string-prefix-p x (file-truename v)) 99 (remhash k org-graph))) 100 org-graph-locations)) 104 ;; graph.el ends here