[nongnu] elpa/slime b2ee8a8c99: Don't lock the SWANK package.

2025-02-10 Thread ELPA Syncer
branch: elpa/slime
commit b2ee8a8c991c5195804e7f2c2f38482f3a6f12b2
Author: Stas Boukarev 
Commit: Stas Boukarev 

Don't lock the SWANK package.

Some third party software interns stuff there.
---
 slime-tests.el | 1 -
 swank.lisp | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/slime-tests.el b/slime-tests.el
index b0696c919f..026da75738 100644
--- a/slime-tests.el
+++ b/slime-tests.el
@@ -60,7 +60,6 @@ Exits Emacs when finished. The exit code is the number of 
failed tests."
   (when noninteractive
 (kill-emacs 252)
 (slime-sync-to-top-level 30)
-(slime-eval `(swank/backend:unlock-package :swank))
 (let* ((selector (if randomize
  `(member ,@(slime-shuffle-list
  (ert-select-tests (or test-name t) t)))
diff --git a/swank.lisp b/swank.lisp
index b3c4db02d9..ac49b54731 100644
--- a/swank.lisp
+++ b/swank.lisp
@@ -2540,7 +2540,7 @@ Record compiler notes signalled as `compiler-condition's."
 
 (defslimefun swank-require (modules &optional filename)
   "Load the module MODULE."
-  (with-unlocked-packages (swank swank/backend)
+  (with-unlocked-packages (swank/backend)
 (dolist (module (ensure-list modules))
   (unless (member (string module) *modules* :test #'string=)
 (catch 'dont-load
@@ -3897,7 +3897,7 @@ Collisions are caused because package information is 
ignored."
   (pushnew :swank *features*)
   (setq *swank-wire-protocol-version* version)
   (setq *load-path* load-path)
-  (loop for x in '(swank swank/backend swank/rpc swank/match swank-mop 
swank/gray)
+  (loop for x in '(swank/backend swank/rpc swank/match swank-mop swank/gray)
 do (lock-package x)))
 
 (defun init ()



[elpa] externals/org 9a3b22098e: Merge branch 'bugfix'

2025-02-10 Thread ELPA Syncer
branch: externals/org
commit 9a3b22098eacff9e10f14e1785d4523229b89724
Merge: 84118cad6b 3a05048238
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Merge branch 'bugfix'
---
 lisp/org-compat.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 91192629a1..1a00e9a896 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -207,7 +207,7 @@ inserted before concatenating."
  (mapcar
   (lambda (str)
 (when (and str (not (seq-empty-p str))
-   (string-match "\\(.+\\)/?" str))
+   (string-match "\\(.+?\\)/?$" str))
   (match-string 1 str)))
   (cons directory components)))
"/"



[elpa] externals-release/org 3a05048238: org-file-name-concat: Fix implementation for Emacs 27

2025-02-10 Thread ELPA Syncer
branch: externals-release/org
commit 3a050482386a255bee6c18a0605402cbbbcadac2
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-file-name-concat: Fix implementation for Emacs 27

* lisp/org-compat.el (org-file-name-concat): Fix regexp stripping
trailing / in the components.
---
 lisp/org-compat.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 59d34b661c..4c4178dbc8 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -207,7 +207,7 @@ inserted before concatenating."
  (mapcar
   (lambda (str)
 (when (and str (not (seq-empty-p str))
-   (string-match "\\(.+\\)/?" str))
+   (string-match "\\(.+?\\)/?$" str))
   (match-string 1 str)))
   (cons directory components)))
"/"



[elpa] externals/org updated (84118cad6b -> 9a3b22098e)

2025-02-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  84118cad6b Fix icorrect call to `skip-char-backward' in 1517ead2aa
   new  3a05048238 org-file-name-concat: Fix implementation for Emacs 27
   new  9a3b22098e Merge branch 'bugfix'


Summary of changes:
 lisp/org-compat.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[nongnu] elpa/dirvish ed0ab52cdd: fix(peek): image & media metadata preview, drop `selectrum` support

2025-02-10 Thread ELPA Syncer
branch: elpa/dirvish
commit ed0ab52cdd01f4f43e0763cf2c43bafc4a6893c9
Author: Alex Lu 
Commit: Alex Lu 

fix(peek): image & media metadata preview, drop `selectrum` support
---
 docs/EXTENSIONS.org|  7 +++--
 extensions/dirvish-peek.el | 70 --
 2 files changed, 40 insertions(+), 37 deletions(-)

diff --git a/docs/EXTENSIONS.org b/docs/EXTENSIONS.org
index 0082c0bd42..0440e1fcf5 100644
--- a/docs/EXTENSIONS.org
+++ b/docs/EXTENSIONS.org
@@ -103,9 +103,10 @@ saved to .dir-locals.el using ~dirvish-emerge-menu~):
 
 * Minibuffer file preview (dirvish-peek.el)
 
-~dirvish-peek-mode~ gives you a preview window when narrowing file candidates
-using minibuffer. It displays file preview for all of the file name narrowing
-commands in the same way as =dirvish= command.
+This extension introduces =dirvish-peek-mode=, a minor mode that enables file
+previews within the minibuffer as you narrow down candidates.  By leveraging
+=dirvish.el= for its core functionality, it delivers a seamless and consistent
+preview experience.
 
 
https://user-images.githubusercontent.com/16313743/158052790-22e6cf49-e18e-435c-908e-f5d91ba316a6.mp4
 
diff --git a/extensions/dirvish-peek.el b/extensions/dirvish-peek.el
index 48e3cd17d2..e47032aafb 100644
--- a/extensions/dirvish-peek.el
+++ b/extensions/dirvish-peek.el
@@ -9,14 +9,14 @@
 
 ;;; Commentary:
 
-;; `dirvish-peek-mode' gives you file preview when narrowing candidates using 
minibuffer.
+;; This extension introduces `dirvish-peek-mode', a minor mode that enables 
file
+;; previews within the minibuffer as you narrow down candidates.  By leveraging
+;; `dirvish.el' for its core functionality, it delivers a seamless and
+;; consistent preview experience.
 
 ;;; Code:
 
 (declare-function vertico--candidate "vertico")
-(declare-function selectrum--get-candidate "selectrum")
-(declare-function selectrum--get-full "selectrum")
-(defvar selectrum--current-candidate-index)
 (declare-function ivy-state-current "ivy")
 (defvar ivy-last)
 (require 'dirvish)
@@ -30,26 +30,27 @@ being used at runtime."
   :group 'dirvish :type '(choice function (const nil)))
 
 (defcustom dirvish-peek-categories '(file project-file library)
-  "Minibuffer metadata categories to show file preview."
-  :group 'dirvish :type '(repeat symbol))
+  "Minibuffer metadata categories to show file preview.
+For now only `file', `project-file' and `library' are supported.
+
+  - `file': preview files on `find-file' command and friends.
+  - `project-file': preview files on `project-find-file' command and friends.
+  - `library':  preview files on `find-library' command.
+
+Notice that the `dirvish-preview-dispatchers' option is respected across
+all categories."
+  :group 'dirvish :type '(repeat :tag "each item can be 'file 'project-file 
'library" symbol))
 
-(defvar dirvish-peek--cand-fetcher nil)
 (defun dirvish-peek--prepare-cand-fetcher ()
   "Set candidate fetcher according to current completion framework."
-  (setq dirvish-peek--cand-fetcher
-(cond (dirvish-peek-candidate-fetcher
-   dirvish-peek-candidate-fetcher)
-  ((bound-and-true-p vertico-mode) #'vertico--candidate)
-  ((bound-and-true-p selectrum-mode)
-   (lambda ()
- (selectrum--get-full
-  (selectrum--get-candidate
-   selectrum--current-candidate-index
-  ((bound-and-true-p ivy-mode) (lambda () (ivy-state-current 
ivy-last)))
-  ((bound-and-true-p icomplete-mode)
-   (lambda () (car completion-all-sorted-completions))
+  (dirvish-prop :peek-fetcher
+(cond (dirvish-peek-candidate-fetcher
+   dirvish-peek-candidate-fetcher)
+  ((bound-and-true-p vertico-mode) #'vertico--candidate)
+  ((bound-and-true-p ivy-mode) (lambda () (ivy-state-current 
ivy-last)))
+  ((bound-and-true-p icomplete-mode)
+   (lambda () (car completion-all-sorted-completions))
 
-(defvar dirvish-peek--curr-category nil)
 (defun dirvish-peek-setup-h ()
   "Create dirvish minibuffer preview window.
 The window is created only when metadata in current minibuffer is
@@ -62,35 +63,36 @@ one of categories in `dirvish-peek-categories'."
  (category (completion-metadata-get meta 'category))
  (p-category (and (memq category dirvish-peek-categories) category))
  new-dv)
-(setq dirvish-peek--curr-category p-category)
+(dirvish-prop :peek-category p-category)
 (when p-category
   (dirvish-peek--prepare-cand-fetcher)
   (add-hook 'post-command-hook #'dirvish-peek-update-h 90 t)
   (add-hook 'minibuffer-exit-hook #'dirvish-peek-exit-h nil t)
   (unless (and dirvish--this (dv-preview-window dirvish--this))
 (setq new-dv (dirvish--new :type 'peek))
+;; `dirvish-image-dp' needs this.
+(setf (dv-index new-dv) (cons default-directory (current-buffer)))
 (setf (

[nongnu] elpa/dirvish 885c2d84b4: perf(peek): prevent redundant updates by tracking previous candidate

2025-02-10 Thread ELPA Syncer
branch: elpa/dirvish
commit 885c2d84b48a52c8042d9289e11ee7757a930590
Author: zsxh 
Commit: Alex Lu 

perf(peek): prevent redundant updates by tracking previous candidate

Added a new variable `dirvish-peek-pre-cand` to track the previously
displayed candidate. The peek window will now only update when the
candidate changes, preventing redundant updates when navigating
through directories. Also resets `dirvish-peek-pre-cand` when cleaning
up peek sessions.
---
 extensions/dirvish-peek.el | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/extensions/dirvish-peek.el b/extensions/dirvish-peek.el
index 1ec9a9805e..48e3cd17d2 100644
--- a/extensions/dirvish-peek.el
+++ b/extensions/dirvish-peek.el
@@ -72,10 +72,13 @@ one of categories in `dirvish-peek-categories'."
 (setf (dv-preview-window new-dv)
   (or (minibuffer-selected-window) (next-window)))
 
+(defvar dirvish-peek--prev-cand nil)
 (defun dirvish-peek-update-h ()
   "Hook for `post-command-hook' to update peek window."
   (when-let* ((dirvish-peek--curr-category)
-  (cand (funcall dirvish-peek--cand-fetcher)))
+  (cand (funcall dirvish-peek--cand-fetcher))
+  ((not (string= cand dirvish-peek--prev-cand
+(setq dirvish-peek--prev-cand cand)
 (pcase dirvish-peek--curr-category
   ('file
(setq cand (expand-file-name cand)))
@@ -94,7 +97,8 @@ one of categories in `dirvish-peek-categories'."
   (dolist (dv (hash-table-values dirvish--session-hash))
 (when (eq (dv-type dv) 'peek)
   (dirvish--clear-session dv)
-  (remhash (dv-name dv) dirvish--session-hash
+  (remhash (dv-name dv) dirvish--session-hash)))
+  (setq dirvish-peek--prev-cand nil))
 
 ;;;###autoload
 (define-minor-mode dirvish-peek-mode



[elpa] externals/org-gnosis updated (610d8f2f40 -> 70d0c660e0)

2025-02-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/org-gnosis.

  from  610d8f2f40 packaging: Fix homepage URL & description
   new  23cbc34ded Transfer copyright to FSF
   new  753868b73b Remove :group property from custom variables.
   new  70d0c660e0 Add gitignore


Summary of changes:
 .gitignore|  5 +
 org-gnosis.el | 46 --
 2 files changed, 21 insertions(+), 30 deletions(-)
 create mode 100644 .gitignore



[elpa] externals/org-gnosis 23cbc34ded 1/3: Transfer copyright to FSF

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 23cbc34dedbb938123e0cfc952a28d716fe074e0
Author: Thanos Apollo 
Commit: Thanos Apollo 

Transfer copyright to FSF

* Change the copyright holder to the Free Software Foundation (FSF).
---
 org-gnosis.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 30492b2d69..a9bf849f06 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -1,13 +1,13 @@
 ;;; org-gnosis.el --- Roam-like Knowledge Management System  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2024-2025  Thanos Apollo
+;; Copyright (C) 2024-2025  Free Software Foundation, Inc.
 
 ;; Author: Thanos Apollo 
 ;; Keywords: extensions
 ;; URL: https://thanosapollo.org/projects/org-gnosis/
 ;; Version: 0.0.1
 
-;; Package-Requires: ((emacs "27.2") (emacsql "4.0.3") (compat "29.1.4.2"))
+;; Package-Requires: ((emacs "27.2") (emacsql "4.1.0") (compat "29.1.4.2"))
 
 ;; 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



[elpa] externals/org-gnosis 70d0c660e0 3/3: Add gitignore

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 70d0c660e0a661ca8cc3004f215bacca23d0fc34
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add gitignore
---
 .gitignore | 5 +
 1 file changed, 5 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00..b39aac86fd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*.elc
+
+# ELPA-generated files.
+/org-gnosis-autoloads.el
+/org-gnosis-pkg.el



[elpa] externals/org-gnosis 753868b73b 2/3: Remove :group property from custom variables.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 753868b73bbc3848288f415112e6b718e187188a
Author: Thanos Apollo 
Commit: Thanos Apollo 

Remove :group property from custom variables.

* Changes suggested by Stefan Monnier.
---
 org-gnosis.el | 42 ++
 1 file changed, 14 insertions(+), 28 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index a9bf849f06..905a4caafd 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -24,13 +24,9 @@
 
 ;;; Commentary:
 
-;; Org Gnosis is a knowledge management system, where notes are stored
-;; in org files under a specified directory.  Files are parsed and
-;; their data is saved in an SQLite databse, making it easier to
-;; retrieve information and view relationships.
-
-;; Functionality for journaling with journal entries in a separated
-;; directory & customizable templates is also available.
+;; Org Gnosis is a knowledge management tool that leverages Org mode
+;; for storing notes & journal entries, integrating them with an
+;; SQLite database for efficient retrieval and relationship mapping.
 
 ;;; Code:
 
@@ -44,58 +40,48 @@
 
 (defcustom org-gnosis-dir (expand-file-name "Notes" "~")
   "Directory with gnosis notes."
-  :type 'directory
-  :group 'org-gnosis)
+  :type 'directory)
 
 (defcustom org-gnosis-journal-templates
   '(("Default" (lambda () (format "* Daily Notes\n\n* Goals\n%s" 
(org-gnosis-todos
 ("Empty" (lambda () "")))
   "Templates for journaling."
   :type '(repeat (cons (string :tag "Name")
-   (function :tag "Template Function")))
-  :group 'org-gnosis)
+   (function :tag "Template Function"
 
 (defcustom org-gnosis-node-templates
   '(("Default" (lambda () "")))
   "Templates for nodes."
   :type '(repeat (cons (string :tag "Name")
-   (function :tag "Template Function")))
-  :group 'org-gnosis)
+   (function :tag "Template Function"
 
 (defcustom org-gnosis-journal-dir (expand-file-name "journal" org-gnosis-dir)
   "Gnosis journal directory."
-  :type 'directory
-  :group 'org-gnosis)
+  :type 'directory)
 
 (defcustom org-gnosis-show-tags nil
   "Display tags with `org-gnosis-find'."
-  :type 'boolean
-  :group 'org-gnosis)
+  :type 'boolean)
 
 (defcustom org-gnosis-timestring "%Y%m%d%H%M%S"
   "Timestring used for the creation of file."
-  :type 'string
-  :group 'org-gnosis)
+  :type 'string)
 
 (defcustom org-gnosis-todo-files org-agenda-files
   "TODO files used for the journal entries."
-  :type '(repeat string)
-  :group 'org-gnosis)
+  :type '(repeat string))
 
 (defcustom org-gnosis-completing-read-func #'org-completing-read
   "Function to use for `completing-read'."
-  :type 'function
-  :group 'org-gnosis)
+  :type 'function)
 
 (defcustom org-gnosis-bullet-point-char "+"
   "String to indicate a bullet point."
-  :type 'string
-  :group 'org-gnosis)
+  :type 'string)
 
 (defface org-gnosis-face-tags
   '((t :inherit font-lock-type-face))
-  "Face for displaying gnosis with `org-gnosis-find'."
-  :group 'org-gnosis)
+  "Face for displaying gnosis with `org-gnosis-find'.")
 
 (defvar org-gnosis-db (emacsql-sqlite-open (locate-user-emacs-file 
"org-gnosis.db")))
 
@@ -334,7 +320,7 @@ Delete file contents in database & file."
(propertized-tags
(when tags
   (concat (propertize "#" 'face 'org-gnosis-face-tags)
-  (propertize (mapconcat 'identity tags "#")
+  (propertize (mapconcat #'identity tags "#")
  'face 'org-gnosis-face-tags)
   (if propertized-tags
   (format "%s  %s" title propertized-tags)



[elpa] externals/org-gnosis 787c83f387 59/63: [Feature] Add todos for journals.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 787c83f3872bffb7625ac0fb0eb427c98f6a814f
Author: Thanos Apollo 
Commit: Thanos Apollo 

[Feature] Add todos for journals.

* Add TODOs in journals from todo files, as checkboxes
* Update todos when checkboxes as ON as DONE in their files.
---
 org-gnosis.el | 142 +++---
 1 file changed, 127 insertions(+), 15 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index a724db00a1..96bca3a075 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -303,7 +303,12 @@ Removes all contents of FILE in database, adding them 
anew."
 ;; Delete all contents for file
 (org-gnosis--delete-file file)
 ;; Reinsert them anew
-(org-gnosis--update-file file journal-p)))
+(org-gnosis--update-file file journal-p)
+;; Update todos
+(when (and journal-p file)
+  (let ((done-todos (org-gnosis-get-checked-items 
(org-element-parse-buffer
+(cl-loop for done-todo in done-todos
+do (org-gnosis-mark-todo-as-done done-todo file))
 
 (defun org-gnosis-delete-file (&optional file)
   "Delete FILE.
@@ -430,7 +435,7 @@ If templates is only item, return it without a prompt."
   (funcall org-gnosis-completing-read-func "Select 
template:"
 (mapcar #'car templates))
templates)
-(apply #'append template)))
+(funcall (apply #'append template
 
 ;;;###autoload
 (defun org-gnosis-insert (&optional journal-p)
@@ -443,9 +448,10 @@ If JOURNAL-P is non-nil, retrieve/create node as a journal 
entry."
 (org-gnosis-select '[title tags] table '1=1)
 (org-gnosis-select 'title table '1=1)))
 (id (concat "id:" (car (org-gnosis-select 'id table `(= ,node title) 
'1=1)
-(cond ((< (length id) 4) ;; if less that 4 then `org-gnosis-select' 
returned nil, (id:)
+(cond ((< (length id) 4) ; if less that 4 then `org-gnosis-select' 
returned nil, (id:)
   (save-window-excursion
-(org-gnosis--create-file node (if journal-p org-gnosis-journal-dir 
org-gnosis-dir))
+(org-gnosis--create-file
+ node (if journal-p org-gnosis-journal-dir org-gnosis-dir))
 ;; Save buffer to store new node id
 (save-buffer)
 (setf id (concat
@@ -495,16 +501,11 @@ If JOURNAL-P is non-nil, retrieve/create node as a 
journal entry."
   (org-gnosis-insert t))
 
 ;;;###autoload
-(defun org-gnosis-journal (&optional template)
-  "Start journaling for current date.
-
-TEMPLATE: Journaling template, refer to `org-gnosis-journal-templates'."
+(defun org-gnosis-journal ()
+  "Journal for current date."
   (interactive)
   (let* ((date (format-time-string "%Y-%m-%d")))
-(org-gnosis--create-file date org-gnosis-journal-dir
-(or template
-(org-gnosis-select-template
- org-gnosis-journal-templates)
+(org-gnosis-journal-find date)))
 
 (defun org-gnosis--get-id-at-point ()
   "Return the Org ID link at point, if any."
@@ -591,8 +592,9 @@ If file or id are not found, use `org-open-at-point'."
 (defun org-gnosis-db-sync--journal ()
   "Sync journal entries in databse."
   (cl-loop for file in (cl-remove-if-not (lambda (file)
-  (and (string-match-p "^[0-9]"
-   
(file-name-nondirectory file))
+  (and
+   (string-match-p "^[0-9]"
+   
(file-name-nondirectory file))
(not (file-directory-p file
 (directory-files 
org-gnosis-journal-dir t nil t))
   do (org-gnosis-update-file file)))
@@ -605,7 +607,8 @@ If called with ARG do not initialize the database."
   (interactive)
   (org-gnosis-db-init)
   (let ((files (cl-remove-if-not (lambda (file)
-  (and (string-match-p "^[0-9]" 
(file-name-nondirectory file))
+  (and (string-match-p "^[0-9]"
+   (file-name-nondirectory 
file))
(not (file-directory-p file
 (directory-files org-gnosis-dir t nil t
 (cl-loop for file in files
@@ -623,6 +626,115 @@ If called with ARG do not initialize the database."
   (pcase-dolist (`(,table ,schema) org-gnosis-db--table-schemata)
(emacsql org-gnosis-db [:create-table $i1 $S2] table schema))
   (emacsql org-gnosis-db [:pragma (= user-version 
org-gnosis-db-version)]
+;; should we use `org-get'
+(defun org-gnosis-get--todos (file)
+  "Get TODO items for FILE."
+  (

[elpa] externals/org-gnosis 1d082d0b41 61/63: [fix] mark-todo-as-done: Add last-done-date property

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 1d082d0b41f50ac214e4035128ea60f59c397bdb
Author: Thanos Apollo 
Commit: Thanos Apollo 

[fix] mark-todo-as-done: Add last-done-date property
---
 org-gnosis.el | 211 +++---
 1 file changed, 99 insertions(+), 112 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index dd6fb8302f..ee52bd0c75 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -308,7 +308,7 @@ Removes all contents of FILE in database, adding them anew."
 (when (and journal-p file)
   (let ((done-todos (org-gnosis-get-checked-items 
(org-element-parse-buffer
 (cl-loop for done-todo in done-todos
-do (org-gnosis-mark-todo-as-done done-todo file))
+do (org-gnosis-mark-todo-as-done done-todo))
 
 (defun org-gnosis-delete-file (&optional file)
   "Delete FILE.
@@ -535,6 +535,104 @@ If file or id are not found, use `org-open-at-point'."
  (t (org-open-at-point)))
 (org-gnosis-mode 1)))
 
+;; Should we use `org-get'?
+(defun org-gnosis-get--todos (file)
+  "Get TODO items for FILE."
+  (let ((todos))
+(with-temp-buffer
+  (insert-file-contents file)
+  (org-mode)
+  (org-element-map (org-element-parse-buffer) 'headline
+(lambda (headline)
+  (when (string= (org-element-property :todo-keyword headline) "TODO")
+(let* ((title (org-element-property :raw-value headline))
+   (timestamp (org-element-property :raw-value
+   (org-element-property :scheduled headline
+  (push `(,title ,timestamp ,file) todos))
+(nreverse todos)))
+
+(defun org-gnosis-find-file-with-heading (title files)
+  "Find first org file in FILES containing heading TITLE."
+  (catch 'found
+(dolist (file files)
+  (with-temp-buffer
+(insert-file-contents file)
+(org-mode)
+(goto-char (point-min))
+(when (org-find-exact-headline-in-buffer title)
+  (throw 'found file))
+
+(defun org-gnosis-get-todos (&optional files)
+  "Get TODO items for FILES.
+
+If TITLE is non-nil, return the file that has a TODO TITLE."
+  (let ((files (or files org-gnosis-todo-files))
+   todos)
+(cl-loop for file in files
+do (push (org-gnosis-get--todos file) todos))
+(nreverse (apply #'append todos
+
+(defun org-gnosis-todos ()
+  "Output todos as checkboxes in a string for current date."
+  (let ((todos (org-gnosis-get-todos))
+   (current-date (format-time-string "%Y-%m-%d"))
+   todos-string)
+(cl-loop for todo in todos
+do
+(let ((todo-title (car todo))
+  (todo-timestamp (cadr todo)))
+  (when (or
+ (null todo-timestamp)
+ (string-match-p (regexp-quote current-date) 
todo-timestamp))
+(setq todos-string
+  (concat todos-string
+  (format "%s [ ] %s\n" 
org-gnosis-bullet-point-char
+  todo-title))
+(or todos-string "")))
+
+(defun org-gnosis-get-checked-items (element)
+  "Get checked items for org ELEMENT.
+
+ELEMENT should be the output of `org-element-parse-buffer'."
+  (let ((checked-items))
+(org-element-map element 'item
+  (lambda (item)
+(when (eq (org-element-property :checkbox item) 'on)
+  (push (car (split-string
+ (substring-no-properties
+  (string-trim
+   (org-element-interpret-data
+(org-element-contents item
+ "\n"))
+checked-items
+(nreverse checked-items)))
+
+(defun org-gnosis-mark-todo-as-done (todo-title)
+  "Mark scheduled TODO with TODO-TITLE as DONE if not already done today.
+ENTRY: Journal entry linked under the heading."
+  (let* ((file (org-gnosis-find-file-with-heading todo-title 
org-gnosis-todo-files))
+ (today (format-time-string "%Y-%m-%d")))
+(when file
+  (save-current-buffer
+(with-current-buffer (find-file-noselect file)
+  (let ((found nil))
+(save-excursion
+  (org-element-map (org-element-parse-buffer) 'headline
+(lambda (headline)
+  (when (and (not found)
+ (string= (org-element-property :raw-value 
headline)
+  todo-title)
+ (string= (org-element-property :todo-keyword 
headline)
+  "TODO")
+;; Check if not done today
+ (not (org-entry-get (org-element-property :begin 
headline)
+"LAST_DONE_DATE")))
+(org-with-point-at (org-element-property :begin headline)
+  (org-todo 'done)
+   

[elpa] externals/org-gnosis 63326abf32 43/63: find: Always enable org-gnosis-mode.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 63326abf32e5da0bb9575640e698113cd9350927
Author: Thanos Apollo 
Commit: Thanos Apollo 

find: Always enable org-gnosis-mode.
---
 org-gnosis.el | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index b5ea284d35..c573ddbb43 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -358,13 +358,12 @@ DIRECTORY."
 (directory (or directory org-gnosis-dir))
 (node-template (org-gnosis-select-template org-gnosis-node-templates)))
 (cond ((null file)
-  (org-gnosis--create-file title nil node-template)
-  (org-gnosis-mode))
+  (org-gnosis--create-file title nil node-template))
  ((file-exists-p (expand-file-name file directory))
   (find-file
(expand-file-name file directory))
-  (ignore-errors (org-id-goto id))
-  (org-gnosis-mode)
+  (ignore-errors (org-id-goto id
+(org-gnosis-mode)))
 
 ;;;###autoload
 (defun org-gnosis-find-by-tag (&optional tag)
@@ -432,7 +431,7 @@ If node does not exist, create it."
 (defun org-gnosis-journal-find (&optional date)
   "Find journal entry for DATE."
   (interactive)
-  (let* ((prompt "Select journal entry")
+  (let* ((prompt "Select journal entry: ")
 (date (or date (org-gnosis--find
 prompt
 (org-gnosis-select '[date tags] 'journal)
@@ -448,7 +447,8 @@ If node does not exist, create it."
   (let* ((node (org-gnosis--find "Select journal entry: "
 (org-gnosis-select '[date tags] 'journal '1=1)
 (org-gnosis-select 'date 'journal '1=1)))
-(node-id (concat "id:" (car (org-gnosis-select 'id 'journal `(= ,node 
date) '1=1)
+(node-id (concat "id:"
+ (car (org-gnosis-select 'id 'journal `(= ,node date) 
'1=1)
 (org-insert-link nil node-id node)))
 
 ;;;###autoload



[elpa] externals/org-gnosis 91955d8344 35/63: Remove auto sync functions.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 91955d8344c2dc9418657291e34f2309eb389025
Author: Thanos Apollo 
Commit: Thanos Apollo 

Remove auto sync functions.

* Uneeded & do not fit with the minimal design.
---
 org-gnosis.el | 31 ---
 1 file changed, 31 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index b1dd3020d3..4ecb2a1bee 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -70,8 +70,6 @@
 
 (defvar org-gnosis-db (emacsql-sqlite-open (locate-user-emacs-file 
"org-gnosis.db")))
 
-(defvar org-gnosis-auto-sync--timer nil)
-
 (cl-defun org-gnosis-select (value table &optional (restrictions '1=1) 
(flatten nil))
   "Select VALUE from TABLE, optionally with RESTRICTIONS.
 
@@ -459,35 +457,6 @@ TEMPLATE: Journaling template, refer to 
`org-gnosis-journal-templates'."
   (add-hook 'after-save-hook #'org-gnosis-update-file nil t) ;; buffer 
local hook
 (remove-hook 'after-save-hook #'org-gnosis-update-file)))
 
-(defvar org-gnosis-db-sync-timer nil
-  "Timer for org-gnosis-db-sync minor mode.")
-
-(defvar org-gnosis-db-sync-interval 60
-  "Second interval to sync database.")
-
-(define-minor-mode org-gnosis-db-sync-mode
-  "Minor mode to automatically run `org-gnosis-db-sync` every 30 seconds."
-  :lighter nil
-  :global t
-  (if org-gnosis-db-sync-mode
-  (setq org-gnosis-db-sync-timer
-(run-with-timer 0 org-gnosis-db-sync-interval 
#'org-gnosis-db-sync-async))
-(when org-gnosis-db-sync-timer
-  (cancel-timer org-gnosis-db-sync-timer)
-  (setq org-gnosis-db-sync-timer nil
-
-(defun org-gnosis-db-sync-async ()
-  "Run `org-gnosis-db-sync` asynchronously using a subprocess."
-  (let ((script (concat
- "(progn "
- "(require 'org-gnosis) "  ;; Ensure the necessary package is 
loaded
- "(org-gnosis-db-sync))")))
-(start-process "org-gnosis-db-sync-process"
-   nil
-   "emacs"
-   "--batch"
-   "--eval" script)))
-
 ;; Org-Gnosis Database
 
 (defconst org-gnosis-db-version 1)



[nongnu] elpa/multiple-cursors 89f1a8df9b 3/3: Release 1.5.0

2025-02-10 Thread ELPA Syncer
branch: elpa/multiple-cursors
commit 89f1a8df9b1fc721b1672b4c7b6d3ab451e7e3ef
Author: Magnar Sveen 
Commit: Magnar Sveen 

Release 1.5.0
---
 multiple-cursors.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/multiple-cursors.el b/multiple-cursors.el
index c510a800c9..309656b49b 100644
--- a/multiple-cursors.el
+++ b/multiple-cursors.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2012-2016 Magnar Sveen
 
 ;; Author: Magnar Sveen 
-;; Version: 1.4.0
+;; Package-Version: 1.5.0
 ;; Package-Requires: ((cl-lib "0.5"))
 ;; Keywords: editing cursors
 ;; Homepage: https://github.com/magnars/multiple-cursors.el



[elpa] externals/org-gnosis 693013ef43 55/63: [Rewrite] insert: Add argument to insert as a journal entry.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 693013ef433823ae720fa46f44682bd215607542
Author: Thanos Apollo 
Commit: Thanos Apollo 

[Rewrite] insert: Add argument to insert as a journal entry.

* Rewrite org-gnosis-insert to work optionally with journal entries.
---
 org-gnosis.el | 49 -
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index d600f26b68..51f1425745 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -423,23 +423,24 @@ If templates is only item, return it without a prompt."
 (apply #'append template)))
 
 ;;;###autoload
-(defun org-gnosis-insert ()
+(defun org-gnosis-insert (&optional journal-p)
   "Insert gnosis node.
 
-If node does not exist, create it."
-  (interactive)
-  (let* ((node (org-gnosis--find "Select gnosis node: "
-(org-gnosis-select '[title tags] 'nodes '1=1)
-(org-gnosis-select 'title 'nodes '1=1)))
-(id (concat "id:" (car (org-gnosis-select 'id 'nodes `(= ,node title) 
'1=1)
-(cond ((< (length id) 4)
+If JOURNAL-P is non-nil, retrieve/create node as a journal entry."
+  (interactive "P")
+  (let* ((table (if journal-p 'journal 'nodes))
+(node (org-gnosis--find "Select gnosis node: "
+(org-gnosis-select '[title tags] table '1=1)
+(org-gnosis-select 'title table '1=1)))
+(id (concat "id:" (car (org-gnosis-select 'id table `(= ,node title) 
'1=1)
+(cond ((< (length id) 4) ;; if less that 4 then `org-gnosis-select' 
returned nil, (id:)
   (save-window-excursion
-(org-gnosis--create-file node)
+(org-gnosis--create-file node (if journal-p org-gnosis-journal-dir 
org-gnosis-dir))
 ;; Save buffer to store new node id
 (save-buffer)
 (setf id (concat
   "id:"
-  (car (org-gnosis-select 'id 'nodes `(= ,node title) 
'1=1)
+  (car (org-gnosis-select 'id table `(= ,node title) 
'1=1)
   (org-insert-link nil id node)
   (message "Created new node: %s" node))
  (t (org-insert-link nil id node)
@@ -462,7 +463,7 @@ If node does not exist, create it."
 
 ;;;###autoload
 (defun org-gnosis-journal-find (&optional title)
-  "Find journal entry for DATE."
+  "Find journal entry for TITLE."
   (interactive)
   (let* ((title (or title (org-gnosis--find
   "Select journal entry: "
@@ -470,18 +471,18 @@ If node does not exist, create it."
   (org-gnosis-select 'title 'journal
 (id (car (org-gnosis-select 'id 'journal `(= title ,title) t)))
 (file (car (org-gnosis-select 'file 'journal `(= title ,title) t
-(org-gnosis-find title file id org-gnosis-journal-dir)))
+(if (and id file)
+   (org-gnosis-find
+title file id org-gnosis-journal-dir org-gnosis-journal-templates)
+  (org-gnosis--create-file
+   title org-gnosis-journal-dir
+   (org-gnosis-select-template org-gnosis-journal-templates)
 
 ;;;###autoload
 (defun org-gnosis-journal-insert ()
   "Insert journal entry."
   (interactive)
-  (let* ((node (org-gnosis--find "Select journal entry: "
-(org-gnosis-select '[title tags] 'journal '1=1)
-(org-gnosis-select 'title 'journal '1=1)))
-(node-id (concat "id:"
- (car (org-gnosis-select 'id 'journal `(= ,node title) 
'1=1)
-(org-insert-link nil node-id node)))
+  (org-gnosis-insert t))
 
 ;;;###autoload
 (defun org-gnosis-journal (&optional template)
@@ -489,13 +490,11 @@ If node does not exist, create it."
 
 TEMPLATE: Journaling template, refer to `org-gnosis-journal-templates'."
   (interactive)
-  (let* ((date (format-time-string "%Y-%m-%d"))
-(file (expand-file-name (format "%s.org" date) 
org-gnosis-journal-dir)))
-(org-gnosis--create-file date file
-(and (not (file-exists-p file))
- (or template
- (org-gnosis-select-template
-  org-gnosis-journal-templates))
+  (let* ((date (format-time-string "%Y-%m-%d")))
+(org-gnosis--create-file date org-gnosis-journal-dir
+(or template
+(org-gnosis-select-template
+ org-gnosis-journal-templates)
 
 (defun org-gnosis--get-id-at-point ()
   "Return the Org ID link at point, if any."



[elpa] externals/org-gnosis 610d8f2f40 63/63: packaging: Fix homepage URL & description

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 610d8f2f40245c09b3d20f3bb12350dbb2f0f317
Author: Thanos Apollo 
Commit: Thanos Apollo 

packaging: Fix homepage URL & description
---
 org-gnosis.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 75e4b44940..30492b2d69 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -1,10 +1,10 @@
-;;; org-gnosis.el --- Knowledge Management System  -*- lexical-binding: t; -*-
+;;; org-gnosis.el --- Roam-like Knowledge Management System  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2024-2025  Thanos Apollo
 
 ;; Author: Thanos Apollo 
 ;; Keywords: extensions
-;; URL: https://thanosapollo.org/projects/gnosis
+;; URL: https://thanosapollo.org/projects/org-gnosis/
 ;; Version: 0.0.1
 
 ;; Package-Requires: ((emacs "27.2") (emacsql "4.0.3") (compat "29.1.4.2"))
@@ -310,6 +310,7 @@ Removes all contents of FILE in database, adding them anew."
 (cl-loop for done-todo in done-todos
 do (org-gnosis-mark-todo-as-done done-todo))
 
+;;;###autoload
 (defun org-gnosis-delete-file (&optional file)
   "Delete FILE.
 



[elpa] externals/org-gnosis c27bc53bbe 39/63: [packaging] Update commentary

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit c27bc53bbea630b9f1ef380833ab9c7f5685606c
Author: Thanos Apollo 
Commit: Thanos Apollo 

[packaging] Update commentary
---
 org-gnosis.el | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 810e42cc9b..22c644aa1e 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -1,4 +1,4 @@
-;;; org-gnosis.el --- Roam-like Note Management System  -*- lexical-binding: 
t; -*-
+;;; org-gnosis.el --- Knowledge Management System  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2024-2025  Thanos Apollo
 
@@ -29,6 +29,9 @@
 ;; their data is saved in an SQLite databse, making it easier to
 ;; retrieve information and view relationships.
 
+;; Functionality for journaling with journal entries in a separated
+;; directory & customizable templates is also available.
+
 ;;; Code:
 
 (require 'cl-lib)
@@ -360,6 +363,7 @@ DIRECTORY."
 ;;;###autoload
 (defun org-gnosis-find-by-tag (&optional tag)
   "Find node under TAG."
+  (interactive)
   (let* ((tag (or tag (funcall org-gnosis-completing-read-func
   "Select tag: "
   (org-gnosis-select 'tag 'tags '1=1 t



[elpa] externals/org-gnosis 76a399fedc 28/63: Add README

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 76a399fedcb422193376e9f90ef2adee8d01f955
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add README
---
 README | 35 +++
 1 file changed, 35 insertions(+)

diff --git a/README b/README
new file mode 100644
index 00..aa45ce4627
--- /dev/null
+++ b/README
@@ -0,0 +1,35 @@
+org-gnosis
+==
+
+
+This is a roam-inspired note-taking system for GNU Emacs.  It is
+designed to serve as a minimalistic, drop-in alternative to org-roam.
+
+It is currently under development & destined to be part of the gnosis
+package .
+
+
+Installation
+
+
+   (use-package org-gnosis
+ :vc (:url "https://git.thanosapollo.org/org-gnosis";)
+ :ensure t
+ :init
+ (define-prefix-command 'thanos/notes-map)
+ :config
+ (setf org-gnosis-dir "~/Notes"
+  org-gnosis-journal-template
+  "* Daily Notes\n\n* Goals\n+ [] Workout\n+ [] Study\n\n* Extras"
+  org-gnosis-show-tags t) ;; enable if you use a vertical 
completion-system e.g vertico
+ :bind (("C-c n" . thanos/notes-map)
+   :map thanos/notes-map
+   ("f" . org-gnosis-find)
+   ("i" . org-gnosis-insert)
+   ("j j" . org-gnosis-journal)
+   ("j f" . org-gnosis-journal-find)
+   ("j i" . org-gnosis-journal-insert)
+   :map thanos/journal-map
+   :map org-mode-map
+   ("C-c C-." . org-gnosis-insert-tag)
+   ("C-c i" . org-id-get-create)))
\ No newline at end of file



[elpa] externals/org-gnosis 2594216dba 56/63: Update README

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 2594216dba718eac1cdbaaa64b0e7df31e7e8ed6
Author: Thanos Apollo 
Commit: Thanos Apollo 

Update README
---
 README | 33 +++--
 1 file changed, 3 insertions(+), 30 deletions(-)

diff --git a/README b/README
index aa45ce4627..c4b321ccdb 100644
--- a/README
+++ b/README
@@ -1,35 +1,8 @@
 org-gnosis
 ==
 
+Roam-inspired note-taking system for GNU Emacs.  It is designed to
+serve as a minimalistic, drop-in alternative to org-roam.
 
-This is a roam-inspired note-taking system for GNU Emacs.  It is
-designed to serve as a minimalistic, drop-in alternative to org-roam.
 
-It is currently under development & destined to be part of the gnosis
-package .
-
-
-Installation
-
-
-   (use-package org-gnosis
- :vc (:url "https://git.thanosapollo.org/org-gnosis";)
- :ensure t
- :init
- (define-prefix-command 'thanos/notes-map)
- :config
- (setf org-gnosis-dir "~/Notes"
-  org-gnosis-journal-template
-  "* Daily Notes\n\n* Goals\n+ [] Workout\n+ [] Study\n\n* Extras"
-  org-gnosis-show-tags t) ;; enable if you use a vertical 
completion-system e.g vertico
- :bind (("C-c n" . thanos/notes-map)
-   :map thanos/notes-map
-   ("f" . org-gnosis-find)
-   ("i" . org-gnosis-insert)
-   ("j j" . org-gnosis-journal)
-   ("j f" . org-gnosis-journal-find)
-   ("j i" . org-gnosis-journal-insert)
-   :map thanos/journal-map
-   :map org-mode-map
-   ("C-c C-." . org-gnosis-insert-tag)
-   ("C-c i" . org-id-get-create)))
\ No newline at end of file
+- Project's Page: 
\ No newline at end of file



[elpa] externals/org-gnosis 9d09fa8b1a 47/63: [fix] find: fix journals bugs & add error handling.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 9d09fa8b1a6ed01b0487d7db21a7acef5ffe2584
Author: Thanos Apollo 
Commit: Thanos Apollo 

[fix] find: fix journals bugs & add error handling.

* Improve support for journals by not hardcoding nil in directory.
  This will allow us to create journals with custom titles.
* Add error handling for when file does not exist.
---
 org-gnosis.el | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index decd88a8ba..fd073776a0 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -355,12 +355,11 @@ DIRECTORY."
 (directory (or directory org-gnosis-dir))
 (node-template (org-gnosis-select-template org-gnosis-node-templates)))
 (cond ((null file)
-  (org-gnosis--create-file title nil node-template))
+  (org-gnosis--create-file title (expand-file-name title directory)
+   node-template))
  ((file-exists-p (expand-file-name file directory))
-  (find-file
-   (expand-file-name file directory))
-  (ignore-errors (org-id-goto id
-(org-gnosis-mode)))
+  (org-gnosis-goto-id id))
+ (t (error "File %s does exist" file)
 
 ;;;###autoload
 (defun org-gnosis-find-by-tag (&optional tag)



[elpa] externals/org-gnosis f68e2350cb 32/63: Remove denote parsing

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit f68e2350cba6578829fec4a2864a86417cd67cb3
Author: Thanos Apollo 
Commit: Thanos Apollo 

Remove denote parsing

* Currently there is no need to add & support denote support, although
  it can easily be added in the feature.
  * The core design of org-gnosis is still under development
---
 org-gnosis.el | 26 --
 1 file changed, 26 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 514ba1be5f..4b69c82eb2 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -63,11 +63,6 @@
   :type 'function
   :group 'gnosis)
 
-(defcustom org-gnosis-denote-p nil
-  "Use org-gnosis databse for denote notes."
-  :group 'org-gnosis
-  :type 'boolean)
-
 (defface org-gnosis-face-tags
   '((t :inherit font-lock-type-face))
   "Face for displaying gnosis with `org-gnosis-find'."
@@ -179,27 +174,6 @@ Return the ID if found, else nil."
 (tags (org-gnosis-get-filetags)))
 (list title tags id)))
 
-(defun org-gnosis--denote-topic ()
-  "Parse current buffer for denote file format."
-  (save-excursion
-(goto-char (point-min))
-(let ((title nil)
-  (tags nil)
-  (identifier nil))
-  (when (or (re-search-forward "^title:\\s-*\\(.*\\)$" nil t)
-(re-search-forward "^#\\+title:\\s-*\\(.*\\)$" nil t))
-(setq title (match-string-no-properties 1)))
-  (when (or (re-search-forward "^tags:\\s-*\\(.*\\)$" nil t)
-(re-search-forward "^#\\+filetags:\\s-*\\(.*\\)$" nil t))
-(setq tags (if (string-match-p ":" (match-string-no-properties 1))
-   (split-string (match-string-no-properties 1) ":")
- (split-string (match-string-no-properties 1
-(setq tags (delete "" tags)))
-  (when (or (re-search-forward "^identifier:\\s-*\\(.*\\)$" nil t)
-(re-search-forward "^#\\+identifier:\\s-*\\(.*\\)$" nil t))
-(setq identifier (match-string-no-properties 1)))
-  (list title tags identifier
-
 ;; This one is used mostly for topic
 (defun org-gnosis-get-filetags (&optional parsed-data)
   "Return the filetags of the buffer's PARSED-DATA as a comma-separated 
string."



[elpa] externals/org-gnosis 9e0d7da6a1 21/63: Add insert-tag

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 9e0d7da6a10af00c7c0502b135ce61424412989c
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add insert-tag
---
 org-gnosis.el | 16 
 1 file changed, 16 insertions(+)

diff --git a/org-gnosis.el b/org-gnosis.el
index 0291cc1630..e93dde2978 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -376,6 +376,22 @@ instead."
 (id (concat "id:" (car (org-gnosis-select 'id 'nodes `(= ,node title) 
'1=1)
 (org-insert-link nil id node)))
 
+;;;###autoload
+(defun org-gnosis-insert-tag ()
+  "Insert filetag."
+  (interactive)
+  (let* ((filetags (org-gnosis-select 'tag 'tags '1=1 t))
+ (tag (funcall org-gnosis-completing-read-func "Select tag: " 
filetags)))
+(save-excursion
+  (goto-char (point-min))
+  (if (re-search-forward "^#\\+FILETAGS:" nil t)
+  (progn
+(end-of-line)
+(insert (if (looking-back ":" nil) "" ":") tag ":"))
+(progn
+  (insert "#+FILETAGS: :" tag ":")
+  (newline))
+
 ;;;###autoload
 (defun org-gnosis-journal-find (&optional date)
   "Find journal entry for DATE."



[nongnu] elpa/gptel bca2b84be6: README: Fix typo in tool use example (#632)

2025-02-10 Thread ELPA Syncer
branch: elpa/gptel
commit bca2b84be6e32f01a6d375dec70f99f4bf9c6660
Author: Matt Niemeir 
Commit: GitHub 

README: Fix typo in tool use example (#632)

README.org: Fix typo in tool use example
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index d806c4356c..c69ac2c0a0 100644
--- a/README.org
+++ b/README.org
@@ -1025,7 +1025,7 @@ Defining a gptel tool requires an elisp function and 
associated metadata.  Here
(buffer-substring-no-properties (point-min) (point-max
  :description "return the contents of an emacs buffer"
  :args (list '(:name "buffer"
-   :type 'string; :type value must be a symbol
+   :type string; :type value must be a symbol
:description "the name of the buffer whose contents are to be 
retrieved"))
  :category "emacs") ; An arbitrary label for grouping
 #+end_src



[elpa] externals/org-gnosis 2532bcbfcc 01/63: Init project

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 2532bcbfcc17f54a04768e16624f1fa3183c3450
Author: Thanos Apollo 
Commit: Thanos Apollo 

Init project
---
 LICENSE   | 674 ++
 org-gnosis.el | 205 ++
 2 files changed, 879 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00..228f9b3eb2
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+   Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+   TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, wi

[elpa] externals/org-gnosis be05c71530 08/63: Add org-gnosis-mode & org-gnosis-insert

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit be05c7153040243a48fc43471c9e815abc2781b6
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add org-gnosis-mode & org-gnosis-insert
---
 org-gnosis.el | 29 +
 1 file changed, 25 insertions(+), 4 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 6815c5080f..b3305011ed 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -289,10 +289,31 @@ Removes all contents of FILE in database, adding them 
anew."
   (org-gnosis-select 'title 'nodes
 (file (caar (org-gnosis-select 'file 'nodes `(= title ,title
 (id (caar (org-gnosis-select 'id 'nodes `(= title ,title)
-(find-file
- (expand-file-name file org-gnosis-dir)
- ;;
- (ignore-errors (org-id-goto id)
+(cond ((null file)
+  (org-gnosis--create-file title))
+ ((file-exists-p (expand-file-name file org-gnosis-dir))
+  (find-file
+   (expand-file-name file org-gnosis-dir))
+  (ignore-errors (org-id-goto id))
+  (org-gnosis-mode 1)
+
+(defun org-gnosis-insert ()
+  "Insert gnosis node."
+  (interactive)
+  (let* ((node (completing-read "Select gnosis node: "
+   (org-gnosis-select 'title 'nodes '1=1 t)))
+(id (concat "id:" (car (org-gnosis-select 'id 'nodes `(= ,node title) 
'1=1)
+(org-insert-link nil id node)))
+
+(define-minor-mode org-gnosis-mode
+  "Org gnosis mode."
+  :lighter " org-gnosis"
+  :keymap nil
+  :global nil
+  :group 'org-gnosis
+  (if org-gnosis-mode
+  (add-hook 'after-save-hook #'org-gnosis-update-file nil t) ;; buffer 
local hook
+(remove-hook 'after-save-hook #'org-gnosis-update-file)))
 
 ;; Org-Gnosis Database
 



[elpa] externals/org-gnosis b1517b1729 04/63: Add db-sync & find

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit b1517b1729c871da6bd4fff660e0766a4cfdafbe
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add db-sync & find
---
 org-gnosis.el | 66 ++-
 1 file changed, 65 insertions(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 7c29997b7f..ac3abdc4d8 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -182,7 +182,71 @@ INITIAL-TAGS: Initial set of tags to inherit."
:tags (append tags initial-tags)
:id id
:top-node nil)))
-   append (org-gnosis-parse-nodes sub-nodes node (append tags 
initial-tags
+   append (org-gnosis-parse-nodes sub-nodes id (append tags 
initial-tags
+
+(defun org-gnosis-db-sync ()
+  "Sync `org-gnosis-db'."
+  (interactive)
+  (let ((files (cl-remove-if-not (lambda (file)
+  (and (string-match-p "^[0-9]" 
(file-name-nondirectory file))
+   (not (file-directory-p file
+(directory-files org-gnosis-dir t nil t
+(cl-loop for file in files
+do
+;; Add gnosis topic
+(let* ((data (org-gnosis-get-file-info file))
+   (file (plist-get data :file))
+   (topic (org-gnosis-adjust-title (nth 0 (plist-get data 
:topic
+   (tags (nth 1 (plist-get data :topic)))
+   (hash (nth 2 (plist-get data :topic
+  (emacsql-with-transaction org-gnosis-db
+(org-gnosis--insert-into 'nodes `([,hash ,file ,topic ,tags])))
+  ;; Add nodes
+  (cl-loop for node in (org-gnosis-parse-data-recursive
+(plist-get data :nodes))
+   do
+   (let ((title (org-gnosis-adjust-title (plist-get node 
:node)))
+ (tags (plist-get node :tags))
+ (id (plist-get node :id)))
+ (emacsql-with-transaction org-gnosis-db
+   (org-gnosis--insert-into 'nodes `([,id ,file ,title 
,tags])))
+ (message "ok")))
+
+(defun org-gnosis-find--tag-with-tag-prop (lst)
+  "Combine each sublist of strings in LST into a single string."
+  (mapcar (lambda (sublist)
+(mapconcat (lambda (element)
+ (let ((str (if (stringp element)
+element
+  (format "%s" element ;; Convert to 
string if necessary
+   (if (eq element (car sublist))
+   str
+ (propertize (replace-regexp-in-string "," "#" str)
+'face 'org-gnosis-face-tags
+   (cl-remove-if-not #'identity sublist) ;; Remove nil 
values
+   (format "  %s" (propertize "#" 'face 
'org-gnosis-face-tags
+  lst))
+
+(defun org-gnosis-find--with-tags ()
+  "Select gnosis node with tags."
+  (replace-regexp-in-string "  #[^[:space:]]+" ""
+   (completing-read "Select gnosis node: "
+   (org-gnosis-find--tag-with-tag-prop
+(org-gnosis-select '[title tags] 'nodes)
+
+(defun org-gnosis-find ()
+  "Select gnosis node."
+  (interactive)
+  (let* ((title (if org-gnosis-show-tags
+   (org-gnosis-find--with-tags)
+ (completing-read "Select gnosis node: "
+  (org-gnosis-select 'title 'nodes
+(file (caar (org-gnosis-select 'file 'nodes `(= title ,title
+(id (caar (org-gnosis-select 'id 'nodes `(= title ,title)
+(find-file
+ (expand-file-name file org-gnosis-dir)
+ ;;
+ (ignore-errors (org-id-goto id)
 
 ;; Org-Gnosis Database
 



[elpa] externals/org-gnosis 660ef0691d 02/63: Add org-gnosis group, customs & faces

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 660ef0691d0d407d67e87b83bca9ec8a09342b67
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add org-gnosis group, customs & faces
---
 org-gnosis.el | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index cebd7db707..fdf1bf6f09 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -1,4 +1,4 @@
-;;; org-gnosis.el --- Org Zettelkasten Note Management System  -*- 
lexical-binding: t; -*-
+;;; org-gnosis.el --- Org Note Management System  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2024-2025  Thanos Apollo
 
@@ -32,6 +32,25 @@
 (require 'emacsql-sqlite)
 (require 'org-element)
 
+(defgroup org-gnosis nil
+  "Note Taking System."
+  :group 'external)
+
+(defcustom org-gnosis-dir "~/Notes"
+  "Directory with gnosis notes."
+  :type 'directory
+  :group 'org-gnosis)
+
+(defcustom org-gnosis-show-tags nil
+  "Display tags with `org-gnosis-find'."
+  :type 'boolean
+  :group 'org-gnosis)
+
+(defface org-gnosis-face-tags
+  '((t :inherit font-lock-type-face))
+  "Face for displaying gnosis with `org-gnosis-find'."
+  :group 'org-gnosis)
+
 (defvar org-gnosis-db (emacsql-sqlite-open (locate-user-emacs-file 
"org-gnosis.db")))
 
 (cl-defun org-gnosis-select (value table &optional (restrictions '1=1) 
(flatten nil))



[elpa] externals/org-gnosis 57c7caad79 06/63: db: Add delete value & drop table functions

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 57c7caad79cfac72c19bda309ba36e3c3ed0e4f5
Author: Thanos Apollo 
Commit: Thanos Apollo 

db: Add delete value & drop table functions
---
 org-gnosis.el | 8 
 1 file changed, 8 insertions(+)

diff --git a/org-gnosis.el b/org-gnosis.el
index acedb2652d..363bc4f5c3 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -66,6 +66,14 @@ Optional argument FLATTEN, when non-nil, flattens the 
result."
   "Insert VALUES to TABLE."
   (emacsql org-gnosis-db `[:insert :into ,table :values ,values]))
 
+(defun org-gnosis--delete (table value)
+  "From TABLE use where to delete VALUE."
+  (emacsql org-gnosis-db `[:delete :from ,table :where ,value]))
+
+(cl-defun org-gnosis--drop-table (table)
+  "Drop TABLE from `gnosis-db'."
+  (emacsql org-gnosis-db `[:drop-table ,table]))
+
 (defun org-gnosis-get-current-node-title ()
   "Return the title of the current node."
   (when (derived-mode-p 'org-mode)



[elpa] externals/dape updated (1b2651157f -> 00761f5614)

2025-02-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/dape.

  from  1b2651157f Fixup some code comments
   new  fac13e7153 Clarify error message
   new  fcf046eeaf Small formatting fixup
   new  00761f5614 Apply comint filter before echoing shell to repl


Summary of changes:
 dape.el | 19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)



[elpa] externals/org-gnosis b7ea215496 48/63: journal-find: Update values for new schema.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit b7ea215496969f1fc3302855e0d4f6f5da5e815b
Author: Thanos Apollo 
Commit: Thanos Apollo 

journal-find: Update values for new schema.
---
 org-gnosis.el | 25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index fd073776a0..6d8529943b 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -371,7 +371,8 @@ DIRECTORY."
 (node
  (funcall org-gnosis-completing-read-func
   "Select node: "
-  (org-gnosis-select 'title 'nodes `(like tags ',(format 
"%%\"%s\"%%" tag))
+  (org-gnosis-select 'title 'nodes
+ `(like tags ',(format "%%\"%s\"%%" 
tag))
 (org-gnosis-find node)))
 
 (defun org-gnosis-select-template (&optional templates)
@@ -401,8 +402,9 @@ If node does not exist, create it."
 (org-gnosis--create-file node)
 ;; Save buffer to store new node id
 (save-buffer)
-(setf id (concat "id:"
- (car (org-gnosis-select 'id 'nodes `(= ,node 
title) '1=1)
+(setf id (concat
+  "id:"
+  (car (org-gnosis-select 'id 'nodes `(= ,node title) 
'1=1)
   (org-insert-link nil id node)
   (message "Created new node: %s" node))
  (t (org-insert-link nil id node)
@@ -424,17 +426,16 @@ If node does not exist, create it."
   (newline))
 
 ;;;###autoload
-(defun org-gnosis-journal-find (&optional date)
+(defun org-gnosis-journal-find (&optional title)
   "Find journal entry for DATE."
   (interactive)
-  (let* ((prompt "Select journal entry: ")
-(date (or date (org-gnosis--find
-prompt
-(org-gnosis-select '[date tags] 'journal)
-(org-gnosis-select 'date 'journal
-(id (car (org-gnosis-select 'id 'journal `(= date ,date) t)))
-(file (car (org-gnosis-select 'file 'journal `(= date ,date) t
-(org-gnosis-find date file id org-gnosis-journal-dir)))
+  (let* ((title (or title (org-gnosis--find
+  "Select journal entry: "
+  (org-gnosis-select '[title tags] 'journal)
+  (org-gnosis-select 'title 'journal
+(id (car (org-gnosis-select 'id 'journal `(= title ,title) t)))
+(file (car (org-gnosis-select 'file 'journal `(= title ,title) t
+(org-gnosis-find title file id org-gnosis-journal-dir)))
 
 ;;;###autoload
 (defun org-gnosis-journal-insert ()



[elpa] branch externals/org-gnosis created (now 610d8f2f40)

2025-02-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/org-gnosis.

at  610d8f2f40 packaging: Fix homepage URL & description

This branch includes the following new commits:

   new  2532bcbfcc Init project
   new  660ef0691d Add org-gnosis group, customs & faces
   new  6015224c61 Update databse schema
   new  b1517b1729 Add db-sync & find
   new  93318e4f5d Adjust node parsing
   new  57c7caad79 db: Add delete value & drop table functions
   new  cf35fc5bd8 Add update-file & create functions.
   new  be05c71530 Add org-gnosis-mode & org-gnosis-insert
   new  1340106961 node-parsing: Adjust for node links
   new  ff2332d87a db: Update schemata & syncing
   new  bb781d674f db: Restracture journal schema
   new  7198e1370f [feature] Add journaling & Refactor finding nodes
   new  75d6fd29cb Add journal-template
   new  dc599a68fa [fix] title adjust & journal-insert
   new  b484e01a5b schemata: Add unique links
   new  c1234ac1eb get-links: Get all links for contents
   new  cf4e914b65 adjust-title: Link link ids in node titles.
   new  ce58231037 Add org-gnosis-completing-read-func
   new  e5f281c982 journal: Add multiple template options.
   new  5bcbca8fcc Rewrite buffer parsing
   new  9e0d7da6a1 Add insert-tag
   new  2bdd2247b4 [fix] Add space for filetags.
   new  05ecfc3fe6 [fix] Adjust node titles
   new  c2ba8bbf37 [fix] Use org-gnosis-completing-read-func
   new  f86b2916c9 Rewrite node topic parsing
   new  331a98b58e Rewrite link & headline parsing
   new  d8ceb601d7 db-sync: Initialize database upon sync
   new  76a399fedc Add README
   new  64730a608e completing-read-func: Use org-completing-read.
   new  4809388113 Refactor parsing for links & Add journal level entries.
   new  604a57a702 [Feature] Add denote notes support.
   new  f68e2350cb Remove denote parsing
   new  e8de093180 Add custom goto-id func & async sync function.
   new  9eedd4fa2e org-gnosis-insert: Create node if it does not already 
exist.
   new  91955d8344 Remove auto sync functions.
   new  ba63354b4c Update commentary & Add node templates.
   new  3c4afccd10 Update docstrings & reorder sections
   new  c10591738c [Feature] org-gnosis-find-by-tag: Select node under tag.
   new  c27bc53bbe [packaging] Update commentary
   new  b906537132 [fix] org-gnosis-goto-id: Adjust for non org-gnosis 
links.
   new  7f68a27e4f db: Remove extra table deletion.
   new  0fea7521ed create-file: fix insertion of template.
   new  63326abf32 find: Always enable org-gnosis-mode.
   new  7851136732 schemata: Use title for journals.
   new  62be48df44 get-id: Rewrite using recursion.
   new  44b4a82031 [fix]: org-mode bug for creation of files.
   new  9d09fa8b1a [fix] find: fix journals bugs & add error handling.
   new  b7ea215496 journal-find: Update values for new schema.
   new  f4d43a0278 [Rewrite] goto-id: Add support for journals.
   new  c9c0829505 journal-insert: Update values for new schema.
   new  bf81cdd64a Separate creation of filename & add custom timestring.
   new  2895b38105 update-file: Add error handling for duplicate titles.
   new  e5ef4d24d7 Add delete-file.
   new  da222a3a16 find: Add optional arg for template input.
   new  693013ef43 [Rewrite] insert: Add argument to insert as a journal 
entry.
   new  2594216dba Update README
   new  8c3f4ccbcd templates: Rewrite as functions.
   new  0573178562 Add custom bullet-point-char & todo-files.
   new  787c83f387 [Feature] Add todos for journals.
   new  ef97ebbf94 [fix] Remove substring properties from checkboxes.
   new  1d082d0b41 [fix] mark-todo-as-done: Add last-done-date property
   new  a3913dd687 Add support for selecting multiple tags
   new  610d8f2f40 packaging: Fix homepage URL & description




[elpa] externals/org-gnosis 93318e4f5d 05/63: Adjust node parsing

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 93318e4f5dd70177451dacfa83e01c5a900a5ba7
Author: Thanos Apollo 
Commit: Thanos Apollo 

Adjust node parsing
---
 org-gnosis.el | 21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index ac3abdc4d8..acedb2652d 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -145,7 +145,7 @@ FILE: File path"
 (filename (file-name-nondirectory file)))
 `(:file ,filename :topic ,topic :nodes ,nodes)))
 
-(defun org-gnosis-adjust-titles (input)
+(defun org-gnosis-adjust-title (input)
   "Adjust the INPUT string to replace id link structures with plain text."
   (replace-regexp-in-string "\\[\\[id:[^]]+\\]\\[\\(.*?\\)\\]\\]" "\\1" input))
 
@@ -153,32 +153,31 @@ FILE: File path"
   "Something FILENAME."
   (with-temp-buffer
 (insert-file-contents filename)
-(let* ((data (org-gnosis-get--data filename))
-  (filename (plist-get data :file)))
+(let* ((data (org-gnosis-get--data filename)))
   data)))
 
-(defun org-gnosis-parse-nodes (nodes top-node inherited-tags)
-  "Parse a list of nodes, inheriting tags from the top node.
+(defun org-gnosis-parse-nodes (nodes top-node-id inherited-tags)
+  "Parse a list of nodes, inheriting tags and associating the top node ID.
 NODES: list of nodes to parse.
-TOP-NODE: the name of the top node to associate with each node.
+TOP-NODE-ID: the ID of the top node to associate with each node.
 INHERITED-TAGS: tags from the top node to inherit."
   (cl-loop for (name tags id sub-nodes) in nodes
;; Only include nodes with non-nil id
when id
-   append (list (list :category name
+   append (list (list :node name
   :tags (append tags inherited-tags)
   :id id
-  :top-node top-node))
+  :top-node top-node-id))
;; Recursively parse sub-nodes, inheriting current node's tags
-   append (org-gnosis-parse-nodes sub-nodes (when id name) (append 
tags inherited-tags
+   append (org-gnosis-parse-nodes sub-nodes (when id id) (append tags 
inherited-tags
 
 (defun org-gnosis-parse-data-recursive (data &optional initial-tags)
   "Recursively parse the entire data structure, extracting nodes and details.
-DATA: List of top-level categories to start parsing.
+DATA: List of top-level nodes to start parsing.
 INITIAL-TAGS: Initial set of tags to inherit."
   (cl-loop for (node tags id sub-nodes) in data
;; Directly parse sub-nodes, using top-level nodes only if they 
have valid id
-   append (when id (list (list :category node
+   append (when id (list (list :node node
:tags (append tags initial-tags)
:id id
:top-node nil)))



[elpa] externals/org-gnosis 6015224c61 03/63: Update databse schema

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 6015224c612aff455095d056b38c3dffa594cc95
Author: Thanos Apollo 
Commit: Thanos Apollo 

Update databse schema

* Remove file as foreign key.
---
 org-gnosis.el | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index fdf1bf6f09..7c29997b7f 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -193,8 +193,7 @@ INITIAL-TAGS: Initial set of tags to inherit."
  ([(id :not-null :primary-key)
(file :not-null)
(title text)
-   tags]
-  (:foreign-key [file] :references files [file] :on-delete :cascade)))
+   tags]))
 (refs
  ([(node-id :not-null)
(ref :not-null)
@@ -212,7 +211,7 @@ INITIAL-TAGS: Initial set of tags to inherit."
   "Initialize database DB with the correct schema and user version."
   (unless (length= (emacsql org-gnosis-db
[:select name :from sqlite-master :where (= type 
table)])
-  7)
+  3)
 (emacsql-with-transaction org-gnosis-db
   (pcase-dolist (`(,table ,schema) org-gnosis-db--table-schemata)
(emacsql org-gnosis-db [:create-table $i1 $S2] table schema))
@@ -220,5 +219,7 @@ INITIAL-TAGS: Initial set of tags to inherit."
(emacsql org-gnosis-db [:create-index $i1 :on $i2 $S3] index-name table 
columns))
   (emacsql org-gnosis-db [:pragma (= user-version 
org-gnosis-db-version)]
 
+(org-gnosis-db-init)
+
 (provide 'org-gnosis)
 ;;; org-gnosis.el ends here



[elpa] externals/org-gnosis 9eedd4fa2e 34/63: org-gnosis-insert: Create node if it does not already exist.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 9eedd4fa2e6fc8ec02588d630f39ac0c04451773
Author: Thanos Apollo 
Commit: Thanos Apollo 

org-gnosis-insert: Create node if it does not already exist.

* If user enters a node that does not exist, create it & insert it as an id 
link.
---
 org-gnosis.el | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index f7e10c20b0..b1dd3020d3 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -359,13 +359,24 @@ instead."
 
 ;;;###autoload
 (defun org-gnosis-insert ()
-  "Insert gnosis node."
+  "Insert gnosis node.
+
+If node does not exist, create it."
   (interactive)
   (let* ((node (org-gnosis--find "Select gnosis node: "
 (org-gnosis-select '[title tags] 'nodes '1=1)
 (org-gnosis-select 'title 'nodes '1=1)))
 (id (concat "id:" (car (org-gnosis-select 'id 'nodes `(= ,node title) 
'1=1)
-(org-insert-link nil id node)))
+(cond ((< (length id) 4)
+  (save-window-excursion
+(org-gnosis--create-file node)
+;; Save buffer to store new node id
+(save-buffer)
+(setf id (concat "id:"
+ (car (org-gnosis-select 'id 'nodes `(= ,node 
title) '1=1)
+  (org-insert-link nil id node)
+  (message "Created new node: %s" node))
+ (t (org-insert-link nil id node)
 
 ;;;###autoload
 (defun org-gnosis-insert-tag ()



[elpa] externals/org-gnosis 62be48df44 45/63: get-id: Rewrite using recursion.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 62be48df445b1bf880b4e0b87144395aa0e4f793
Author: Thanos Apollo 
Commit: Thanos Apollo 

get-id: Rewrite using recursion.

* Simplify code by using cond with recursion.
---
 org-gnosis.el | 22 ++
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 60b86b8c3e..e33ff274a8 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -141,19 +141,17 @@ TOPIC-ID: Topic hash id."
  (list :title title :id id :tags all-tags :master master :level 
level
 
 (defun org-gnosis-get-id ()
-  "Find the nearest ID property searching up the outline hierarchy.
-
-Return the ID if found, else nil."
+  "Return id for heading at point."
   (save-excursion
-(while (and (not (org-entry-get nil "ID"))
-(not (bobp)))
-  (ignore-errors
-(if (> (funcall outline-level) 1)
-   ;; Adjust for level <1 headings that do not have a level 1 heading.
-(or (org-up-heading-safe) (goto-char (point-min)))
-   (org-up-heading-safe)
-  (goto-char (point-min)
-(org-entry-get nil "ID")))
+(let ((heading-level (org-current-level))
+ (id (org-id-get)))
+  (cond (id id)
+   ((and (null id) (= heading-level 1))
+(goto-char (point-min))
+(org-id-get))
+   (t
+(outline-up-heading 1 t)
+(org-gnosis-get-id))
 
 (defun org-gnosis-collect-id-links ()
   "Collect ID links and current headline ID as (link-id . headline-id) pairs."



[elpa] externals/org-gnosis b906537132 40/63: [fix] org-gnosis-goto-id: Adjust for non org-gnosis links.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit b9065371324dd59d89bb194b1795f84b1d6df630
Author: Thanos Apollo 
Commit: Thanos Apollo 

[fix] org-gnosis-goto-id: Adjust for non org-gnosis links.

* If it's not an org-gnosis link, use default behavior.
---
 org-gnosis.el | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 22c644aa1e..50c5e39897 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -232,7 +232,6 @@ Returns file data with FILENAME."
   (with-temp-buffer
 (insert-file-contents filename)
 (org-mode)
-(message "%s" filename)
 (let* ((data (org-gnosis-buffer-data))
   (links (org-gnosis-collect-id-links)))
   ;; Append links even if they are nil
@@ -469,12 +468,16 @@ TEMPLATE: Journaling template, refer to 
`org-gnosis-journal-templates'."
 
 
 (defun org-gnosis-goto-id (&optional id)
-  "Visit file for ID."
+  "Visit file for ID.
+
+If file or id are not found, use `org-open-at-point'."
   (interactive)
   (let* ((id (or id (org-gnosis--get-id-at-point)))
 (file (caar (org-gnosis-select 'file 'nodes `(= id ,id)
-(find-file (expand-file-name file org-gnosis-dir))
-(org-gnosis-mode)))
+(if (and id file)
+   (progn (find-file (expand-file-name file org-gnosis-dir))
+  (org-gnosis-mode))
+  (org-open-at-point
 
 (defvar-keymap org-gnosis-mode-map
   :doc "org-gnosis keymap"



[elpa] externals/org-gnosis da222a3a16 54/63: find: Add optional arg for template input.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit da222a3a1675608141338d72c237a71d9f4dfe55
Author: Thanos Apollo 
Commit: Thanos Apollo 

find: Add optional arg for template input.
---
 org-gnosis.el | 27 ++-
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index f9b9ca0ba0..d600f26b68 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -114,8 +114,8 @@ Optional argument FLATTEN, when non-nil, flattens the 
result."
 (defun org-gnosis-adjust-title (input &optional node-id)
   "Adjust the INPUT string to replace id link structures with plain text.
 
-Adjust title INPUT for NODE-ID.  If node-id contains an id link, it's
-inserted as link for NODE-ID in the database."
+If node TITLE contains an id link, it's inserted as link for NODE-ID
+in the database."
   (when (stringp input)
 (let* ((id-links '())
   (new-input (replace-regexp-in-string
@@ -373,7 +373,7 @@ instead."
 entry))
 
 ;;;###autoload
-(defun org-gnosis-find (&optional title file id directory)
+(defun org-gnosis-find (&optional title file id directory templates)
   "Select gnosis node.
 
 If there is no ID for TITLE, create a new FILE with TITLE as TOPIC in
@@ -387,13 +387,14 @@ DIRECTORY."
 (file (or file (caar (org-gnosis-select 'file 'nodes `(= title 
,title)
 (id (or id (caar (or id (org-gnosis-select 'id 'nodes `(= title 
,title))
 (directory (or directory org-gnosis-dir))
-(node-template (org-gnosis-select-template org-gnosis-node-templates)))
+(templates (or templates org-gnosis-node-templates)))
 (cond ((null file)
-  (org-gnosis--create-file title (expand-file-name title directory)
-   node-template))
+  (org-gnosis--create-file title directory
+   (org-gnosis-select-template templates)))
  ((file-exists-p (expand-file-name file directory))
   (org-gnosis-goto-id id))
- (t (error "File %s does exist" file)
+ (t (error "File %s does not exist.  Try running `org-gnosis-db-sync' 
to resolve this"
+   file)
 
 ;;;###autoload
 (defun org-gnosis-find-by-tag (&optional tag)
@@ -409,16 +410,16 @@ DIRECTORY."
  `(like tags ',(format "%%\"%s\"%%" 
tag))
 (org-gnosis-find node)))
 
-(defun org-gnosis-select-template (&optional templates)
+(defun org-gnosis-select-template (templates)
   "Select journal template from TEMPLATES.
 
 If templates is only item, return it without a prompt."
-  (let* ((templates (or templates org-gnosis-journal-templates))
- (template (if (= (length templates) 1)
+  (let* ((template (if (= (length templates) 1)
(cdar templates)
- (cdr (assoc (funcall org-gnosis-completing-read-func 
"Select template:"
-  (mapcar #'car templates))
- templates)
+ (cdr (assoc
+  (funcall org-gnosis-completing-read-func "Select 
template:"
+(mapcar #'car templates))
+   templates)
 (apply #'append template)))
 
 ;;;###autoload



[elpa] externals/org-gnosis ef97ebbf94 60/63: [fix] Remove substring properties from checkboxes.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit ef97ebbf94fa4d00145cc8bcb3a26824c8f86b2f
Author: Thanos Apollo 
Commit: Thanos Apollo 

[fix] Remove substring properties from checkboxes.
---
 org-gnosis.el | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 96bca3a075..dd6fb8302f 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -408,8 +408,9 @@ DIRECTORY."
(org-gnosis-select-template templates)))
  ((file-exists-p (expand-file-name file directory))
   (org-gnosis-goto-id id))
- (t (error "File %s does not exist.  Try running `org-gnosis-db-sync' 
to resolve this"
-   file)
+ (t (error
+ "File %s does not exist.  Try running `org-gnosis-db-sync' to 
resolve this"
+ file)
 
 ;;;###autoload
 (defun org-gnosis-find-by-tag (&optional tag)
@@ -685,14 +686,16 @@ If TITLE is non-nil, return the file that has a TODO 
TITLE."
   "Get checked items for org ELEMENT.
 
 ELEMENT should be the output of `org-element-parse-buffer'."
-  (let ((checked-items nil))
+  (let ((checked-items))
 (org-element-map element 'item
   (lambda (item)
 (when (eq (org-element-property :checkbox item) 'on)
-  (push (substring-no-properties
- (string-trim
-  (org-element-interpret-data
-   (org-element-contents item
+  (push (car (split-string
+ (substring-no-properties
+  (string-trim
+   (org-element-interpret-data
+(org-element-contents item
+ "\n"))
 checked-items
 (nreverse checked-items)))
 



[elpa] externals/org-gnosis 331a98b58e 26/63: Rewrite link & headline parsing

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 331a98b58e4324ebdb763bb39536af8b4d085e22
Author: Thanos Apollo 
Commit: Thanos Apollo 

Rewrite link & headline parsing

* Fix parsing of links, making it compatible with org-roam.
---
 org-gnosis.el | 99 +++
 1 file changed, 38 insertions(+), 61 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index da147e0941..293290efa1 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -116,31 +116,21 @@ inserted as link for NODE-ID in the database."
   do (org-gnosis--insert-into 'links `([,node-id ,link])
   new-input)))
 
-(defun org-collect-id-links (element)
-  "Collect all ID links within an ELEMENT."
-  (org-element-map element 'link
-(lambda (link)
-  (let ((raw-link (org-element-property :raw-link link)))
-(when (string-prefix-p "id:" raw-link)
-  (substring raw-link 3
-nil nil t))
-
-;; TODO: Do not use links from master headline
 (defun org-gnosis-parse-headline (headline inherited-tags topic-id)
-  "Parse a single headline element."
+  "Parse a single headline and return a plist with its info."
   (let* ((title (org-element-property :raw-value headline))
  (id (org-element-property :ID headline))
  (level (org-element-property :level headline))
- (tags (org-element-property :tags headline))
- (links (org-collect-id-links headline))
- (combined-tags (delete-dups (append inherited-tags tags)))
+ (tags (or (org-element-property :tags headline) inherited-tags))
+ (all-tags (delete-dups (append inherited-tags tags)))
+ (links (org-gnosis-collect-id-links headline))
  (master (if (= level 1) topic-id
(org-element-property :ID (org-element-property :parent 
headline)
-(when id
-  (list :title title :id id :links links :tags combined-tags :master 
master
+(and id
+ (list :title title :id id :links links :tags all-tags :master 
master
 
 (defun org-gnosis-collect-id-links (element)
-  "Collect all ID links within an element."
+  "Collect all ID links within ELEMENT that start with id:."
   (org-element-map element 'link
 (lambda (link)
   (let ((raw-link (org-element-property :raw-link link)))
@@ -157,13 +147,13 @@ inserted as link for NODE-ID in the database."
   (org-element-property :value kw)))
   nil t))
  (id (org-element-map parsed-data 'property-drawer
-(lambda (drawer)
-  (org-element-map (org-element-contents drawer) 'node-property
-(lambda (prop)
-  (when (string= (org-element-property :key prop) "ID")
-(org-element-property :value prop)))
-nil t))
-nil t))
+   (lambda (drawer)
+ (org-element-map (org-element-contents drawer) 'node-property
+   (lambda (prop)
+ (when (string= (org-element-property :key prop) "ID")
+   (org-element-property :value prop)))
+   nil t))
+   nil t))
 (tags (org-gnosis-get-filetags)))
 (list title tags id)))
 
@@ -189,35 +179,22 @@ inserted as link for NODE-ID in the database."
   (list :title topic-title :id topic-id :links topic-links :tags 
topic-tags :master 0
 
 (defun org-gnosis-buffer-data (&optional data)
-  "Parse DATA in FILENAME for topic & headlines with IDs, ID, TAGS, MASTER id."
+  "Parse DATA in current buffer for topics & headlines with their ID, tags, 
links."
   (let* ((parsed-data (or data (org-element-parse-buffer)))
  (topic (org-gnosis-parse-topic parsed-data))
- (topic-id (plist-get topic :id))
- (headlines '())
- (current-path '())
+ (all-ids (when topic (list (plist-get topic :id
  (inherited-tags (plist-get topic :tags))
- (all-ids '()))
+ (headlines '()))
 (org-element-map parsed-data 'headline
   (lambda (headline)
-(let ((entry (org-gnosis-parse-headline headline inherited-tags 
topic-id)))
-  (when entry
-(push entry headlines)
-(push (plist-get entry :id) all-ids)
-(setq current-path
- (cl-subseq current-path 0
-(min (org-element-property :level headline)
- (length current-path
-(dolist (parent current-path)
-  (plist-put parent
-:links (cons (plist-get entry :id)
- (remove (plist-get entry :id)
- (plist-get parent :links)
-(push entry current-path)
-(setq inherited-tags (plist-get entry :tags))
+(let ((parsed-headline (org-gnosis-parse-headline
+   headli

[elpa] externals/org-gnosis ce58231037 18/63: Add org-gnosis-completing-read-func

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit ce582310379d7dff44211e40040728c1ed957aad
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add org-gnosis-completing-read-func

* Function to use for completing-read.  Adjusts for user that do not
  have a completion system enabled.
---
 org-gnosis.el | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/org-gnosis.el b/org-gnosis.el
index f2e8899c51..97bca05431 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -57,6 +57,17 @@
   :type 'boolean
   :group 'org-gnosis)
 
+(defcustom org-gnosis-completing-read-func
+  (cond ((or (bound-and-true-p ivy-mode)
+(bound-and-true-p helm-mode)
+(bound-and-true-p vertico-mode)
+(bound-and-true-p fido-mode))
+#'completing-read)
+   (t #'ido-completing-read))
+  "Function to use for `completing-read'."
+  :type 'function
+  :group 'gnosis)
+
 (defface org-gnosis-face-tags
   '((t :inherit font-lock-type-face))
   "Face for displaying gnosis with `org-gnosis-find'."



[elpa] externals/org-gnosis 05ecfc3fe6 23/63: [fix] Adjust node titles

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 05ecfc3fe69cb9fed1844cb5b7e2b6f3601b79cc
Author: Thanos Apollo 
Commit: Thanos Apollo 

[fix] Adjust node titles

* Get links from within titles.
---
 org-gnosis.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 65175fd29f..8b50a275b3 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -231,7 +231,8 @@ Removes all contents of FILE in database, adding them anew."
 ;; Add gnosis topic
 (emacsql-with-transaction org-gnosis-db
   (cl-loop for item in (butlast data)
-  do (let ((title (plist-get item :title))
+  do (let ((title (org-gnosis-adjust-title
+   (plist-get item :title)))
(id (plist-get item :id))
(links (plist-get item :links))
;; (master (plist-get item :master))



[elpa] externals/org-gnosis e5f281c982 19/63: journal: Add multiple template options.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit e5f281c982db78ccb31d54d0d13f4c17a093c318
Author: Thanos Apollo 
Commit: Thanos Apollo 

journal: Add multiple template options.
---
 org-gnosis.el | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 97bca05431..a3db8bec10 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -41,8 +41,9 @@
   :type 'directory
   :group 'org-gnosis)
 
-(defcustom org-gnosis-journal-template
-  "* Daily Notes\n\n* Goals\n+ []"
+(defcustom org-gnosis-journal-templates
+  '(("default" "* Daily Notes\n\n* Goals\n+ []")
+("Empty" ""))
   "Template for journaling."
   :type 'string
   :group 'org-gnosis)
@@ -397,6 +398,14 @@ instead."
   (ignore-errors (org-id-goto id))
   (org-gnosis-mode 1)
 
+(defun org-gnosis-journal-select-template (&optional templates)
+  "Selecte journal template from TEMPLATES."
+  (let* ((templates (or templates org-gnosis-journal-templates))
+(selected (funcall org-gnosis-completing-read-func "Select template:"
+   (mapcar #'car templates)))
+(template (cdr (assoc selected templates
+(apply #'append template)))
+
 ;;;###autoload
 (defun org-gnosis-insert ()
   "Insert gnosis node."
@@ -436,7 +445,7 @@ instead."
   (let* ((date (format-time-string "%Y-%m-%d"))
 (file (format "%s.org" date)))
 (org-gnosis--create-file date (expand-file-name file 
org-gnosis-journal-dir)
-(or template org-gnosis-journal-template
+(or template 
(org-gnosis-journal-select-template)
 
 (define-minor-mode org-gnosis-mode
   "Org gnosis mode."



[elpa] externals/org-gnosis c2ba8bbf37 24/63: [fix] Use org-gnosis-completing-read-func

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit c2ba8bbf377fb28767cc3fec16499a1b5a1bb9fa
Author: Thanos Apollo 
Commit: Thanos Apollo 

[fix] Use org-gnosis-completing-read-func

* Adjustment for users that do not have enabled a completion system.
---
 org-gnosis.el | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 8b50a275b3..bb8679c908 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -325,10 +325,11 @@ If called with ARG do not initialize the database."
   "Select gnosis node with tags from ENTRIES.
 
 PROMPT: Prompt message."
-  (replace-regexp-in-string "  #[^[:space:]]+" ""
-   (completing-read (or prompt "Select gnosis node: ")
-   (org-gnosis-find--tag-with-tag-prop
-(or entries (org-gnosis-select '[title tags] 'nodes))
+  (replace-regexp-in-string
+   "  #[^[:space:]]+" ""
+   (funcall org-gnosis-completing-read-func (or prompt "Select gnosis node: ")
+   (org-gnosis-find--tag-with-tag-prop
+(or entries (org-gnosis-select '[title tags] 'nodes))
 
 (defun org-gnosis--find (prompt entries-with-tags entries)
   "PROMPT user to select from ENTRIES.
@@ -337,7 +338,7 @@ If `org-gnosis-show-tags' is non-nil, ENTRIES-WITH-TAGS 
will be used
 instead."
   (let* ((entry (if org-gnosis-show-tags
 (org-gnosis-find--with-tags prompt entries-with-tags)
-  (completing-read prompt entries
+  (funcall org-gnosis-completing-read-func prompt entries
 entry))
 
 ;;;###autoload



[elpa] externals/org-gnosis d8ceb601d7 27/63: db-sync: Initialize database upon sync

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit d8ceb601d7e22d02376d6e718e74d8b754877ff2
Author: Thanos Apollo 
Commit: Thanos Apollo 

db-sync: Initialize database upon sync
---
 org-gnosis.el | 49 -
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 293290efa1..80d05eebda 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -271,31 +271,6 @@ Removes all contents of FILE in database, adding them 
anew."
 (org-gnosis--insert-into 'tags `([,tag]))
 (org-gnosis--insert-into 'node-tag `([,id 
,tag]
 
-(defun org-gnosis-db-sync--journal ()
-  "Sync journal entries in databse."
-  (cl-loop for file in (cl-remove-if-not (lambda (file)
-  (and (string-match-p "^[0-9]"
-   
(file-name-nondirectory file))
-   (not (file-directory-p file
-(directory-files 
org-gnosis-journal-dir t nil t))
-  do (org-gnosis-journal--update-file file)))
-
-;;;###autoload
-(defun org-gnosis-db-sync (&optional arg)
-  "Sync `org-gnosis-db'.
-
-If called with ARG do not initialize the database."
-  (interactive "P")
-  (unless arg
-(org-gnosis-db-init))
-  (let ((files (cl-remove-if-not (lambda (file)
-  (and (string-match-p "^[0-9]" 
(file-name-nondirectory file))
-   (not (file-directory-p file
-(directory-files org-gnosis-dir t nil t
-(cl-loop for file in files
-do (org-gnosis--update-file file)))
-  (org-gnosis-db-sync--journal))
-
 (defun org-gnosis-find--tag-with-tag-prop (lst)
   "Combine each sublist of strings in LST into a single string."
   (mapcar (lambda (item)
@@ -480,6 +455,30 @@ instead."
   (org-gnosis--drop-table 'links)
   (org-gnosis--drop-table 'node-tag
 
+(defun org-gnosis-db-sync--journal ()
+  "Sync journal entries in databse."
+  (cl-loop for file in (cl-remove-if-not (lambda (file)
+  (and (string-match-p "^[0-9]"
+   
(file-name-nondirectory file))
+   (not (file-directory-p file
+(directory-files 
org-gnosis-journal-dir t nil t))
+  do (org-gnosis-journal--update-file file)))
+
+;;;###autoload
+(defun org-gnosis-db-sync ()
+  "Sync `org-gnosis-db'.
+
+If called with ARG do not initialize the database."
+  (interactive)
+  (org-gnosis-db-init)
+  (let ((files (cl-remove-if-not (lambda (file)
+  (and (string-match-p "^[0-9]" 
(file-name-nondirectory file))
+   (not (file-directory-p file
+(directory-files org-gnosis-dir t nil t
+(cl-loop for file in files
+do (org-gnosis--update-file file)))
+  (org-gnosis-db-sync--journal))
+
 (defun org-gnosis-db-init ()
   "Initialize database DB with the correct schema and user version."
   (setf org-gnosis-db (emacsql-sqlite-open (locate-user-emacs-file 
"org-gnosis.db")))



[elpa] externals/org-gnosis 1340106961 09/63: node-parsing: Adjust for node links

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 1340106961e1b5b9953273b5c402eaecab9802a7
Author: Thanos Apollo 
Commit: Thanos Apollo 

node-parsing: Adjust for node links

* Inserting nodes is still a work in progress
---
 org-gnosis.el | 27 +++
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index b3305011ed..99d8037afe 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -93,18 +93,27 @@ Optional argument FLATTEN, when non-nil, flattens the 
result."
(when (string-equal (org-element-property :key kw) 
"FILETAGS")
  (org-element-property :value kw)))
  nil t)))
-(when filetags
-  (mapconcat 'identity (split-string filetags "[:\s]+" t) ","
+(and filetags (remove "" (split-string filetags ":")
+
+(defun org-gnosis-get-links (contents)
+  "Recursively collect all node id links from CONTENTS."
+  (org-element-map contents 'link
+(lambda (link)
+  (when (string-equal "id" (org-element-property :type link))
+(org-element-property :path link)))
+nil nil 'headline))
 
 (defun org-gnosis-process-node (node)
   "Process a single headline NODE and return information as a list."
   (let ((title (org-element-property :raw-value node))
 (tags (org-element-property :tags node))
 (id (org-element-property :ID node))
+   (links (org-gnosis-get-links (org-element-contents node)))
 (children (org-element-contents node)))
 (when title
   (list title tags id
-(org-gnosis-process-children children (1+ (org-element-property 
:level node)))
+(org-gnosis-process-children children (1+ (org-element-property 
:level node)))
+   links
 
 (defun org-gnosis-process-children (nodes level)
   "Recursively process NODES at a given LEVEL."
@@ -150,8 +159,9 @@ FILE: File path"
   (let* ((parsed-data (org-element-parse-buffer))
 (topic (org-gnosis-get-data--topic parsed-data))
 (nodes (org-gnosis-get-data--nodes parsed-data))
-(filename (file-name-nondirectory file)))
-`(:file ,filename :topic ,topic :nodes ,nodes)))
+(filename (file-name-nondirectory file))
+(links (org-gnosis-get-links parsed-data)))
+`(:file ,filename :topic ,topic :nodes ,nodes :links ,links)))
 
 (defun org-gnosis-adjust-title (input)
   "Adjust the INPUT string to replace id link structures with plain text."
@@ -169,17 +179,18 @@ FILE: File path"
 NODES: list of nodes to parse.
 TOP-NODE-ID: the ID of the top node to associate with each node.
 INHERITED-TAGS: tags from the top node to inherit."
-  (cl-loop for (name tags id sub-nodes) in nodes
+  (cl-loop for (name tags id sub-nodes links) in nodes
;; Only include nodes with non-nil id
when id
append (list (list :node name
   :tags (append tags inherited-tags)
   :id id
-  :top-node top-node-id))
+  :top-node top-node-id
+ :links links))
;; Recursively parse sub-nodes, inheriting current node's tags
append (org-gnosis-parse-nodes sub-nodes (when id id) (append tags 
inherited-tags
 
-(defun org-gnosis-parse-data-recursive (data &optional initial-tags)
+(defun org-gnosis-parse-data-recursive (data &optional initial-tags 
top-node-id)
   "Recursively parse the entire data structure, extracting nodes and details.
 DATA: List of top-level nodes to start parsing.
 INITIAL-TAGS: Initial set of tags to inherit."



[elpa] externals/org-gnosis f86b2916c9 25/63: Rewrite node topic parsing

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit f86b2916c9815acb7dce125d6bde6dac178ef69d
Author: Thanos Apollo 
Commit: Thanos Apollo 

Rewrite node topic parsing
---
 org-gnosis.el | 57 +++--
 1 file changed, 43 insertions(+), 14 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index bb8679c908..da147e0941 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -97,17 +97,6 @@ Optional argument FLATTEN, when non-nil, flattens the 
result."
   "Drop TABLE from `gnosis-db'."
   (emacsql org-gnosis-db `[:drop-table ,table]))
 
-(defun org-gnosis-get--data (file)
-  "Return data for FILE.
-
-FILE: File path"
-  (let* ((parsed-data (org-element-parse-buffer))
-(topic (org-gnosis-get-data--topic parsed-data))
-(nodes (org-gnosis-get-data--nodes parsed-data))
-(filename (file-name-nondirectory file))
-(links (org-gnosis-get-links parsed-data)))
-`(:file ,filename :topic ,topic :nodes ,nodes :links ,links)))
-
 (defun org-gnosis-adjust-title (input &optional node-id)
   "Adjust the INPUT string to replace id link structures with plain text.
 
@@ -127,6 +116,16 @@ inserted as link for NODE-ID in the database."
   do (org-gnosis--insert-into 'links `([,node-id ,link])
   new-input)))
 
+(defun org-collect-id-links (element)
+  "Collect all ID links within an ELEMENT."
+  (org-element-map element 'link
+(lambda (link)
+  (let ((raw-link (org-element-property :raw-link link)))
+(when (string-prefix-p "id:" raw-link)
+  (substring raw-link 3
+nil nil t))
+
+;; TODO: Do not use links from master headline
 (defun org-gnosis-parse-headline (headline inherited-tags topic-id)
   "Parse a single headline element."
   (let* ((title (org-element-property :raw-value headline))
@@ -134,7 +133,7 @@ inserted as link for NODE-ID in the database."
  (level (org-element-property :level headline))
  (tags (org-element-property :tags headline))
  (links (org-collect-id-links headline))
- (combined-tags (inherit-tags inherited-tags tags))
+ (combined-tags (delete-dups (append inherited-tags tags)))
  (master (if (= level 1) topic-id
(org-element-property :ID (org-element-property :parent 
headline)
 (when id
@@ -149,15 +148,45 @@ inserted as link for NODE-ID in the database."
   (substring raw-link 3
 nil nil t))
 
+(defun org-gnosis-get-data--topic (&optional parsed-data)
+  "Retrieve the title and ID from the current org buffer or given PARSED-DATA."
+  (let* ((parsed-data (or parsed-data (org-element-parse-buffer)))
+ (title (org-element-map parsed-data 'keyword
+  (lambda (kw)
+(when (string= (org-element-property :key kw) "TITLE")
+  (org-element-property :value kw)))
+  nil t))
+ (id (org-element-map parsed-data 'property-drawer
+(lambda (drawer)
+  (org-element-map (org-element-contents drawer) 'node-property
+(lambda (prop)
+  (when (string= (org-element-property :key prop) "ID")
+(org-element-property :value prop)))
+nil t))
+nil t))
+(tags (org-gnosis-get-filetags)))
+(list title tags id)))
+
+;; This one is used mostly for topic
+(defun org-gnosis-get-filetags (&optional parsed-data)
+  "Return the filetags of the buffer's PARSED-DATA as a comma-separated 
string."
+  (let* ((parsed-data (or parsed-data (org-element-parse-buffer)))
+ (filetags (org-element-map parsed-data 'keyword
+ (lambda (kw)
+   (when (string-equal (org-element-property :key kw) 
"FILETAGS")
+ (org-element-property :value kw)))
+ nil t)))
+(and filetags (remove "" (split-string filetags ":")
+
 (defun org-gnosis-parse-topic (parsed-data)
-  "Parse topic information from the buffer."
+  "Parse topic information from the PARSED-DATA."
   (let* ((topic-info (org-gnosis-get-data--topic parsed-data))
  (topic-title (nth 0 topic-info))
  (topic-tags (nth 1 topic-info))
  (topic-id (nth 2 topic-info))
  (topic-links (org-gnosis-collect-id-links parsed-data)))
 (when topic-id
-  (list :title topic-title :id topic-id :links topic-links :tags 
topic-tags :level 0
+  (list :title topic-title :id topic-id :links topic-links :tags 
topic-tags :master 0
 
 (defun org-gnosis-buffer-data (&optional data)
   "Parse DATA in FILENAME for topic & headlines with IDs, ID, TAGS, MASTER id."



[elpa] externals/org-gnosis 3c4afccd10 37/63: Update docstrings & reorder sections

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 3c4afccd10755e426124929efae364ca018fa084
Author: Thanos Apollo 
Commit: Thanos Apollo 

Update docstrings & reorder sections
---
 org-gnosis.el | 50 --
 1 file changed, 24 insertions(+), 26 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 695b8a172d..42b35c625d 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -232,33 +232,9 @@ Returns file data with FILENAME."
 (message "%s" filename)
 (let* ((data (org-gnosis-buffer-data))
   (links (org-gnosis-collect-id-links)))
-  ;; Append an empty list if links are nil
+  ;; Append links even if they are nil
   (append data (list links)
 
-(defun org-gnosis-update-file (&optional file)
-  "Update contents of FILE in databse.
-
-Removes all contents of FILE in database, adding them anew."
-  (let* ((file (or file (file-name-nondirectory (buffer-file-name
-(journal-p (file-in-directory-p file org-gnosis-journal-dir))
-(nodes (if journal-p
-   (org-gnosis-select 'id 'journal `(= file ,file) t)
- (org-gnosis-select 'id 'nodes `(= file ,file) t
-(emacsql-with-transaction org-gnosis-db
-  ;; Delete all nodes of file in db
-  (cl-loop for node in nodes
-  do (if journal-p
- (org-gnosis--delete 'journal `(= id ,node))
-   (org-gnosis--delete 'nodes `(= id ,node
-  ;; Add new data
-  (org-gnosis--update-file file journal-p
-
-(defun org-gnosis--is-journal-entry-p (file)
-  "Check if FILE is a journal entry."
-  (let ((file-dir (file-name-directory (expand-file-name file)))
-(expanded-dir (file-name-as-directory (expand-file-name 
org-gnosis-journal-dir
-(string-equal file-dir expanded-dir)))
-
 (defun org-gnosis--update-file (file &optional journal)
   "Add contents of FILE to database.
 
@@ -287,6 +263,24 @@ If JOURNAL is non-nil, update file as a journal entry."
 (cl-loop for link in links
 do (org-gnosis--insert-into 'links `[,(cdr link) ,(car link)]
 
+(defun org-gnosis-update-file (&optional file)
+  "Update contents of FILE in databse.
+
+Removes all contents of FILE in database, adding them anew."
+  (let* ((file (or file (file-name-nondirectory (buffer-file-name
+(journal-p (file-in-directory-p file org-gnosis-journal-dir))
+(nodes (if journal-p
+   (org-gnosis-select 'id 'journal `(= file ,file) t)
+ (org-gnosis-select 'id 'nodes `(= file ,file) t
+(emacsql-with-transaction org-gnosis-db
+  ;; Delete all nodes of file in db
+  (cl-loop for node in nodes
+  do (if journal-p
+ (org-gnosis--delete 'journal `(= id ,node))
+   (org-gnosis--delete 'nodes `(= id ,node
+  ;; Add new data
+  (org-gnosis--update-file file journal-p
+
 (defun org-gnosis-find--tag-with-tag-prop (lst)
   "Combine each sublist of strings in LST into a single string."
   (mapcar (lambda (item)
@@ -340,7 +334,10 @@ instead."
 
 ;;;###autoload
 (defun org-gnosis-find (&optional title file id directory)
-  "Select gnosis node."
+  "Select gnosis node.
+
+If there is no ID for TITLE, create a new FILE with TITLE as TOPIC in
+DIRECTORY."
   (interactive)
   (let* ((title (or title (if org-gnosis-show-tags
  (org-gnosis-find--with-tags)
@@ -432,6 +429,7 @@ If node does not exist, create it."
 (node-id (concat "id:" (car (org-gnosis-select 'id 'journal `(= ,node 
date) '1=1)
 (org-insert-link nil node-id node)))
 
+;;;###autoload
 (defun org-gnosis-journal (&optional template)
   "Start journaling for current date.
 



[elpa] externals/org-gnosis e8de093180 33/63: Add custom goto-id func & async sync function.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit e8de093180d6f8f86262683f6e4ffc27f638dd22
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add custom goto-id func & async sync function.
---
 org-gnosis.el | 63 +--
 1 file changed, 57 insertions(+), 6 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 4b69c82eb2..f7e10c20b0 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -70,6 +70,8 @@
 
 (defvar org-gnosis-db (emacsql-sqlite-open (locate-user-emacs-file 
"org-gnosis.db")))
 
+(defvar org-gnosis-auto-sync--timer nil)
+
 (cl-defun org-gnosis-select (value table &optional (restrictions '1=1) 
(flatten nil))
   "Select VALUE from TABLE, optionally with RESTRICTIONS.
 
@@ -187,9 +189,7 @@ Return the ID if found, else nil."
 
 (defun org-gnosis-parse-topic (parsed-data)
   "Parse topic information from the PARSED-DATA."
-  (let* ((topic-info (if org-gnosis-denote-p
-(org-gnosis--denote-topic)
-  (org-gnosis-get-data--topic parsed-data)))
+  (let* ((topic-info (org-gnosis-get-data--topic parsed-data))
  (topic-title (nth 0 topic-info))
  (topic-tags (nth 1 topic-info))
  (topic-id (nth 2 topic-info)))
@@ -335,8 +335,9 @@ instead."
   (interactive)
   (let* ((title (or title (if org-gnosis-show-tags
  (org-gnosis-find--with-tags)
-   (completing-read "Select gnosis node: "
-(org-gnosis-select 'title 
'nodes)
+   (funcall org-gnosis-completing-read-func
+"Select gnosis node: "
+(org-gnosis-select 'title 'nodes)
 (file (or file (caar (org-gnosis-select 'file 'nodes `(= title 
,title)
 (id (or id (caar (or id (org-gnosis-select 'id 'nodes `(= title 
,title))
 (directory (or directory org-gnosis-dir)))
@@ -416,16 +417,66 @@ TEMPLATE: Journaling template, refer to 
`org-gnosis-journal-templates'."
 (and (not (file-exists-p file))
  (or template 
(org-gnosis-journal-select-template))
 
+(defun org-gnosis--get-id-at-point ()
+  "Return the Org ID link at point, if any."
+  (let* ((element (org-element-context))
+ (id-link (when (and (eq (org-element-type element) 'link)
+ (string= (org-element-property :type element) 
"id"))
+(org-element-property :path element
+(and id-link id-link)))
+
+
+(defun org-gnosis-goto-id (&optional id)
+  "Visit file for ID."
+  (interactive)
+  (let* ((id (or id (org-gnosis--get-id-at-point)))
+(file (caar (org-gnosis-select 'file 'nodes `(= id ,id)
+(find-file (expand-file-name file org-gnosis-dir))
+(org-gnosis-mode)))
+
+(defvar-keymap org-gnosis-mode-map
+  :doc "org-gnosis keymap"
+  "C-c C-o" #'org-gnosis-goto-id)
+
 (define-minor-mode org-gnosis-mode
   "Org gnosis mode."
   :lighter " org-gnosis"
-  :keymap nil
+  :keymap org-gnosis-mode-map
   :global nil
   :group 'org-gnosis
   (if org-gnosis-mode
   (add-hook 'after-save-hook #'org-gnosis-update-file nil t) ;; buffer 
local hook
 (remove-hook 'after-save-hook #'org-gnosis-update-file)))
 
+(defvar org-gnosis-db-sync-timer nil
+  "Timer for org-gnosis-db-sync minor mode.")
+
+(defvar org-gnosis-db-sync-interval 60
+  "Second interval to sync database.")
+
+(define-minor-mode org-gnosis-db-sync-mode
+  "Minor mode to automatically run `org-gnosis-db-sync` every 30 seconds."
+  :lighter nil
+  :global t
+  (if org-gnosis-db-sync-mode
+  (setq org-gnosis-db-sync-timer
+(run-with-timer 0 org-gnosis-db-sync-interval 
#'org-gnosis-db-sync-async))
+(when org-gnosis-db-sync-timer
+  (cancel-timer org-gnosis-db-sync-timer)
+  (setq org-gnosis-db-sync-timer nil
+
+(defun org-gnosis-db-sync-async ()
+  "Run `org-gnosis-db-sync` asynchronously using a subprocess."
+  (let ((script (concat
+ "(progn "
+ "(require 'org-gnosis) "  ;; Ensure the necessary package is 
loaded
+ "(org-gnosis-db-sync))")))
+(start-process "org-gnosis-db-sync-process"
+   nil
+   "emacs"
+   "--batch"
+   "--eval" script)))
+
 ;; Org-Gnosis Database
 
 (defconst org-gnosis-db-version 1)



[elpa] externals/org-gnosis 2bdd2247b4 22/63: [fix] Add space for filetags.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 2bdd2247b4041f47b7c60cd1829f404ed659c48d
Author: Thanos Apollo 
Commit: Thanos Apollo 

[fix] Add space for filetags.

* Add space to properly insert filetags.
---
 org-gnosis.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index e93dde2978..65175fd29f 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -313,7 +313,7 @@ If called with ARG do not initialize the database."
 org-gnosis-dir
 (find-file file)
 (unless (file-exists-p file)
-  (insert (format "#+title: %s\n#+filetags:\n" title))
+  (insert (format "#+title: %s\n#+filetags: \n" title))
   (org-id-get-create)
   (and extras (insert extras))
   (org-mode)



[elpa] externals/org-gnosis ba63354b4c 36/63: Update commentary & Add node templates.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit ba63354b4cf4ec2063587b2bcd74e40045db46e7
Author: Thanos Apollo 
Commit: Thanos Apollo 

Update commentary & Add node templates.
---
 org-gnosis.el | 41 ++---
 1 file changed, 30 insertions(+), 11 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 4ecb2a1bee..695b8a172d 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -24,7 +24,10 @@
 
 ;;; Commentary:
 
-;; Minimal, Roam Research inspired, note taking tool.
+;; Org Gnosis is a knowledge management system, where notes are stored
+;; in org files under a specified directory.  Files are parsed and
+;; their data is saved in an SQLite databse, making it easier to
+;; retrieve information and view relationships.
 
 ;;; Code:
 
@@ -45,7 +48,15 @@
   '(("Default" "* Daily Notes\n\n* Goals\n+ []")
 ("Empty" ""))
   "Template for journaling."
-  :type 'string
+  :type '(repeat (cons (string :tag "Name")
+   (string :tag "Template")))
+  :group 'org-gnosis)
+
+(defcustom org-gnosis-node-templates
+  '(("Default" ""))
+  "Template for nodes."
+  :type '(repeat (cons (string :tag "Name")
+   (string :tag "Template")))
   :group 'org-gnosis)
 
 (defcustom org-gnosis-journal-dir (expand-file-name "journal" org-gnosis-dir)
@@ -338,21 +349,27 @@ instead."
 (org-gnosis-select 'title 'nodes)
 (file (or file (caar (org-gnosis-select 'file 'nodes `(= title 
,title)
 (id (or id (caar (or id (org-gnosis-select 'id 'nodes `(= title 
,title))
-(directory (or directory org-gnosis-dir)))
+(directory (or directory org-gnosis-dir))
+(node-template (org-gnosis-select-template org-gnosis-node-templates)))
 (cond ((null file)
-  (org-gnosis--create-file title))
+  (org-gnosis--create-file title nil node-template)
+  (org-gnosis-mode))
  ((file-exists-p (expand-file-name file directory))
   (find-file
(expand-file-name file directory))
   (ignore-errors (org-id-goto id))
-  (org-gnosis-mode 1)
+  (org-gnosis-mode)
+
+(defun org-gnosis-select-template (&optional templates)
+  "Select journal template from TEMPLATES.
 
-(defun org-gnosis-journal-select-template (&optional templates)
-  "Selecte journal template from TEMPLATES."
+If templates is only item, return it without a prompt."
   (let* ((templates (or templates org-gnosis-journal-templates))
-(selected (funcall org-gnosis-completing-read-func "Select template:"
-   (mapcar #'car templates)))
-(template (cdr (assoc selected templates
+ (template (if (= (length templates) 1)
+   (cdar templates)
+ (cdr (assoc (funcall org-gnosis-completing-read-func 
"Select template:"
+  (mapcar #'car templates))
+ templates)
 (apply #'append template)))
 
 ;;;###autoload
@@ -424,7 +441,9 @@ TEMPLATE: Journaling template, refer to 
`org-gnosis-journal-templates'."
 (file (expand-file-name (format "%s.org" date) 
org-gnosis-journal-dir)))
 (org-gnosis--create-file date file
 (and (not (file-exists-p file))
- (or template 
(org-gnosis-journal-select-template))
+ (or template
+ (org-gnosis-select-template
+  org-gnosis-journal-templates))
 
 (defun org-gnosis--get-id-at-point ()
   "Return the Org ID link at point, if any."



[elpa] externals/org-gnosis cf35fc5bd8 07/63: Add update-file & create functions.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit cf35fc5bd89f7ac44ee6ff1122cf1897cc42ad73
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add update-file & create functions.
---
 org-gnosis.el | 103 --
 1 file changed, 71 insertions(+), 32 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 363bc4f5c3..6815c5080f 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -188,51 +188,90 @@ INITIAL-TAGS: Initial set of tags to inherit."
append (when id (list (list :node node
:tags (append tags initial-tags)
:id id
-   :top-node nil)))
+   :top-node top-node-id)))
append (org-gnosis-parse-nodes sub-nodes id (append tags 
initial-tags
 
+(defun org-gnosis-update-file (&optional file)
+  "Update contents of FILE in databse.
+
+Removes all contents of FILE in database, adding them anew."
+  (let* ((file (or file (file-name-nondirectory (buffer-file-name
+(nodes (org-gnosis-select 'id 'nodes `(= file ,file) t)))
+(if (null nodes)
+   (org-gnosis--update-file file)
+  (emacsql-with-transaction org-gnosis-db
+  ;; Delete all nodes of file in db
+  (cl-loop for node in nodes
+  do (org-gnosis--delete 'nodes `(= id ,node)))
+  (org-gnosis--update-file file)
+
+(defun org-gnosis--update-file (file)
+  "Add contents of FILE to database."
+  (let* ((data (org-gnosis-get-file-info file))
+(file (plist-get data :file))
+(topic (org-gnosis-adjust-title (nth 0 (plist-get data :topic
+(tags (nth 1 (plist-get data :topic)))
+(hash (nth 2 (plist-get data :topic))) ;; topic id
+(links  (plist-get data :links))) ;; main topic links
+;; Add gnosis topic
+(emacsql-with-transaction org-gnosis-db
+  (org-gnosis--insert-into 'nodes `([,hash ,file ,topic ,tags]))
+  (cl-loop for link in links
+  do (org-gnosis--insert-into 'links `([,hash ,link]
+;; Add nodes of topic
+(cl-loop for node in (org-gnosis-parse-data-recursive
+ (plist-get data :nodes)
+ tags ;; initial topic tags for top node
+ hash ;; node topic hash
+ )
+do
+(let ((title (org-gnosis-adjust-title (plist-get node :node)))
+  (tags (plist-get node :tags))
+  (id (plist-get node :id)))
+  (emacsql-with-transaction org-gnosis-db
+(org-gnosis--insert-into 'nodes `([,id ,file ,title ,tags]))
+;; (org-gnosis--insert-into 'links `([,id ]))
+)
+
 (defun org-gnosis-db-sync ()
   "Sync `org-gnosis-db'."
   (interactive)
+  (org-gnosis-db-init)
   (let ((files (cl-remove-if-not (lambda (file)
   (and (string-match-p "^[0-9]" 
(file-name-nondirectory file))
(not (file-directory-p file
 (directory-files org-gnosis-dir t nil t
 (cl-loop for file in files
-do
-;; Add gnosis topic
-(let* ((data (org-gnosis-get-file-info file))
-   (file (plist-get data :file))
-   (topic (org-gnosis-adjust-title (nth 0 (plist-get data 
:topic
-   (tags (nth 1 (plist-get data :topic)))
-   (hash (nth 2 (plist-get data :topic
-  (emacsql-with-transaction org-gnosis-db
-(org-gnosis--insert-into 'nodes `([,hash ,file ,topic ,tags])))
-  ;; Add nodes
-  (cl-loop for node in (org-gnosis-parse-data-recursive
-(plist-get data :nodes))
-   do
-   (let ((title (org-gnosis-adjust-title (plist-get node 
:node)))
- (tags (plist-get node :tags))
- (id (plist-get node :id)))
- (emacsql-with-transaction org-gnosis-db
-   (org-gnosis--insert-into 'nodes `([,id ,file ,title 
,tags])))
- (message "ok")))
+do (org-gnosis--update-file file
 
 (defun org-gnosis-find--tag-with-tag-prop (lst)
   "Combine each sublist of strings in LST into a single string."
-  (mapcar (lambda (sublist)
-(mapconcat (lambda (element)
- (let ((str (if (stringp element)
-element
-  (format "%s" element ;; Convert to 
string if necessary
-   (if (eq element (car sublist))
-   str
- (propertize (replace-regexp-in-string "," "#" str)
-'face 'org-gnosis-face-ta

[elpa] externals/org-gnosis 2895b38105 52/63: update-file: Add error handling for duplicate titles.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 2895b3810593cf60f842bf28fb556da2e2fbcf71
Author: Thanos Apollo 
Commit: Thanos Apollo 

update-file: Add error handling for duplicate titles.
---
 org-gnosis.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index f7a0e5570d..cc3129f3f7 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -249,7 +249,8 @@ If JOURNAL is non-nil, update file as a journal entry."
 (data (butlast info))
 (table (if journal 'journal 'nodes))
 (filename (file-name-nondirectory file))
-(links (and (> (length info) 1) (apply #'append (last info)
+(links (and (> (length info) 1) (apply #'append (last info
+(titles (org-gnosis-select 'title table '1=1 t)))
 ;; Add gnosis topic
 (message "Parsing: %s" filename)
 (cl-loop for item in data
@@ -259,6 +260,7 @@ If JOURNAL is non-nil, update file as a journal entry."
  (master (plist-get item :master))
  (tags (plist-get item :tags))
  (level (plist-get item :level)))
+ (when (member title titles) (error "Title for node already 
exists"))
  (org-gnosis--insert-into table `([,id ,filename ,title ,level 
,tags]))
  (cl-loop for tag in tags
   do



[elpa] externals/org-gnosis bb781d674f 11/63: db: Restracture journal schema

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit bb781d674f3628587978751247dd44a9b0651026
Author: Thanos Apollo 
Commit: Thanos Apollo 

db: Restracture journal schema
---
 org-gnosis.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index eaeaa57266..6afab9af0b 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -340,7 +340,8 @@ Removes all contents of FILE in database, adding them anew."
  ([(tag-name text :primary-key)]))
 (journal
  ([(id :not-null :primary-key)
-   (title text)
+   (file :not-null)
+   (date text)
tags]))
 ;; (node-tags
 ;;  ([(node-id :not-null)
@@ -350,7 +351,6 @@ Removes all contents of FILE in database, adding them anew."
 (links
  ([(source text)
(dest text)]
-  ;; (:unique (source dest))
   (:foreign-key [source] :references nodes [id] :on-delete :cascade)
   
 



[elpa] externals/org-gnosis 8c3f4ccbcd 57/63: templates: Rewrite as functions.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 8c3f4ccbcd3f3c067d06a345f1c238d66e19d928
Author: Thanos Apollo 
Commit: Thanos Apollo 

templates: Rewrite as functions.

* Templates should be functions that return a string.
---
 org-gnosis.el | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 51f1425745..5a1fb22066 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -48,18 +48,18 @@
   :group 'org-gnosis)
 
 (defcustom org-gnosis-journal-templates
-  '(("Default" "* Daily Notes\n\n* Goals\n+ []")
-("Empty" ""))
-  "Template for journaling."
+  '(("Default" (lambda () (format "* Daily Notes\n\n* Goals\n%s" 
(org-gnosis-todos
+("Empty" (lambda () "")))
+  "Templates for journaling."
   :type '(repeat (cons (string :tag "Name")
-   (string :tag "Template")))
+   (function :tag "Template Function")))
   :group 'org-gnosis)
 
 (defcustom org-gnosis-node-templates
-  '(("Default" ""))
-  "Template for nodes."
+  '(("Default" (lambda () "")))
+  "Templates for nodes."
   :type '(repeat (cons (string :tag "Name")
-   (string :tag "Template")))
+   (function :tag "Template Function")))
   :group 'org-gnosis)
 
 (defcustom org-gnosis-journal-dir (expand-file-name "journal" org-gnosis-dir)



[elpa] externals/org-gnosis 7198e1370f 12/63: [feature] Add journaling & Refactor finding nodes

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 7198e1370f0434e68b5f35242ec92b3b0534a0ad
Author: Thanos Apollo 
Commit: Thanos Apollo 

[feature] Add journaling & Refactor finding nodes
---
 org-gnosis.el | 166 --
 1 file changed, 126 insertions(+), 40 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 6afab9af0b..a7177c90e6 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -41,6 +41,11 @@
   :type 'directory
   :group 'org-gnosis)
 
+(defcustom org-gnosis-journal-dir "~/Notes/journal"
+  "Gnosis journal directory."
+  :type 'directory
+  :group 'org-gnosis)
+
 (defcustom org-gnosis-show-tags nil
   "Display tags with `org-gnosis-find'."
   :type 'boolean
@@ -207,14 +212,25 @@ INITIAL-TAGS: Initial set of tags to inherit."
 
 Removes all contents of FILE in database, adding them anew."
   (let* ((file (or file (file-name-nondirectory (buffer-file-name
-(nodes (org-gnosis-select 'id 'nodes `(= file ,file) t)))
-(if (null nodes)
-   (org-gnosis--update-file file)
-  (emacsql-with-transaction org-gnosis-db
+(journal-p (file-in-directory-p file org-gnosis-journal-dir))
+(nodes (if journal-p
+   (org-gnosis-select 'id 'journal `(= file ,file) t)
+ (org-gnosis-select 'id 'nodes `(= file ,file) t
+(emacsql-with-transaction org-gnosis-db
   ;; Delete all nodes of file in db
   (cl-loop for node in nodes
-  do (org-gnosis--delete 'nodes `(= id ,node)))
-  (org-gnosis--update-file file)
+  do (if journal-p
+ (org-gnosis--delete 'journal `(= id ,node))
+   (org-gnosis--delete 'nodes `(= id ,node
+  (if journal-p
+ (org-gnosis-journal--update-file file)
+   (org-gnosis--update-file file)
+
+(defun org-gnosis--is-journal-entry-p (file)
+  "Check if FILE is a journal entry."
+  (let ((file-dir (file-name-directory (expand-file-name file)))
+(expanded-dir (file-name-as-directory (expand-file-name 
org-gnosis-journal-dir
+(string-equal file-dir expanded-dir)))
 
 (defun org-gnosis--update-file (file)
   "Add contents of FILE to database."
@@ -244,16 +260,41 @@ Removes all contents of FILE in database, adding them 
anew."
 ;; (org-gnosis--insert-into 'links `([,id ]))
 )
 
-(defun org-gnosis-db-sync ()
-  "Sync `org-gnosis-db'."
-  (interactive)
-  (org-gnosis-db-init)
+(defun org-gnosis-journal--update-file (file)
+  "Update database for journal FILE."
+  (let* ((data (org-gnosis-get-file-info file))
+(file (plist-get data :file))
+(tags (nth 1 (plist-get data :topic)))
+(date (org-gnosis-adjust-title (nth 0 (plist-get data :topic
+(hash (nth 2 (plist-get data :topic)))
+(links (plist-get data :links)))
+;; Add journal
+(emacsql-with-transaction org-gnosis-db
+  (org-gnosis--insert-into 'journal `([,hash ,file ,date ,tags])
+
+(defun org-gnosis-db-sync--journal ()
+  "Sync journal entries in databse."
+  (cl-loop for file in (cl-remove-if-not (lambda (file)
+  (and (string-match-p "^[0-9]"
+   
(file-name-nondirectory file))
+   (not (file-directory-p file
+(directory-files 
org-gnosis-journal-dir t nil t))
+  do (org-gnosis-journal--update-file file)))
+
+(defun org-gnosis-db-sync (&optional arg)
+  "Sync `org-gnosis-db'.
+
+If called with ARG do not initialize the database."
+  (interactive "P")
+  (unless arg
+(org-gnosis-db-init))
   (let ((files (cl-remove-if-not (lambda (file)
   (and (string-match-p "^[0-9]" 
(file-name-nondirectory file))
(not (file-directory-p file
 (directory-files org-gnosis-dir t nil t
 (cl-loop for file in files
-do (org-gnosis--update-file file
+do (org-gnosis--update-file file)))
+  (org-gnosis-db-sync--journal))
 
 (defun org-gnosis-find--tag-with-tag-prop (lst)
   "Combine each sublist of strings in LST into a single string."
@@ -270,52 +311,97 @@ Removes all contents of FILE in database, adding them 
anew."
   title)))
 lst))
 
-(defun org-gnosis--create-file (title)
-  "Create node & file for TITLE."
-  (let ((file-name (replace-regexp-in-string "#" ""
-   (replace-regexp-in-string " " "-" title
-(find-file
- (expand-file-name
-  (format "%s--%s.org" (format-time-string "%Y%m%d%H%M%S") file-name)
-  org-gnosis-dir))
-(insert (format "#+title: %s" title))
-(org-mode)
-(org-gnosis-mode)
-(org-id-get-create)
-file-name))
-
-(defun org-gnosis-find--with-tags ()
-  "Select gnosis node with tags."
+(defun org-gnosis--create-file (title

[elpa] externals/org-gnosis cf4e914b65 17/63: adjust-title: Link link ids in node titles.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit cf4e914b65965aa99f06d6a04882e1cf8a4ce62a
Author: Thanos Apollo 
Commit: Thanos Apollo 

adjust-title: Link link ids in node titles.

* Add link ids in titles in databse.
---
 org-gnosis.el | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 6d5e5ebb5b..f2e8899c51 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -173,10 +173,24 @@ FILE: File path"
 (links (org-gnosis-get-links parsed-data)))
 `(:file ,filename :topic ,topic :nodes ,nodes :links ,links)))
 
-(defun org-gnosis-adjust-title (input)
-  "Adjust the INPUT string to replace id link structures with plain text."
+(defun org-gnosis-adjust-title (input &optional node-id)
+  "Adjust the INPUT string to replace id link structures with plain text.
+
+Adjust title INPUT for NODE-ID.  If node-id contains an id link, it's
+inserted as link for NODE-ID in the database."
   (when (stringp input)
-(replace-regexp-in-string "\\[\\[id:[^]]+\\]\\[\\(.*?\\)\\]\\]" "\\1" 
input)))
+(let* ((id-links '())
+  (new-input (replace-regexp-in-string
+   "\\[\\[id:[^]]+\\]\\[\\(.*?\\)\\]\\]"
+   (lambda (match)
+ (push (match-string 1 match) id-links)
+ (match-string 1 match))
+   input)))
+  (when (and node-id id-links)
+   (emacsql-with-transaction org-gnosis-db
+ (cl-loop for link in (reverse id-links)
+  do (org-gnosis--insert-into 'links `([,node-id ,link])
+  new-input)))
 
 (defun org-gnosis-get-file-info (filename)
   "Something FILENAME."



[elpa] externals/org-gnosis 44b4a82031 46/63: [fix]: org-mode bug for creation of files.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 44b4a82031eecf3b4d5eece7ee96a6288160f4e2
Author: Thanos Apollo 
Commit: Thanos Apollo 

[fix]: org-mode bug for creation of files.

* Make sure org-mode is enabled before we run #'org-id-get-create.
* Enable org-gnosis-mode.
---
 org-gnosis.el | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index e33ff274a8..decd88a8ba 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -298,9 +298,8 @@ Removes all contents of FILE in database, adding them anew."
   lst))
 
 (defun org-gnosis--create-file (title &optional file extras)
-  "Create a node and optionally a FILE for TITLE.
-
-  Insert initial Org metadata if the buffer is new or empty."
+  "Create a node FILE for TITLE.
+Insert initial Org metadata if the buffer is new or empty."
   (let* ((file-name (replace-regexp-in-string "#" ""
  (replace-regexp-in-string " " "_" 
title)))
 (file (or file (expand-file-name
@@ -313,11 +312,11 @@ Removes all contents of FILE in database, adding them 
anew."
   (unless (or (file-exists-p file)
  (> (buffer-size) 0))
(insert (format "#+title: %s\n#+filetags: \n" title))
+   (org-mode)
(org-id-get-create)
-   (when extras (insert extras))
-   (org-mode)))
+   (when extras (insert extras
 (switch-to-buffer buffer)
-file-name))
+(org-gnosis-mode 1)))
 
 (defun org-gnosis-find--with-tags (&optional prompt entries)
   "Select gnosis node with tags from ENTRIES.



[elpa] externals/org-gnosis 75d6fd29cb 13/63: Add journal-template

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 75d6fd29cb9296b9893395726adeb10ba4134202
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add journal-template
---
 org-gnosis.el | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/org-gnosis.el b/org-gnosis.el
index a7177c90e6..628ce47544 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -41,6 +41,12 @@
   :type 'directory
   :group 'org-gnosis)
 
+(defcustom org-gnosis-journal-template
+  "* Daily Notes\n\n* Goals\n+ []"
+  "Template for journaling."
+  :type 'string
+  :group 'org-gnosis)
+
 (defcustom org-gnosis-journal-dir "~/Notes/journal"
   "Gnosis journal directory."
   :type 'directory
@@ -281,6 +287,7 @@ Removes all contents of FILE in database, adding them anew."
 (directory-files 
org-gnosis-journal-dir t nil t))
   do (org-gnosis-journal--update-file file)))
 
+;;;###autoload
 (defun org-gnosis-db-sync (&optional arg)
   "Sync `org-gnosis-db'.
 
@@ -346,6 +353,7 @@ instead."
   (completing-read prompt entries
 entry))
 
+;;;###autoload
 (defun org-gnosis-find (&optional title file id directory)
   "Select gnosis node."
   (interactive)
@@ -364,6 +372,7 @@ instead."
   (ignore-errors (org-id-goto id))
   (org-gnosis-mode 1)
 
+;;;###autoload
 (defun org-gnosis-insert ()
   "Insert gnosis node."
   (interactive)
@@ -373,6 +382,7 @@ instead."
 (id (concat "id:" (car (org-gnosis-select 'id 'nodes `(= ,node title) 
'1=1)
 (org-insert-link nil id node)))
 
+;;;###autoload
 (defun org-gnosis-journal-find (&optional date)
   "Find journal entry for DATE."
   (interactive)
@@ -385,6 +395,7 @@ instead."
 (file (car (org-gnosis-select 'file 'journal `(= date ,date) t
 (org-gnosis-find date file id org-gnosis-journal-dir)))
 
+;;;###autoload
 (defun org-gnosis-journal-insert ()
   "Insert journal entry."
   (interactive)



[elpa] externals/org-gnosis f4d43a0278 49/63: [Rewrite] goto-id: Add support for journals.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit f4d43a0278da28e59dd4173a1d01e25bb9f160f9
Author: Thanos Apollo 
Commit: Thanos Apollo 

[Rewrite] goto-id: Add support for journals.

* Add support for opening journal entries.
* Rewrite using a cond statement
* Make sure org-gnosis-mode is enabled.
---
 org-gnosis.el | 22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 6d8529943b..ebe79837f4 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -468,20 +468,26 @@ TEMPLATE: Journaling template, refer to 
`org-gnosis-journal-templates'."
  (id-link (when (and (eq (org-element-type element) 'link)
  (string= (org-element-property :type element) 
"id"))
 (org-element-property :path element
-(and id-link id-link)))
-
+id-link))
 
 (defun org-gnosis-goto-id (&optional id)
   "Visit file for ID.
 
 If file or id are not found, use `org-open-at-point'."
   (interactive)
-  (let* ((id (or id (org-gnosis--get-id-at-point)))
-(file (caar (org-gnosis-select 'file 'nodes `(= id ,id)
-(if (and id file)
-   (progn (find-file (expand-file-name file org-gnosis-dir))
-  (org-gnosis-mode))
-  (org-open-at-point
+  (let* ((id (or id (org-gnosis--get-id-at-point
+(cond ((org-gnosis-select 'file 'nodes `(= id ,id))
+  (find-file
+   (expand-file-name (car (org-gnosis-select 'file 'nodes `(= id ,id) 
t))
+ org-gnosis-dir))
+  (org-id-goto id))
+ ((org-gnosis-select 'file 'journal `(= id ,id))
+  (find-file
+   (expand-file-name (car (org-gnosis-select 'file 'journal `(= id 
,id) t))
+ org-gnosis-journal-dir))
+  (org-id-goto id))
+ (t (org-open-at-point)))
+(org-gnosis-mode 1)))
 
 (defvar-keymap org-gnosis-mode-map
   :doc "org-gnosis keymap"



[elpa] externals/org-gnosis 5bcbca8fcc 20/63: Rewrite buffer parsing

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 5bcbca8fccbd46c7fc4efa0cad6ee270111d77e2
Author: Thanos Apollo 
Commit: Thanos Apollo 

Rewrite buffer parsing
---
 org-gnosis.el | 256 +-
 1 file changed, 109 insertions(+), 147 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index a3db8bec10..0291cc1630 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -97,83 +97,6 @@ Optional argument FLATTEN, when non-nil, flattens the 
result."
   "Drop TABLE from `gnosis-db'."
   (emacsql org-gnosis-db `[:drop-table ,table]))
 
-(defun org-gnosis-get-current-node-title ()
-  "Return the title of the current node."
-  (when (derived-mode-p 'org-mode)
-(let* ((parsed-data (org-element-parse-buffer))
-   (title (org-element-map parsed-data 'keyword
-(lambda (kw)
-  (when (string-equal (org-element-property :key kw) 
"TITLE")
-(org-element-property :value kw)))
-nil t)))
-  title)))
-
-(defun org-gnosis-get-filetags (&optional parsed-data)
-  "Return the filetags of the buffer's PARSED-DATA as a comma-separated 
string."
-  (let* ((parsed-data (or parsed-data (org-element-parse-buffer)))
- (filetags (org-element-map parsed-data 'keyword
- (lambda (kw)
-   (when (string-equal (org-element-property :key kw) 
"FILETAGS")
- (org-element-property :value kw)))
- nil t)))
-(and filetags (remove "" (split-string filetags ":")
-
-(defun org-gnosis-get-links (contents)
-  "Recursively collect all node id links from CONTENTS."
-  (org-element-map contents 'link
-(lambda (link)
-  (when (string-equal "id" (org-element-property :type link))
-(org-element-property :path link)
-
-(defun org-gnosis-process-node (node)
-  "Process a single headline NODE and return information as a list."
-  (let ((title (org-element-property :raw-value node))
-(tags (org-element-property :tags node))
-(id (org-element-property :ID node))
-   (links (org-gnosis-get-links (org-element-contents node)))
-(children (org-element-contents node)))
-(when title
-  (list title tags id
-(org-gnosis-process-children children (1+ (org-element-property 
:level node)))
-   links
-
-(defun org-gnosis-process-children (nodes level)
-  "Recursively process NODES at a given LEVEL."
-  (let (result)
-(while nodes
-  (let ((current-node (car nodes))
-(current-level (org-element-property :level (car nodes
-(if (and current-level (= current-level level))
-(progn
-  (push (org-gnosis-process-node current-node) result)
-  (setq nodes (cdr nodes)))
-  (setq nodes (cdr nodes)
-(nreverse result)))
-
-(defun org-gnosis-get-data--nodes (&optional parsed-data)
-  "Return a hierarchical list of nodes with titles, tags, and IDs from 
PARSED-DATA."
-  (let ((parsed-data (or parsed-data (org-element-parse-buffer
-(org-gnosis-process-children (org-element-map parsed-data 'headline 
#'identity) 1)))
-
-(defun org-gnosis-get-data--topic (&optional parsed-data)
-  "Retrieve the title and ID from the current org buffer or given PARSED-DATA."
-  (let* ((parsed-data (or parsed-data (org-element-parse-buffer)))
- (title (org-element-map parsed-data 'keyword
-  (lambda (kw)
-(when (string= (org-element-property :key kw) "TITLE")
-  (org-element-property :value kw)))
-  nil t))
- (id (org-element-map parsed-data 'property-drawer
-(lambda (drawer)
-  (org-element-map (org-element-contents drawer) 'node-property
-(lambda (prop)
-  (when (string= (org-element-property :key prop) "ID")
-(org-element-property :value prop)))
-nil t))
-nil t))
-(tags (org-gnosis-get-filetags)))
-(list title tags id)))
-
 (defun org-gnosis-get--data (file)
   "Return data for FILE.
 
@@ -204,40 +127,77 @@ inserted as link for NODE-ID in the database."
   do (org-gnosis--insert-into 'links `([,node-id ,link])
   new-input)))
 
+(defun org-gnosis-parse-headline (headline inherited-tags topic-id)
+  "Parse a single headline element."
+  (let* ((title (org-element-property :raw-value headline))
+ (id (org-element-property :ID headline))
+ (level (org-element-property :level headline))
+ (tags (org-element-property :tags headline))
+ (links (org-collect-id-links headline))
+ (combined-tags (inherit-tags inherited-tags tags))
+ (master (if (= level 1) topic-id
+   (org-element-property :ID (org-element-property :parent 
headline)
+(when id
+  (list :title title :id id :links links :tag

[elpa] externals/org-gnosis 64730a608e 29/63: completing-read-func: Use org-completing-read.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 64730a608e30f11312641a85fca4cf08deb4ef5c
Author: Thanos Apollo 
Commit: Thanos Apollo 

completing-read-func: Use org-completing-read.
---
 org-gnosis.el | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 80d05eebda..39319ad767 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -42,7 +42,7 @@
   :group 'org-gnosis)
 
 (defcustom org-gnosis-journal-templates
-  '(("default" "* Daily Notes\n\n* Goals\n+ []")
+  '(("Default" "* Daily Notes\n\n* Goals\n+ []")
 ("Empty" ""))
   "Template for journaling."
   :type 'string
@@ -58,13 +58,7 @@
   :type 'boolean
   :group 'org-gnosis)
 
-(defcustom org-gnosis-completing-read-func
-  (cond ((or (bound-and-true-p ivy-mode)
-(bound-and-true-p helm-mode)
-(bound-and-true-p vertico-mode)
-(bound-and-true-p fido-mode))
-#'completing-read)
-   (t #'ido-completing-read))
+(defcustom org-gnosis-completing-read-func #'org-completing-read
   "Function to use for `completing-read'."
   :type 'function
   :group 'gnosis)



[elpa] externals/org-gnosis 0fea7521ed 42/63: create-file: fix insertion of template.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 0fea7521ed6497dd3c8c951b06f77a4ef1879009
Author: Thanos Apollo 
Commit: Thanos Apollo 

create-file: fix insertion of template.

* If buffer-size is above zero, do not insert a template.
---
 org-gnosis.el | 37 ++---
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 3735afd3b6..b5ea284d35 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -75,7 +75,7 @@
 (defcustom org-gnosis-completing-read-func #'org-completing-read
   "Function to use for `completing-read'."
   :type 'function
-  :group 'gnosis)
+  :group 'org-gnosis)
 
 (defface org-gnosis-face-tags
   '((t :inherit font-lock-type-face))
@@ -88,7 +88,8 @@
   "Select VALUE from TABLE, optionally with RESTRICTIONS.
 
 Optional argument FLATTEN, when non-nil, flattens the result."
-  (let ((output (emacsql org-gnosis-db `[:select ,value :from ,table :where 
,restrictions])))
+  (let ((output (emacsql org-gnosis-db
+`[:select ,value :from ,table :where ,restrictions])))
 (if flatten
(apply #'append output)
   output)))
@@ -299,20 +300,26 @@ Removes all contents of FILE in database, adding them 
anew."
   lst))
 
 (defun org-gnosis--create-file (title &optional file extras)
-  "Create node & FILE for TITLE."
-  (let* ((file-name (replace-regexp-in-string "#" "" ;; hashtags are used for 
tags
- (replace-regexp-in-string " " "-" 
title)))
+  "Create a node and optionally a FILE for TITLE.
+
+  Insert initial Org metadata if the buffer is new or empty."
+  (let* ((file-name (replace-regexp-in-string "#" ""
+ (replace-regexp-in-string " " "_" 
title)))
 (file (or file (expand-file-name
-(format "%s--%s.org" (format-time-string 
"%Y%m%d%H%M%S") file-name)
-org-gnosis-dir
-(find-file file)
-(unless (file-exists-p file)
-  (insert (format "#+title: %s\n#+filetags: \n" title))
-  (org-id-get-create)
-  (and extras (insert extras))
-  (org-mode)
-  (org-gnosis-mode)
-  file-name)))
+(format "%s--%s.org"
+(format-time-string "%Y%m%d%H%M%S")
+file-name)
+org-gnosis-dir)))
+(buffer (find-file-noselect file)))
+(with-current-buffer buffer
+  (unless (or (file-exists-p file)
+ (> (buffer-size) 0))
+   (insert (format "#+title: %s\n#+filetags: \n" title))
+   (org-id-get-create)
+   (when extras (insert extras))
+   (org-mode)))
+(switch-to-buffer buffer)
+file-name))
 
 (defun org-gnosis-find--with-tags (&optional prompt entries)
   "Select gnosis node with tags from ENTRIES.



[elpa] externals/org-gnosis 604a57a702 31/63: [Feature] Add denote notes support.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 604a57a702b3a4ea319c4b0ea57f47bcf53f8d91
Author: Thanos Apollo 
Commit: Thanos Apollo 

[Feature] Add denote notes support.
---
 org-gnosis.el | 36 
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 357921aeea..514ba1be5f 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -1,4 +1,4 @@
-;;; org-gnosis.el --- Org Note Management System  -*- lexical-binding: t; -*-
+;;; org-gnosis.el --- Roam-like Note Management System  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 2024-2025  Thanos Apollo
 
@@ -24,7 +24,7 @@
 
 ;;; Commentary:
 
-;; Under development
+;; Minimal, Roam Research inspired, note taking tool.
 
 ;;; Code:
 
@@ -36,7 +36,7 @@
   "Note Taking System."
   :group 'external)
 
-(defcustom org-gnosis-dir "~/Notes"
+(defcustom org-gnosis-dir (expand-file-name "Notes" "~")
   "Directory with gnosis notes."
   :type 'directory
   :group 'org-gnosis)
@@ -63,6 +63,11 @@
   :type 'function
   :group 'gnosis)
 
+(defcustom org-gnosis-denote-p nil
+  "Use org-gnosis databse for denote notes."
+  :group 'org-gnosis
+  :type 'boolean)
+
 (defface org-gnosis-face-tags
   '((t :inherit font-lock-type-face))
   "Face for displaying gnosis with `org-gnosis-find'."
@@ -174,6 +179,27 @@ Return the ID if found, else nil."
 (tags (org-gnosis-get-filetags)))
 (list title tags id)))
 
+(defun org-gnosis--denote-topic ()
+  "Parse current buffer for denote file format."
+  (save-excursion
+(goto-char (point-min))
+(let ((title nil)
+  (tags nil)
+  (identifier nil))
+  (when (or (re-search-forward "^title:\\s-*\\(.*\\)$" nil t)
+(re-search-forward "^#\\+title:\\s-*\\(.*\\)$" nil t))
+(setq title (match-string-no-properties 1)))
+  (when (or (re-search-forward "^tags:\\s-*\\(.*\\)$" nil t)
+(re-search-forward "^#\\+filetags:\\s-*\\(.*\\)$" nil t))
+(setq tags (if (string-match-p ":" (match-string-no-properties 1))
+   (split-string (match-string-no-properties 1) ":")
+ (split-string (match-string-no-properties 1
+(setq tags (delete "" tags)))
+  (when (or (re-search-forward "^identifier:\\s-*\\(.*\\)$" nil t)
+(re-search-forward "^#\\+identifier:\\s-*\\(.*\\)$" nil t))
+(setq identifier (match-string-no-properties 1)))
+  (list title tags identifier
+
 ;; This one is used mostly for topic
 (defun org-gnosis-get-filetags (&optional parsed-data)
   "Return the filetags of the buffer's PARSED-DATA as a comma-separated 
string."
@@ -187,7 +213,9 @@ Return the ID if found, else nil."
 
 (defun org-gnosis-parse-topic (parsed-data)
   "Parse topic information from the PARSED-DATA."
-  (let* ((topic-info (org-gnosis-get-data--topic parsed-data))
+  (let* ((topic-info (if org-gnosis-denote-p
+(org-gnosis--denote-topic)
+  (org-gnosis-get-data--topic parsed-data)))
  (topic-title (nth 0 topic-info))
  (topic-tags (nth 1 topic-info))
  (topic-id (nth 2 topic-info)))



[elpa] externals/org-gnosis c9c0829505 50/63: journal-insert: Update values for new schema.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit c9c082950590d7dc4044043481632a9dec230a42
Author: Thanos Apollo 
Commit: Thanos Apollo 

journal-insert: Update values for new schema.
---
 org-gnosis.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index ebe79837f4..027cd4e481 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -442,10 +442,10 @@ If node does not exist, create it."
   "Insert journal entry."
   (interactive)
   (let* ((node (org-gnosis--find "Select journal entry: "
-(org-gnosis-select '[date tags] 'journal '1=1)
-(org-gnosis-select 'date 'journal '1=1)))
+(org-gnosis-select '[title tags] 'journal '1=1)
+(org-gnosis-select 'title 'journal '1=1)))
 (node-id (concat "id:"
- (car (org-gnosis-select 'id 'journal `(= ,node date) 
'1=1)
+ (car (org-gnosis-select 'id 'journal `(= ,node title) 
'1=1)
 (org-insert-link nil node-id node)))
 
 ;;;###autoload



[elpa] externals/org-gnosis bf81cdd64a 51/63: Separate creation of filename & add custom timestring.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit bf81cdd64a65b067bc98bdfa784c42a414cc5688
Author: Thanos Apollo 
Commit: Thanos Apollo 

Separate creation of filename & add custom timestring.

* Add org-gnosis--create-name function, separating the filename creation
  based on a customizable timestring.
---
 org-gnosis.el | 27 +++
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 027cd4e481..f7a0e5570d 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -72,6 +72,11 @@
   :type 'boolean
   :group 'org-gnosis)
 
+(defcustom org-gnosis-timestring "%Y%m%d%H%M%S"
+  "Timestring used for the creation of file."
+  :type 'string
+  :group 'org-gnosis)
+
 (defcustom org-gnosis-completing-read-func #'org-completing-read
   "Function to use for `completing-read'."
   :type 'function
@@ -297,16 +302,22 @@ Removes all contents of FILE in database, adding them 
anew."
title)))
   lst))
 
-(defun org-gnosis--create-file (title &optional file extras)
+(defun org-gnosis--create-name (title &optional timestring)
+  "Create filename for TITLE.
+
+TIMESTRING defaults to `org-gnosis-timestring'"
+  (let ((timestring (or timestring org-gnosis-timestring))
+   (filename (replace-regexp-in-string "#" ""
+   (replace-regexp-in-string " " "_" 
title
+(format "%s--%s.org" (format-time-string timestring) filename)))
+
+(defun org-gnosis--create-file (title &optional directory extras)
   "Create a node FILE for TITLE.
+
 Insert initial Org metadata if the buffer is new or empty."
-  (let* ((file-name (replace-regexp-in-string "#" ""
- (replace-regexp-in-string " " "_" 
title)))
-(file (or file (expand-file-name
-(format "%s--%s.org"
-(format-time-string "%Y%m%d%H%M%S")
-file-name)
-org-gnosis-dir)))
+  (let* ((file (expand-file-name
+   (org-gnosis--create-name title)
+   (or directory org-gnosis-dir)))
 (buffer (find-file-noselect file)))
 (with-current-buffer buffer
   (unless (or (file-exists-p file)



[elpa] externals/org-gnosis 0573178562 58/63: Add custom bullet-point-char & todo-files.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 0573178562b20ea0fd5c362ef4ba943cd57404a5
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add custom bullet-point-char & todo-files.
---
 org-gnosis.el | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/org-gnosis.el b/org-gnosis.el
index 5a1fb22066..a724db00a1 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -77,11 +77,21 @@
   :type 'string
   :group 'org-gnosis)
 
+(defcustom org-gnosis-todo-files org-agenda-files
+  "TODO files used for the journal entries."
+  :type '(repeat string)
+  :group 'org-gnosis)
+
 (defcustom org-gnosis-completing-read-func #'org-completing-read
   "Function to use for `completing-read'."
   :type 'function
   :group 'org-gnosis)
 
+(defcustom org-gnosis-bullet-point-char "+"
+  "String to indicate a bullet point."
+  :type 'string
+  :group 'org-gnosis)
+
 (defface org-gnosis-face-tags
   '((t :inherit font-lock-type-face))
   "Face for displaying gnosis with `org-gnosis-find'."



[elpa] externals/org-gnosis c1234ac1eb 16/63: get-links: Get all links for contents

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit c1234ac1ebc4614021c4813eff6e0485faafcd68
Author: Thanos Apollo 
Commit: Thanos Apollo 

get-links: Get all links for contents

* Remove restrictions for retrieval of links only from headlines.
---
 org-gnosis.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 29a578c381..6d5e5ebb5b 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -111,8 +111,7 @@ Optional argument FLATTEN, when non-nil, flattens the 
result."
   (org-element-map contents 'link
 (lambda (link)
   (when (string-equal "id" (org-element-property :type link))
-(org-element-property :path link)))
-nil nil 'headline))
+(org-element-property :path link)
 
 (defun org-gnosis-process-node (node)
   "Process a single headline NODE and return information as a list."



[elpa] externals/org-gnosis a3913dd687 62/63: Add support for selecting multiple tags

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit a3913dd687c1c586d27b2a5f7cbc6ae09e6251e8
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add support for selecting multiple tags

* Add org-gnosis-insert-tags
* Use completing-read-multiple to select more than one tag to be inserted
---
 org-gnosis.el | 22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index ee52bd0c75..75e4b44940 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -352,7 +352,10 @@ TIMESTRING defaults to `org-gnosis-timestring'"
 (defun org-gnosis--create-file (title &optional directory extras)
   "Create a node FILE for TITLE.
 
-Insert initial Org metadata if the buffer is new or empty."
+Insert initial Org metadata if the buffer is new or empty.
+
+DIRECTORY: Directory where the file is created.
+EXTRAS: The template to be inserted at the start."
   (let* ((file (expand-file-name
(org-gnosis--create-name title)
(or directory org-gnosis-dir)))
@@ -462,12 +465,12 @@ If JOURNAL-P is non-nil, retrieve/create node as a 
journal entry."
   (message "Created new node: %s" node))
  (t (org-insert-link nil id node)
 
-;;;###autoload
-(defun org-gnosis-insert-tag ()
-  "Insert filetag."
+
+(defun org-gnosis-insert-tag (&optional tag)
+  "Insert TAG as filetag."
   (interactive)
   (let* ((filetags (org-gnosis-select 'tag 'tags '1=1 t))
- (tag (funcall org-gnosis-completing-read-func "Select tag: " 
filetags)))
+ (tag (or tag (funcall org-gnosis-completing-read-func "Select tag: " 
filetags
 (save-excursion
   (goto-char (point-min))
   (if (re-search-forward "^#\\+FILETAGS:" nil t)
@@ -478,6 +481,15 @@ If JOURNAL-P is non-nil, retrieve/create node as a journal 
entry."
   (insert "#+FILETAGS: :" tag ":")
   (newline))
 
+;;;###autoload
+(defun org-gnosis-insert-tags (tags)
+  "Insert TAGS as filetags."
+  (interactive (list (completing-read-multiple
+ "Select tags (seperated by ,): "
+ (org-gnosis-select 'tag 'tags '1=1 t
+  (dolist (tag tags)
+(org-gnosis-insert-tag tag)))
+
 ;;;###autoload
 (defun org-gnosis-journal-find (&optional title)
   "Find journal entry for TITLE."



[elpa] externals/org-gnosis 7f68a27e4f 41/63: db: Remove extra table deletion.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 7f68a27e4f3221b58238b46ede55c852eeb318b5
Author: Thanos Apollo 
Commit: Thanos Apollo 

db: Remove extra table deletion.
---
 org-gnosis.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 50c5e39897..3735afd3b6 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -565,7 +565,6 @@ If called with ARG do not initialize the database."
   (when (length< (emacsql org-gnosis-db
  [:select name :from sqlite-master :where (= type 
table)])
 3)
-(org-gnosis-db-delete-tables)
 (emacsql-with-transaction org-gnosis-db
   (pcase-dolist (`(,table ,schema) org-gnosis-db--table-schemata)
(emacsql org-gnosis-db [:create-table $i1 $S2] table schema))



[elpa] externals/org-gnosis 4809388113 30/63: Refactor parsing for links & Add journal level entries.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 4809388113a4f04adaf239d0abf8de4c95cee04b
Author: Thanos Apollo 
Commit: Thanos Apollo 

Refactor parsing for links & Add journal level entries.
---
 org-gnosis.el | 162 --
 1 file changed, 89 insertions(+), 73 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 39319ad767..357921aeea 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -111,35 +111,51 @@ inserted as link for NODE-ID in the database."
   new-input)))
 
 (defun org-gnosis-parse-headline (headline inherited-tags topic-id)
-  "Parse a single headline and return a plist with its info."
+  "Parse a HEADLINE and return a plist with its info.
+
+INHERITED-TAGS: Upper level headline tags.
+TOPIC-ID: Topic hash id."
   (let* ((title (org-element-property :raw-value headline))
  (id (org-element-property :ID headline))
  (level (org-element-property :level headline))
  (tags (or (org-element-property :tags headline) inherited-tags))
  (all-tags (delete-dups (append inherited-tags tags)))
- (links (org-gnosis-collect-id-links headline))
  (master (if (= level 1) topic-id
(org-element-property :ID (org-element-property :parent 
headline)
 (and id
- (list :title title :id id :links links :tags all-tags :master 
master
-
-(defun org-gnosis-collect-id-links (element)
-  "Collect all ID links within ELEMENT that start with id:."
-  (org-element-map element 'link
-(lambda (link)
-  (let ((raw-link (org-element-property :raw-link link)))
-(when (string-prefix-p "id:" raw-link)
-  (substring raw-link 3
-nil nil t))
+ (list :title title :id id :tags all-tags :master master :level 
level
+
+(defun org-gnosis-get-id ()
+  "Find the nearest ID property searching up the outline hierarchy.
+
+Return the ID if found, else nil."
+  (save-excursion
+(while (and (not (org-entry-get nil "ID"))
+(not (bobp)))
+  (ignore-errors
+(if (> (funcall outline-level) 1)
+   ;; Adjust for level <1 headings that do not have a level 1 heading.
+(or (org-up-heading-safe) (goto-char (point-min)))
+   (org-up-heading-safe)
+  (goto-char (point-min)
+(org-entry-get nil "ID")))
+
+(defun org-gnosis-collect-id-links ()
+  "Collect ID links and current headline ID as (link-id . headline-id) pairs."
+  (let ((links nil)
+(begin (point-min))
+(end (point-max)))
+(save-excursion
+  (goto-char begin)
+  (while (re-search-forward org-link-any-re end t)
+(let ((link (match-string-no-properties 0)))
+  (when (string-match "id:\\([^]]+\\)" link)
+(push (cons (match-string 1 link) (org-gnosis-get-id)) links)
+(nreverse links)))
 
 (defun org-gnosis-get-data--topic (&optional parsed-data)
   "Retrieve the title and ID from the current org buffer or given PARSED-DATA."
   (let* ((parsed-data (or parsed-data (org-element-parse-buffer)))
- (title (org-element-map parsed-data 'keyword
-  (lambda (kw)
-(when (string= (org-element-property :key kw) "TITLE")
-  (org-element-property :value kw)))
-  nil t))
  (id (org-element-map parsed-data 'property-drawer
(lambda (drawer)
  (org-element-map (org-element-contents drawer) 'node-property
@@ -148,6 +164,13 @@ inserted as link for NODE-ID in the database."
(org-element-property :value prop)))
nil t))
nil t))
+(title (org-gnosis-adjust-title
+(org-element-map parsed-data 'keyword
+  (lambda (kw)
+(when (string= (org-element-property :key kw) "TITLE")
+  (org-element-property :value kw)))
+  nil t)
+id))
 (tags (org-gnosis-get-filetags)))
 (list title tags id)))
 
@@ -167,10 +190,10 @@ inserted as link for NODE-ID in the database."
   (let* ((topic-info (org-gnosis-get-data--topic parsed-data))
  (topic-title (nth 0 topic-info))
  (topic-tags (nth 1 topic-info))
- (topic-id (nth 2 topic-info))
- (topic-links (org-gnosis-collect-id-links parsed-data)))
+ (topic-id (nth 2 topic-info)))
 (when topic-id
-  (list :title topic-title :id topic-id :links topic-links :tags 
topic-tags :master 0
+  (list :title topic-title
+   :id topic-id :tags topic-tags :master 0 :level 0
 
 (defun org-gnosis-buffer-data (&optional data)
   "Parse DATA in current buffer for topics & headlines with their ID, tags, 
links."
@@ -186,8 +209,6 @@ inserted as link for NODE-ID in the database."
   (when parsed-headline
 (push parsed-headline headlines)
 (push (plist-get parsed-headline :id) all-ids)
-(when topic
- 

[nongnu] elpa/multiple-cursors 758223c45b 2/3: Merge pull request #388 from emacsmirror/expkg

2025-02-10 Thread ELPA Syncer
branch: elpa/multiple-cursors
commit 758223c45bb79530c2c76fe14495eee706d49630
Merge: dd10cf2334 bb07ffee68
Author: Magnar Sveen 
Commit: GitHub 

Merge pull request #388 from emacsmirror/expkg

Move metadata from multiple-cursors-pkg.el to multiple-cursors.el
---
 multiple-cursors-pkg.el | 3 ---
 multiple-cursors.el | 1 +
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/multiple-cursors-pkg.el b/multiple-cursors-pkg.el
deleted file mode 100644
index 2087f25ea4..00
--- a/multiple-cursors-pkg.el
+++ /dev/null
@@ -1,3 +0,0 @@
-(define-package "multiple-cursors" "1.4.0"
-  "Multiple cursors for Emacs."
-  '((cl-lib "0.5")))
diff --git a/multiple-cursors.el b/multiple-cursors.el
index 8c3e14814e..c510a800c9 100644
--- a/multiple-cursors.el
+++ b/multiple-cursors.el
@@ -4,6 +4,7 @@
 
 ;; Author: Magnar Sveen 
 ;; Version: 1.4.0
+;; Package-Requires: ((cl-lib "0.5"))
 ;; Keywords: editing cursors
 ;; Homepage: https://github.com/magnars/multiple-cursors.el
 



[nongnu] elpa/haskell-mode 7f452cc9e6 2/2: Merge pull request #1864 from pacastega/imenu-preserve-order

2025-02-10 Thread ELPA Syncer
branch: elpa/haskell-mode
commit 7f452cc9e6c3316b5a4a2b790d3a396f271609d9
Merge: 80054782bf d7b05e4b04
Author: Steve Purcell 
Commit: GitHub 

Merge pull request #1864 from pacastega/imenu-preserve-order

Add user option to preserve the order of imenu candidates
---
 haskell-decl-scan.el | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/haskell-decl-scan.el b/haskell-decl-scan.el
index f32515ac6f..8299f34e61 100644
--- a/haskell-decl-scan.el
+++ b/haskell-decl-scan.el
@@ -124,6 +124,11 @@
   :group 'haskell-decl-scan
   :type 'boolean)
 
+(defcustom haskell-decl-scan-sort-imenu t
+  "Whether to sort the candidates in imenu."
+  :group 'haskell-decl-scan
+  :type 'boolean)
+
 ;;
 ;; General declaration scanning functions.
 
@@ -562,15 +567,21 @@ datatypes) in a Haskell file for the `imenu' package."
 (import   . "Imports")   (class. "Classes")))
   (when-let ((curr-alist (gethash (car type) imenu)))
 (push (cons (cdr type)
-(sort curr-alist 'haskell-ds-imenu-label-cmp))
+(if haskell-decl-scan-sort-imenu
+(sort curr-alist 'haskell-ds-imenu-label-cmp)
+  (reverse curr-alist)))
   index-alist)))
 (when-let ((var-alist (gethash 'variable imenu)))
   (if haskell-decl-scan-bindings-as-variables
   (push (cons "Variables"
-  (sort var-alist 'haskell-ds-imenu-label-cmp))
+  (if haskell-decl-scan-sort-imenu
+  (sort var-alist 'haskell-ds-imenu-label-cmp)
+(reverse var-alist)))
 index-alist)
 (setq index-alist (append index-alist
-  (sort var-alist 
'haskell-ds-imenu-label-cmp)
+  (if haskell-decl-scan-sort-imenu
+  (sort var-alist 
'haskell-ds-imenu-label-cmp)
+(reverse var-alist))
 ;; Return the alist.
 index-alist))
 



[elpa] externals/org-gnosis dc599a68fa 14/63: [fix] title adjust & journal-insert

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit dc599a68fa34cbdd2a682bfe99b61398f5b1100d
Author: Thanos Apollo 
Commit: Thanos Apollo 

[fix] title adjust & journal-insert
---
 org-gnosis.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 628ce47544..be96e1b42f 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -47,7 +47,7 @@
   :type 'string
   :group 'org-gnosis)
 
-(defcustom org-gnosis-journal-dir "~/Notes/journal"
+(defcustom org-gnosis-journal-dir (expand-file-name "journal" org-gnosis-dir)
   "Gnosis journal directory."
   :type 'directory
   :group 'org-gnosis)
@@ -176,7 +176,8 @@ FILE: File path"
 
 (defun org-gnosis-adjust-title (input)
   "Adjust the INPUT string to replace id link structures with plain text."
-  (replace-regexp-in-string "\\[\\[id:[^]]+\\]\\[\\(.*?\\)\\]\\]" "\\1" input))
+  (when (stringp input)
+(replace-regexp-in-string "\\[\\[id:[^]]+\\]\\[\\(.*?\\)\\]\\]" "\\1" 
input)))
 
 (defun org-gnosis-get-file-info (filename)
   "Something FILENAME."
@@ -402,8 +403,8 @@ instead."
   (let* ((node (org-gnosis--find "Select journal entry: "
  (org-gnosis-select '[date tags] 'journal '1=1)
  (org-gnosis-select 'date 'journal '1=1)))
-(id (concat "id:" (car (org-gnosis-select 'id 'nodes `(= ,node title) 
'1=1)
-(org-insert-link nil id node)))
+(node-id (concat "id:" (car (org-gnosis-select 'id 'journal `(= ,node 
date) '1=1)
+(org-insert-link nil node-id node)))
 
 (defun org-gnosis-journal (&optional template)
   "Start journaling for current date."



[elpa] externals/org-gnosis ff2332d87a 10/63: db: Update schemata & syncing

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit ff2332d87a5d022286ad209a8b04291b010ad561
Author: Thanos Apollo 
Commit: Thanos Apollo 

db: Update schemata & syncing

* Drop all tables upong synching & reinit
---
 org-gnosis.el | 47 ++-
 1 file changed, 30 insertions(+), 17 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 99d8037afe..eaeaa57266 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -336,32 +336,45 @@ Removes all contents of FILE in database, adding them 
anew."
(file :not-null)
(title text)
tags]))
-(refs
- ([(node-id :not-null)
-   (ref :not-null)
-   (type :not-null)]
-  (:foreign-key [node-id] :references nodes [id] :on-delete :cascade)))
+(tags
+ ([(tag-name text :primary-key)]))
+(journal
+ ([(id :not-null :primary-key)
+   (title text)
+   tags]))
+;; (node-tags
+;;  ([(node-id :not-null)
+;;(tags :not-null)
+;;(:foreign-key [node-id] :references nodes [id] :on-delete :cascade)
+;;(:foreign-key [tags] :references tags [tag-name] :on-delete 
:cascade)]))
 (links
- ([(source :not-null)
-   (dest :not-null)]
-  (:foreign-key [source] :references nodes [id] :on-delete :cascade)
-
-(defconst org-gnosis-db--table-indices
-  '((refs-node-id refs [node-id])))
+ ([(source text)
+   (dest text)]
+  ;; (:unique (source dest))
+  (:foreign-key [source] :references nodes [id] :on-delete :cascade)
+  
+
+(defun org-gnosis-db-delete-tables ()
+  "Drop all tables."
+  (ignore-errors
+(emacsql-with-transaction org-gnosis-db
+(org-gnosis--drop-table 'nodes)
+(org-gnosis--drop-table 'tags)
+(org-gnosis--drop-table 'journal)
+(org-gnosis--drop-table 'links
 
 (defun org-gnosis-db-init ()
   "Initialize database DB with the correct schema and user version."
-  (unless (length= (emacsql org-gnosis-db
+  (setf org-gnosis-db (emacsql-sqlite-open (locate-user-emacs-file 
"org-gnosis.db")))
+  (org-gnosis-db-delete-tables)
+  (when (length< (emacsql org-gnosis-db
[:select name :from sqlite-master :where (= type 
table)])
-  3)
+3)
+(org-gnosis-db-delete-tables)
 (emacsql-with-transaction org-gnosis-db
   (pcase-dolist (`(,table ,schema) org-gnosis-db--table-schemata)
(emacsql org-gnosis-db [:create-table $i1 $S2] table schema))
-  (pcase-dolist (`(,index-name ,table ,columns) 
org-gnosis-db--table-indices)
-   (emacsql org-gnosis-db [:create-index $i1 :on $i2 $S3] index-name table 
columns))
   (emacsql org-gnosis-db [:pragma (= user-version 
org-gnosis-db-version)]
 
-(org-gnosis-db-init)
-
 (provide 'org-gnosis)
 ;;; org-gnosis.el ends here



[elpa] externals/org-gnosis c10591738c 38/63: [Feature] org-gnosis-find-by-tag: Select node under tag.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit c10591738cd98a8a123f6a47071dd8b75bad0b0a
Author: Thanos Apollo 
Commit: Thanos Apollo 

[Feature] org-gnosis-find-by-tag: Select node under tag.

* Search for nodes under selected.
---
 org-gnosis.el | 12 
 1 file changed, 12 insertions(+)

diff --git a/org-gnosis.el b/org-gnosis.el
index 42b35c625d..810e42cc9b 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -357,6 +357,18 @@ DIRECTORY."
   (ignore-errors (org-id-goto id))
   (org-gnosis-mode)
 
+;;;###autoload
+(defun org-gnosis-find-by-tag (&optional tag)
+  "Find node under TAG."
+  (let* ((tag (or tag (funcall org-gnosis-completing-read-func
+  "Select tag: "
+  (org-gnosis-select 'tag 'tags '1=1 t
+(node
+ (funcall org-gnosis-completing-read-func
+  "Select node: "
+  (org-gnosis-select 'title 'nodes `(like tags ',(format 
"%%\"%s\"%%" tag))
+(org-gnosis-find node)))
+
 (defun org-gnosis-select-template (&optional templates)
   "Select journal template from TEMPLATES.
 



[elpa] externals/org-gnosis 7851136732 44/63: schemata: Use title for journals.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 7851136732fa64d04b4dfc9f79cd596838e5be07
Author: Thanos Apollo 
Commit: Thanos Apollo 

schemata: Use title for journals.

* Instead of focusing on just journals as just being dates, it's
  better to see them as fleeting notes for a current date as well,
  where they can have sub-nodes.
---
 org-gnosis.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index c573ddbb43..60b86b8c3e 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -517,7 +517,7 @@ If file or id are not found, use `org-open-at-point'."
 (journal
  ([(id :not-null :primary-key)
(file :not-null)
-   (date text)
+   (title text :not-null)
(level text :not-null)
tags]))
 (node-tag



[elpa] main dd405dd0d1: elpa-packages (org-gnosis): New package

2025-02-10 Thread Stefan Monnier via
branch: main
commit dd405dd0d1775e0e7417d18761e54e177c1b90fc
Author: Stefan Monnier 
Commit: Stefan Monnier 

elpa-packages (org-gnosis): New package
---
 elpa-packages | 1 +
 1 file changed, 1 insertion(+)

diff --git a/elpa-packages b/elpa-packages
index 04bdea57c1..2718c7c8c6 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -566,6 +566,7 @@
  (org-edna :url "bzr::https://bzr.savannah.gnu.org/git/org-edna-el";
   ;; The Bzr<->Git bridge wasn't working well enough last time I tried.
   :manual-sync t)
+ (org-gnosis   :url "https://git.thanosapollo.org/org-gnosis";)
  (org-jami-bot :url "https://gitlab.com/hperrey/org-jami-bot";
   :ignored-files ("LICENSE"))
  ;; FIXME: Waiting for copyright paperwork from Brandon Webster.



[elpa] externals/dape 00761f5614 3/3: Apply comint filter before echoing shell to repl

2025-02-10 Thread ELPA Syncer
branch: externals/dape
commit 00761f56142dc2219444f815fc7977bc8c4898b6
Author: Daniel Pettersson 
Commit: Daniel Pettersson 

Apply comint filter before echoing shell to repl
---
 dape.el | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/dape.el b/dape.el
index 2cd63a92a9..531f1257fb 100644
--- a/dape.el
+++ b/dape.el
@@ -1935,12 +1935,16 @@ Starts a new adapter CONNs from ARGUMENTS."
(list shell-file-name shell-command-switch
  (mapconcat #'identity args " "))
  args))
- :filter (if dape-repl-echo-shell-output
- (lambda (process string)
-   (dape--repl-insert string)
-   (comint-output-filter process string))
-   #'comint-output-filter)
- :sentinel 'shell-command-sentinel
+ :filter
+ (if dape-repl-echo-shell-output
+ (lambda (process string)
+   (let ((before (marker-position (process-mark 
process
+ (comint-output-filter process string)
+ (dape--repl-insert
+  (with-current-buffer (process-buffer process)
+(buffer-substring before (process-mark 
process))
+   #'comint-output-filter)
+ :sentinel #'shell-command-sentinel
  :file-handler t)))
   (unless dape-repl-echo-shell-output (dape--display-buffer buffer))
   (list :processId (process-id process)



[elpa] externals/dape fcf046eeaf 2/3: Small formatting fixup

2025-02-10 Thread ELPA Syncer
branch: externals/dape
commit fcf046eeaf75d798fd945537ae3d8853fe0fa7e1
Author: Daniel Pettersson 
Commit: Daniel Pettersson 

Small formatting fixup
---
 dape.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/dape.el b/dape.el
index b0563c99d1..2cd63a92a9 100644
--- a/dape.el
+++ b/dape.el
@@ -1783,7 +1783,6 @@ See `dape-request' for expected CB signature."
 (seq-filter 'identity)))
 (dape--request-continue cb)
 
-
 (defun dape--variables-recursive (conn object path pred cb)
   "Update variables recursivly.
 Get variable data from CONN and put result on OBJECT until PRED is nil.



[elpa] externals/dape fac13e7153 1/3: Clarify error message

2025-02-10 Thread ELPA Syncer
branch: externals/dape
commit fac13e7153f8778ccbe4203311ec12d54f9305aa
Author: Daniel Pettersson 
Commit: Daniel Pettersson 

Clarify error message
---
 dape.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dape.el b/dape.el
index 33e57b6a58..b0563c99d1 100644
--- a/dape.el
+++ b/dape.el
@@ -1308,7 +1308,7 @@ See `dape--connection-selected'."
 (and (dape--stopped-threads conn)))
   ordered)
 (unless (or nowarn conn)
-  (user-error "No %sdebug connection live"
+  (user-error "No %sdebug connection"
   ;; `parent' and `last' does not make sense to the user
   (if (memq type '(running stopped))
   (format "%s " type) "")))



[nongnu] elpa/multiple-cursors bb07ffee68 1/3: Move metadata from multiple-cursors-pkg.el to multiple-cursors.el

2025-02-10 Thread ELPA Syncer
branch: elpa/multiple-cursors
commit bb07ffee6825b0aa9a866862538b79628e5413cd
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

Move metadata from multiple-cursors-pkg.el to multiple-cursors.el
---
 multiple-cursors-pkg.el | 3 ---
 multiple-cursors.el | 1 +
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/multiple-cursors-pkg.el b/multiple-cursors-pkg.el
deleted file mode 100644
index 2087f25ea4..00
--- a/multiple-cursors-pkg.el
+++ /dev/null
@@ -1,3 +0,0 @@
-(define-package "multiple-cursors" "1.4.0"
-  "Multiple cursors for Emacs."
-  '((cl-lib "0.5")))
diff --git a/multiple-cursors.el b/multiple-cursors.el
index 8c3e14814e..c510a800c9 100644
--- a/multiple-cursors.el
+++ b/multiple-cursors.el
@@ -4,6 +4,7 @@
 
 ;; Author: Magnar Sveen 
 ;; Version: 1.4.0
+;; Package-Requires: ((cl-lib "0.5"))
 ;; Keywords: editing cursors
 ;; Homepage: https://github.com/magnars/multiple-cursors.el
 



[nongnu] elpa/haskell-mode d7b05e4b04 1/2: Add user option to preserve the order of imenu candidates

2025-02-10 Thread ELPA Syncer
branch: elpa/haskell-mode
commit d7b05e4b047d34d73278ce81ec2d355d1a5d1c83
Author: Pablo Castellanos 
Commit: Pablo Castellanos 

Add user option to preserve the order of imenu candidates
---
 haskell-decl-scan.el | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/haskell-decl-scan.el b/haskell-decl-scan.el
index f32515ac6f..8299f34e61 100644
--- a/haskell-decl-scan.el
+++ b/haskell-decl-scan.el
@@ -124,6 +124,11 @@
   :group 'haskell-decl-scan
   :type 'boolean)
 
+(defcustom haskell-decl-scan-sort-imenu t
+  "Whether to sort the candidates in imenu."
+  :group 'haskell-decl-scan
+  :type 'boolean)
+
 ;;
 ;; General declaration scanning functions.
 
@@ -562,15 +567,21 @@ datatypes) in a Haskell file for the `imenu' package."
 (import   . "Imports")   (class. "Classes")))
   (when-let ((curr-alist (gethash (car type) imenu)))
 (push (cons (cdr type)
-(sort curr-alist 'haskell-ds-imenu-label-cmp))
+(if haskell-decl-scan-sort-imenu
+(sort curr-alist 'haskell-ds-imenu-label-cmp)
+  (reverse curr-alist)))
   index-alist)))
 (when-let ((var-alist (gethash 'variable imenu)))
   (if haskell-decl-scan-bindings-as-variables
   (push (cons "Variables"
-  (sort var-alist 'haskell-ds-imenu-label-cmp))
+  (if haskell-decl-scan-sort-imenu
+  (sort var-alist 'haskell-ds-imenu-label-cmp)
+(reverse var-alist)))
 index-alist)
 (setq index-alist (append index-alist
-  (sort var-alist 
'haskell-ds-imenu-label-cmp)
+  (if haskell-decl-scan-sort-imenu
+  (sort var-alist 
'haskell-ds-imenu-label-cmp)
+(reverse var-alist))
 ;; Return the alist.
 index-alist))
 



[elpa] externals/org-gnosis b484e01a5b 15/63: schemata: Add unique links

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit b484e01a5bdab2bfb79b367e0b1087bafdf2b840
Author: Thanos Apollo 
Commit: Thanos Apollo 

schemata: Add unique links
---
 org-gnosis.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index be96e1b42f..29a578c381 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -450,7 +450,7 @@ instead."
  ([(source text)
(dest text)]
   (:foreign-key [source] :references nodes [id] :on-delete :cascade)
-  
+  (:unique [source dest])
 
 (defun org-gnosis-db-delete-tables ()
   "Drop all tables."



[nongnu] elpa/multiple-cursors updated (dd10cf2334 -> 89f1a8df9b)

2025-02-10 Thread ELPA Syncer
elpasync pushed a change to branch elpa/multiple-cursors.

  from  dd10cf2334 Merge pull request #387 from arialdomartini/tables
   new  bb07ffee68 Move metadata from multiple-cursors-pkg.el to 
multiple-cursors.el
   new  758223c45b Merge pull request #388 from emacsmirror/expkg
   new  89f1a8df9b Release 1.5.0


Summary of changes:
 multiple-cursors-pkg.el | 3 ---
 multiple-cursors.el | 3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)
 delete mode 100644 multiple-cursors-pkg.el



[elpa] externals/org-gnosis e5ef4d24d7 53/63: Add delete-file.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit e5ef4d24d7adeb5aa479d3681a36be70795c82e4
Author: Thanos Apollo 
Commit: Thanos Apollo 

Add delete-file.

* Add org-gnosis--delete-file function that deletes all contents for
  file in db.
  * This is also used in update-file to avoid code duplication.
* Add org-gnosis-delete-file, which should be the method for deleting
  files.
---
 org-gnosis.el | 37 +
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index cc3129f3f7..f9b9ca0ba0 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -271,23 +271,44 @@ If JOURNAL is non-nil, update file as a journal entry."
 (cl-loop for link in links
 do (org-gnosis--insert-into 'links `[,(cdr link) ,(car link)]
 
-(defun org-gnosis-update-file (&optional file)
-  "Update contents of FILE in databse.
-
-Removes all contents of FILE in database, adding them anew."
+(defun org-gnosis--delete-file (&optional file)
+  "Delete contents for FILE in database."
   (let* ((file (or file (file-name-nondirectory (buffer-file-name
 (journal-p (file-in-directory-p file org-gnosis-journal-dir))
 (nodes (if journal-p
(org-gnosis-select 'id 'journal `(= file ,file) t)
  (org-gnosis-select 'id 'nodes `(= file ,file) t
 (emacsql-with-transaction org-gnosis-db
-  ;; Delete all nodes of file in db
   (cl-loop for node in nodes
   do (if journal-p
  (org-gnosis--delete 'journal `(= id ,node))
-   (org-gnosis--delete 'nodes `(= id ,node
-  ;; Add new data
-  (org-gnosis--update-file file journal-p
+   (org-gnosis--delete 'nodes `(= id ,node)))
+
+(defun org-gnosis-update-file (&optional file)
+  "Update contents of FILE in databse.
+
+Removes all contents of FILE in database, adding them anew."
+  (let* ((file (or file (file-name-nondirectory (buffer-file-name
+(journal-p (file-in-directory-p file org-gnosis-journal-dir)))
+;; Delete all contents for file
+(org-gnosis--delete-file file)
+;; Reinsert them anew
+(org-gnosis--update-file file journal-p)))
+
+(defun org-gnosis-delete-file (&optional file)
+  "Delete FILE.
+
+Delete file contents in database & file."
+  (interactive)
+  (let ((file (or file (file-name-nondirectory (buffer-file-name)
+(if (or (file-in-directory-p (buffer-file-name) org-gnosis-dir)
+   (file-in-directory-p (buffer-file-name) org-gnosis-journal-dir))
+   (progn
+ (when (y-or-n-p (format "Delete file: %s?" file))
+   (org-gnosis--delete-file file)
+   (delete-file (buffer-file-name))
+   (kill-buffer (buffer-name
+  (error "%s is not an org-gnosis file" file
 
 (defun org-gnosis-find--tag-with-tag-prop (lst)
   "Combine each sublist of strings in LST into a single string."



[elpa] externals/llm 53337bed5a 2/3: Fix README example of tool use (#156)

2025-02-10 Thread ELPA Syncer
branch: externals/llm
commit 53337bed5af169bec7e8b469a131185da961606a
Author: Andrew Hyatt 
Commit: GitHub 

Fix README example of tool use (#156)

This fixes https://github.com/ahyatt/llm/issues/155
---
 README.org | 36 +---
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/README.org b/README.org
index 0c42bcb703..4a3014fd15 100644
--- a/README.org
+++ b/README.org
@@ -213,21 +213,27 @@ This basic structure is useful because it can guarantee a 
well-structured output
 The way to call functions is to attach a list of functions to the =tools= slot 
in the prompt. This is a list of =llm-tool= structs, which is a tool that is an 
elisp function, with a name, a description, and a list of arguments. The 
docstrings give an explanation of the format.  An example is:
 
 #+begin_src emacs-lisp
-(llm-chat-async my-llm-provider (llm-make-chat-prompt
-   "What is the capital of France?"
-   :tools
-   (list (llm-make-tool
-  :function (lambda (callback result)
-  ;; In this example function the assumption is that the
-  ;; callback will be called after processing the result is
-  ;; complete.
-  (notify-user-of-capital result callback))
-  :name "capital_of_country"
-  :description "Get the capital of a country."
-  :args '((:name "country"
-   :description "The country whose capital to look up."
-   :type string))
-  :async t
+(llm-chat-async
+ my-llm-provider
+ (llm-make-chat-prompt
+  "What is the capital of France?"
+  :tools
+  (list (llm-make-tool
+ :function
+ (lambda (callback result)
+   ;; In this example function the assumption is that the
+   ;; callback will be called after processing the result is
+   ;; complete.
+   (notify-user-of-capital result callback))
+ :name "capital_of_country"
+ :description "Get the capital of a country."
+ :args '((:name "country"
+:description "The country whose capital to look up."
+:type string))
+ :async t)))
+ #'identity  ;; No need to process the result in this example.
+ (lambda (_ err)
+   (error "Error on getting capital: %s" err)))
 #+end_src
 
 Note that tools have the same arguments and structure as the tool definitions 
in [[https://github.com/karthink/gptel][GTPel]].



[elpa] externals/llm 697a4f1b6f 1/3: Rename llm-make-tool-function to llm-make-tool (#153)

2025-02-10 Thread ELPA Syncer
branch: externals/llm
commit 697a4f1b6ffe5f6e7462a63449a6419c8049f7f1
Author: Daniel Krizian 
Commit: GitHub 

Rename llm-make-tool-function to llm-make-tool (#153)

extends #141 to utilities/elisp-to-tool.el

Without this fix,

```elisp
(require 'utilities/elisp-to-tool)
```
throws `Debugger entered--Lisp error: (void-function
llm-make-tool-function)`
---
 utilities/elisp-to-tool.el | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/utilities/elisp-to-tool.el b/utilities/elisp-to-tool.el
index baedcc4fca..fd1fdeb9f7 100644
--- a/utilities/elisp-to-tool.el
+++ b/utilities/elisp-to-tool.el
@@ -35,16 +35,16 @@
 ;; An example of the output - you can remove the function call definition and
 ;; call `elisp-to-tool-insert' to see this in action.
 (defconst elisp-to-tool-switch-to-buffer
-  (llm-make-tool-function :function
-  'switch-to-buffer
-  :name
-  "switch_to_buffer"
-  :args
-  '((:name "buffer_or_name" :type string :description 
"A buffer, a string (buffer name), or nil. If a string that doesn't identify an 
existing buffer, create a buffer with that name. If nil, switch to the buffer 
returned by 'other_buffer'." :required t) (:name "norecord" :type boolean 
:description "If non-nil, do not put the buffer at the front of the buffer 
list, and do not make the window displaying it the most recently selected one." 
:required t) (:name "force_ [...]
-  :description
-  "Display buffer BUFFER_OR_NAME in the selected 
window. WARNING: This is NOT the way to work on another buffer temporarily 
within a Lisp program! Use 'set_buffer' instead. That avoids messing with the 
'window_buffer' correspondences. If the selected window cannot display the 
specified buffer because it is a minibuffer window or strongly dedicated to 
another buffer, call 'pop_to_buffer' to select the buffer in another window. In 
interactive use, if the selected wi [...]
-  :async
-  nil)
+  (llm-make-tool :function
+ 'switch-to-buffer
+ :name
+ "switch_to_buffer"
+ :args
+ '((:name "buffer_or_name" :type string :description "A 
buffer, a string (buffer name), or nil. If a string that doesn't identify an 
existing buffer, create a buffer with that name. If nil, switch to the buffer 
returned by 'other_buffer'." :required t) (:name "norecord" :type boolean 
:description "If non-nil, do not put the buffer at the front of the buffer 
list, and do not make the window displaying it the most recently selected one." 
:required t) (:name "force_same_wind [...]
+ :description
+ "Display buffer BUFFER_OR_NAME in the selected window. 
WARNING: This is NOT the way to work on another buffer temporarily within a 
Lisp program! Use 'set_buffer' instead. That avoids messing with the 
'window_buffer' correspondences. If the selected window cannot display the 
specified buffer because it is a minibuffer window or strongly dedicated to 
another buffer, call 'pop_to_buffer' to select the buffer in another window. In 
interactive use, if the selected window is s [...]
+ :async
+ nil)
   )
 
 ;; A demonstration of the resulting function call in action.
@@ -100,14 +100,14 @@ Use lowercase for all argument names even if you see it 
in uppercase in the docu
 Documentation strings should start with uppercase and end with a period."
  :tools
  (list
-  (llm-make-tool-function
+  (llm-make-tool
:function
(lambda (args description)
  (with-current-buffer (marker-buffer marker)
(save-excursion
  (goto-char marker)
  (cl-prettyprint
-  `(llm-make-tool-function
+  `(llm-make-tool
 :function ,(list 'quote f)
 :name ,(elisp-to-tool-el-to-js-name 
(symbol-name f))
 :args '(,@(mapcar



[elpa] externals/org-gnosis a27e86c470 3/4: Version bump: 0.0.2

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit a27e86c470a368c163e150ac3e85889ab763a6e9
Author: Thanos Apollo 
Commit: Thanos Apollo 

Version bump: 0.0.2

* This is the first "packaged ready" release that should work OOB and
  can be distributed in ELPAs.
---
 org-gnosis.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index bd97ec359e..1ec9f62761 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -5,7 +5,7 @@
 ;; Author: Thanos Apollo 
 ;; Keywords: extensions
 ;; URL: https://thanosapollo.org/projects/org-gnosis/
-;; Version: 0.0.1
+;; Version: 0.0.2
 
 ;; Package-Requires: ((emacs "27.2") (emacsql "4.1.0") (compat "29.1.4.2"))
 



[elpa] externals/org-gnosis 9a6921d3c4 1/4: [fix] Make sure database is initialized.

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 9a6921d3c44e86b7d94d74608213c7e6534c6811
Author: Thanos Apollo 
Commit: Thanos Apollo 

[fix] Make sure database is initialized.

* I've been assuming users would run org-gnosis-db-sync first thing
  after installing org-gnosis.

* This change adjusts for new users that might have not already have a
  collection of notes from org-roam to import & would just start
  calling org-gnosis-find or org-gnosis-insert immediately.
---
 org-gnosis.el | 9 +
 1 file changed, 9 insertions(+)

diff --git a/org-gnosis.el b/org-gnosis.el
index 905a4caafd..e8e5575b24 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -89,6 +89,7 @@
   "Select VALUE from TABLE, optionally with RESTRICTIONS.
 
 Optional argument FLATTEN, when non-nil, flattens the result."
+  (org-gnosis-db-init-if-needed)
   (let ((output (emacsql org-gnosis-db
 `[:select ,value :from ,table :where ,restrictions])))
 (if flatten
@@ -725,5 +726,13 @@ If called with ARG do not initialize the database."
(emacsql org-gnosis-db [:create-table $i1 $S2] table schema))
   (emacsql org-gnosis-db [:pragma (= user-version 
org-gnosis-db-version)]
 
+(defun org-gnosis-db-init-if-needed ()
+  "Init database if it has not been initizalized."
+  (when (length< (emacsql org-gnosis-db
+ [:select name :from sqlite-master :where (= type 
table)])
+4)
+(message "Creating org-gnosis database...")
+(org-gnosis-db-init)))
+
 (provide 'org-gnosis)
 ;;; org-gnosis.el ends here



[elpa] externals/org-gnosis updated (70d0c660e0 -> 2588a75a15)

2025-02-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/org-gnosis.

  from  70d0c660e0 Add gitignore
   new  9a6921d3c4 [fix] Make sure database is initialized.
   new  9be0293488 [fix] Create notes & journal directories
   new  a27e86c470 Version bump: 0.0.2
   new  2588a75a15 packaging: Use emacsql 4.0.0


Summary of changes:
 org-gnosis.el | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)



[elpa] externals/llm updated (1d2250805d -> 286b1cf18e)

2025-02-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/llm.

  from  1d2250805d Add Gemini 2.0 Pro model, and use 2.0 flash as a default 
(#152)
   new  697a4f1b6f Rename llm-make-tool-function to llm-make-tool (#153)
   new  53337bed5a Fix README example of tool use (#156)
   new  286b1cf18e Add o3 mini model (#157)


Summary of changes:
 NEWS.org   |  1 +
 README.org | 36 +---
 llm-models.el  |  5 +
 utilities/elisp-to-tool.el | 24 
 4 files changed, 39 insertions(+), 27 deletions(-)



[elpa] externals/org-gnosis 9be0293488 2/4: [fix] Create notes & journal directories

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 9be029348879f75c83d32072637877fa611e4beb
Author: Thanos Apollo 
Commit: Thanos Apollo 

[fix] Create notes & journal directories

* If notes & journal directories do not exist, create them upon
  loading this package.
---
 org-gnosis.el | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index e8e5575b24..bd97ec359e 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -37,7 +37,7 @@
 (defgroup org-gnosis nil
   "Note Taking System."
   :group 'external)
-
+;; is ~/Notes appropriate for all Operating Systems?
 (defcustom org-gnosis-dir (expand-file-name "Notes" "~")
   "Directory with gnosis notes."
   :type 'directory)
@@ -85,6 +85,11 @@
 
 (defvar org-gnosis-db (emacsql-sqlite-open (locate-user-emacs-file 
"org-gnosis.db")))
 
+;; Create notes & journal directories.
+(dolist (dir `(,org-gnosis-dir ,org-gnosis-journal-dir))
+  (unless (file-directory-p dir)
+(make-directory dir)))
+
 (cl-defun org-gnosis-select (value table &optional (restrictions '1=1) 
(flatten nil))
   "Select VALUE from TABLE, optionally with RESTRICTIONS.
 



[elpa] externals/org-gnosis 2588a75a15 4/4: packaging: Use emacsql 4.0.0

2025-02-10 Thread ELPA Syncer
branch: externals/org-gnosis
commit 2588a75a1592bb3bf73af669ece465c78dad751f
Author: Thanos Apollo 
Commit: Thanos Apollo 

packaging: Use emacsql 4.0.0

* Switch emacsql version to 4.0.0 as the minimum required version.
---
 org-gnosis.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 1ec9f62761..5e7583ecad 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -7,7 +7,7 @@
 ;; URL: https://thanosapollo.org/projects/org-gnosis/
 ;; Version: 0.0.2
 
-;; Package-Requires: ((emacs "27.2") (emacsql "4.1.0") (compat "29.1.4.2"))
+;; Package-Requires: ((emacs "27.2") (emacsql "4.0.0") (compat "29.1.4.2"))
 
 ;; 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



[elpa] externals/llm 286b1cf18e 3/3: Add o3 mini model (#157)

2025-02-10 Thread ELPA Syncer
branch: externals/llm
commit 286b1cf18eb358ac9c208a709a625f3ee19ae451
Author: Andrew Hyatt 
Commit: GitHub 

Add o3 mini model (#157)
---
 NEWS.org  | 1 +
 llm-models.el | 5 +
 2 files changed, 6 insertions(+)

diff --git a/NEWS.org b/NEWS.org
index b4668d0fa7..75a4cfa89f 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,5 +1,6 @@
 * Version 0.23.1
 - Add Gemini 2.0 pro experimental model, default to 2.0 flash
+- Add Open AI's o3 mini model
 * Version 0.23.0
 - Add GitHub's GitHub Models
 - Accept lists as nonstandard
diff --git a/llm-models.el b/llm-models.el
index 72b2c7b275..e766dc715a 100644
--- a/llm-models.el
+++ b/llm-models.el
@@ -75,6 +75,11 @@ REGEX is a regular expression that can be used to identify 
the model, uniquely (
 :capabilities '(generation)
 :context-length 3
 :regex "o1-mini")
+   (make-llm-model
+:name "o3 Mini" :symbol 'o3-mini
+:capabilities '(generation)
+:context-length 3
+:regex "o3-mini")
(make-llm-model
 :name "GPT-4 Turbo" :symbol 'gpt-4-turbo
 :capabilities '(generation tool-use image-input)



[elpa] externals/posframe 12f540c9ad: Better handle cursor-type.

2025-02-10 Thread ELPA Syncer
branch: externals/posframe
commit 12f540c9ad5da09673b2bca1132b41f94c134e82
Author: Feng Shu 
Commit: Feng Shu 

Better handle cursor-type.
---
 posframe.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/posframe.el b/posframe.el
index 079af3251e..e75b0811f3 100644
--- a/posframe.el
+++ b/posframe.el
@@ -707,7 +707,7 @@ ACCEPT-FOCUS."
(not (and (> border-width 0)
  (featurep 
'tty-child-frames)
(visibility . nil)
-   (cursor-type . nil)
+   (cursor-type . ,cursor)
(tty-non-selected-cursor . ,tty-non-selected-cursor)
(minibuffer . ,(minibuffer-window parent-frame))
(left . ,(if (consp position) (car position) 0))



[nongnu] elpa/dirvish d64c65d7b0 1/3: chore: remove outdated obsolete declarations

2025-02-10 Thread ELPA Syncer
branch: elpa/dirvish
commit d64c65d7b0b4993770d4f659ea0c9ebb7424657f
Author: Alex Lu 
Commit: Alex Lu 

chore: remove outdated obsolete declarations
---
 dirvish-widgets.el| 1 -
 dirvish.el| 2 --
 extensions/dirvish-fd.el  | 2 --
 extensions/dirvish-history.el | 5 -
 extensions/dirvish-side.el| 2 --
 extensions/dirvish-subtree.el | 1 -
 6 files changed, 13 deletions(-)

diff --git a/dirvish-widgets.el b/dirvish-widgets.el
index d150959b15..8ddfb09540 100644
--- a/dirvish-widgets.el
+++ b/dirvish-widgets.el
@@ -60,7 +60,6 @@ variable is nil, the auto caching is disabled."
(setq dirvish-media--auto-cache-timer
  (run-with-timer 0 0.25 #'dirvish-media--autocache)
 
-(define-obsolete-variable-alias 'dirvish-media-auto-properties 
'dirvish-show-media-properties "Sep 28, 2022")
 (defcustom dirvish-show-media-properties
   (and (executable-find "mediainfo") (executable-find "pdfinfo") t)
   "Show media properties automatically in preview window."
diff --git a/dirvish.el b/dirvish.el
index 08358f1f11..b2ca5bae1a 100644
--- a/dirvish.el
+++ b/dirvish.el
@@ -104,7 +104,6 @@ allocated to preview window.  The default value provides a
   "Face for Dirvish line highlighting."
   :group 'dirvish)
 
-(define-obsolete-variable-alias 'dirvish-mode-line-position 
'dirvish-use-mode-line "Aug 5, 2022")
 (defcustom dirvish-use-mode-line t
   "Whether to display mode line in dirvish buffers.
 The valid value are:
@@ -116,7 +115,6 @@ The valid value are:
  (const :tag "Display the mode line across directory panes" t)
  (const :tag "Make the mode line span all panes" global)))
 
-(define-obsolete-variable-alias 'dirvish-header-line-position 
'dirvish-use-header-line "Aug 5, 2022")
 (defcustom dirvish-use-header-line t
   "Like `dirvish-use-mode-line', but for header line."
   :group 'dirvish :type 'symbol)
diff --git a/extensions/dirvish-fd.el b/extensions/dirvish-fd.el
index bfb3693717..4d1a38535e 100644
--- a/extensions/dirvish-fd.el
+++ b/extensions/dirvish-fd.el
@@ -251,8 +251,6 @@ Raise an error if fd executable is not available."
   "Current working directory."
   (propertize (abbreviate-file-name default-directory) 'face 'dired-directory))
 
-(define-obsolete-function-alias 'dirvish-roam #'dirvish-fd-jump "Jun 08, 2022")
-(define-obsolete-function-alias 'dirvish-fd-roam #'dirvish-fd-jump "Jul 17, 
2022")
 ;;;###autoload
 (defun dirvish-fd-jump (&optional current-dir-p)
   "Browse directories using `fd' command.
diff --git a/extensions/dirvish-history.el b/extensions/dirvish-history.el
index 3f474103ca..e28016a14b 100644
--- a/extensions/dirvish-history.el
+++ b/extensions/dirvish-history.el
@@ -15,11 +15,6 @@
 
 (require 'dirvish)
 
-(define-obsolete-function-alias 'dirvish-show-history #'dirvish-history-jump 
"Jun 08, 2022")
-(define-obsolete-function-alias 'dirvish-other-buffer #'dirvish-history-last 
"Jun 08, 2022")
-(define-obsolete-function-alias 'dirvish-go-forward-history 
#'dirvish-history-go-forward "Jun 08, 2022")
-(define-obsolete-function-alias 'dirvish-go-backward-history 
#'dirvish-history-go-backward "Jun 08, 2022")
-
 ;;;###autoload
 (defun dirvish-history-jump ()
   "Open a target directory from `dirvish--history'."
diff --git a/extensions/dirvish-side.el b/extensions/dirvish-side.el
index 57c36b98d1..26e03b6204 100644
--- a/extensions/dirvish-side.el
+++ b/extensions/dirvish-side.el
@@ -28,7 +28,6 @@
   "Window parameters for `dirvish-side' window."
   :group 'dirvish :type 'alist)
 
-(define-obsolete-variable-alias 'dirvish-side-open-file-window-function 
'dirvish-side-open-file-action "Sep 23, 2022")
 (defcustom dirvish-side-open-file-action 'mru
   "The action of how to open a file in side window.
 The value can be one of:
@@ -48,7 +47,6 @@ The value can be one of:
   "Whether to auto close the side session after opening a file."
   :group 'dirvish :type 'boolean)
 
-(define-obsolete-variable-alias 'dirvish-side-follow-buffer-file 
'dirvish-side-auto-expand "Sep 15, 2022")
 (defcustom dirvish-side-auto-expand t
   "Whether to auto expand parent directories of current file.
 If non-nil, expand all the parent directories of current buffer's
diff --git a/extensions/dirvish-subtree.el b/extensions/dirvish-subtree.el
index 970ea27536..70699cdeb0 100644
--- a/extensions/dirvish-subtree.el
+++ b/extensions/dirvish-subtree.el
@@ -28,7 +28,6 @@ The value may be a string of options or nil which means the
 working switches of current buffer will be used."
   :type '(choice symbol string) :group 'dirvish)
 
-(define-obsolete-variable-alias 'dirvish-subtree-line-prefix 
'dirvish-subtree-prefix "Sep 1, 2022")
 (defcustom dirvish-subtree-prefix " │"
   "A string put into each nested subtree.
 The prefix is repeated \"depth\" times."



[nongnu] elpa/dirvish updated (ed0ab52cdd -> e7faf3916c)

2025-02-10 Thread ELPA Syncer
elpasync pushed a change to branch elpa/dirvish.

  from  ed0ab52cdd fix(peek): image & media metadata preview, drop 
`selectrum` support
   new  d64c65d7b0 chore: remove outdated obsolete declarations
   new  1b905092f6 fix: drop usages of `featurep`
   new  e7faf3916c chore: fix free var `pdf-info-epdfinfo-program`


Summary of changes:
 dirvish-widgets.el| 11 ---
 dirvish.el|  9 -
 extensions/dirvish-fd.el  |  2 --
 extensions/dirvish-history.el |  5 -
 extensions/dirvish-side.el|  2 --
 extensions/dirvish-subtree.el |  1 -
 6 files changed, 12 insertions(+), 18 deletions(-)



[nongnu] elpa/dirvish e7faf3916c 3/3: chore: fix free var `pdf-info-epdfinfo-program`

2025-02-10 Thread ELPA Syncer
branch: elpa/dirvish
commit e7faf3916c5e74fef450ca4b338df03dabf34cda
Author: Alex Lu 
Commit: Alex Lu 

chore: fix free var `pdf-info-epdfinfo-program`
---
 dirvish-widgets.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dirvish-widgets.el b/dirvish-widgets.el
index 1470f7ca27..e92c3c8a56 100644
--- a/dirvish-widgets.el
+++ b/dirvish-widgets.el
@@ -617,6 +617,7 @@ Require: `epub-thumbnailer' (executable)"
 Require: `pdf-tools' (Emacs package)"
   (when (equal ext "pdf")
 (if (and (require 'pdf-tools nil t)
+ (bound-and-true-p pdf-info-epdfinfo-program)
  (file-exists-p pdf-info-epdfinfo-program))
 (dirvish--find-file-temporarily file)
   '(info . "`epdfinfo' program required to preview pdfs; run `M-x 
pdf-tools-install'"



[nongnu] elpa/dirvish 1b905092f6 2/3: fix: drop usages of `featurep`

2025-02-10 Thread ELPA Syncer
branch: elpa/dirvish
commit 1b905092f67483bce8db4901227df15e6c548dce
Author: Alex Lu 
Commit: Alex Lu 

fix: drop usages of `featurep`

It's not reliable to check if a package is loaded using `featurep`.
---
 dirvish-widgets.el | 9 +++--
 dirvish.el | 7 ---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/dirvish-widgets.el b/dirvish-widgets.el
index 8ddfb09540..1470f7ca27 100644
--- a/dirvish-widgets.el
+++ b/dirvish-widgets.el
@@ -616,8 +616,10 @@ Require: `epub-thumbnailer' (executable)"
   "Preview pdf files.
 Require: `pdf-tools' (Emacs package)"
   (when (equal ext "pdf")
-(if (featurep 'pdf-tools) (dirvish--find-file-temporarily file)
-  '(info . "Emacs package 'pdf-tools' is required to preview pdf 
documents"
+(if (and (require 'pdf-tools nil t)
+ (file-exists-p pdf-info-epdfinfo-program))
+(dirvish--find-file-temporarily file)
+  '(info . "`epdfinfo' program required to preview pdfs; run `M-x 
pdf-tools-install'"
 
 (dirvish-define-preview pdf-preface (file ext preview-window)
   "Display the preface image as preview for pdf files."
@@ -637,6 +639,9 @@ Require: `zipinfo' (executable)
 Require: `tar' (executable)"
   :require ("zipinfo" "tar")
   (cond ((equal ext "zip") `(shell . ("zipinfo" ,file)))
+;; Emacs source code files
+((string-suffix-p ".el.gz" file)
+ (dirvish--find-file-temporarily file))
 ((member ext '("tar" "zst" "bz2" "bz" "gz" "xz" "tgz"))
  `(shell . ("tar" "-tvf" ,file)
 
diff --git a/dirvish.el b/dirvish.el
index b2ca5bae1a..9a88decd68 100644
--- a/dirvish.el
+++ b/dirvish.el
@@ -1205,8 +1205,7 @@ LEVEL is the depth of current window."
   "Script for DIR data retrieving."
   `(with-temp-buffer
  (let ((hash (make-hash-table))
-   (bk ,(and (featurep 'dirvish-vc)
- `(ignore-errors (vc-responsible-backend ,dir)
+   (bk (ignore-errors (vc-responsible-backend ,dir
;; keep this until `vc-git' fixed upstream.  See: #224 and #273
(advice-add #'vc-git--git-status-to-vc-state :around
(lambda (fn code-list)
@@ -1214,7 +1213,9 @@ LEVEL is the depth of current window."
(dolist (file (directory-files ,dir t nil t))
  (let* ((attrs (file-attributes file))
 (state (and bk (vc-state-refresh file bk)))
-(git (and (eq bk 'Git) ; TODO: refactor this
+;; TODO: eventually this should belong to `dirvish-vc'
+;; we spawn a separate process to deal with git stuff.
+(git (and (eq bk 'Git)
   (shell-command-to-string
(format "git log -1 --pretty=%%s %s"
(shell-quote-argument file)



  1   2   >