Commit Graph

410 Commits

Author SHA1 Message Date
fb0662efe7 (fix): uniqify title and tag extraction (#1325)
Remove duplicates from title and tag extraction, arising from
multiple (or the same) sources.

Fixes #1324
2020-11-24 20:00:49 +08:00
9ca5461a2f (fix): fix mode toggle not re-enabling buffer-local hooks (#1321) 2020-11-23 19:59:30 +08:00
bf41352c1c (fix): fix title change not triggering rename if new title contains old (#1315)
title

Fixes #1303
2020-11-20 21:32:36 +08:00
ab34dd138d (fix): fix rename file corrupting database (#1308)
The rename file advice is passed relative file names: e.g. "foo.org" ->
"bar.org". This was not accounted for, and paths in the Org-roam
database are supposed to be absolute paths. This caused the storing of
relative paths in the Org-roam database, which were then never purged.

Fixes #1304
2020-11-19 22:26:59 +08:00
d70198bba9 (fix): fix cache updates on org-id creation in non-existing files (#1288)
closes #1287
2020-11-16 10:38:58 +08:00
face683e00 (internal): remove org-roam--get-title-or-slug function (#1284)
Every file has a title when saved into the database, so this function is
redundant in most cases (e.g. in org-roam-buffer, where backlinks are
fetched from the database).
2020-11-15 19:44:36 +08:00
a9fd6c0fc7 (fix): fix idle-timer not created on org-roam-mode (#1281)
Fixes #1280
2020-11-15 14:21:03 +08:00
cc01cf346e (release): v1.2.3 (#1269) 2020-11-13 14:22:18 +08:00
bc12d1cf04 (feat): add org-roam-db-update-method (#1264)
* (feat): add `org-roam-db-update-method`

Add `org-roam-db-update-method`, which can be one of two choices:

1. `immediate`: the cache is updated upon file changes
2. `idle-timer`: Marks the org-roam database as dirty. If Emacs idles
for some seconds, the Org-roam cache is updated. This is the default,
and current behaviour.

The idle method makes for a smoother editing experience, but some
inconsistencies can be faced.

* org-roam-update-db-idle-seconds -> org-roam-db-update-idle-seconds
2020-11-12 19:48:40 +08:00
a86d82b20e (fix): fix backlink-to-current-p killing buffers (#1263)
Change `org-roam--backlink-to-current-p` to only perform a DB query.
2020-11-12 16:11:35 +08:00
d39556a78b (fix): unlinked-references: support filenames with spaces (#1256) 2020-11-12 12:05:14 +08:00
e96685b1a9 (fix): respect original link type during replacement (#1252)
During automatic link replacement, respect the original link type
i.e. absolute links remain absolute. Fixes #1228.
2020-11-11 14:25:50 +08:00
4f6eb285bf (feat): Overhaul org-roam-dailies (#978)
Implement ideas from `org-journal` to `org-roam-dailies`.

Update the doc.
2020-11-10 14:31:38 +01:00
8c81104816 (feat): unlinked-references: add error message if rg has no PCRE2 support (#1243) 2020-11-10 13:48:50 +08:00
c6797cbd75 (feat): Allow one file to have multiple roam_key statements (#1215) 2020-11-07 15:33:31 +08:00
440461a90b (feat): add org-roam-prefer-id-links to select linking method (#1238) 2020-11-07 15:06:12 +08:00
b2cc997976 (fix): fix relative link replacement (#1233) 2020-11-04 15:25:08 +08:00
bc5c41d212 (fix): widen before title extraction (#1232)
Prevent renaming file and changing links incorrectly due to using (org-narrow-to-subtree) and saving.
2020-11-04 13:34:40 +08:00
7c83a84db3 (fix): only update relative path of file links (#1226) 2020-11-04 00:07:31 +08:00
0d235686f4 (fix): fix id-face killing buffers (#1218)
org-roam-id-get-file no longer falls back onto the current buffer: It queries the org-roam database, and optionally org-id-locations, and declares that it does not exist if it isn't in either.
2020-10-27 00:25:39 +08:00
ac2044b84b (fix): save current position in mark ring before id-open (#1217) 2020-10-26 13:36:35 +08:00
bd8b5587f5 (internal): rename link columns (#1213)
from -> source
to -> dest

"from" is a reserved keyword in sqlite, so we avoid it.
2020-10-25 22:33:43 +08:00
b937bc9655 (internal): simplify db update operations (#1212)
Instead of maintaining a file queue to process for updating the Org-roam
database, we instead simply call `org-roam-db-build-cache` to rebuild
the db. `org-roam-db-build-cache` feels Fast Enough(TM), and basically
runs instantly if no files are modified. This greatly simplifies the
code, basically allowing to maintaining a single code path for db
operations.

This PR should also address the slowness wrt to ID links. Org-roam now
builds the headline information first, so there is no need to read the
file to check if the headline is there. The downside to this is that
this only works for IDs in Org-roam files.
2020-10-25 16:35:05 +08:00
a4da8f32bf (fix): use org-roam-link-title-format in link replacement (#1199)
* (fix): use org-roam-link-title-format in link replacement

Makes `org-roam-format-link` respect `org-roam-link-title-format`.

Also removes lowercasing via prefix argument in `org-roam-insert`, not
sure how many people use it.

* update changelog
2020-10-19 21:02:25 +08:00
5d483f2d4d (fix): fall back to org-id search ID face computation (#1195)
* (fix): fall back to org-id search ID face computation

Fixes the scenario where the face is reported as invalid although it is
part of Org's ID files (e.g. in the agenda).

Fixes #1191.

This can however slow face computation a lot (when there are many org
id/agenda files). Here, we choose to focus on correctness.

* Document faces, default to only applying to Org-roam notes
2020-10-19 13:47:07 +08:00
09fd41ce24 (fix): do not kill temp buffer when extracting links for file (#1193)
Otherwise it breaks `org-roam-db-build-cache` as it relies on temporary buffer.
Without keeping the buffer, `org-roam--extract-links` kills it and any further
functionality of file processing breaks.
2020-10-19 12:12:36 +08:00
a0c4abf579 (fix): allow title changes that don't modify filename (#1189)
Prevent error when trying to move file to same name

Prevent string matching in org from messing with the current re-search-forward
position which has caused infinite broken search
2020-10-16 02:19:15 +08:00
66cd5b6226 (internal): simplify internal db cache update api (#1186) 2020-10-12 21:55:32 +08:00
5348654a7e (feat): add interactive functions for managing aliases and tags (#1183) 2020-10-12 14:51:10 +08:00
87d7c07e87 (fix): correct usage of org-element api (#1181)
content-end -> contents-end
2020-10-11 14:52:27 +08:00
82bd6c6cda (fix): fix org-roam--extract-links (#1179)
Co-authored-by: Boris Buliga <boris@d12frosted.io>
Co-authored-by: Gustav <gustav@whil.se>
2020-10-10 21:34:16 +08:00
e8d3516fa8 (fix): fix org-roam--extract-ids at outline level 0 (#1174) 2020-10-09 22:00:58 +08:00
0cce9d1165 (release): Org-roam v1.2.2 (#1168) 2020-10-06 03:02:41 +08:00
7a76f7b476 (internal): remove compat functions (#1167)
* remove org-roam-link-make-string
* remove org-roam-link-store-props and org-roam-link-decode
2020-10-06 02:45:59 +08:00
d973e8f6e0 (feat): support file-level IDs (#1163)
Additionally cache IDs at outline-level 0, now that property drawers are supported in Org 9.4.

Update org-roam--format-link to prefer ID links wherever possible. That is, when a file has an ID, use an id link instead of file link.
2020-10-05 16:57:54 +08:00
369753c98b (feat): clean up link expansions (#1157)
Adds `org-roam-link-file-path-type`, used for link path computation
wherever sensible. This includes in the org-roam backlinks buffer, and
in link replacement.

Also moves link expansion/fixing from cache build to Org-roam buffer
render time. This reduces cache build time, but makes buffer rendering
slightly slower.
2020-09-30 19:21:02 +08:00
93d8c477fe (feat): remove file store-link function override (#1155)
Previously we had overwritten the Org's store link function for files,
to create IDs if the point was under the headline. This has several
issues:

1. It becomes impossible to store a link to the file using `org-store-link`
2. This override is global across Org, although we had a guard in
`org-roam-store-link`
3. IDs are created during an org-capture, because org-capture calls `org-store-link`

This is unnecessary. Org provides `org-id-store-link` instead for this
purpose. Instead, we advice `org-id-new`, to queue the file for a DB
update if an ID was created.
2020-09-30 15:27:25 +08:00
30d52e5508 (fix): fix org-roam-id-find buffer-kill logic (#1154) 2020-09-30 13:26:14 +08:00
be64f107e9 (internal): replace find-file-noselect with with-temp-buffer where possible (#1150)
`find-file-noselect` is affected by the user's init.el, and there is
little control over what is being activated. For database updates, read
access is all we need, so we use `with-temp-file`.
2020-09-29 12:42:23 +08:00
64d8ba1900 (fix): fix org-roam-completions-everywhere (#1145)
Fix org-roam-completion-everywhere still producing fuzzy links
2020-09-27 15:51:26 +08:00
273d0dffa6 (fix): fix refs not showing in backlinks buffer (#1140)
This changes ref extraction to parse the ref using the org plain-links
syntax. This works for arbitrary `cite` links, and web links.

Link storage and ref lookup is now based on the path (e.g.
`//google.com`) or `author_year`.
2020-09-27 02:20:23 +08:00
fadb515a87 (fix): fix emacsql-sqlite3 check (#1142) 2020-09-27 02:14:27 +08:00
2e58d3df19 (fix): add emacsql-sqlite3-executable null check (#1139)
Fixes #1138
2020-09-26 20:39:58 +08:00
c05368a16b (fix): prevent link-extraction from keeping buffers open (#1131)
Fixes #1129 .

Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
2020-09-26 19:42:59 +08:00
ae32c465de (feat): move fuzzy links to roam: links (#1105) 2020-09-23 17:58:18 +08:00
da6af3a468 (fix): fix additional buffers opening from ID face (#1130)
`org-roam-id-find` opens the file containing the ID to get the marker.
We don't need to get the exact point for face computation.

Fixes #1129
2020-09-23 13:09:16 +08:00
feda1f41e5 (feat): extract idle timer interval as a customizable value (#1122)
Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
2020-09-22 15:10:43 +08:00
b2aa8bdad0 (feat): remove all symlink resolutions (#1109)
file-truename calls alone accounts for over 20% of CPU samples in org-roam-db-build-cache. It's expensive and unnecessary. To get an absolute path, expand-file-name alone is enough.

Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
2020-09-19 16:12:08 +08:00
925d225f13 (fix): fix file-name change not working on new files (#1113)
PR #1076 prevented the title change hook from causing errors for new files,
but completely disables the behaviour. To cause the title hooks to take
effect, we set the local variable `org-roam-current-title` upon save,
regardless of whether the hook ran.

This should have the effect of enabling the title change behaviour upon
first save, assuming the save succeeds.

Addresses https://org-roam.discourse.group/t/org-roam-update-file-name-on-title-change-works-discontinuously/767
2020-09-18 14:52:51 +08:00
6c89eb82af (fix): perform link expansion only on file links (#1110)
This prevents ID links from being expanded in the Org-roam buffer
2020-09-17 14:29:40 +08:00