Before this patch all hash-sums were computed over the files or
buffers content. For encrypted files this means that we first have
decrypt the file before we can compute the hash-sum. So when the
cache get's updated all gpg files need to be decrypted which is a very
expensive operation and nearly defeats the purpose of having a cache
in the first place (for gpg files).
This changes the computation of hash-sums for gpg encrypted files.
Instead of the content the raw files on disk will be read.
This shouldn't interfere with the current use of hashes.
There is one ugly (but otherwise inconsequential) ward, though.
For open buffers of to be gpg encrypted files we need to compute the
hash sum over the contents as well. This is because there is
no (easy) way to get the encrypted version. The consequence is that
that buffers file will be rehashed again (then using the bytes on
disk). But all other non changed gpg files will only be hashed once,
as desired.
Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
7f56df7f4d introduced the delta symbol in the
db-rebuild message to make it clearer the the db was updated as opposed to
being completely rebuilt.
However, the unicode symbol used, U+1D6AB, which is the mathematical, bold
variant of the Greek letter is not present in many fonts. Switching to
U+0394, the base Greek letter, is better for compatibility.
Instead of storing titles as a list within in the Org-roam cache, e.g.
file, ("title1" "title2"). We normalize it and store it as:
file, "title1"
file, "title2"
The high value has been reported to cause significant slowdowns, so we
reset the default, and add documentation for its customization instead.
Ref #834
We use sqlite transactions to commit changes into the database, rather
than storing all the data in a list before running one big insert.
Hopefully this gives a noticeable perf boost.
We also add `org-roam-db-gc-threshold`, which shaves time by deferring the garbage collection to the end.
Achieve feature parity between links to files and links to headlines.
Before, we used the `file:foo::*bar` format to link to the headline `bar` in file `foo`, but this was prone to breakage upon renaming the file or modifying the headline. This is not the case anymore. Now, we use `org-id` to create IDs for those headlines, which are then stored in our database to compute the relationships and jump around. Note that this will work even if you’re not using `org-id` in your global configuration for Org-mode.
Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
Org-roam now skips over bad properties and throws a warning for the
given file that contains a malformed property. This allows most of the
database rebuild to complete, and for the user to fix the offending
file.
Fixes#728.
Fixes#647: file: links are now updated to reflect the directory change.
Also fixes#554: rename-files to directories are also resolved correctly now.
Co-authored-by: Leo Vivier <leo.vivier+dev@gmail.com>
Tags are used as meta-data for files: they facilitate interactions with notes where titles are insufficient. For example, tags allow for categorization of notes: differentiating between bibliographical and structure notes during interactive commands.
Co-authored-by: Leo Vivier <leo.vivier+dev@gmail.com>
Co-authored-by: N V <44036031+progfolio@users.noreply.github.com>
* (internal): Summarize features
Replace generic package description in features' first line summary.
Co-authored-by: Leo Vivier <leo.vivier+dev@gmail.com>
This macro simplifies message printing, so we can respect
`org-roam-verbose` in more places. Also silences more messages when
`org-roam-verbose` set to false.
* (feat) cond display relative subdir in title for selection
A title can now be constructed as ‘subdir/file-title’ where ‘subdir’ is the
sub-directory relative from ‘org-roam-directory’.
When ‘org-roam-title-include-subdirs’ is non-nil, ‘org-roam--extract-titles’
now outputs titles in this format.
* (fix) improve docstrings
* (feat) add var for modifying subdir-separator
* (fix) nitpick docstring
* (doc) document subdir creation in templates with :file-name
* (feat) make subdir-format accept a function
* (fix) respect docstring one-line-description
* (fix) address checkdoc errors
* (fix) also add subdirs when db--update-titles
* (feat) improve modularisation
`org-roam--extract-titles' is now reverted to its default definition, i.e. it
doesn’t format the titles. In its stead,
`org-roam--extract-and-format-titles' is created to both extract the titles
and process all of them with `org-roam--format-title', which is a much better
way to do this.
* Refactor with ->>
* Refactor with let*
Pretty sure I got confused because I thought I needed to use the result of the
db-queryr.
* Remove useless ->>
In #470, the `and` clause was removed, so `org-roam--org-roam-file-p`
returns `t` on `foo.org~` backup files. This PR adds that back in.
In addition, the `after-save-hook` function was not checking for whether
the file was within the org-roam system, which meant files from outside
`org-roam` would also be added into the database. This PR adds a guard
clause.
Prevents unnecessary evaluation when compiled .elc is loaded.
From the commentary of subr-x.el:
;; NB If you want to use this library, it's almost always correct to use:
;; (eval-when-compile (require 'subr-x))
See: #429
Split functionality related to the org-roam-buffer into its own
feature/file.
Introduce `org-roam-buffer-prepare-hook' to allow customizations of the
org-roam-buffer content.
Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>