Commit Graph

377 Commits

Author SHA1 Message Date
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
8ec4cafa2b (fix): fix link expansion on URL links (#1103)
Attempting to perform link expansion on URL links caused extreme slowdowns in Windows environment. Ref #1038 #1067.

Co-authored-by: Noboru Ota <me@nobiot.com>
2020-09-17 13:28:42 +08:00
e881ea26b1 (internal): bump required version of emacsql-sqlite3 to 1.0.2 (#1102)
This version includes the fix that ignores the user .sqliterc which can
interfere with expected behaviour.

See https://github.com/cireu/emacsql-sqlite3/pull/15 for more details.
2020-09-15 15:10:36 +08:00
efb592907e (fix): fix org-agenda hangs on face computation (#1101)
Org expects face functions to save-match-data, or it would lead to
infinite recursions with use of some Org functionality such as
org-agenda (h.t. @myshevchuk for figuring this out)

Fixes #1096 and fixes #1045.
2020-09-13 20:42:28 +08:00
da507a5bee (fix): add vanilla option for tag custom interface (#1100) 2020-09-13 02:56:32 +08:00
fc3a03977d (feat): add vanilla org-mode-tag-source (#1093)
Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
2020-09-13 02:45:45 +08:00
fac0465dd8 (feat): add org-roam-enable-fuzzy-links (#1097)
`org-roam-enable-fuzzy-links` controls whether to enable Org-roam's
fuzzy link behaviour. This can be undesirable to some users, who would
like to use [[foo]] links to reference named blocks
2020-09-12 19:30:05 +08:00
6d09323218 (fix): fix sort by mtime in completions (#1087) 2020-09-07 10:14:49 +08:00
d3a920a5b7 (fix): fix link outline extraction (#1085) 2020-09-04 20:37:02 +08:00
8fff0b86f9 (fix): fix link-extraction extracting wrong element (#1084)
Fixes #1082, #1077, #1074

When reverting link extraction to using the `org-element` api, the
preview content (org-element-at-point) was incorrectly extracted,
causing incorrect preview content and cryptic messages.
2020-09-04 15:09:12 +08:00
df174bb52b Fix link extraction error when a file starts with blank lines (#1081)
org-element-at-point doesn't just determine the closest element -- if
it's "within blank lines at the beginning of buffer", it returns nil.

  ;; Within blank lines at the beginning of buffer, return nil.
  ((bobp) nil)

Skip whitespace at beginning of buffer to avoid this.
2020-09-03 10:02:10 +08:00
cb10b16fc0 (feat): add org-roam-tag-face (#1079)
`org-roam-tag-face` controls the appearance of tags in the minibuffer.
Defaults to a bold face.
2020-08-31 23:02:12 +08:00
9ff57c8fd1 (fix): don't run title-change-hooks on new files (#1076) 2020-08-30 02:16:13 +08:00
a6aabf4038 (feat): rename file on title change (#1073)
Adds `org-roam-title-change-hook`. This now contains two functions:

1. `org-roam--update-links-on-title-change`: updates the link
description of all files that link to the current file.
2. `org-roam--update-file-name-on-title-change`: updates the current
buffer's filename to reflect the updated title.
2020-08-27 22:13:23 +08:00
b8b180d60d (feat): rename link descriptions on title changes (#1071)
Previously the rename file advice was responsible for trying to update
the link descriptions as well. This was brittle and didn't work in some
cases.

The rename-file-advice has now been altered to solely deal with breaking
links. We use the before and after-save-hooks to determine whether the
title has changed, and update the link descriptions accordingly.
2020-08-26 17:24:58 +08:00
fe5566c0dc (fix): fix non-fuzzy links being treated as fuzzy links (#1070)
Fuzzy links were initially detected as anything within double brackets.
This could include code in source blocks.

This PR introduces `(org-roam--fuzzy-link-p)`. This uses an additional
check using the `org-element` API, and ensures that the link type is
fuzzy (not a file: or https: link, for example).

Fixes #1069, and an array of unreported bugs:

1. Link extraction into the database should no longer pick up false
links (in code blocks, for example).
2. Link completion will only truly work within fuzzy links
2020-08-26 15:27:45 +08:00
cc8a2184b7 (internal): replace org-element-parse-buffer calls with regexp search (#1068) 2020-08-26 13:44:35 +08:00
4f0b1b8d43 (internal): use regexp search for link-extraction (#1066)
Replace call to org-element-parse-buffer with simple regexp search.
2020-08-25 18:24:29 +08:00
0a64a5def4 (feat): allow enabling of link completions everywhere (#1062)
Completions for Org-roam files can be enabled everywhere by setting
`org-roam-completion-everywhere` to `t`.
2020-08-25 17:09:10 +08:00
2cd993e0a5 (internal): use regexp-search for fuzzy link replacement (#1065)
This should improve responsiveness on large files
2020-08-25 13:57:02 +08:00
82ac6b6b9c (internal): speed up extraction of global props, headlines, and title (#1061)
Avoids usage of org-element-parse-buffer, preferring simple regex searches.
2020-08-24 22:14:15 +08:00
f6bf9d9401 (fix): remove org-roam-completion-case-sensitive (#1060)
Case sensitivity for completions is already controlled via
`completion-ignore-case`, so we remove this variable that doesn't
actually do what is expected.
2020-08-24 16:59:53 +08:00
38234b491d (feat): add case sensitivity for Org-roam completions (#1056)
Completions are now case-insensitive by default.
`org-roam-completion-case-sensitive` can be set to `t` to allow
case-sensitive completions.
2020-08-22 20:21:01 +08:00
4e5b52fbd3 (fix) strip todo, priority, and tags from headline candidates (#1052)
Fixes #1047
2020-08-20 15:01:19 +08:00
c33867e6bc (feat): allow ignoring files matching a regular expression (#1046)
Adds a new user option, `org-roam-file-exclude-regexp`, to exclude files from Org-roam.
2020-08-18 16:16:56 +08:00
9ee591f7a4 (fix): fix possibility of multiple idle timers (#1042)
This change ensures that `org-roam--file-update-timer` has only one
instance per Emacs instance. Fixes #1037
2020-08-16 12:08:19 +08:00
2081e1268a (feat): add org-roam-enable-headline-linking (#1030)
When disabled, Org-roam will not attempt to cache headlines, and will not create IDs.

Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
2020-08-13 11:18:06 +08:00
11aac39a1b (feat): propagate file changes on idle-timer (#1032)
Queue up file updates, to be processed on idle timer. This makes saving files more responsive for large files.

Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
2020-08-12 17:07:27 +08:00
7813b1fe1f (internal): fix CI for compat functions (#1031)
Following the advice from the coding conventions from the Emacs manual,
we preface the compatibility functions with the org-roam namespace.
2020-08-12 00:04:15 +08:00
0318983cac (feat): cache all link-types (#1009)
Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
2020-08-10 15:59:02 +08:00
9753ee451f (fix): fix fuzzy link completions (#1022) 2020-08-10 15:38:17 +08:00
8c442a72de (fix): fix fuzzy-links opening for file (#1023) 2020-08-10 14:31:10 +08:00
0ed9057a87 (feat): tag completion via capf (#1017) 2020-08-09 21:49:06 +08:00
5d02e6407b (fix): remove save-buffer on id creation (#1018)
This can trigger a lot of hooks, which may not be desirable.
2020-08-09 21:03:27 +08:00