From ed272eaf56ffede424763be740cd5bb4ef0375c5 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Wed, 27 Nov 2024 00:02:26 +0100 Subject: [PATCH] Address compiler warnings Depend on Org 9.6 for `org-fold-show-context'. --- org-roam-db.el | 5 +++-- org-roam-id.el | 9 ++++----- org-roam-mode.el | 2 +- org-roam-node.el | 14 +++++++------- org-roam-utils.el | 12 ++++++------ org-roam.el | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/org-roam-db.el b/org-roam-db.el index 70903d1..ab5f308 100644 --- a/org-roam-db.el +++ b/org-roam-db.el @@ -337,7 +337,7 @@ If HASH is non-nil, use that as the file's hash without recalculating it." (let* ((begin (match-beginning 0)) (element (org-element-context)) (type (org-element-type element)) - link bounds) + link) (cond ;; Links correctly recognized by Org Mode ((eq type 'link) @@ -581,7 +581,8 @@ in `org-roam-db-sync'." (emacsql-with-transaction (org-roam-db) (org-with-wide-buffer (org-set-regexps-and-options 'tags-only) - (org-refresh-category-properties) + ;; Org doesn't use this anymore, so we probably should stop too. + ;; (org-refresh-category-properties) (org-roam-db-clear-file) (org-roam-db-insert-file content-hash) (org-roam-db-insert-file-node) diff --git a/org-roam-id.el b/org-roam-id.el index f71121c..3b0ea31 100644 --- a/org-roam-id.el +++ b/org-roam-id.el @@ -55,11 +55,10 @@ With optional argument MARKERP, return the position as a new marker." (let ((node (org-roam-populate (org-roam-node-create :id id)))) (when-let ((file (org-roam-node-file node))) (if markerp - (unwind-protect - (let ((buffer (or (find-buffer-visiting file) - (find-file-noselect file)))) - (with-current-buffer buffer - (move-marker (make-marker) (org-roam-node-point node) buffer)))) + (let ((buffer (or (find-buffer-visiting file) + (find-file-noselect file)))) + (with-current-buffer buffer + (move-marker (make-marker) (org-roam-node-point node) buffer))) (cons (org-roam-node-file node) (org-roam-node-point node)))))) diff --git a/org-roam-mode.el b/org-roam-mode.el index 7faf40f..8b3b660 100644 --- a/org-roam-mode.el +++ b/org-roam-mode.el @@ -319,7 +319,7 @@ To toggle its display use `org-roam-buffer-toggle' command.") (define-inline org-roam-buffer--visibility () "Return the current visibility state of the persistent `org-roam-buffer'. -Valid states are 'visible, 'exists and 'none." +Valid states are `visible', `exists' and `none'." (declare (side-effect-free t)) (inline-quote (cond diff --git a/org-roam-node.el b/org-roam-node.el index 9da7a6d..76c9a26 100644 --- a/org-roam-node.el +++ b/org-roam-node.el @@ -32,6 +32,7 @@ ;; interactively. ;; ;;; Code: +(require 'crm) (require 'org-roam) ;;; Options @@ -446,12 +447,11 @@ GROUP BY id"))) ;;;; Finders (defun org-roam-node-marker (node) "Get the marker for NODE." - (unwind-protect - (let* ((file (org-roam-node-file node)) - (buffer (or (find-buffer-visiting file) - (find-file-noselect file)))) - (with-current-buffer buffer - (move-marker (make-marker) (org-roam-node-point node) buffer))))) + (let* ((file (org-roam-node-file node)) + (buffer (or (find-buffer-visiting file) + (find-file-noselect file)))) + (with-current-buffer buffer + (move-marker (make-marker) (org-roam-node-point node) buffer)))) (defun org-roam-node-open (node &optional cmd force) "Go to the node NODE. @@ -1057,7 +1057,7 @@ and when nil is returned the node will be filtered out." (let ((node (org-roam-node-at-point 'assert))) (save-excursion (goto-char (org-roam-node-point node)) - (org-roam-property-add "ROAM_REFS" (if (memq " " (string-to-list ref)) + (org-roam-property-add "ROAM_REFS" (if (member " " (string-to-list ref)) (concat "\"" ref "\"") ref))))) diff --git a/org-roam-utils.el b/org-roam-utils.el index 94c4933..5f4ff2e 100644 --- a/org-roam-utils.el +++ b/org-roam-utils.el @@ -72,11 +72,10 @@ Like `string-equal', but case-insensitive." (defun org-roam-whitespace-content (s) "Return the whitespace content at the end of S." (with-temp-buffer - (let ((c 0)) - (insert s) - (skip-chars-backward " \t\n") - (buffer-substring-no-properties - (point) (point-max))))) + (insert s) + (skip-chars-backward " \t\n") + (buffer-substring-no-properties + (point) (point-max)))) (defun org-roam-strip-comments (s) "Strip Org comments from string S." @@ -85,7 +84,8 @@ Like `string-equal', but case-insensitive." (goto-char (point-min)) (while (not (eobp)) (if (org-at-comment-p) - (delete-region (point-at-bol) (progn (forward-line) (point))) + (delete-region (line-beginning-position) + (progn (forward-line) (point))) (forward-line))) (buffer-string))) diff --git a/org-roam.el b/org-roam.el index 30fc82d..3606ef1 100644 --- a/org-roam.el +++ b/org-roam.el @@ -186,7 +186,7 @@ in the list is found. By default, `executable-find' will be used to look up the path to the executable. If a custom path is required, it can be specified together with the method symbol as a cons cell. For example: -'(find (rg . \"/path/to/rg\"))." +\\='(find (rg . \"/path/to/rg\"))." :type '(set (const :tag "find" find) (const :tag "fd" fd)