Commit Graph

483 Commits

Author SHA1 Message Date
bbf1d97eb0 (refactor): move all the backward compatibility related code to org-roam-compat.el (#1595) 2021-07-18 22:50:45 +08:00
681873759d Refactor some docstring and parameters in org-roam.el (#1594)
This mostly goes over docstrings, updating them in places where it was
outdated and adding them to places where they didn't exist or were
existed as placeholders.
2021-07-18 14:22:45 +08:00
3a78422a09 (fix): update filter-fn docstring (#1589)
Fix inconsistency for filter-fn in ref and node functions, and update
docstrings to be consistent.
2021-07-17 21:09:38 +08:00
aee3467b3e Org-roam V2 (#1401) 2021-07-17 19:29:30 +08:00
756f6215b6 (feat): allow setting #+roam_alias and #+roam_tag on multiple lines (#1540)
This brings them more in line with how other Org keywords, such as
\#+PROPERTY, are declared.

Previously

    #+roam_alias: abc def
    #+roam_alias: ghi

would result in only the last one ("ghi") being extracted. Now ("abc"
"def" "ghi") are all extracted (in that order).

* org-roam.el (org-roam--extract-tags-prop, org-roam--extract-titles-alias): Accept and return all values in a list, not just from one line.
(org-roam--extract-prop-as-list): New function. List prop extraction refactored from `org-roam--extract-tags-prop` and `org-roam--extract-titles-alias`

* tests/test-org-roam.el: Add tests for defining tags and aliases in multiple lines
2021-06-09 20:21:08 +08:00
53c9a16e90 (fix): files not excluded when org-roam-list-files-commands is nil (#1542) 2021-06-09 20:07:47 +08:00
8ad1414030 (fix): tags: fix vanilla option (#1520)
Set `org-file-tags` before pulling tags from buffer. Should fix the
'vanilla option in `org-roam-tag-sources`
2021-05-13 15:04:49 +07:00
f754160402 (fix): Fix chronology issue between renaming notes and updating links (#1517) 2021-05-12 09:06:11 +02:00
2d58651699 optimize filename normalize (#1460)
* Normalize slug using ucs-normalize-NFC-string after remove Unicode spacing mark
* Add org-roam-slug--preserve-chars-from-normalization for Unicode Normalization
* Add org-roam-slug-trim-chars instead of org-roam-slug--preserve-chars-from-normalization
2021-04-05 21:35:58 +08:00
fde40dc1c4 (fix) parsing of missing props (#1406)
Followup from #1404
2021-01-26 14:45:19 +08:00
96b0a52273 (fix) inconsistency between props writing and reading (alias, tags) (#1404)
Fixes #1403
2021-01-26 11:09:19 +08:00
aa52b65a4a (feat): add org-roam-file-completion-tag-position (#1396) 2021-01-23 18:09:52 +08:00
1b3a0abd36 (feat): add org-roam-buffer-preview-function (#1388)
Instead of storing preview content in the database, now provide a
function to fetch these on the fly. This paves the way for future
improvements (e.g. showing more lines)
2021-01-17 02:52:39 +08:00
3fb4e21adf (fix): fix org-roam-protocol--open-ref creating new files (#1375)
We need to split the ref into its type/file before querying the db for a
match. Throw a warning when `org-roam--capture-new-file` tries to
recreate an existing file.
2021-01-10 23:05:45 +08:00
62bba9755c (fix): keep id backlinks on filename change (#1367) 2021-01-10 16:01:15 +08:00
65c0f0dc8c (feat): use org-link-display-format in org-roam-insert (#1356)
So that, like org-store-link, the computed description does not
contain the links that were captured.
2020-12-25 13:43:41 +08:00
48e195dd82 (refactor): refactor org-roam-capture (#1355) 2020-12-22 21:57:02 +08:00
777f6d23ec (feat): Support file-property drawers (#1353)
* (feat): Support file-property drawers

Add support for file-property drawers in property extraction. This means
the following is now supported:

:PROPERTIES:
:ROAM_ALIAS: alias
:ROAM_TAGS: tag1 tag2
:END:
2020-12-19 23:59:40 +08:00
8f1cf7b449 (fix): set-global-prop: prefer lowercase (#1352)
Prefer lower-case version of Org properties. Fixed bug where
adding/deleting props will alter the original case of the Org property.

Addresses #1342
2020-12-19 19:23:27 +08:00
57cfb3dbb7 (fix): index file: prevent malformed absolute path (#1346)
When `org-roam-directory` doesn't end with trailing slash and
`org-roam-index-file` contains relative filename, absolute path
to org-roam index file returned by `org-roam--get-index-path` is
malformed and invalid.

Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
2020-12-16 20:31:32 +08:00
9c23218553 (docs): fix docstring for org-roam--get-title-path-completions (#1344) 2020-12-15 20:26:43 +08:00
f2976fa3be (fix): close files intelligently after modifying (#1330)
Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
2020-12-15 18:33:55 +08:00
cff1168ac1 (doc): fix link to manual (#1328) 2020-11-28 19:44:15 +08:00
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