Compare commits
208 Commits
488372b070
...
v0.1.10
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b54f95087 | ||
|
|
17c2e9fefe | ||
|
|
d2d8c1ffcf | ||
|
|
b9c638c280 | ||
|
|
8ac8f9fe6e | ||
|
|
ddb3144e66 | ||
|
|
ad5efc4b0f | ||
|
|
2de33b8150 | ||
|
|
e1fde88a60 | ||
|
|
123da9cca3 | ||
|
|
c20e7b5f2f | ||
|
|
74a3512038 | ||
|
|
ff04c4a131 | ||
|
|
00611e05c2 | ||
|
|
3e7e54a1bd | ||
|
|
aa35d1dc03 | ||
|
|
92afdc0ea6 | ||
|
|
f43920fc7c | ||
|
|
dde4bc7920 | ||
|
|
3d68e1fd00 | ||
|
|
8271f6b44a | ||
|
|
8a26965e14 | ||
|
|
3927889e66 | ||
|
|
5ecd7b8bef | ||
|
|
b0b795d13b | ||
|
|
182c2737cd | ||
|
|
5f93cabff5 | ||
|
|
a1f8cbe079 | ||
|
|
d7e870cba1 | ||
|
|
591b5ed382 | ||
|
|
fd141762f0 | ||
|
|
d59bbfa7d2 | ||
|
|
1d9f91cdd2 | ||
|
|
68f8e04ee8 | ||
|
|
c039e0d62c | ||
|
|
e6e3783ec6 | ||
|
|
5ae19e455d | ||
|
|
f475754a71 | ||
|
|
767f44f94d | ||
|
|
1411aca7b5 | ||
|
|
9ccdcaac24 | ||
|
|
d1223dcdb7 | ||
|
|
59448a4f2c | ||
|
|
5136880532 | ||
|
|
8654cf5507 | ||
|
|
6ca4dc8ffc | ||
|
|
a6f36ba679 | ||
|
|
176e37874e | ||
|
|
3208a04f7a | ||
|
|
0d579263cb | ||
|
|
c022b30110 | ||
|
|
7da4e4a29b | ||
|
|
8bc942a26f | ||
|
|
dff7550038 | ||
|
|
c4edcb8c24 | ||
|
|
4a44d88461 | ||
|
|
efc6bd11d9 | ||
|
|
51429e3155 | ||
|
|
b1a0fa4acf | ||
|
|
aeb2b6fe68 | ||
|
|
6679db98a8 | ||
|
|
5363324bbf | ||
|
|
dc9188dffc | ||
|
|
bd620ccd0d | ||
|
|
1947ae9f22 | ||
|
|
3fcf1b3864 | ||
|
|
d965dd6fd1 | ||
|
|
42dcd41e48 | ||
|
|
68fac7cfe8 | ||
|
|
a9f067e25a | ||
|
|
41b4b1015e | ||
|
|
9523365090 | ||
|
|
aa33fe42a8 | ||
|
|
78a9b93f22 | ||
|
|
a89339e472 | ||
|
|
f3307a8159 | ||
|
|
4bfa25dcb3 | ||
|
|
441a240c33 | ||
|
|
e767892dd5 | ||
|
|
8e0a7dea0f | ||
|
|
c4cc40f5e1 | ||
|
|
a5129199c7 | ||
|
|
c0e462944d | ||
|
|
63614841e8 | ||
|
|
bc4c09c546 | ||
|
|
0d1ab0e75a | ||
|
|
6e39029f91 | ||
|
|
d550966516 | ||
|
|
32d6b3d1ee | ||
|
|
7cb71a5a0a | ||
|
|
6b90a9bfa8 | ||
|
|
83d939bdc0 | ||
|
|
0e1ace78f4 | ||
|
|
6d4db60688 | ||
|
|
3aca01891d | ||
|
|
275ed87c3f | ||
|
|
b385270d7b | ||
|
|
fb412bc2cd | ||
|
|
585b1d2b74 | ||
|
|
c578bb45af | ||
|
|
b7f7876706 | ||
|
|
ee5ed17c20 | ||
|
|
a873794068 | ||
|
|
360b2d963d | ||
|
|
534c5ded3c | ||
|
|
bdaf90af03 | ||
|
|
1a67aac502 | ||
|
|
9f166278f4 | ||
|
|
c2222c9102 | ||
|
|
fc104680eb | ||
|
|
e40e3ff553 | ||
|
|
0b465fe290 | ||
|
|
d5396e311b | ||
|
|
384242af87 | ||
|
|
ec755bae8b | ||
|
|
0b1e06f0d5 | ||
|
|
bdfa050ee3 | ||
|
|
ec98e1c3c5 | ||
|
|
0d0b1b2051 | ||
|
|
2215c32e57 | ||
|
|
cf257443b0 | ||
|
|
62815621e4 | ||
|
|
7af5359e00 | ||
|
|
d1184fa1d0 | ||
|
|
5b146d7c07 | ||
|
|
926682d513 | ||
|
|
4c89d6c813 | ||
|
|
62926bb91d | ||
|
|
9ab649ebd4 | ||
|
|
ca1b633a9f | ||
|
|
f543caee00 | ||
|
|
409a92333e | ||
|
|
7a38d1ead3 | ||
|
|
33c53a14ab | ||
|
|
65615c64d2 | ||
|
|
166e59b922 | ||
|
|
8e357ed3b6 | ||
|
|
45074e3be3 | ||
|
|
ee1d8ca321 | ||
|
|
25531cc443 | ||
|
|
47a440147f | ||
|
|
8a91b9a074 | ||
|
|
d1ef83afca | ||
|
|
86dd526dde | ||
|
|
4d88256394 | ||
|
|
c49455e9ce | ||
|
|
a588da2c4a | ||
|
|
869c98d8b2 | ||
|
|
0374743cad | ||
|
|
4bc2f48738 | ||
|
|
69500837f2 | ||
|
|
0d0b9863c3 | ||
|
|
6bc6fdc87b | ||
|
|
53b9deff10 | ||
|
|
627f16e3a0 | ||
|
|
bf1a281c29 | ||
|
|
df4daa0e16 | ||
|
|
5cd34ba3a2 | ||
|
|
13b95cd0a1 | ||
|
|
876d042c37 | ||
|
|
81c0b7079f | ||
|
|
4a367dd7e0 | ||
|
|
8a0f9d4540 | ||
|
|
f6155ecf93 | ||
|
|
c077d34933 | ||
|
|
1ecc3ecf9d | ||
|
|
ced35e1694 | ||
|
|
840dc0a750 | ||
|
|
adc5a383c3 | ||
|
|
5ac12229f4 | ||
|
|
9565435526 | ||
|
|
e39562c85d | ||
|
|
c49556bd5d | ||
|
|
84ec2f2023 | ||
|
|
00ed63dcaa | ||
|
|
8dde8ce4e1 | ||
|
|
4e551e6d7e | ||
|
|
ea29ad8667 | ||
|
|
085e728c34 | ||
|
|
99318f39e3 | ||
|
|
c679a85e77 | ||
|
|
fc17fc224c | ||
|
|
7fe7e7a6ea | ||
|
|
ef591556fe | ||
|
|
c150aa4dea | ||
|
|
1df6777b0b | ||
|
|
8a109276df | ||
|
|
f07d041eb9 | ||
|
|
9bdec391f1 | ||
|
|
b9ead09dde | ||
|
|
dd009498dd | ||
|
|
17c745ee71 | ||
|
|
41aa0349a0 | ||
|
|
a6adeee40b | ||
|
|
a32cea8139 | ||
|
|
37bc5ef712 | ||
|
|
1a2f0856da | ||
|
|
3f707149e3 | ||
|
|
e9276e35ca | ||
|
|
3041a575f9 | ||
|
|
42dbda494a | ||
|
|
0e791e67ab | ||
|
|
ba55e0df4f | ||
|
|
d987b9b75b | ||
|
|
aa253c38dd | ||
|
|
ceb5376b21 | ||
|
|
b64c1c944b | ||
|
|
8bc79f9ef3 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
/target
|
/target
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
|
TODO.org
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ spec:
|
|||||||
value: []
|
value: []
|
||||||
- name: docker-image
|
- name: docker-image
|
||||||
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
|
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
|
||||||
- name: run-image-all
|
- name: run-image-tracing-compare
|
||||||
taskRef:
|
taskRef:
|
||||||
name: run-docker-image
|
name: run-docker-image
|
||||||
workspaces:
|
workspaces:
|
||||||
@@ -152,6 +152,46 @@ spec:
|
|||||||
value: ["--no-default-features", "--features", "tracing,compare"]
|
value: ["--no-default-features", "--features", "tracing,compare"]
|
||||||
- name: docker-image
|
- name: docker-image
|
||||||
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
|
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
|
||||||
|
- name: run-image-compare-foreign
|
||||||
|
taskRef:
|
||||||
|
name: run-docker-image
|
||||||
|
workspaces:
|
||||||
|
- name: source
|
||||||
|
workspace: git-source
|
||||||
|
- name: cargo-cache
|
||||||
|
workspace: cargo-cache
|
||||||
|
runAfter:
|
||||||
|
- run-image-tracing-compare
|
||||||
|
params:
|
||||||
|
- name: args
|
||||||
|
value:
|
||||||
|
[
|
||||||
|
"--no-default-features",
|
||||||
|
"--features",
|
||||||
|
"compare,foreign_document_test",
|
||||||
|
]
|
||||||
|
- name: docker-image
|
||||||
|
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
|
||||||
|
- name: run-image-all
|
||||||
|
taskRef:
|
||||||
|
name: run-docker-image
|
||||||
|
workspaces:
|
||||||
|
- name: source
|
||||||
|
workspace: git-source
|
||||||
|
- name: cargo-cache
|
||||||
|
workspace: cargo-cache
|
||||||
|
runAfter:
|
||||||
|
- run-image-compare-foreign
|
||||||
|
params:
|
||||||
|
- name: args
|
||||||
|
value:
|
||||||
|
[
|
||||||
|
"--no-default-features",
|
||||||
|
"--features",
|
||||||
|
"tracing,compare,foreign_document_test",
|
||||||
|
]
|
||||||
|
- name: docker-image
|
||||||
|
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
|
||||||
finally:
|
finally:
|
||||||
- name: report-success
|
- name: report-success
|
||||||
when:
|
when:
|
||||||
|
|||||||
13
Cargo.toml
13
Cargo.toml
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "organic"
|
name = "organic"
|
||||||
version = "0.1.9"
|
version = "0.1.10"
|
||||||
authors = ["Tom Alexander <tom@fizz.buzz>"]
|
authors = ["Tom Alexander <tom@fizz.buzz>"]
|
||||||
description = "An org-mode parser."
|
description = "An org-mode parser."
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@@ -31,7 +31,14 @@ path = "src/lib.rs"
|
|||||||
path = "src/bin_compare.rs"
|
path = "src/bin_compare.rs"
|
||||||
required-features = ["compare"]
|
required-features = ["compare"]
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
# This bin exists for development purposes only. The real target of this crate is the library.
|
||||||
|
name = "foreign_document_test"
|
||||||
|
path = "src/bin_foreign_document_test.rs"
|
||||||
|
required-features = ["foreign_document_test"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
futures = { version = "0.3.28", optional = true }
|
||||||
nom = "7.1.1"
|
nom = "7.1.1"
|
||||||
opentelemetry = { version = "0.20.0", optional = true, default-features = false, features = ["trace", "rt-tokio"] }
|
opentelemetry = { version = "0.20.0", optional = true, default-features = false, features = ["trace", "rt-tokio"] }
|
||||||
opentelemetry-otlp = { version = "0.13.0", optional = true }
|
opentelemetry-otlp = { version = "0.13.0", optional = true }
|
||||||
@@ -40,13 +47,15 @@ tokio = { version = "1.30.0", optional = true, default-features = false, feature
|
|||||||
tracing = { version = "0.1.37", optional = true }
|
tracing = { version = "0.1.37", optional = true }
|
||||||
tracing-opentelemetry = { version = "0.20.0", optional = true }
|
tracing-opentelemetry = { version = "0.20.0", optional = true }
|
||||||
tracing-subscriber = { version = "0.3.17", optional = true, features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3.17", optional = true, features = ["env-filter"] }
|
||||||
|
walkdir = { version = "2.3.3", optional = true }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
walkdir = "2.3.3"
|
walkdir = "2.3.3"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
compare = []
|
compare = ["tokio/process", "tokio/macros"]
|
||||||
|
foreign_document_test = ["compare", "dep:futures", "tokio/sync", "dep:walkdir", "tokio/process"]
|
||||||
tracing = ["dep:opentelemetry", "dep:opentelemetry-otlp", "dep:opentelemetry-semantic-conventions", "dep:tokio", "dep:tracing", "dep:tracing-opentelemetry", "dep:tracing-subscriber"]
|
tracing = ["dep:opentelemetry", "dep:opentelemetry-otlp", "dep:opentelemetry-semantic-conventions", "dep:tokio", "dep:tracing", "dep:tracing-opentelemetry", "dep:tracing-subscriber"]
|
||||||
|
|
||||||
# Optimized build for any sort of release.
|
# Optimized build for any sort of release.
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -52,6 +52,8 @@ buildtest:
|
|||||||
> cargo build --no-default-features --features compare
|
> cargo build --no-default-features --features compare
|
||||||
> cargo build --no-default-features --features tracing
|
> cargo build --no-default-features --features tracing
|
||||||
> cargo build --no-default-features --features compare,tracing
|
> cargo build --no-default-features --features compare,tracing
|
||||||
|
> cargo build --no-default-features --features compare,foreign_document_test
|
||||||
|
> cargo build --no-default-features --features compare,tracing,foreign_document_test
|
||||||
|
|
||||||
.PHONY: foreign_document_test
|
.PHONY: foreign_document_test
|
||||||
foreign_document_test:
|
foreign_document_test:
|
||||||
|
|||||||
@@ -6,14 +6,13 @@ Organic is an emacs-less implementation of an [org-mode](https://orgmode.org/) p
|
|||||||
|
|
||||||
This project is still under HEAVY development. While the version remains v0.1.x the API will be changing often. Once we hit v0.2.x we will start following semver.
|
This project is still under HEAVY development. While the version remains v0.1.x the API will be changing often. Once we hit v0.2.x we will start following semver.
|
||||||
|
|
||||||
Currently, the parser is able to correctly identify the start/end bounds of all the org-mode objects and elements (except table.el tables, org-mode tables are supported) but many of the interior properties are not yet populated.
|
Currently, Organic parses most documents the same as the official org-mode parser. Most of the development right now is finding documents where the parsers differ and fixing those issues.
|
||||||
|
|
||||||
### Project Goals
|
### Project Goals
|
||||||
- We aim to provide perfect parity with the emacs org-mode parser. In that regard, any document that parses differently between Emacs and Organic is considered a bug.
|
- We aim to provide perfect parity with the emacs org-mode parser. In that regard, any document that parses differently between Emacs and Organic is considered a bug.
|
||||||
- The parser should be fast. We're not doing anything special, but since this is written in Rust and natively compiled we should be able to beat the existing parsers.
|
|
||||||
- The parser should have minimal dependencies. This should reduce effort w.r.t.: security audits, legal compliance, portability.
|
- The parser should have minimal dependencies. This should reduce effort w.r.t.: security audits, legal compliance, portability.
|
||||||
- The parser should be usable everywhere. In the interest of getting org-mode used in as many places as possible, this parser should be usable by everyone everywhere. This means:
|
- The parser should be usable everywhere. In the interest of getting org-mode used in as many places as possible, this parser should be usable by everyone everywhere. This means:
|
||||||
- It must have a permissive license for use in proprietary code bases.
|
- It must have a permissive license.
|
||||||
- We will investigate compiling to WASM. This is an important goal of the project and will definitely happen, but only after the parser has a more stable API.
|
- We will investigate compiling to WASM. This is an important goal of the project and will definitely happen, but only after the parser has a more stable API.
|
||||||
- We will investigate compiling to a C library for native linking to other code. This is more of a maybe-goal for the project.
|
- We will investigate compiling to a C library for native linking to other code. This is more of a maybe-goal for the project.
|
||||||
### Project Non-Goals
|
### Project Non-Goals
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ RUN make DESTDIR="/root/dist" install
|
|||||||
|
|
||||||
|
|
||||||
FROM build AS build-org-mode
|
FROM build AS build-org-mode
|
||||||
ARG ORG_VERSION=c703541ffcc14965e3567f928de1683a1c1e33f6
|
ARG ORG_VERSION=abf5156096c06ee5aa05795c3dc5a065f76ada97
|
||||||
COPY --from=build-emacs /root/dist/ /
|
COPY --from=build-emacs /root/dist/ /
|
||||||
RUN mkdir /root/dist
|
RUN mkdir /root/dist
|
||||||
# Savannah does not allow fetching specific revisions, so we're going to have to put unnecessary load on their server by cloning main and then checking out the revision we want.
|
# Savannah does not allow fetching specific revisions, so we're going to have to put unnecessary load on their server by cloning main and then checking out the revision we want.
|
||||||
@@ -102,6 +102,4 @@ COPY --from=foreign-document-gather /foreign_documents/doomemacs /foreign_docume
|
|||||||
COPY --from=foreign-document-gather /foreign_documents/worg /foreign_documents/worg
|
COPY --from=foreign-document-gather /foreign_documents/worg /foreign_documents/worg
|
||||||
COPY --from=build-org-mode /root/org-mode /foreign_documents/org-mode
|
COPY --from=build-org-mode /root/org-mode /foreign_documents/org-mode
|
||||||
COPY --from=build-emacs /root/emacs /foreign_documents/emacs
|
COPY --from=build-emacs /root/emacs /foreign_documents/emacs
|
||||||
COPY foreign_document_test_entrypoint.sh /entrypoint.sh
|
ENTRYPOINT ["cargo", "run", "--bin", "foreign_document_test", "--features", "compare,foreign_document_test", "--profile", "release-lto"]
|
||||||
RUN chmod +x /entrypoint.sh
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
||||||
|
|||||||
@@ -1,149 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# Run the Organic compare script against a series of documents sourced from exterior places.
|
|
||||||
set -euo pipefail
|
|
||||||
IFS=$'\n\t'
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
||||||
|
|
||||||
REALPATH=$(command -v uu-realpath || command -v realpath)
|
|
||||||
|
|
||||||
function log {
|
|
||||||
(>&2 echo "${@}")
|
|
||||||
}
|
|
||||||
|
|
||||||
function die {
|
|
||||||
local status_code="$1"
|
|
||||||
shift
|
|
||||||
(>&2 echo "${@}")
|
|
||||||
exit "$status_code"
|
|
||||||
}
|
|
||||||
|
|
||||||
function main {
|
|
||||||
cargo build --no-default-features --features compare --profile release-lto
|
|
||||||
if [ "${CARGO_TARGET_DIR:-}" = "" ]; then
|
|
||||||
CARGO_TARGET_DIR=$(realpath target/)
|
|
||||||
fi
|
|
||||||
PARSE="${CARGO_TARGET_DIR}/release-lto/compare"
|
|
||||||
|
|
||||||
local all_status=0
|
|
||||||
set +e
|
|
||||||
|
|
||||||
(run_compare_function "org-mode" compare_all_org_document "/foreign_documents/org-mode")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
(run_compare_function "emacs" compare_all_org_document "/foreign_documents/emacs")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
(run_compare_function "worg" compare_all_org_document "/foreign_documents/worg")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
(run_compare_function "howard_abrams" compare_howard_abrams)
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
(run_compare_function "doomemacs" compare_all_org_document "/foreign_documents/doomemacs")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
|
|
||||||
set -e
|
|
||||||
if [ "$all_status" -ne 0 ]; then
|
|
||||||
red_text "Some tests failed."
|
|
||||||
else
|
|
||||||
green_text "All tests passed."
|
|
||||||
fi
|
|
||||||
return "$all_status"
|
|
||||||
}
|
|
||||||
|
|
||||||
function green_text {
|
|
||||||
(IFS=' '; printf '\x1b[38;2;0;255;0m%s\x1b[0m' "${*}")
|
|
||||||
}
|
|
||||||
|
|
||||||
function red_text {
|
|
||||||
(IFS=' '; printf '\x1b[38;2;255;0;0m%s\x1b[0m' "${*}")
|
|
||||||
}
|
|
||||||
|
|
||||||
function yellow_text {
|
|
||||||
(IFS=' '; printf '\x1b[38;2;255;255;0m%s\x1b[0m' "${*}")
|
|
||||||
}
|
|
||||||
|
|
||||||
function indent {
|
|
||||||
local depth="$1"
|
|
||||||
local scaled_depth=$((depth * 2))
|
|
||||||
shift 1
|
|
||||||
local prefix
|
|
||||||
prefix=$(printf -- "%${scaled_depth}s")
|
|
||||||
while read -r l; do
|
|
||||||
(IFS=' '; printf -- '%s%s\n' "$prefix" "$l")
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function run_compare_function {
|
|
||||||
local name="$1"
|
|
||||||
local stdoutput
|
|
||||||
shift 1
|
|
||||||
set +e
|
|
||||||
stdoutput=$("${@}")
|
|
||||||
local status=$?
|
|
||||||
set -e
|
|
||||||
if [ "$status" -eq 0 ]; then
|
|
||||||
echo "$(green_text "GOOD") $name"
|
|
||||||
indent 1 <<<"$stdoutput"
|
|
||||||
else
|
|
||||||
echo "$(red_text "FAIL") $name"
|
|
||||||
indent 1 <<<"$stdoutput"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function compare_all_org_document {
|
|
||||||
local root_dir="$1"
|
|
||||||
local target_document
|
|
||||||
local all_status=0
|
|
||||||
while read target_document; do
|
|
||||||
local relative_path
|
|
||||||
relative_path=$($REALPATH --relative-to "$root_dir" "$target_document")
|
|
||||||
set +e
|
|
||||||
(run_compare "$relative_path" "$target_document")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
set -e
|
|
||||||
done<<<"$(find "$root_dir" -type f -iname '*.org' | sort)"
|
|
||||||
return "$all_status"
|
|
||||||
}
|
|
||||||
|
|
||||||
function run_compare {
|
|
||||||
local name="$1"
|
|
||||||
local target_document="$2"
|
|
||||||
set +e
|
|
||||||
($PARSE "$target_document" &> /dev/null)
|
|
||||||
local status=$?
|
|
||||||
set -e
|
|
||||||
if [ "$status" -eq 0 ]; then
|
|
||||||
echo "$(green_text "GOOD") $name"
|
|
||||||
else
|
|
||||||
echo "$(red_text "FAIL") $name"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function compare_howard_abrams {
|
|
||||||
local all_status=0
|
|
||||||
set +e
|
|
||||||
|
|
||||||
(run_compare_function "dot-files" compare_all_org_document "/foreign_documents/howardabrams/dot-files")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
(run_compare_function "hamacs" compare_all_org_document "/foreign_documents/howardabrams/hamacs")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
(run_compare_function "demo-it" compare_all_org_document "/foreign_documents/howardabrams/demo-it")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
(run_compare_function "magit-demo" compare_all_org_document "/foreign_documents/howardabrams/magit-demo")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
(run_compare_function "pdx-emacs-hackers" compare_all_org_document "/foreign_documents/howardabrams/pdx-emacs-hackers")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
(run_compare_function "flora-simulator" compare_all_org_document "/foreign_documents/howardabrams/flora-simulator")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
(run_compare_function "literate-devops-demo" compare_all_org_document "/foreign_documents/howardabrams/literate-devops-demo")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
(run_compare_function "clojure-yesql-xp" compare_all_org_document "/foreign_documents/howardabrams/clojure-yesql-xp")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
(run_compare_function "veep" compare_all_org_document "/foreign_documents/howardabrams/veep")
|
|
||||||
if [ "$?" -ne 0 ]; then all_status=1; fi
|
|
||||||
|
|
||||||
set -e
|
|
||||||
return "$all_status"
|
|
||||||
}
|
|
||||||
|
|
||||||
main "${@}"
|
|
||||||
@@ -1,5 +1,11 @@
|
|||||||
(dolist (var org-entities)
|
(dolist (var (sort (seq-filter 'listp org-entities)
|
||||||
(when (listp var)
|
(lambda (x y) (> (length (nth 0 x)) (length (nth 0 y))))))
|
||||||
(message "\"%s\"," (nth 0 var))
|
(message "EntityDefinition {name: %s, latex_math_mode: %s, latex: %s, html: %s, ascii: %s, utf8: %s},"
|
||||||
|
(prin1-to-string (nth 0 var))
|
||||||
|
(if (nth 2 var) "true" "false")
|
||||||
|
(prin1-to-string (nth 1 var))
|
||||||
|
(prin1-to-string (nth 3 var))
|
||||||
|
(prin1-to-string (nth 4 var))
|
||||||
|
(prin1-to-string (nth 6 var))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
8
org_mode_samples/affiliated_keyword/optional_value.org
Normal file
8
org_mode_samples/affiliated_keyword/optional_value.org
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#+CAPTION[foo]: *bar*
|
||||||
|
#+CAPTION[*lorem* ipsum]: dolar
|
||||||
|
1. baz
|
||||||
|
|
||||||
|
|
||||||
|
#+CAPTION[foo]: *bar*
|
||||||
|
#+CAPTION[*lorem* ipsum]: dolar
|
||||||
|
# Comments cannot have affiliated keywords so those become regular keywords.
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
* Headline
|
||||||
|
before
|
||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
:candle:
|
||||||
|
inside
|
||||||
|
|
||||||
|
the drawer
|
||||||
|
:end:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
:candle:
|
||||||
|
inside
|
||||||
|
|
||||||
|
the drawer
|
||||||
|
:end:
|
||||||
|
|
||||||
|
after
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
* Headline
|
|
||||||
before
|
|
||||||
#+NAME: foo
|
|
||||||
:candle:
|
|
||||||
inside
|
|
||||||
|
|
||||||
the drawer
|
|
||||||
:end:
|
|
||||||
|
|
||||||
after
|
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
#+BEGIN: clocktable :scope file :maxlevel 2
|
||||||
|
#+CAPTION: Clock summary at [2023-08-25 Fri 05:34]
|
||||||
|
| Headline | Time |
|
||||||
|
|--------------+--------|
|
||||||
|
| *Total time* | *0:00* |
|
||||||
|
#+END:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
#+BEGIN: clocktable :scope file :maxlevel 2
|
||||||
|
#+CAPTION: Clock summary at [2023-08-25 Fri 05:34]
|
||||||
|
| Headline | Time |
|
||||||
|
|--------------+--------|
|
||||||
|
| *Total time* | *0:00* |
|
||||||
|
#+END:
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
#+BEGIN: clocktable :scope file :maxlevel 2
|
|
||||||
#+CAPTION: Clock summary at [2023-08-25 Fri 05:34]
|
|
||||||
| Headline | Time |
|
|
||||||
|--------------+--------|
|
|
||||||
| *Total time* | *0:00* |
|
|
||||||
#+END:
|
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
[fn:1] A footnote.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
[fn:1] A footnote.
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
#+begin_center
|
||||||
|
|
||||||
|
#+end_center
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
#+begin_center
|
||||||
|
|
||||||
|
#+end_center
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
#+begin_center
|
|
||||||
|
|
||||||
#+end_center
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
#+begin_quote
|
||||||
|
|
||||||
|
#+end_quote
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
#+begin_quote
|
||||||
|
|
||||||
|
#+end_quote
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
#+begin_quote
|
|
||||||
|
|
||||||
#+end_quote
|
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
#+begin_defun
|
||||||
|
foo
|
||||||
|
|
||||||
|
{{{bar(baz)}}}
|
||||||
|
#+end_defun
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
#+begin_defun
|
||||||
|
foo
|
||||||
|
|
||||||
|
{{{bar(baz)}}}
|
||||||
|
#+end_defun
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
#+begin_defun
|
|
||||||
foo
|
|
||||||
|
|
||||||
{{{bar(baz)}}}
|
|
||||||
#+end_defun
|
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
1. bar
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
1. BAR
|
||||||
3
org_mode_samples/greater_element/plain_list/checkbox.org
Normal file
3
org_mode_samples/greater_element/plain_list/checkbox.org
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
- [ ] Foo
|
||||||
|
- [-] Bar
|
||||||
|
- [X] Baz
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
1. foo
|
||||||
|
#+NAME: bar
|
||||||
|
2. baz
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
1. bar
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# This test causes problems with regular links if we do not create a new ContextTree when calling into confine_context.
|
||||||
|
- foo [[info:bar][baz]] lorem
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
* baz
|
||||||
|
# lorem
|
||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
* baz
|
||||||
|
# lorem
|
||||||
|
|
||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
* baz
|
||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
* baz
|
||||||
|
|
||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
* baz
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# lorem
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
:PROPERTIES:
|
||||||
|
:foo: bar
|
||||||
|
:foo+: baz
|
||||||
|
:cat: dog
|
||||||
|
:END:
|
||||||
|
|
||||||
|
# Even though these are inheriting the properties and overwriting and/or appending to them, this is not represented in the parser AST so Organic does not do any special handling of this.
|
||||||
|
|
||||||
|
* Overwrite
|
||||||
|
:PROPERTIES:
|
||||||
|
:foo: lorem
|
||||||
|
:bat: car
|
||||||
|
:END:
|
||||||
|
|
||||||
|
* Append
|
||||||
|
:PROPERTIES:
|
||||||
|
:foo+: ipsum
|
||||||
|
:cake: lie
|
||||||
|
:END:
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
* Overwrite
|
||||||
|
#+NAME: foo
|
||||||
|
:PROPERTIES:
|
||||||
|
:header-args: :var foo="lorem"
|
||||||
|
:END:
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Blank lines and comments can come before property drawers in the zeroth section
|
|
||||||
:PROPERTIES:
|
|
||||||
:FOO: bar
|
|
||||||
:END:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Spaces turn property drawers into regular drawers
|
|
||||||
|
|
||||||
:PROPERTIES:
|
|
||||||
:FOO: bar
|
|
||||||
:END:
|
|
||||||
* Comments turn property drawers into regular drawers
|
|
||||||
# Comment
|
|
||||||
:PROPERTIES:
|
|
||||||
:FOO: bar
|
|
||||||
:END:
|
|
||||||
* Baseline
|
|
||||||
:PROPERTIES:
|
|
||||||
:FOO: bar
|
|
||||||
:END:
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# lorem
|
||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# lorem
|
||||||
|
|
||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# lorem
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Blank lines and comments can come before property drawers in the zeroth section
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
:PROPERTIES:
|
|
||||||
:FOO: bar
|
|
||||||
:END:
|
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
| foo | bar |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
| foo | bar |
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
| foo | bar |
|
|
||||||
3
org_mode_samples/greater_element/table/row/name.org
Normal file
3
org_mode_samples/greater_element/table/row/name.org
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|foo|
|
||||||
|
#+NAME: bar
|
||||||
|
|baz |
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
#+call: foo(bar="baz")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
#+call: foo(bar="baz")
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
#+call: foo(bar="baz")
|
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
%%(foo)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
%%(foo)
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
%%(foo)
|
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
: bar
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
: bar
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
: bar
|
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
-----
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
-----
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
-----
|
|
||||||
@@ -1,8 +1,63 @@
|
|||||||
#+name: foo
|
#+NAME: a
|
||||||
#+caption: bar
|
#+caption: b *lorem* ipsum
|
||||||
#+caption: baz
|
#+results: c
|
||||||
[[file:lorem/ipsum.png]]
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
#+foo: bar
|
||||||
|
|
||||||
#+name: cat
|
|
||||||
#+caption: dog
|
|
||||||
[[file:lorem/ipsum.png]]
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
#+foo: bar
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
# This test is to prove that the parser works with affiliated keywords that have both a shorter and longer version.
|
|
||||||
|
|
||||||
#+results:
|
|
||||||
#+result:
|
|
||||||
#+begin_latex
|
|
||||||
\foo
|
|
||||||
#+end_latex
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
#+FOO: BAR
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
\begin{foo}
|
||||||
|
bar
|
||||||
|
\end{foo}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
\begin{foo}
|
||||||
|
bar
|
||||||
|
\end{foo}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
\begin{foo}
|
|
||||||
bar
|
|
||||||
\end{foo}
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
#+begin_comment text
|
||||||
|
bar
|
||||||
|
#+end_comment
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
#+begin_comment text
|
||||||
|
bar
|
||||||
|
#+end_comment
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
#+begin_comment text
|
|
||||||
bar
|
|
||||||
#+end_comment
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
#+begin_example text
|
||||||
|
bar
|
||||||
|
#+end_example
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
#+begin_example text
|
||||||
|
bar
|
||||||
|
#+end_example
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
#+begin_example text
|
|
||||||
bar
|
|
||||||
#+end_example
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
#+begin_export text
|
||||||
|
bar
|
||||||
|
#+end_export
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
#+begin_export text
|
||||||
|
bar
|
||||||
|
#+end_export
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
#+begin_export text
|
|
||||||
bar
|
|
||||||
#+end_export
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
#+begin_src text
|
||||||
|
bar
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
#+begin_src text
|
||||||
|
bar
|
||||||
|
#+end_src
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
#+begin_src text
|
|
||||||
bar
|
|
||||||
#+end_src
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
#+begin_verse text
|
||||||
|
bar
|
||||||
|
#+end_verse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
#+begin_verse text
|
||||||
|
bar
|
||||||
|
#+end_verse
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
#+begin_verse text
|
|
||||||
bar
|
|
||||||
#+end_verse
|
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
#+NAME: a
|
||||||
|
#+caption: b *lorem* ipsum
|
||||||
|
#+results: c
|
||||||
|
#+headers: d
|
||||||
|
#+header: e
|
||||||
|
#+label: f
|
||||||
|
#+plot: g
|
||||||
|
#+resname: h
|
||||||
|
#+result: i
|
||||||
|
#+source: j
|
||||||
|
#+srcname: k
|
||||||
|
#+tblname: l
|
||||||
|
#+attr_latex: m
|
||||||
|
#+attr_html: n
|
||||||
|
#+NAME: aa
|
||||||
|
#+caption: bb *lorem* ipsum
|
||||||
|
#+results: cc
|
||||||
|
#+headers: dd
|
||||||
|
#+header: ee
|
||||||
|
#+label: ff
|
||||||
|
#+plot: gg
|
||||||
|
#+resname: hh
|
||||||
|
#+result: ii
|
||||||
|
#+source: jj
|
||||||
|
#+srcname: kk
|
||||||
|
#+tblname: ll
|
||||||
|
#+attr_latex: mm
|
||||||
|
#+attr_html: nn
|
||||||
|
bar
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#+NAME: A
|
||||||
|
#+CAPTION: B *LOREM* IPSUM
|
||||||
|
#+RESULTS: C
|
||||||
|
#+HEADERS: D
|
||||||
|
#+HEADER: E
|
||||||
|
#+LABEL: F
|
||||||
|
#+PLOT: G
|
||||||
|
#+RESNAME: H
|
||||||
|
#+RESULT: I
|
||||||
|
#+SOURCE: J
|
||||||
|
#+SRCNAME: K
|
||||||
|
#+TBLNAME: L
|
||||||
|
#+ATTR_LATEX: M
|
||||||
|
#+ATTR_HTML: N
|
||||||
|
#+NAME: AA
|
||||||
|
#+CAPTION: BB *LOREM* IPSUM
|
||||||
|
#+RESULTS: CC
|
||||||
|
#+HEADERS: DD
|
||||||
|
#+HEADER: EE
|
||||||
|
#+LABEL: FF
|
||||||
|
#+PLOT: GG
|
||||||
|
#+RESNAME: HH
|
||||||
|
#+RESULT: II
|
||||||
|
#+SOURCE: JJ
|
||||||
|
#+SRCNAME: KK
|
||||||
|
#+TBLNAME: LL
|
||||||
|
#+ATTR_LATEX: MM
|
||||||
|
#+ATTR_HTML: NN
|
||||||
|
bar
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#+NAME: foo
|
|
||||||
bar
|
|
||||||
2
org_mode_samples/object/angle_link/application.org
Normal file
2
org_mode_samples/object/angle_link/application.org
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<file+sys://foo>
|
||||||
|
<file+emacs://foo>
|
||||||
13
org_mode_samples/object/angle_link/code_ref_link.org
Normal file
13
org_mode_samples/object/angle_link/code_ref_link.org
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<(foo)>
|
||||||
|
|
||||||
|
<((bar))>
|
||||||
|
|
||||||
|
<((baz)>
|
||||||
|
|
||||||
|
<(lo
|
||||||
|
rem)>
|
||||||
|
|
||||||
|
# These become fuzzy
|
||||||
|
<(foo) >
|
||||||
|
< (foo)>
|
||||||
|
<(foo)::3>
|
||||||
6
org_mode_samples/object/angle_link/custom_id_link.org
Normal file
6
org_mode_samples/object/angle_link/custom_id_link.org
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<#foo>
|
||||||
|
|
||||||
|
<#fo
|
||||||
|
o>
|
||||||
|
|
||||||
|
<#foo::3>
|
||||||
1
org_mode_samples/object/angle_link/elisp.org
Normal file
1
org_mode_samples/object/angle_link/elisp.org
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<elisp:(local-set-key "\M-\x" 'foo-bar-baz)>
|
||||||
21
org_mode_samples/object/angle_link/file_link.org
Normal file
21
org_mode_samples/object/angle_link/file_link.org
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<./simple.org>
|
||||||
|
<../simple.org>
|
||||||
|
</simple.org>
|
||||||
|
<file:simple.org>
|
||||||
|
<file:sim ple.org>
|
||||||
|
|
||||||
|
<file:simp
|
||||||
|
le.org>
|
||||||
|
|
||||||
|
<file:simple.org::3>
|
||||||
|
<file:simple.org::foo>
|
||||||
|
<file:simple.org::#foo>
|
||||||
|
<file:simple.org::foo bar>
|
||||||
|
<file:simple.org::foo
|
||||||
|
bar>
|
||||||
|
<file:simple.org::foo
|
||||||
|
bar>
|
||||||
|
<file:simple.org::foo
|
||||||
|
bar>
|
||||||
|
<file:simple.org::foo::bar>
|
||||||
|
<file:simple.org::/foo/>
|
||||||
6
org_mode_samples/object/angle_link/fuzzy_link.org
Normal file
6
org_mode_samples/object/angle_link/fuzzy_link.org
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<elisp.org>
|
||||||
|
|
||||||
|
<eli
|
||||||
|
sp.org>
|
||||||
|
|
||||||
|
<elisp.org::3>
|
||||||
6
org_mode_samples/object/angle_link/id_link.org
Normal file
6
org_mode_samples/object/angle_link/id_link.org
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<id:83986bdf-987c-465d-8851-44cb4c02a86c>
|
||||||
|
|
||||||
|
<id:83986bdf-987c-465d
|
||||||
|
-8851-44cb4c02a86c>
|
||||||
|
|
||||||
|
<id:83986bdf-987c-465d-8851-44cb4c02a86c::foo>
|
||||||
20
org_mode_samples/object/angle_link/multiple_slashes.org
Normal file
20
org_mode_samples/object/angle_link/multiple_slashes.org
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<file:foo>
|
||||||
|
<file:/bar>
|
||||||
|
<file://baz>
|
||||||
|
<file:///lorem>
|
||||||
|
<file:////ipsum>
|
||||||
|
<file://///dolar>
|
||||||
|
|
||||||
|
<foo>
|
||||||
|
</bar>
|
||||||
|
<//baz>
|
||||||
|
<///lorem>
|
||||||
|
<////ipsum>
|
||||||
|
</////dolar>
|
||||||
|
|
||||||
|
<https:foo>
|
||||||
|
<https:/bar>
|
||||||
|
<https://baz>
|
||||||
|
<https:///lorem>
|
||||||
|
<https:////ipsum>
|
||||||
|
<https://///dolar>
|
||||||
6
org_mode_samples/object/angle_link/protocol_link.org
Normal file
6
org_mode_samples/object/angle_link/protocol_link.org
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<shell:foo>
|
||||||
|
|
||||||
|
<shell:fo
|
||||||
|
o>
|
||||||
|
|
||||||
|
<shell:foo::3>
|
||||||
16
org_mode_samples/object/angle_link/search_option.org
Normal file
16
org_mode_samples/object/angle_link/search_option.org
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<file:simple.org::foo>
|
||||||
|
|
||||||
|
<file:simple.org::#foo>
|
||||||
|
<file:simple.org::foo bar>
|
||||||
|
<file:simple.org::foo
|
||||||
|
bar>
|
||||||
|
<file:simple.org::foo::bar>
|
||||||
|
<file:simple.org::/foo/>
|
||||||
|
|
||||||
|
<file://en.wikipedia.org/wiki/Shebang_(Uni::x)>
|
||||||
|
|
||||||
|
|
||||||
|
<file:simple.org::*>
|
||||||
|
<file:simple.org::* foo>
|
||||||
|
<file:simple.org::*bar>
|
||||||
|
<file:simple.org::b*az>
|
||||||
1
org_mode_samples/object/angle_link/simple.org
Normal file
1
org_mode_samples/object/angle_link/simple.org
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<https://fizz.buzz/>
|
||||||
6
org_mode_samples/object/angle_link/template.org
Normal file
6
org_mode_samples/object/angle_link/template.org
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#+LINK: foo https://foo.bar/baz#%s
|
||||||
|
<foo::lorem>
|
||||||
|
|
||||||
|
<cat::bat>
|
||||||
|
#+LINK: cat dog%s
|
||||||
|
<cat:bat>
|
||||||
1
org_mode_samples/object/angle_link/with_parenthesis.org
Normal file
1
org_mode_samples/object/angle_link/with_parenthesis.org
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<https://en.wikipedia.org/wiki/Shebang_(Unix)>
|
||||||
414
org_mode_samples/object/entity/all_entities.org
Normal file
414
org_mode_samples/object/entity/all_entities.org
Normal file
@@ -0,0 +1,414 @@
|
|||||||
|
\Agrave{}
|
||||||
|
\agrave{}
|
||||||
|
\Aacute{}
|
||||||
|
\aacute{}
|
||||||
|
\Acirc{}
|
||||||
|
\acirc{}
|
||||||
|
\Amacr{}
|
||||||
|
\amacr{}
|
||||||
|
\Atilde{}
|
||||||
|
\atilde{}
|
||||||
|
\Auml{}
|
||||||
|
\auml{}
|
||||||
|
\Aring{}
|
||||||
|
\AA{}
|
||||||
|
\aring{}
|
||||||
|
\AElig{}
|
||||||
|
\aelig{}
|
||||||
|
\Ccedil{}
|
||||||
|
\ccedil{}
|
||||||
|
\Egrave{}
|
||||||
|
\egrave{}
|
||||||
|
\Eacute{}
|
||||||
|
\eacute{}
|
||||||
|
\Ecirc{}
|
||||||
|
\ecirc{}
|
||||||
|
\Euml{}
|
||||||
|
\euml{}
|
||||||
|
\Igrave{}
|
||||||
|
\igrave{}
|
||||||
|
\Iacute{}
|
||||||
|
\iacute{}
|
||||||
|
\Idot{}
|
||||||
|
\inodot{}
|
||||||
|
\Icirc{}
|
||||||
|
\icirc{}
|
||||||
|
\Iuml{}
|
||||||
|
\iuml{}
|
||||||
|
\Ntilde{}
|
||||||
|
\ntilde{}
|
||||||
|
\Ograve{}
|
||||||
|
\ograve{}
|
||||||
|
\Oacute{}
|
||||||
|
\oacute{}
|
||||||
|
\Ocirc{}
|
||||||
|
\ocirc{}
|
||||||
|
\Otilde{}
|
||||||
|
\otilde{}
|
||||||
|
\Ouml{}
|
||||||
|
\ouml{}
|
||||||
|
\Oslash{}
|
||||||
|
\oslash{}
|
||||||
|
\OElig{}
|
||||||
|
\oelig{}
|
||||||
|
\Scaron{}
|
||||||
|
\scaron{}
|
||||||
|
\szlig{}
|
||||||
|
\Ugrave{}
|
||||||
|
\ugrave{}
|
||||||
|
\Uacute{}
|
||||||
|
\uacute{}
|
||||||
|
\Ucirc{}
|
||||||
|
\ucirc{}
|
||||||
|
\Uuml{}
|
||||||
|
\uuml{}
|
||||||
|
\Yacute{}
|
||||||
|
\yacute{}
|
||||||
|
\Yuml{}
|
||||||
|
\yuml{}
|
||||||
|
\fnof{}
|
||||||
|
\real{}
|
||||||
|
\image{}
|
||||||
|
\weierp{}
|
||||||
|
\ell{}
|
||||||
|
\imath{}
|
||||||
|
\jmath{}
|
||||||
|
\Alpha{}
|
||||||
|
\alpha{}
|
||||||
|
\Beta{}
|
||||||
|
\beta{}
|
||||||
|
\Gamma{}
|
||||||
|
\gamma{}
|
||||||
|
\Delta{}
|
||||||
|
\delta{}
|
||||||
|
\Epsilon{}
|
||||||
|
\epsilon{}
|
||||||
|
\varepsilon{}
|
||||||
|
\Zeta{}
|
||||||
|
\zeta{}
|
||||||
|
\Eta{}
|
||||||
|
\eta{}
|
||||||
|
\Theta{}
|
||||||
|
\theta{}
|
||||||
|
\thetasym{}
|
||||||
|
\vartheta{}
|
||||||
|
\Iota{}
|
||||||
|
\iota{}
|
||||||
|
\Kappa{}
|
||||||
|
\kappa{}
|
||||||
|
\Lambda{}
|
||||||
|
\lambda{}
|
||||||
|
\Mu{}
|
||||||
|
\mu{}
|
||||||
|
\nu{}
|
||||||
|
\Nu{}
|
||||||
|
\Xi{}
|
||||||
|
\xi{}
|
||||||
|
\Omicron{}
|
||||||
|
\omicron{}
|
||||||
|
\Pi{}
|
||||||
|
\pi{}
|
||||||
|
\Rho{}
|
||||||
|
\rho{}
|
||||||
|
\Sigma{}
|
||||||
|
\sigma{}
|
||||||
|
\sigmaf{}
|
||||||
|
\varsigma{}
|
||||||
|
\Tau{}
|
||||||
|
\Upsilon{}
|
||||||
|
\upsih{}
|
||||||
|
\upsilon{}
|
||||||
|
\Phi{}
|
||||||
|
\phi{}
|
||||||
|
\varphi{}
|
||||||
|
\Chi{}
|
||||||
|
\chi{}
|
||||||
|
\acutex{}
|
||||||
|
\Psi{}
|
||||||
|
\psi{}
|
||||||
|
\tau{}
|
||||||
|
\Omega{}
|
||||||
|
\omega{}
|
||||||
|
\piv{}
|
||||||
|
\varpi{}
|
||||||
|
\partial{}
|
||||||
|
\alefsym{}
|
||||||
|
\aleph{}
|
||||||
|
\gimel{}
|
||||||
|
\beth{}
|
||||||
|
\dalet{}
|
||||||
|
\ETH{}
|
||||||
|
\eth{}
|
||||||
|
\THORN{}
|
||||||
|
\thorn{}
|
||||||
|
\dots{}
|
||||||
|
\cdots{}
|
||||||
|
\hellip{}
|
||||||
|
\middot{}
|
||||||
|
\iexcl{}
|
||||||
|
\iquest{}
|
||||||
|
\shy{}
|
||||||
|
\ndash{}
|
||||||
|
\mdash{}
|
||||||
|
\quot{}
|
||||||
|
\acute{}
|
||||||
|
\ldquo{}
|
||||||
|
\rdquo{}
|
||||||
|
\bdquo{}
|
||||||
|
\lsquo{}
|
||||||
|
\rsquo{}
|
||||||
|
\sbquo{}
|
||||||
|
\laquo{}
|
||||||
|
\raquo{}
|
||||||
|
\lsaquo{}
|
||||||
|
\rsaquo{}
|
||||||
|
\circ{}
|
||||||
|
\vert{}
|
||||||
|
\vbar{}
|
||||||
|
\brvbar{}
|
||||||
|
\S{}
|
||||||
|
\sect{}
|
||||||
|
\P{}
|
||||||
|
\para{}
|
||||||
|
\amp{}
|
||||||
|
\lt{}
|
||||||
|
\gt{}
|
||||||
|
\tilde{}
|
||||||
|
\slash{}
|
||||||
|
\plus{}
|
||||||
|
\under{}
|
||||||
|
\equal{}
|
||||||
|
\asciicirc{}
|
||||||
|
\dagger{}
|
||||||
|
\dag{}
|
||||||
|
\Dagger{}
|
||||||
|
\ddag{}
|
||||||
|
\nbsp{}
|
||||||
|
\ensp{}
|
||||||
|
\emsp{}
|
||||||
|
\thinsp{}
|
||||||
|
\curren{}
|
||||||
|
\cent{}
|
||||||
|
\pound{}
|
||||||
|
\yen{}
|
||||||
|
\euro{}
|
||||||
|
\EUR{}
|
||||||
|
\dollar{}
|
||||||
|
\USD{}
|
||||||
|
\copy{}
|
||||||
|
\reg{}
|
||||||
|
\trade{}
|
||||||
|
\minus{}
|
||||||
|
\pm{}
|
||||||
|
\plusmn{}
|
||||||
|
\times{}
|
||||||
|
\frasl{}
|
||||||
|
\colon{}
|
||||||
|
\div{}
|
||||||
|
\frac12{}
|
||||||
|
\frac14{}
|
||||||
|
\frac34{}
|
||||||
|
\permil{}
|
||||||
|
\sup1{}
|
||||||
|
\sup2{}
|
||||||
|
\sup3{}
|
||||||
|
\radic{}
|
||||||
|
\sum{}
|
||||||
|
\prod{}
|
||||||
|
\micro{}
|
||||||
|
\macr{}
|
||||||
|
\deg{}
|
||||||
|
\prime{}
|
||||||
|
\Prime{}
|
||||||
|
\infin{}
|
||||||
|
\infty{}
|
||||||
|
\prop{}
|
||||||
|
\propto{}
|
||||||
|
\not{}
|
||||||
|
\neg{}
|
||||||
|
\land{}
|
||||||
|
\wedge{}
|
||||||
|
\lor{}
|
||||||
|
\vee{}
|
||||||
|
\cap{}
|
||||||
|
\cup{}
|
||||||
|
\smile{}
|
||||||
|
\frown{}
|
||||||
|
\int{}
|
||||||
|
\therefore{}
|
||||||
|
\there4{}
|
||||||
|
\because{}
|
||||||
|
\sim{}
|
||||||
|
\cong{}
|
||||||
|
\simeq{}
|
||||||
|
\asymp{}
|
||||||
|
\approx{}
|
||||||
|
\ne{}
|
||||||
|
\neq{}
|
||||||
|
\equiv{}
|
||||||
|
\triangleq{}
|
||||||
|
\le{}
|
||||||
|
\leq{}
|
||||||
|
\ge{}
|
||||||
|
\geq{}
|
||||||
|
\lessgtr{}
|
||||||
|
\lesseqgtr{}
|
||||||
|
\ll{}
|
||||||
|
\Ll{}
|
||||||
|
\lll{}
|
||||||
|
\gg{}
|
||||||
|
\Gg{}
|
||||||
|
\ggg{}
|
||||||
|
\prec{}
|
||||||
|
\preceq{}
|
||||||
|
\preccurlyeq{}
|
||||||
|
\succ{}
|
||||||
|
\succeq{}
|
||||||
|
\succcurlyeq{}
|
||||||
|
\sub{}
|
||||||
|
\subset{}
|
||||||
|
\sup{}
|
||||||
|
\supset{}
|
||||||
|
\nsub{}
|
||||||
|
\sube{}
|
||||||
|
\nsup{}
|
||||||
|
\supe{}
|
||||||
|
\setminus{}
|
||||||
|
\forall{}
|
||||||
|
\exist{}
|
||||||
|
\exists{}
|
||||||
|
\nexist{}
|
||||||
|
\nexists{}
|
||||||
|
\empty{}
|
||||||
|
\emptyset{}
|
||||||
|
\isin{}
|
||||||
|
\in{}
|
||||||
|
\notin{}
|
||||||
|
\ni{}
|
||||||
|
\nabla{}
|
||||||
|
\ang{}
|
||||||
|
\angle{}
|
||||||
|
\perp{}
|
||||||
|
\parallel{}
|
||||||
|
\sdot{}
|
||||||
|
\cdot{}
|
||||||
|
\lceil{}
|
||||||
|
\rceil{}
|
||||||
|
\lfloor{}
|
||||||
|
\rfloor{}
|
||||||
|
\lang{}
|
||||||
|
\rang{}
|
||||||
|
\langle{}
|
||||||
|
\rangle{}
|
||||||
|
\hbar{}
|
||||||
|
\mho{}
|
||||||
|
\larr{}
|
||||||
|
\leftarrow{}
|
||||||
|
\gets{}
|
||||||
|
\lArr{}
|
||||||
|
\Leftarrow{}
|
||||||
|
\uarr{}
|
||||||
|
\uparrow{}
|
||||||
|
\uArr{}
|
||||||
|
\Uparrow{}
|
||||||
|
\rarr{}
|
||||||
|
\to{}
|
||||||
|
\rightarrow{}
|
||||||
|
\rArr{}
|
||||||
|
\Rightarrow{}
|
||||||
|
\darr{}
|
||||||
|
\downarrow{}
|
||||||
|
\dArr{}
|
||||||
|
\Downarrow{}
|
||||||
|
\harr{}
|
||||||
|
\leftrightarrow{}
|
||||||
|
\hArr{}
|
||||||
|
\Leftrightarrow{}
|
||||||
|
\crarr{}
|
||||||
|
\hookleftarrow{}
|
||||||
|
\arccos{}
|
||||||
|
\arcsin{}
|
||||||
|
\arctan{}
|
||||||
|
\arg{}
|
||||||
|
\cos{}
|
||||||
|
\cosh{}
|
||||||
|
\cot{}
|
||||||
|
\coth{}
|
||||||
|
\csc{}
|
||||||
|
\deg{}
|
||||||
|
\det{}
|
||||||
|
\dim{}
|
||||||
|
\exp{}
|
||||||
|
\gcd{}
|
||||||
|
\hom{}
|
||||||
|
\inf{}
|
||||||
|
\ker{}
|
||||||
|
\lg{}
|
||||||
|
\lim{}
|
||||||
|
\liminf{}
|
||||||
|
\limsup{}
|
||||||
|
\ln{}
|
||||||
|
\log{}
|
||||||
|
\max{}
|
||||||
|
\min{}
|
||||||
|
\Pr{}
|
||||||
|
\sec{}
|
||||||
|
\sin{}
|
||||||
|
\sinh{}
|
||||||
|
\sup{}
|
||||||
|
\tan{}
|
||||||
|
\tanh{}
|
||||||
|
\bull{}
|
||||||
|
\bullet{}
|
||||||
|
\star{}
|
||||||
|
\lowast{}
|
||||||
|
\ast{}
|
||||||
|
\odot{}
|
||||||
|
\oplus{}
|
||||||
|
\otimes{}
|
||||||
|
\check{}
|
||||||
|
\checkmark{}
|
||||||
|
\ordf{}
|
||||||
|
\ordm{}
|
||||||
|
\cedil{}
|
||||||
|
\oline{}
|
||||||
|
\uml{}
|
||||||
|
\zwnj{}
|
||||||
|
\zwj{}
|
||||||
|
\lrm{}
|
||||||
|
\rlm{}
|
||||||
|
\smiley{}
|
||||||
|
\blacksmile{}
|
||||||
|
\sad{}
|
||||||
|
\frowny{}
|
||||||
|
\clubs{}
|
||||||
|
\clubsuit{}
|
||||||
|
\spades{}
|
||||||
|
\spadesuit{}
|
||||||
|
\hearts{}
|
||||||
|
\heartsuit{}
|
||||||
|
\diams{}
|
||||||
|
\diamondsuit{}
|
||||||
|
\diamond{}
|
||||||
|
\Diamond{}
|
||||||
|
\loz{}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
|
\_ {}
|
||||||
414
org_mode_samples/object/entity/all_entities_without_braces.org
Normal file
414
org_mode_samples/object/entity/all_entities_without_braces.org
Normal file
@@ -0,0 +1,414 @@
|
|||||||
|
\Agrave
|
||||||
|
\agrave
|
||||||
|
\Aacute
|
||||||
|
\aacute
|
||||||
|
\Acirc
|
||||||
|
\acirc
|
||||||
|
\Amacr
|
||||||
|
\amacr
|
||||||
|
\Atilde
|
||||||
|
\atilde
|
||||||
|
\Auml
|
||||||
|
\auml
|
||||||
|
\Aring
|
||||||
|
\AA
|
||||||
|
\aring
|
||||||
|
\AElig
|
||||||
|
\aelig
|
||||||
|
\Ccedil
|
||||||
|
\ccedil
|
||||||
|
\Egrave
|
||||||
|
\egrave
|
||||||
|
\Eacute
|
||||||
|
\eacute
|
||||||
|
\Ecirc
|
||||||
|
\ecirc
|
||||||
|
\Euml
|
||||||
|
\euml
|
||||||
|
\Igrave
|
||||||
|
\igrave
|
||||||
|
\Iacute
|
||||||
|
\iacute
|
||||||
|
\Idot
|
||||||
|
\inodot
|
||||||
|
\Icirc
|
||||||
|
\icirc
|
||||||
|
\Iuml
|
||||||
|
\iuml
|
||||||
|
\Ntilde
|
||||||
|
\ntilde
|
||||||
|
\Ograve
|
||||||
|
\ograve
|
||||||
|
\Oacute
|
||||||
|
\oacute
|
||||||
|
\Ocirc
|
||||||
|
\ocirc
|
||||||
|
\Otilde
|
||||||
|
\otilde
|
||||||
|
\Ouml
|
||||||
|
\ouml
|
||||||
|
\Oslash
|
||||||
|
\oslash
|
||||||
|
\OElig
|
||||||
|
\oelig
|
||||||
|
\Scaron
|
||||||
|
\scaron
|
||||||
|
\szlig
|
||||||
|
\Ugrave
|
||||||
|
\ugrave
|
||||||
|
\Uacute
|
||||||
|
\uacute
|
||||||
|
\Ucirc
|
||||||
|
\ucirc
|
||||||
|
\Uuml
|
||||||
|
\uuml
|
||||||
|
\Yacute
|
||||||
|
\yacute
|
||||||
|
\Yuml
|
||||||
|
\yuml
|
||||||
|
\fnof
|
||||||
|
\real
|
||||||
|
\image
|
||||||
|
\weierp
|
||||||
|
\ell
|
||||||
|
\imath
|
||||||
|
\jmath
|
||||||
|
\Alpha
|
||||||
|
\alpha
|
||||||
|
\Beta
|
||||||
|
\beta
|
||||||
|
\Gamma
|
||||||
|
\gamma
|
||||||
|
\Delta
|
||||||
|
\delta
|
||||||
|
\Epsilon
|
||||||
|
\epsilon
|
||||||
|
\varepsilon
|
||||||
|
\Zeta
|
||||||
|
\zeta
|
||||||
|
\Eta
|
||||||
|
\eta
|
||||||
|
\Theta
|
||||||
|
\theta
|
||||||
|
\thetasym
|
||||||
|
\vartheta
|
||||||
|
\Iota
|
||||||
|
\iota
|
||||||
|
\Kappa
|
||||||
|
\kappa
|
||||||
|
\Lambda
|
||||||
|
\lambda
|
||||||
|
\Mu
|
||||||
|
\mu
|
||||||
|
\nu
|
||||||
|
\Nu
|
||||||
|
\Xi
|
||||||
|
\xi
|
||||||
|
\Omicron
|
||||||
|
\omicron
|
||||||
|
\Pi
|
||||||
|
\pi
|
||||||
|
\Rho
|
||||||
|
\rho
|
||||||
|
\Sigma
|
||||||
|
\sigma
|
||||||
|
\sigmaf
|
||||||
|
\varsigma
|
||||||
|
\Tau
|
||||||
|
\Upsilon
|
||||||
|
\upsih
|
||||||
|
\upsilon
|
||||||
|
\Phi
|
||||||
|
\phi
|
||||||
|
\varphi
|
||||||
|
\Chi
|
||||||
|
\chi
|
||||||
|
\acutex
|
||||||
|
\Psi
|
||||||
|
\psi
|
||||||
|
\tau
|
||||||
|
\Omega
|
||||||
|
\omega
|
||||||
|
\piv
|
||||||
|
\varpi
|
||||||
|
\partial
|
||||||
|
\alefsym
|
||||||
|
\aleph
|
||||||
|
\gimel
|
||||||
|
\beth
|
||||||
|
\dalet
|
||||||
|
\ETH
|
||||||
|
\eth
|
||||||
|
\THORN
|
||||||
|
\thorn
|
||||||
|
\dots
|
||||||
|
\cdots
|
||||||
|
\hellip
|
||||||
|
\middot
|
||||||
|
\iexcl
|
||||||
|
\iquest
|
||||||
|
\shy
|
||||||
|
\ndash
|
||||||
|
\mdash
|
||||||
|
\quot
|
||||||
|
\acute
|
||||||
|
\ldquo
|
||||||
|
\rdquo
|
||||||
|
\bdquo
|
||||||
|
\lsquo
|
||||||
|
\rsquo
|
||||||
|
\sbquo
|
||||||
|
\laquo
|
||||||
|
\raquo
|
||||||
|
\lsaquo
|
||||||
|
\rsaquo
|
||||||
|
\circ
|
||||||
|
\vert
|
||||||
|
\vbar
|
||||||
|
\brvbar
|
||||||
|
\S
|
||||||
|
\sect
|
||||||
|
\P
|
||||||
|
\para
|
||||||
|
\amp
|
||||||
|
\lt
|
||||||
|
\gt
|
||||||
|
\tilde
|
||||||
|
\slash
|
||||||
|
\plus
|
||||||
|
\under
|
||||||
|
\equal
|
||||||
|
\asciicirc
|
||||||
|
\dagger
|
||||||
|
\dag
|
||||||
|
\Dagger
|
||||||
|
\ddag
|
||||||
|
\nbsp
|
||||||
|
\ensp
|
||||||
|
\emsp
|
||||||
|
\thinsp
|
||||||
|
\curren
|
||||||
|
\cent
|
||||||
|
\pound
|
||||||
|
\yen
|
||||||
|
\euro
|
||||||
|
\EUR
|
||||||
|
\dollar
|
||||||
|
\USD
|
||||||
|
\copy
|
||||||
|
\reg
|
||||||
|
\trade
|
||||||
|
\minus
|
||||||
|
\pm
|
||||||
|
\plusmn
|
||||||
|
\times
|
||||||
|
\frasl
|
||||||
|
\colon
|
||||||
|
\div
|
||||||
|
\frac12
|
||||||
|
\frac14
|
||||||
|
\frac34
|
||||||
|
\permil
|
||||||
|
\sup1
|
||||||
|
\sup2
|
||||||
|
\sup3
|
||||||
|
\radic
|
||||||
|
\sum
|
||||||
|
\prod
|
||||||
|
\micro
|
||||||
|
\macr
|
||||||
|
\deg
|
||||||
|
\prime
|
||||||
|
\Prime
|
||||||
|
\infin
|
||||||
|
\infty
|
||||||
|
\prop
|
||||||
|
\propto
|
||||||
|
\not
|
||||||
|
\neg
|
||||||
|
\land
|
||||||
|
\wedge
|
||||||
|
\lor
|
||||||
|
\vee
|
||||||
|
\cap
|
||||||
|
\cup
|
||||||
|
\smile
|
||||||
|
\frown
|
||||||
|
\int
|
||||||
|
\therefore
|
||||||
|
\there4
|
||||||
|
\because
|
||||||
|
\sim
|
||||||
|
\cong
|
||||||
|
\simeq
|
||||||
|
\asymp
|
||||||
|
\approx
|
||||||
|
\ne
|
||||||
|
\neq
|
||||||
|
\equiv
|
||||||
|
\triangleq
|
||||||
|
\le
|
||||||
|
\leq
|
||||||
|
\ge
|
||||||
|
\geq
|
||||||
|
\lessgtr
|
||||||
|
\lesseqgtr
|
||||||
|
\ll
|
||||||
|
\Ll
|
||||||
|
\lll
|
||||||
|
\gg
|
||||||
|
\Gg
|
||||||
|
\ggg
|
||||||
|
\prec
|
||||||
|
\preceq
|
||||||
|
\preccurlyeq
|
||||||
|
\succ
|
||||||
|
\succeq
|
||||||
|
\succcurlyeq
|
||||||
|
\sub
|
||||||
|
\subset
|
||||||
|
\sup
|
||||||
|
\supset
|
||||||
|
\nsub
|
||||||
|
\sube
|
||||||
|
\nsup
|
||||||
|
\supe
|
||||||
|
\setminus
|
||||||
|
\forall
|
||||||
|
\exist
|
||||||
|
\exists
|
||||||
|
\nexist
|
||||||
|
\nexists
|
||||||
|
\empty
|
||||||
|
\emptyset
|
||||||
|
\isin
|
||||||
|
\in
|
||||||
|
\notin
|
||||||
|
\ni
|
||||||
|
\nabla
|
||||||
|
\ang
|
||||||
|
\angle
|
||||||
|
\perp
|
||||||
|
\parallel
|
||||||
|
\sdot
|
||||||
|
\cdot
|
||||||
|
\lceil
|
||||||
|
\rceil
|
||||||
|
\lfloor
|
||||||
|
\rfloor
|
||||||
|
\lang
|
||||||
|
\rang
|
||||||
|
\langle
|
||||||
|
\rangle
|
||||||
|
\hbar
|
||||||
|
\mho
|
||||||
|
\larr
|
||||||
|
\leftarrow
|
||||||
|
\gets
|
||||||
|
\lArr
|
||||||
|
\Leftarrow
|
||||||
|
\uarr
|
||||||
|
\uparrow
|
||||||
|
\uArr
|
||||||
|
\Uparrow
|
||||||
|
\rarr
|
||||||
|
\to
|
||||||
|
\rightarrow
|
||||||
|
\rArr
|
||||||
|
\Rightarrow
|
||||||
|
\darr
|
||||||
|
\downarrow
|
||||||
|
\dArr
|
||||||
|
\Downarrow
|
||||||
|
\harr
|
||||||
|
\leftrightarrow
|
||||||
|
\hArr
|
||||||
|
\Leftrightarrow
|
||||||
|
\crarr
|
||||||
|
\hookleftarrow
|
||||||
|
\arccos
|
||||||
|
\arcsin
|
||||||
|
\arctan
|
||||||
|
\arg
|
||||||
|
\cos
|
||||||
|
\cosh
|
||||||
|
\cot
|
||||||
|
\coth
|
||||||
|
\csc
|
||||||
|
\deg
|
||||||
|
\det
|
||||||
|
\dim
|
||||||
|
\exp
|
||||||
|
\gcd
|
||||||
|
\hom
|
||||||
|
\inf
|
||||||
|
\ker
|
||||||
|
\lg
|
||||||
|
\lim
|
||||||
|
\liminf
|
||||||
|
\limsup
|
||||||
|
\ln
|
||||||
|
\log
|
||||||
|
\max
|
||||||
|
\min
|
||||||
|
\Pr
|
||||||
|
\sec
|
||||||
|
\sin
|
||||||
|
\sinh
|
||||||
|
\sup
|
||||||
|
\tan
|
||||||
|
\tanh
|
||||||
|
\bull
|
||||||
|
\bullet
|
||||||
|
\star
|
||||||
|
\lowast
|
||||||
|
\ast
|
||||||
|
\odot
|
||||||
|
\oplus
|
||||||
|
\otimes
|
||||||
|
\check
|
||||||
|
\checkmark
|
||||||
|
\ordf
|
||||||
|
\ordm
|
||||||
|
\cedil
|
||||||
|
\oline
|
||||||
|
\uml
|
||||||
|
\zwnj
|
||||||
|
\zwj
|
||||||
|
\lrm
|
||||||
|
\rlm
|
||||||
|
\smiley
|
||||||
|
\blacksmile
|
||||||
|
\sad
|
||||||
|
\frowny
|
||||||
|
\clubs
|
||||||
|
\clubsuit
|
||||||
|
\spades
|
||||||
|
\spadesuit
|
||||||
|
\hearts
|
||||||
|
\heartsuit
|
||||||
|
\diams
|
||||||
|
\diamondsuit
|
||||||
|
\diamond
|
||||||
|
\Diamond
|
||||||
|
\loz
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
|
\_
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
call_foo()
|
||||||
call_foo(arguments)
|
call_foo(arguments)
|
||||||
call_bar[header](arguments)
|
call_bar[header](arguments)
|
||||||
call_baz(arguments)[header]
|
call_baz(arguments)[header]
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
before src_foo{ipsum} after
|
src_foo{}
|
||||||
src_bar[lorem]{ipsum}
|
before src_bar{lorem} after
|
||||||
|
src_baz[ipsum]{dolar}
|
||||||
|
|||||||
1
org_mode_samples/object/macro/capitalize.org
Normal file
1
org_mode_samples/object/macro/capitalize.org
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{{{Foo(Bar,Baz)}}}
|
||||||
7
org_mode_samples/object/macro/escape.org
Normal file
7
org_mode_samples/object/macro/escape.org
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{{{foo}}}
|
||||||
|
|
||||||
|
{{{fo\o}}}
|
||||||
|
|
||||||
|
{{{foo(b\ar)}}}
|
||||||
|
|
||||||
|
{{{foo(b\,r)}}}
|
||||||
10
org_mode_samples/object/macro/whitespace_in_args.org
Normal file
10
org_mode_samples/object/macro/whitespace_in_args.org
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{{{foo(bar baz)}}}
|
||||||
|
|
||||||
|
{{{foo(bar
|
||||||
|
baz)}}}
|
||||||
|
|
||||||
|
{{{foo(foo )}}}
|
||||||
|
|
||||||
|
{{{foo(foo , bar )}}}
|
||||||
|
|
||||||
|
{{{foo(foo , bar , baz )}}}
|
||||||
@@ -7,8 +7,7 @@ bar
|
|||||||
file:simple.org::foo::bar
|
file:simple.org::foo::bar
|
||||||
file:simple.org::/foo/
|
file:simple.org::/foo/
|
||||||
|
|
||||||
# Does not become a search option because it is inside parenthesis.
|
file://en.wikipedia.org/wiki/Shebang_(Uni::x)
|
||||||
https://en.wikipedia.org/wiki/Shebang_(Uni::x)
|
|
||||||
|
|
||||||
|
|
||||||
file:simple.org::* foo
|
file:simple.org::* foo
|
||||||
|
|||||||
25
org_mode_samples/object/regular_link/all_default_links.org
Normal file
25
org_mode_samples/object/regular_link/all_default_links.org
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
non-link text
|
||||||
|
[[eww://foo]]
|
||||||
|
[[rmail://foo]]
|
||||||
|
[[mhe://foo]]
|
||||||
|
[[irc://foo]]
|
||||||
|
[[info://foo]]
|
||||||
|
[[gnus://foo]]
|
||||||
|
[[docview://foo]]
|
||||||
|
[[bibtex://foo]]
|
||||||
|
[[bbdb://foo]]
|
||||||
|
[[w3m://foo]]
|
||||||
|
[[doi://foo]]
|
||||||
|
[[file+sys://foo]]
|
||||||
|
[[file+emacs://foo]]
|
||||||
|
[[shell://foo]]
|
||||||
|
[[news://foo]]
|
||||||
|
[[mailto://foo]]
|
||||||
|
[[https://foo]]
|
||||||
|
[[http://foo]]
|
||||||
|
[[ftp://foo]]
|
||||||
|
[[help://foo]]
|
||||||
|
[[file://foo]]
|
||||||
|
[[elisp://foo]]
|
||||||
|
[[randomfakeprotocl://foo]]
|
||||||
|
non-link text
|
||||||
@@ -1,2 +1,16 @@
|
|||||||
# Does not become a search option because it is inside parenthesis.
|
[[file:simple.org::foo]]
|
||||||
[[https://en.wikipedia.org/wiki/Shebang_(Uni::x)]]
|
|
||||||
|
[[file:simple.org::#foo]]
|
||||||
|
[[file:simple.org::foo bar]]
|
||||||
|
[[file:simple.org::foo
|
||||||
|
bar]]
|
||||||
|
[[file:simple.org::foo::bar]]
|
||||||
|
[[file:simple.org::/foo/]]
|
||||||
|
|
||||||
|
[[file://en.wikipedia.org/wiki/Shebang_(Uni::x)]]
|
||||||
|
|
||||||
|
|
||||||
|
[[file:simple.org::*]]
|
||||||
|
[[file:simple.org::* foo]]
|
||||||
|
[[file:simple.org::*bar]]
|
||||||
|
[[file:simple.org::b*az]]
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
|
**foo**
|
||||||
|
|
||||||
foo ** bar ** baz
|
foo ** bar ** baz
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
__foo_bar_baz__
|
||||||
1
org_mode_samples/object/text_markup/italic_bold.org
Normal file
1
org_mode_samples/object/text_markup/italic_bold.org
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/*foo*/
|
||||||
3
org_mode_samples/sections_and_headings/name.org
Normal file
3
org_mode_samples/sections_and_headings/name.org
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#+NAME: foo
|
||||||
|
* bar
|
||||||
|
#+NAME: baz
|
||||||
@@ -14,7 +14,12 @@ mod init_tracing;
|
|||||||
|
|
||||||
#[cfg(not(feature = "tracing"))]
|
#[cfg(not(feature = "tracing"))]
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
main_body()
|
let rt = tokio::runtime::Runtime::new()?;
|
||||||
|
let result = rt.block_on(async {
|
||||||
|
let main_body_result = main_body().await;
|
||||||
|
main_body_result
|
||||||
|
});
|
||||||
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "tracing")]
|
#[cfg(feature = "tracing")]
|
||||||
@@ -22,7 +27,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let rt = tokio::runtime::Runtime::new()?;
|
let rt = tokio::runtime::Runtime::new()?;
|
||||||
let result = rt.block_on(async {
|
let result = rt.block_on(async {
|
||||||
init_telemetry()?;
|
init_telemetry()?;
|
||||||
let main_body_result = main_body();
|
let main_body_result = main_body().await;
|
||||||
shutdown_telemetry()?;
|
shutdown_telemetry()?;
|
||||||
main_body_result
|
main_body_result
|
||||||
});
|
});
|
||||||
@@ -30,14 +35,21 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||||
fn main_body() -> Result<(), Box<dyn std::error::Error>> {
|
async fn main_body() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let args = std::env::args().skip(1);
|
let args = std::env::args().skip(1);
|
||||||
if args.is_empty() {
|
if args.is_empty() {
|
||||||
let org_contents = read_stdin_to_string()?;
|
let org_contents = read_stdin_to_string()?;
|
||||||
run_anonymous_compare(org_contents)
|
if run_anonymous_compare(org_contents).await? {
|
||||||
|
} else {
|
||||||
|
Err("Diff results do not match.")?;
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
for arg in args {
|
for arg in args {
|
||||||
run_compare_on_file(arg)?
|
if run_compare_on_file(arg).await? {
|
||||||
|
} else {
|
||||||
|
Err("Diff results do not match.")?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
399
src/bin_foreign_document_test.rs
Normal file
399
src/bin_foreign_document_test.rs
Normal file
@@ -0,0 +1,399 @@
|
|||||||
|
#![feature(round_char_boundary)]
|
||||||
|
#![feature(exact_size_is_empty)]
|
||||||
|
use std::path::Path;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use std::process::ExitCode;
|
||||||
|
|
||||||
|
use futures::future::BoxFuture;
|
||||||
|
use futures::future::FutureExt;
|
||||||
|
use organic::compare::silent_compare_on_file;
|
||||||
|
use tokio::sync::Semaphore;
|
||||||
|
use tokio::task::JoinError;
|
||||||
|
use walkdir::WalkDir;
|
||||||
|
|
||||||
|
#[cfg(feature = "tracing")]
|
||||||
|
use crate::init_tracing::init_telemetry;
|
||||||
|
#[cfg(feature = "tracing")]
|
||||||
|
use crate::init_tracing::shutdown_telemetry;
|
||||||
|
#[cfg(feature = "tracing")]
|
||||||
|
mod init_tracing;
|
||||||
|
|
||||||
|
#[cfg(not(feature = "tracing"))]
|
||||||
|
fn main() -> Result<ExitCode, Box<dyn std::error::Error>> {
|
||||||
|
let rt = tokio::runtime::Runtime::new()?;
|
||||||
|
let result = rt.block_on(async {
|
||||||
|
let main_body_result = main_body().await;
|
||||||
|
main_body_result
|
||||||
|
});
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "tracing")]
|
||||||
|
fn main() -> Result<ExitCode, Box<dyn std::error::Error>> {
|
||||||
|
let rt = tokio::runtime::Runtime::new()?;
|
||||||
|
let result = rt.block_on(async {
|
||||||
|
init_telemetry()?;
|
||||||
|
let main_body_result = main_body().await;
|
||||||
|
shutdown_telemetry()?;
|
||||||
|
main_body_result
|
||||||
|
});
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||||
|
async fn main_body() -> Result<ExitCode, Box<dyn std::error::Error>> {
|
||||||
|
let layer = compare_group("org-mode", || {
|
||||||
|
compare_all_org_document("/foreign_documents/org-mode")
|
||||||
|
});
|
||||||
|
let layer = layer.chain(compare_group("emacs", || {
|
||||||
|
compare_all_org_document("/foreign_documents/emacs")
|
||||||
|
}));
|
||||||
|
let layer = layer.chain(compare_group("worg", || {
|
||||||
|
compare_all_org_document("/foreign_documents/worg")
|
||||||
|
}));
|
||||||
|
let layer = layer.chain(compare_group("howard_abrams", compare_howard_abrams));
|
||||||
|
let layer = layer.chain(compare_group("doomemacs", || {
|
||||||
|
compare_all_org_document("/foreign_documents/doomemacs")
|
||||||
|
}));
|
||||||
|
|
||||||
|
let running_tests: Vec<_> = layer.map(|c| tokio::spawn(c.run_test())).collect();
|
||||||
|
let mut any_failed = false;
|
||||||
|
for test in running_tests.into_iter() {
|
||||||
|
let test_result = test.await??;
|
||||||
|
if test_result.is_immediately_bad() || test_result.has_bad_children() {
|
||||||
|
any_failed = true;
|
||||||
|
}
|
||||||
|
test_result.print();
|
||||||
|
}
|
||||||
|
|
||||||
|
if any_failed {
|
||||||
|
println!(
|
||||||
|
"{color}Some tests failed.{reset}",
|
||||||
|
color = TestResult::foreground_color(255, 0, 0),
|
||||||
|
reset = TestResult::reset_color(),
|
||||||
|
);
|
||||||
|
Ok(ExitCode::FAILURE)
|
||||||
|
} else {
|
||||||
|
println!(
|
||||||
|
"{color}All tests passed.{reset}",
|
||||||
|
color = TestResult::foreground_color(0, 255, 0),
|
||||||
|
reset = TestResult::reset_color(),
|
||||||
|
);
|
||||||
|
Ok(ExitCode::SUCCESS)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn compare_howard_abrams() -> impl Iterator<Item = TestConfig> {
|
||||||
|
let layer = compare_group("dot-files", || {
|
||||||
|
compare_all_org_document("/foreign_documents/howardabrams/dot-files")
|
||||||
|
});
|
||||||
|
let layer = layer.chain(compare_group("hamacs", || {
|
||||||
|
compare_all_org_document("/foreign_documents/howardabrams/hamacs")
|
||||||
|
}));
|
||||||
|
let layer = layer.chain(compare_group("demo-it", || {
|
||||||
|
compare_all_org_document("/foreign_documents/howardabrams/demo-it")
|
||||||
|
}));
|
||||||
|
let layer = layer.chain(compare_group("magit-demo", || {
|
||||||
|
compare_all_org_document("/foreign_documents/howardabrams/magit-demo")
|
||||||
|
}));
|
||||||
|
let layer = layer.chain(compare_group("pdx-emacs-hackers", || {
|
||||||
|
compare_all_org_document("/foreign_documents/howardabrams/pdx-emacs-hackers")
|
||||||
|
}));
|
||||||
|
let layer = layer.chain(compare_group("flora-simulator", || {
|
||||||
|
compare_all_org_document("/foreign_documents/howardabrams/flora-simulator")
|
||||||
|
}));
|
||||||
|
let layer = layer.chain(compare_group("literate-devops-demo", || {
|
||||||
|
compare_all_org_document("/foreign_documents/howardabrams/literate-devops-demo")
|
||||||
|
}));
|
||||||
|
let layer = layer.chain(compare_group("clojure-yesql-xp", || {
|
||||||
|
compare_all_org_document("/foreign_documents/howardabrams/clojure-yesql-xp")
|
||||||
|
}));
|
||||||
|
let layer = layer.chain(compare_group("veep", || {
|
||||||
|
compare_all_org_document("/foreign_documents/howardabrams/veep")
|
||||||
|
}));
|
||||||
|
layer
|
||||||
|
}
|
||||||
|
|
||||||
|
fn compare_group<N: Into<String>, F: Fn() -> I, I: Iterator<Item = TestConfig>>(
|
||||||
|
name: N,
|
||||||
|
inner: F,
|
||||||
|
) -> impl Iterator<Item = TestConfig> {
|
||||||
|
std::iter::once(TestConfig::TestLayer(TestLayer {
|
||||||
|
name: name.into(),
|
||||||
|
children: inner().collect(),
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn compare_all_org_document<P: AsRef<Path>>(root_dir: P) -> impl Iterator<Item = TestConfig> {
|
||||||
|
let root_dir = root_dir.as_ref();
|
||||||
|
let mut test_files = WalkDir::new(root_dir)
|
||||||
|
.into_iter()
|
||||||
|
.filter(|e| match e {
|
||||||
|
Ok(dir_entry) => {
|
||||||
|
dir_entry.file_type().is_file()
|
||||||
|
&& Path::new(dir_entry.file_name())
|
||||||
|
.extension()
|
||||||
|
.map(|ext| ext.to_ascii_lowercase() == "org")
|
||||||
|
.unwrap_or(false)
|
||||||
|
}
|
||||||
|
Err(_) => true,
|
||||||
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()
|
||||||
|
.unwrap();
|
||||||
|
test_files.sort_by_cached_key(|test_file| PathBuf::from(test_file.path()));
|
||||||
|
let test_configs: Vec<_> = test_files
|
||||||
|
.into_iter()
|
||||||
|
.map(|test_file| {
|
||||||
|
let name = test_file
|
||||||
|
.path()
|
||||||
|
.strip_prefix(root_dir)
|
||||||
|
.expect("Result is from walkdir so it must be below the root directory.")
|
||||||
|
.as_os_str()
|
||||||
|
.to_string_lossy()
|
||||||
|
.into_owned();
|
||||||
|
TestConfig::SingleFile(SingleFile {
|
||||||
|
name,
|
||||||
|
file_path: test_file.into_path(),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
test_configs.into_iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
static TEST_PERMITS: Semaphore = Semaphore::const_new(8);
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
enum TestConfig {
|
||||||
|
TestLayer(TestLayer),
|
||||||
|
SingleFile(SingleFile),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
struct TestLayer {
|
||||||
|
name: String,
|
||||||
|
children: Vec<TestConfig>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
struct SingleFile {
|
||||||
|
name: String,
|
||||||
|
file_path: PathBuf,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
enum TestResult {
|
||||||
|
ResultLayer(ResultLayer),
|
||||||
|
SingleFileResult(SingleFileResult),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
struct ResultLayer {
|
||||||
|
name: String,
|
||||||
|
children: Vec<TestResult>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
struct SingleFileResult {
|
||||||
|
name: String,
|
||||||
|
file_path: PathBuf,
|
||||||
|
status: TestStatus,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub(crate) enum TestStatus {
|
||||||
|
Pass,
|
||||||
|
Fail,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TestConfig {
|
||||||
|
fn run_test(self) -> BoxFuture<'static, Result<TestResult, JoinError>> {
|
||||||
|
async move {
|
||||||
|
match self {
|
||||||
|
TestConfig::TestLayer(test) => Ok(TestResult::ResultLayer(test.run_test().await?)),
|
||||||
|
TestConfig::SingleFile(test) => {
|
||||||
|
Ok(TestResult::SingleFileResult(test.run_test().await?))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.boxed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SingleFile {
|
||||||
|
async fn run_test(self) -> Result<SingleFileResult, JoinError> {
|
||||||
|
let _permit = TEST_PERMITS.acquire().await.unwrap();
|
||||||
|
let result = silent_compare_on_file(&self.file_path).await;
|
||||||
|
Ok(SingleFileResult {
|
||||||
|
name: self.name,
|
||||||
|
file_path: self.file_path,
|
||||||
|
status: if let Ok(true) = result {
|
||||||
|
TestStatus::Pass
|
||||||
|
} else {
|
||||||
|
TestStatus::Fail
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TestLayer {
|
||||||
|
async fn run_test(self) -> Result<ResultLayer, JoinError> {
|
||||||
|
let running_children: Vec<_> = self
|
||||||
|
.children
|
||||||
|
.into_iter()
|
||||||
|
.map(|c| tokio::spawn(c.run_test()))
|
||||||
|
.collect();
|
||||||
|
let mut children = Vec::with_capacity(running_children.len());
|
||||||
|
for c in running_children {
|
||||||
|
children.push(c.await??);
|
||||||
|
}
|
||||||
|
Ok(ResultLayer {
|
||||||
|
name: self.name,
|
||||||
|
children,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TestResult {
|
||||||
|
pub fn print(&self) {
|
||||||
|
self.print_indented(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn print_indented(&self, indentation: usize) {
|
||||||
|
match self {
|
||||||
|
TestResult::ResultLayer(result) => result.print_indented(indentation),
|
||||||
|
TestResult::SingleFileResult(result) => result.print_indented(indentation),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn has_bad_children(&self) -> bool {
|
||||||
|
match self {
|
||||||
|
TestResult::ResultLayer(result) => result.has_bad_children(),
|
||||||
|
TestResult::SingleFileResult(result) => result.has_bad_children(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn is_immediately_bad(&self) -> bool {
|
||||||
|
match self {
|
||||||
|
TestResult::ResultLayer(result) => result.is_immediately_bad(),
|
||||||
|
TestResult::SingleFileResult(result) => result.is_immediately_bad(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn foreground_color(red: u8, green: u8, blue: u8) -> String {
|
||||||
|
if TestResult::should_use_color() {
|
||||||
|
format!(
|
||||||
|
"\x1b[38;2;{red};{green};{blue}m",
|
||||||
|
red = red,
|
||||||
|
green = green,
|
||||||
|
blue = blue
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
String::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub(crate) fn background_color(red: u8, green: u8, blue: u8) -> String {
|
||||||
|
if TestResult::should_use_color() {
|
||||||
|
format!(
|
||||||
|
"\x1b[48;2;{red};{green};{blue}m",
|
||||||
|
red = red,
|
||||||
|
green = green,
|
||||||
|
blue = blue
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
String::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn reset_color() -> &'static str {
|
||||||
|
if TestResult::should_use_color() {
|
||||||
|
"\x1b[0m"
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn should_use_color() -> bool {
|
||||||
|
!std::env::var("NO_COLOR").is_ok_and(|val| !val.is_empty())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SingleFileResult {
|
||||||
|
fn print_indented(&self, indentation: usize) {
|
||||||
|
match self.status {
|
||||||
|
TestStatus::Pass => {
|
||||||
|
println!(
|
||||||
|
"{indentation}{color}PASS{reset} {name}",
|
||||||
|
indentation = " ".repeat(indentation),
|
||||||
|
color = TestResult::foreground_color(0, 255, 0),
|
||||||
|
reset = TestResult::reset_color(),
|
||||||
|
name = self.name
|
||||||
|
);
|
||||||
|
}
|
||||||
|
TestStatus::Fail => {
|
||||||
|
println!(
|
||||||
|
"{indentation}{color}FAIL{reset} {name}",
|
||||||
|
indentation = " ".repeat(indentation),
|
||||||
|
color = TestResult::foreground_color(255, 0, 0),
|
||||||
|
reset = TestResult::reset_color(),
|
||||||
|
name = self.name
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn has_bad_children(&self) -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
fn is_immediately_bad(&self) -> bool {
|
||||||
|
match self.status {
|
||||||
|
TestStatus::Pass => false,
|
||||||
|
TestStatus::Fail => true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ResultLayer {
|
||||||
|
fn print_indented(&self, indentation: usize) {
|
||||||
|
if self.is_immediately_bad() {
|
||||||
|
println!(
|
||||||
|
"{indentation}{color}FAIL{reset} {name}",
|
||||||
|
indentation = " ".repeat(indentation),
|
||||||
|
color = TestResult::foreground_color(255, 0, 0),
|
||||||
|
reset = TestResult::reset_color(),
|
||||||
|
name = self.name
|
||||||
|
);
|
||||||
|
} else if self.has_bad_children() {
|
||||||
|
println!(
|
||||||
|
"{indentation}{color}BADCHILD{reset} {name}",
|
||||||
|
indentation = " ".repeat(indentation),
|
||||||
|
color = TestResult::foreground_color(255, 255, 0),
|
||||||
|
reset = TestResult::reset_color(),
|
||||||
|
name = self.name
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
println!(
|
||||||
|
"{indentation}{color}PASS{reset} {name}",
|
||||||
|
indentation = " ".repeat(indentation),
|
||||||
|
color = TestResult::foreground_color(0, 255, 0),
|
||||||
|
reset = TestResult::reset_color(),
|
||||||
|
name = self.name
|
||||||
|
);
|
||||||
|
}
|
||||||
|
self.children
|
||||||
|
.iter()
|
||||||
|
.for_each(|result| result.print_indented(indentation + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn has_bad_children(&self) -> bool {
|
||||||
|
self.children
|
||||||
|
.iter()
|
||||||
|
.any(|result| result.is_immediately_bad() || result.has_bad_children())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn is_immediately_bad(&self) -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,39 +12,60 @@ use crate::context::LocalFileAccessInterface;
|
|||||||
use crate::parser::parse_file_with_settings;
|
use crate::parser::parse_file_with_settings;
|
||||||
use crate::parser::parse_with_settings;
|
use crate::parser::parse_with_settings;
|
||||||
|
|
||||||
pub fn run_anonymous_compare<P: AsRef<str>>(
|
pub async fn run_anonymous_compare<P: AsRef<str>>(
|
||||||
org_contents: P,
|
org_contents: P,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<bool, Box<dyn std::error::Error>> {
|
||||||
run_anonymous_compare_with_settings(org_contents, &GlobalSettings::default())
|
run_anonymous_compare_with_settings(org_contents, &GlobalSettings::default(), false).await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_compare_on_file<P: AsRef<Path>>(org_path: P) -> Result<(), Box<dyn std::error::Error>> {
|
pub async fn run_compare_on_file<P: AsRef<Path>>(
|
||||||
run_compare_on_file_with_settings(org_path, &GlobalSettings::default())
|
org_path: P,
|
||||||
|
) -> Result<bool, Box<dyn std::error::Error>> {
|
||||||
|
run_compare_on_file_with_settings(org_path, &GlobalSettings::default(), false).await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_anonymous_compare_with_settings<P: AsRef<str>>(
|
pub async fn silent_anonymous_compare<P: AsRef<str>>(
|
||||||
org_contents: P,
|
org_contents: P,
|
||||||
global_settings: &GlobalSettings,
|
) -> Result<bool, Box<dyn std::error::Error>> {
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
run_anonymous_compare_with_settings(org_contents, &GlobalSettings::default(), true).await
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn silent_compare_on_file<P: AsRef<Path>>(
|
||||||
|
org_path: P,
|
||||||
|
) -> Result<bool, Box<dyn std::error::Error>> {
|
||||||
|
run_compare_on_file_with_settings(org_path, &GlobalSettings::default(), true).await
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn run_anonymous_compare_with_settings<'g, 's, P: AsRef<str>>(
|
||||||
|
org_contents: P,
|
||||||
|
global_settings: &GlobalSettings<'g, 's>,
|
||||||
|
silent: bool,
|
||||||
|
) -> Result<bool, Box<dyn std::error::Error>> {
|
||||||
// TODO: This is a work-around to pretend that dos line endings do not exist. It would be better to handle the difference in line endings.
|
// TODO: This is a work-around to pretend that dos line endings do not exist. It would be better to handle the difference in line endings.
|
||||||
let org_contents = org_contents.as_ref().replace("\r\n", "\n");
|
let org_contents = org_contents.as_ref().replace("\r\n", "\n");
|
||||||
let org_contents = org_contents.as_str();
|
let org_contents = org_contents.as_str();
|
||||||
print_versions()?;
|
if !silent {
|
||||||
|
print_versions().await?;
|
||||||
|
}
|
||||||
let rust_parsed = parse_with_settings(org_contents, global_settings)?;
|
let rust_parsed = parse_with_settings(org_contents, global_settings)?;
|
||||||
let org_sexp = emacs_parse_anonymous_org_document(org_contents, global_settings)?;
|
let org_sexp = emacs_parse_anonymous_org_document(org_contents, global_settings).await?;
|
||||||
let (_remaining, parsed_sexp) = sexp(org_sexp.as_str()).map_err(|e| e.to_string())?;
|
let (_remaining, parsed_sexp) = sexp(org_sexp.as_str()).map_err(|e| e.to_string())?;
|
||||||
|
|
||||||
|
if !silent {
|
||||||
println!("{}\n\n\n", org_contents);
|
println!("{}\n\n\n", org_contents);
|
||||||
println!("{}", org_sexp);
|
println!("{}", org_sexp);
|
||||||
println!("{:#?}", rust_parsed);
|
println!("{:#?}", rust_parsed);
|
||||||
|
}
|
||||||
|
|
||||||
// We do the diffing after printing out both parsed forms in case the diffing panics
|
// We do the diffing after printing out both parsed forms in case the diffing panics
|
||||||
let diff_result = compare_document(&parsed_sexp, &rust_parsed)?;
|
let diff_result = compare_document(&parsed_sexp, &rust_parsed)?;
|
||||||
|
if !silent {
|
||||||
diff_result.print(org_contents)?;
|
diff_result.print(org_contents)?;
|
||||||
|
}
|
||||||
|
|
||||||
if diff_result.is_bad() {
|
if diff_result.is_bad() {
|
||||||
Err("Diff results do not match.")?;
|
return Ok(false);
|
||||||
} else {
|
} else if !silent {
|
||||||
println!(
|
println!(
|
||||||
"{color}Entire document passes.{reset}",
|
"{color}Entire document passes.{reset}",
|
||||||
color = DiffResult::foreground_color(0, 255, 0),
|
color = DiffResult::foreground_color(0, 255, 0),
|
||||||
@@ -52,15 +73,18 @@ pub fn run_anonymous_compare_with_settings<P: AsRef<str>>(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_compare_on_file_with_settings<P: AsRef<Path>>(
|
pub async fn run_compare_on_file_with_settings<'g, 's, P: AsRef<Path>>(
|
||||||
org_path: P,
|
org_path: P,
|
||||||
global_settings: &GlobalSettings,
|
global_settings: &GlobalSettings<'g, 's>,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
silent: bool,
|
||||||
|
) -> Result<bool, Box<dyn std::error::Error>> {
|
||||||
let org_path = org_path.as_ref();
|
let org_path = org_path.as_ref();
|
||||||
print_versions()?;
|
if !silent {
|
||||||
|
print_versions().await?;
|
||||||
|
}
|
||||||
let parent_directory = org_path
|
let parent_directory = org_path
|
||||||
.parent()
|
.parent()
|
||||||
.ok_or("Should be contained inside a directory.")?;
|
.ok_or("Should be contained inside a directory.")?;
|
||||||
@@ -77,20 +101,24 @@ pub fn run_compare_on_file_with_settings<P: AsRef<Path>>(
|
|||||||
global_settings
|
global_settings
|
||||||
};
|
};
|
||||||
let rust_parsed = parse_file_with_settings(org_contents, &global_settings, Some(org_path))?;
|
let rust_parsed = parse_file_with_settings(org_contents, &global_settings, Some(org_path))?;
|
||||||
let org_sexp = emacs_parse_file_org_document(org_path, &global_settings)?;
|
let org_sexp = emacs_parse_file_org_document(org_path, &global_settings).await?;
|
||||||
let (_remaining, parsed_sexp) = sexp(org_sexp.as_str()).map_err(|e| e.to_string())?;
|
let (_remaining, parsed_sexp) = sexp(org_sexp.as_str()).map_err(|e| e.to_string())?;
|
||||||
|
|
||||||
|
if !silent {
|
||||||
println!("{}\n\n\n", org_contents);
|
println!("{}\n\n\n", org_contents);
|
||||||
println!("{}", org_sexp);
|
println!("{}", org_sexp);
|
||||||
println!("{:#?}", rust_parsed);
|
println!("{:#?}", rust_parsed);
|
||||||
|
}
|
||||||
|
|
||||||
// We do the diffing after printing out both parsed forms in case the diffing panics
|
// We do the diffing after printing out both parsed forms in case the diffing panics
|
||||||
let diff_result = compare_document(&parsed_sexp, &rust_parsed)?;
|
let diff_result = compare_document(&parsed_sexp, &rust_parsed)?;
|
||||||
|
if !silent {
|
||||||
diff_result.print(org_contents)?;
|
diff_result.print(org_contents)?;
|
||||||
|
}
|
||||||
|
|
||||||
if diff_result.is_bad() {
|
if diff_result.is_bad() {
|
||||||
Err("Diff results do not match.")?;
|
return Ok(false);
|
||||||
} else {
|
} else if !silent {
|
||||||
println!(
|
println!(
|
||||||
"{color}Entire document passes.{reset}",
|
"{color}Entire document passes.{reset}",
|
||||||
color = DiffResult::foreground_color(0, 255, 0),
|
color = DiffResult::foreground_color(0, 255, 0),
|
||||||
@@ -98,11 +126,14 @@ pub fn run_compare_on_file_with_settings<P: AsRef<Path>>(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_versions() -> Result<(), Box<dyn std::error::Error>> {
|
async fn print_versions() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
eprintln!("Using emacs version: {}", get_emacs_version()?.trim());
|
eprintln!("Using emacs version: {}", get_emacs_version().await?.trim());
|
||||||
eprintln!("Using org-mode version: {}", get_org_mode_version()?.trim());
|
eprintln!(
|
||||||
|
"Using org-mode version: {}",
|
||||||
|
get_org_mode_version().await?.trim()
|
||||||
|
);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +1,75 @@
|
|||||||
|
use std::collections::BTreeSet;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
use super::diff::artificial_diff_scope;
|
||||||
|
use super::diff::artificial_owned_diff_scope;
|
||||||
|
use super::diff::compare_ast_node;
|
||||||
|
use super::diff::DiffEntry;
|
||||||
use super::diff::DiffStatus;
|
use super::diff::DiffStatus;
|
||||||
|
use super::sexp::unquote;
|
||||||
use super::sexp::Token;
|
use super::sexp::Token;
|
||||||
use super::util::get_property;
|
use super::util::get_property;
|
||||||
|
use super::util::get_property_numeric;
|
||||||
use super::util::get_property_quoted_string;
|
use super::util::get_property_quoted_string;
|
||||||
use super::util::get_property_unquoted_atom;
|
use super::util::get_property_unquoted_atom;
|
||||||
|
use crate::types::AstNode;
|
||||||
|
use crate::types::CharOffsetInLine;
|
||||||
|
use crate::types::LineNumber;
|
||||||
|
use crate::types::Object;
|
||||||
|
use crate::types::RetainLabels;
|
||||||
|
use crate::types::SwitchNumberLines;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub(crate) enum EmacsField<'s> {
|
pub(crate) enum EmacsField<'s> {
|
||||||
Required(&'s str),
|
Required(&'s str),
|
||||||
#[allow(dead_code)]
|
|
||||||
Optional(&'s str),
|
Optional(&'s str),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub(crate) enum ComparePropertiesResult<'b, 's> {
|
||||||
|
NoChange,
|
||||||
|
/// Return when you want the status for "this" node to change (as opposed to collecting child status).
|
||||||
|
SelfChange(DiffStatus, Option<String>),
|
||||||
|
DiffEntry(DiffEntry<'b, 's>),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'b, 's> ComparePropertiesResult<'b, 's> {
|
||||||
|
pub(crate) fn apply(
|
||||||
|
self,
|
||||||
|
child_status: &mut Vec<DiffEntry<'b, 's>>,
|
||||||
|
this_status: &mut DiffStatus,
|
||||||
|
message: &mut Option<String>,
|
||||||
|
) {
|
||||||
|
match self {
|
||||||
|
ComparePropertiesResult::NoChange => {}
|
||||||
|
ComparePropertiesResult::SelfChange(new_status, new_message) => {
|
||||||
|
*this_status = new_status;
|
||||||
|
*message = new_message
|
||||||
|
}
|
||||||
|
ComparePropertiesResult::DiffEntry(diff_entry) => child_status.push(diff_entry),
|
||||||
|
}
|
||||||
|
|
||||||
|
// foo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Do no comparison.
|
/// Do no comparison.
|
||||||
///
|
///
|
||||||
/// This is for when you want to acknowledge that a field exists in the emacs token, but you do not have any validation for it when using the compare_properties!() macro. Ideally, this should be kept to a minimum since this represents untested values.
|
/// This is for when you want to acknowledge that a field exists in the emacs token, but you do not have any validation for it when using the compare_properties!() macro. Ideally, this should be kept to a minimum since this represents untested values.
|
||||||
#[allow(dead_code)]
|
|
||||||
pub(crate) fn compare_noop<'b, 's, 'x, R, RG>(
|
pub(crate) fn compare_noop<'b, 's, 'x, R, RG>(
|
||||||
|
_source: &'s str,
|
||||||
_emacs: &'b Token<'s>,
|
_emacs: &'b Token<'s>,
|
||||||
_rust_node: R,
|
_rust_node: R,
|
||||||
_emacs_field: &'x str,
|
_emacs_field: &'x str,
|
||||||
_rust_value_getter: RG,
|
_rust_value_getter: RG,
|
||||||
) -> Result<Option<(DiffStatus, Option<String>)>, Box<dyn std::error::Error>> {
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
Ok(None)
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Do no comparison.
|
/// Do no comparison.
|
||||||
///
|
///
|
||||||
/// This is for when you want to acknowledge that a field exists in the emacs token, but you do not have any validation for it when using the compare_properties!() macro. Ideally, this should be kept to a minimum since this represents untested values.
|
/// This is for when you want to acknowledge that a field exists in the emacs token, but you do not have any validation for it when using the compare_properties!() macro. Ideally, this should be kept to a minimum since this represents untested values.
|
||||||
#[allow(dead_code)]
|
|
||||||
pub(crate) fn compare_identity() -> () {
|
pub(crate) fn compare_identity() -> () {
|
||||||
()
|
()
|
||||||
}
|
}
|
||||||
@@ -38,11 +78,12 @@ pub(crate) fn compare_identity() -> () {
|
|||||||
///
|
///
|
||||||
/// This is usually used for fields which, in my testing, are always nil. Using this compare function instead of simply doing a compare_noop will enable us to be alerted when we finally come across an org-mode document that has a value other than nil for the property.
|
/// This is usually used for fields which, in my testing, are always nil. Using this compare function instead of simply doing a compare_noop will enable us to be alerted when we finally come across an org-mode document that has a value other than nil for the property.
|
||||||
pub(crate) fn compare_property_always_nil<'b, 's, 'x, R, RG>(
|
pub(crate) fn compare_property_always_nil<'b, 's, 'x, R, RG>(
|
||||||
|
_source: &'s str,
|
||||||
emacs: &'b Token<'s>,
|
emacs: &'b Token<'s>,
|
||||||
_rust_node: R,
|
_rust_node: R,
|
||||||
emacs_field: &'x str,
|
emacs_field: &'x str,
|
||||||
_rust_value_getter: RG,
|
_rust_value_getter: RG,
|
||||||
) -> Result<Option<(DiffStatus, Option<String>)>, Box<dyn std::error::Error>> {
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
let value = get_property(emacs, emacs_field)?;
|
let value = get_property(emacs, emacs_field)?;
|
||||||
if value.is_some() {
|
if value.is_some() {
|
||||||
let this_status = DiffStatus::Bad;
|
let this_status = DiffStatus::Bad;
|
||||||
@@ -50,9 +91,9 @@ pub(crate) fn compare_property_always_nil<'b, 's, 'x, R, RG>(
|
|||||||
"{} was expected to always be nil: {:?}",
|
"{} was expected to always be nil: {:?}",
|
||||||
emacs_field, value
|
emacs_field, value
|
||||||
));
|
));
|
||||||
Ok(Some((this_status, message)))
|
Ok(ComparePropertiesResult::SelfChange(this_status, message))
|
||||||
} else {
|
} else {
|
||||||
Ok(None)
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,11 +105,12 @@ pub(crate) fn compare_property_quoted_string<
|
|||||||
RV: AsRef<str> + std::fmt::Debug,
|
RV: AsRef<str> + std::fmt::Debug,
|
||||||
RG: Fn(R) -> Option<RV>,
|
RG: Fn(R) -> Option<RV>,
|
||||||
>(
|
>(
|
||||||
|
_source: &'s str,
|
||||||
emacs: &'b Token<'s>,
|
emacs: &'b Token<'s>,
|
||||||
rust_node: R,
|
rust_node: R,
|
||||||
emacs_field: &'x str,
|
emacs_field: &'x str,
|
||||||
rust_value_getter: RG,
|
rust_value_getter: RG,
|
||||||
) -> Result<Option<(DiffStatus, Option<String>)>, Box<dyn std::error::Error>> {
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
let value = get_property_quoted_string(emacs, emacs_field)?;
|
let value = get_property_quoted_string(emacs, emacs_field)?;
|
||||||
let rust_value = rust_value_getter(rust_node);
|
let rust_value = rust_value_getter(rust_node);
|
||||||
if rust_value.as_ref().map(|s| s.as_ref()) != value.as_ref().map(String::as_str) {
|
if rust_value.as_ref().map(|s| s.as_ref()) != value.as_ref().map(String::as_str) {
|
||||||
@@ -77,18 +119,19 @@ pub(crate) fn compare_property_quoted_string<
|
|||||||
"{} mismatch (emacs != rust) {:?} != {:?}",
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
emacs_field, value, rust_value
|
emacs_field, value, rust_value
|
||||||
));
|
));
|
||||||
Ok(Some((this_status, message)))
|
Ok(ComparePropertiesResult::SelfChange(this_status, message))
|
||||||
} else {
|
} else {
|
||||||
Ok(None)
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn compare_property_unquoted_atom<'b, 's, 'x, R, RG: Fn(R) -> Option<&'s str>>(
|
pub(crate) fn compare_property_unquoted_atom<'b, 's, 'x, R, RG: Fn(R) -> Option<&'s str>>(
|
||||||
|
_source: &'s str,
|
||||||
emacs: &'b Token<'s>,
|
emacs: &'b Token<'s>,
|
||||||
rust_node: R,
|
rust_node: R,
|
||||||
emacs_field: &'x str,
|
emacs_field: &'x str,
|
||||||
rust_value_getter: RG,
|
rust_value_getter: RG,
|
||||||
) -> Result<Option<(DiffStatus, Option<String>)>, Box<dyn std::error::Error>> {
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
let value = get_property_unquoted_atom(emacs, emacs_field)?;
|
let value = get_property_unquoted_atom(emacs, emacs_field)?;
|
||||||
let rust_value = rust_value_getter(rust_node);
|
let rust_value = rust_value_getter(rust_node);
|
||||||
if rust_value != value {
|
if rust_value != value {
|
||||||
@@ -97,8 +140,506 @@ pub(crate) fn compare_property_unquoted_atom<'b, 's, 'x, R, RG: Fn(R) -> Option<
|
|||||||
"{} mismatch (emacs != rust) {:?} != {:?}",
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
emacs_field, value, rust_value
|
emacs_field, value, rust_value
|
||||||
));
|
));
|
||||||
Ok(Some((this_status, message)))
|
Ok(ComparePropertiesResult::SelfChange(this_status, message))
|
||||||
} else {
|
} else {
|
||||||
Ok(None)
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn compare_property_numeric<
|
||||||
|
'b,
|
||||||
|
's,
|
||||||
|
'x,
|
||||||
|
R,
|
||||||
|
RV: FromStr + PartialEq + Debug,
|
||||||
|
RG: Fn(R) -> Option<RV>,
|
||||||
|
>(
|
||||||
|
_source: &'s str,
|
||||||
|
emacs: &'b Token<'s>,
|
||||||
|
rust_node: R,
|
||||||
|
emacs_field: &'x str,
|
||||||
|
rust_value_getter: RG,
|
||||||
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error + 's>>
|
||||||
|
where
|
||||||
|
<RV as FromStr>::Err: std::error::Error,
|
||||||
|
<RV as FromStr>::Err: 's,
|
||||||
|
{
|
||||||
|
let value = get_property_numeric::<RV>(emacs, emacs_field)?;
|
||||||
|
let rust_value = rust_value_getter(rust_node);
|
||||||
|
if rust_value != value {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, value, rust_value
|
||||||
|
));
|
||||||
|
Ok(ComparePropertiesResult::SelfChange(this_status, message))
|
||||||
|
} else {
|
||||||
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn compare_property_list_of_quoted_string<
|
||||||
|
'b,
|
||||||
|
's,
|
||||||
|
'x,
|
||||||
|
R,
|
||||||
|
RV: AsRef<str> + std::fmt::Debug,
|
||||||
|
RI: Iterator<Item = RV>,
|
||||||
|
RG: Fn(R) -> Option<RI>,
|
||||||
|
>(
|
||||||
|
_source: &'s str,
|
||||||
|
emacs: &'b Token<'s>,
|
||||||
|
rust_node: R,
|
||||||
|
emacs_field: &'x str,
|
||||||
|
rust_value_getter: RG,
|
||||||
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
|
let value = get_property(emacs, emacs_field)?
|
||||||
|
.map(Token::as_list)
|
||||||
|
.map_or(Ok(None), |r| r.map(Some))?;
|
||||||
|
let rust_value = rust_value_getter(rust_node);
|
||||||
|
// TODO: Seems we are needlessly coverting to a vec here.
|
||||||
|
let rust_value: Option<Vec<RV>> = rust_value.map(|it| it.collect());
|
||||||
|
match (value, &rust_value) {
|
||||||
|
(None, None) => {}
|
||||||
|
(None, Some(_)) | (Some(_), None) => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, value, rust_value
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
(Some(el), Some(rl)) if el.len() != rl.len() => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, value, rust_value
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
(Some(el), Some(rl)) => {
|
||||||
|
for (e, r) in el.iter().zip(rl) {
|
||||||
|
let e = unquote(e.as_atom()?)?;
|
||||||
|
let r = r.as_ref();
|
||||||
|
if e != r {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}. Full list: {:?} != {:?}",
|
||||||
|
emacs_field, e, r, value, rust_value
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn compare_property_set_of_quoted_string<
|
||||||
|
'a,
|
||||||
|
'b,
|
||||||
|
's,
|
||||||
|
'x,
|
||||||
|
R,
|
||||||
|
RV: AsRef<str> + std::fmt::Debug + Ord + 'a + ?Sized,
|
||||||
|
RI: Iterator<Item = &'a RV>,
|
||||||
|
RG: Fn(R) -> Option<RI>,
|
||||||
|
>(
|
||||||
|
_source: &'s str,
|
||||||
|
emacs: &'b Token<'s>,
|
||||||
|
rust_node: R,
|
||||||
|
emacs_field: &'x str,
|
||||||
|
rust_value_getter: RG,
|
||||||
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
|
let value = get_property(emacs, emacs_field)?
|
||||||
|
.map(Token::as_list)
|
||||||
|
.map_or(Ok(None), |r| r.map(Some))?;
|
||||||
|
let empty = Vec::new();
|
||||||
|
let value = value.unwrap_or(&empty);
|
||||||
|
let rust_value = rust_value_getter(rust_node);
|
||||||
|
let rust_value = if let Some(rust_value) = rust_value {
|
||||||
|
let slices: BTreeSet<&str> = rust_value.map(|rv| rv.as_ref()).collect();
|
||||||
|
slices
|
||||||
|
} else {
|
||||||
|
BTreeSet::new()
|
||||||
|
};
|
||||||
|
let value: Vec<&str> = value
|
||||||
|
.iter()
|
||||||
|
.map(|e| e.as_atom())
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
let value: Vec<String> = value
|
||||||
|
.into_iter()
|
||||||
|
.map(unquote)
|
||||||
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
let value: BTreeSet<&str> = value.iter().map(|e| e.as_str()).collect();
|
||||||
|
let mismatched: Vec<_> = value
|
||||||
|
.symmetric_difference(&rust_value)
|
||||||
|
.map(|val| *val)
|
||||||
|
.collect();
|
||||||
|
if !mismatched.is_empty() {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch. Mismatched values: {}",
|
||||||
|
emacs_field,
|
||||||
|
mismatched.join(", ")
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn compare_property_boolean<'b, 's, 'x, R, RG: Fn(R) -> bool>(
|
||||||
|
_source: &'s str,
|
||||||
|
emacs: &'b Token<'s>,
|
||||||
|
rust_node: R,
|
||||||
|
emacs_field: &'x str,
|
||||||
|
rust_value_getter: RG,
|
||||||
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
|
// get_property already converts nil to None.
|
||||||
|
let value = get_property(emacs, emacs_field)?.is_some();
|
||||||
|
let rust_value = rust_value_getter(rust_node);
|
||||||
|
if rust_value != value {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, value, rust_value
|
||||||
|
));
|
||||||
|
Ok(ComparePropertiesResult::SelfChange(this_status, message))
|
||||||
|
} else {
|
||||||
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn compare_property_single_ast_node<
|
||||||
|
'b,
|
||||||
|
's,
|
||||||
|
'x: 'b + 's,
|
||||||
|
R,
|
||||||
|
RV: std::fmt::Debug,
|
||||||
|
RG: Fn(R) -> Option<RV>,
|
||||||
|
>(
|
||||||
|
source: &'s str,
|
||||||
|
emacs: &'b Token<'s>,
|
||||||
|
rust_node: R,
|
||||||
|
emacs_field: &'x str,
|
||||||
|
rust_value_getter: RG,
|
||||||
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error>>
|
||||||
|
where
|
||||||
|
AstNode<'b, 's>: From<RV>,
|
||||||
|
{
|
||||||
|
let value = get_property(emacs, emacs_field)?;
|
||||||
|
let rust_value = rust_value_getter(rust_node);
|
||||||
|
match (value, rust_value) {
|
||||||
|
(None, None) => {}
|
||||||
|
(None, rv @ Some(_)) | (Some(_), rv @ None) => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, value, rv
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
(Some(ev), Some(rv)) => {
|
||||||
|
let child_status: Vec<DiffEntry<'b, 's>> =
|
||||||
|
vec![compare_ast_node(source, ev, rv.into())?];
|
||||||
|
let diff_scope = artificial_diff_scope(emacs_field, child_status)?;
|
||||||
|
return Ok(ComparePropertiesResult::DiffEntry(diff_scope));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn compare_property_list_of_ast_nodes<
|
||||||
|
'b,
|
||||||
|
's,
|
||||||
|
'x: 'b + 's,
|
||||||
|
R,
|
||||||
|
RV: std::fmt::Debug,
|
||||||
|
RI: Iterator<Item = RV>,
|
||||||
|
RG: Fn(R) -> Option<RI>,
|
||||||
|
>(
|
||||||
|
source: &'s str,
|
||||||
|
emacs: &'b Token<'s>,
|
||||||
|
rust_node: R,
|
||||||
|
emacs_field: &'x str,
|
||||||
|
rust_value_getter: RG,
|
||||||
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error>>
|
||||||
|
where
|
||||||
|
AstNode<'b, 's>: From<RV>,
|
||||||
|
{
|
||||||
|
let value = get_property(emacs, emacs_field)?
|
||||||
|
.map(Token::as_list)
|
||||||
|
.map_or(Ok(None), |r| r.map(Some))?;
|
||||||
|
let rust_value = rust_value_getter(rust_node);
|
||||||
|
// TODO: Seems we are needlessly coverting to a vec here.
|
||||||
|
let rust_value: Option<Vec<RV>> = rust_value.map(|it| it.collect());
|
||||||
|
match (value, rust_value) {
|
||||||
|
(None, None) => {}
|
||||||
|
(Some(el), None)
|
||||||
|
if el.len() == 1
|
||||||
|
&& el.into_iter().all(|t| {
|
||||||
|
if let Ok(r#""""#) = t.as_atom() {
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}) => {}
|
||||||
|
(None, rv @ Some(_)) | (Some(_), rv @ None) => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, value, rv
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
(Some(el), Some(rl)) if el.len() != rl.len() => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, el, rl
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
(Some(el), Some(rl)) => {
|
||||||
|
let mut child_status: Vec<DiffEntry<'b, 's>> = Vec::with_capacity(rl.len());
|
||||||
|
for (e, r) in el.iter().zip(rl) {
|
||||||
|
child_status.push(compare_ast_node(source, e, r.into())?);
|
||||||
|
}
|
||||||
|
let diff_scope = artificial_diff_scope(emacs_field, child_status)?;
|
||||||
|
return Ok(ComparePropertiesResult::DiffEntry(diff_scope));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Special compare used for affiliate keywords that are parsed as objects.
|
||||||
|
///
|
||||||
|
/// Org-mode seems to store these as a 3-deep list:
|
||||||
|
/// - Outer list with 1 element per #+caption keyword (or other parsed keyword).
|
||||||
|
/// - Middle list which has:
|
||||||
|
/// - first element is a list of objects representing the value after the colon.
|
||||||
|
/// - every additional element is a list of objects from inside the square brackets (the optional value).
|
||||||
|
pub(crate) fn compare_property_list_of_list_of_list_of_ast_nodes<
|
||||||
|
'b,
|
||||||
|
's,
|
||||||
|
'x,
|
||||||
|
R,
|
||||||
|
RG: Fn(R) -> Option<&'b Vec<(Option<Vec<Object<'s>>>, Vec<Object<'s>>)>>,
|
||||||
|
>(
|
||||||
|
source: &'s str,
|
||||||
|
emacs: &'b Token<'s>,
|
||||||
|
rust_node: R,
|
||||||
|
emacs_field: &'x str,
|
||||||
|
rust_value_getter: RG,
|
||||||
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
|
// TODO: Replace Object<'s> with generics. I hard-coded Object in to make lifetimes easier.
|
||||||
|
let rust_value = rust_value_getter(rust_node);
|
||||||
|
let value = get_property(emacs, emacs_field)?
|
||||||
|
.map(Token::as_list)
|
||||||
|
.map_or(Ok(None), |r| r.map(Some))?;
|
||||||
|
let (value, rust_value) = match (value, rust_value) {
|
||||||
|
(None, None) => {
|
||||||
|
return Ok(ComparePropertiesResult::NoChange);
|
||||||
|
}
|
||||||
|
(None, Some(_)) | (Some(_), None) => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, value, rust_value
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
(Some(value), Some(rust_value)) if value.len() != rust_value.len() => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, value, rust_value
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
(Some(value), Some(rust_value)) => (value, rust_value),
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut full_status: Vec<DiffEntry<'b, 's>> = Vec::with_capacity(rust_value.len());
|
||||||
|
|
||||||
|
// Iterate the outer lists
|
||||||
|
for (value, (rust_optional, rust_value)) in value.iter().zip(rust_value.iter()) {
|
||||||
|
let mut middle_value = value.as_list()?.iter();
|
||||||
|
// First element of middle list is the mandatory value (the value past the colon).
|
||||||
|
let mandatory_value = middle_value.next();
|
||||||
|
let mandatory_value = match mandatory_value {
|
||||||
|
Some(mandatory_value) => mandatory_value,
|
||||||
|
None => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, value, rust_value
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Compare optional value
|
||||||
|
if let Some(rust_optional) = rust_optional {
|
||||||
|
let mut child_status: Vec<DiffEntry<'b, 's>> = Vec::with_capacity(rust_value.len());
|
||||||
|
if rust_optional.len() != middle_value.len() {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} optional value length mismatch (emacs != rust) {} != {} | {:?}",
|
||||||
|
emacs_field,
|
||||||
|
middle_value.len(),
|
||||||
|
rust_optional.len(),
|
||||||
|
rust_optional
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
for (e, r) in middle_value.zip(rust_optional) {
|
||||||
|
child_status.push(compare_ast_node(source, e, r.into())?);
|
||||||
|
}
|
||||||
|
if !child_status.is_empty() {
|
||||||
|
let diff_scope = artificial_diff_scope("optional value", child_status)?;
|
||||||
|
full_status.push(diff_scope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compare mandatory value
|
||||||
|
let mut child_status: Vec<DiffEntry<'b, 's>> = Vec::with_capacity(rust_value.len());
|
||||||
|
let mandatory_value = mandatory_value.as_list()?;
|
||||||
|
if rust_value.len() != mandatory_value.len() {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mandatory value length mismatch (emacs != rust) {} != {} | {:?}",
|
||||||
|
emacs_field,
|
||||||
|
mandatory_value.len(),
|
||||||
|
rust_value.len(),
|
||||||
|
rust_value
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
for (e, r) in mandatory_value.iter().zip(rust_value) {
|
||||||
|
child_status.push(compare_ast_node(source, e, r.into())?);
|
||||||
|
}
|
||||||
|
if !child_status.is_empty() {
|
||||||
|
let diff_scope = artificial_diff_scope("mandatory value", child_status)?;
|
||||||
|
full_status.push(diff_scope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if full_status.is_empty() {
|
||||||
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
|
} else {
|
||||||
|
let diff_scope = artificial_owned_diff_scope(emacs_field, full_status)?;
|
||||||
|
Ok(ComparePropertiesResult::DiffEntry(diff_scope))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn compare_property_number_lines<
|
||||||
|
'b,
|
||||||
|
's,
|
||||||
|
'x,
|
||||||
|
'y,
|
||||||
|
R,
|
||||||
|
RG: Fn(R) -> Option<&'y SwitchNumberLines>,
|
||||||
|
>(
|
||||||
|
_source: &'s str,
|
||||||
|
emacs: &'b Token<'s>,
|
||||||
|
rust_node: R,
|
||||||
|
emacs_field: &'x str,
|
||||||
|
rust_value_getter: RG,
|
||||||
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
|
let number_lines = get_property(emacs, emacs_field)?;
|
||||||
|
let rust_value = rust_value_getter(rust_node);
|
||||||
|
match (number_lines, &rust_value) {
|
||||||
|
(None, None) => {}
|
||||||
|
(Some(number_lines), Some(rust_number_lines)) => {
|
||||||
|
let token_list = number_lines.as_list()?;
|
||||||
|
let number_type = token_list
|
||||||
|
.get(0)
|
||||||
|
.map(Token::as_atom)
|
||||||
|
.map_or(Ok(None), |r| r.map(Some))?
|
||||||
|
.ok_or(":number-lines should have a type.")?;
|
||||||
|
let number_value = token_list
|
||||||
|
.get(2)
|
||||||
|
.map(Token::as_atom)
|
||||||
|
.map_or(Ok(None), |r| r.map(Some))?
|
||||||
|
.map(|val| val.parse::<LineNumber>())
|
||||||
|
.map_or(Ok(None), |r| r.map(Some))?
|
||||||
|
.ok_or(":number-lines should have a value.")?;
|
||||||
|
match (number_type, number_value, rust_number_lines) {
|
||||||
|
("new", emacs_val, SwitchNumberLines::New(rust_val)) if emacs_val == *rust_val => {}
|
||||||
|
("continued", emacs_val, SwitchNumberLines::Continued(rust_val))
|
||||||
|
if emacs_val == *rust_val => {}
|
||||||
|
_ => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, number_lines, rust_value
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, number_lines, rust_value
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn compare_property_retain_labels<'b, 's, 'x, 'y, R, RG: Fn(R) -> &'y RetainLabels>(
|
||||||
|
_source: &'s str,
|
||||||
|
emacs: &'b Token<'s>,
|
||||||
|
rust_node: R,
|
||||||
|
emacs_field: &'x str,
|
||||||
|
rust_value_getter: RG,
|
||||||
|
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error + 's>> {
|
||||||
|
let rust_value = rust_value_getter(rust_node);
|
||||||
|
let retain_labels = get_property_unquoted_atom(emacs, ":retain-labels")?;
|
||||||
|
if let Some(retain_labels) = retain_labels {
|
||||||
|
if retain_labels == "t" {
|
||||||
|
match rust_value {
|
||||||
|
RetainLabels::Yes => {}
|
||||||
|
_ => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, retain_labels, rust_value
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let retain_labels: CharOffsetInLine = get_property_numeric(emacs, ":retain-labels")?.expect("Cannot be None or else the earlier get_property_unquoted_atom would have been None.");
|
||||||
|
match (retain_labels, rust_value) {
|
||||||
|
(e, RetainLabels::Keep(r)) if e == *r => {}
|
||||||
|
_ => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, retain_labels, rust_value
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
match rust_value {
|
||||||
|
RetainLabels::No => {}
|
||||||
|
_ => {
|
||||||
|
let this_status = DiffStatus::Bad;
|
||||||
|
let message = Some(format!(
|
||||||
|
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
emacs_field, retain_labels, rust_value
|
||||||
|
));
|
||||||
|
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(ComparePropertiesResult::NoChange)
|
||||||
|
}
|
||||||
|
|||||||
3762
src/compare/diff.rs
3762
src/compare/diff.rs
File diff suppressed because it is too large
Load Diff
@@ -30,10 +30,9 @@
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
macro_rules! compare_properties {
|
macro_rules! compare_properties {
|
||||||
($emacs:expr, $rust:expr, $(($emacs_field:expr, $rust_value_getter:expr, $compare_fn: expr)),+) => {
|
($source:expr, $emacs:expr, $rust:expr, $(($emacs_field:expr, $rust_value_getter:expr, $compare_fn: expr)),*) => {
|
||||||
{
|
{
|
||||||
let mut this_status = DiffStatus::Good;
|
let mut new_status = Vec::new();
|
||||||
let mut message: Option<String> = None;
|
|
||||||
let children = $emacs.as_list()?;
|
let children = $emacs.as_list()?;
|
||||||
let attributes_child = children
|
let attributes_child = children
|
||||||
.iter()
|
.iter()
|
||||||
@@ -44,10 +43,9 @@ macro_rules! compare_properties {
|
|||||||
if emacs_keys.contains(":standard-properties") {
|
if emacs_keys.contains(":standard-properties") {
|
||||||
emacs_keys.remove(":standard-properties");
|
emacs_keys.remove(":standard-properties");
|
||||||
} else {
|
} else {
|
||||||
this_status = DiffStatus::Bad;
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
message = Some(format!(
|
|
||||||
"Emacs token lacks :standard-properties field.",
|
"Emacs token lacks :standard-properties field.",
|
||||||
));
|
))));
|
||||||
}
|
}
|
||||||
$(
|
$(
|
||||||
match $emacs_field {
|
match $emacs_field {
|
||||||
@@ -58,24 +56,22 @@ macro_rules! compare_properties {
|
|||||||
emacs_keys.remove(name);
|
emacs_keys.remove(name);
|
||||||
},
|
},
|
||||||
EmacsField::Required(name) => {
|
EmacsField::Required(name) => {
|
||||||
this_status = DiffStatus::Bad;
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
message = Some(format!(
|
|
||||||
"Emacs token lacks required field: {}",
|
"Emacs token lacks required field: {}",
|
||||||
name
|
name
|
||||||
));
|
))));
|
||||||
},
|
},
|
||||||
EmacsField::Optional(_name) => {},
|
EmacsField::Optional(_name) => {},
|
||||||
}
|
}
|
||||||
)+
|
)*
|
||||||
|
|
||||||
if !emacs_keys.is_empty() {
|
if !emacs_keys.is_empty() {
|
||||||
let unexpected_keys: Vec<&str> = emacs_keys.into_iter().collect();
|
let unexpected_keys: Vec<&str> = emacs_keys.into_iter().collect();
|
||||||
let unexpected_keys = unexpected_keys.join(", ");
|
let unexpected_keys = unexpected_keys.join(", ");
|
||||||
this_status = DiffStatus::Bad;
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
message = Some(format!(
|
|
||||||
"Emacs token had extra field(s): {}",
|
"Emacs token had extra field(s): {}",
|
||||||
unexpected_keys
|
unexpected_keys
|
||||||
));
|
))));
|
||||||
}
|
}
|
||||||
|
|
||||||
$(
|
$(
|
||||||
@@ -87,33 +83,23 @@ macro_rules! compare_properties {
|
|||||||
name
|
name
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let result = $compare_fn($emacs, $rust, emacs_name, $rust_value_getter)?;
|
let result = $compare_fn($source, $emacs, $rust, emacs_name, $rust_value_getter)?;
|
||||||
match result {
|
match result {
|
||||||
Some((DiffStatus::Good, _)) => unreachable!("No comparison functions should return Some() when DiffStatus is good."),
|
ComparePropertiesResult::SelfChange(DiffStatus::Good, _) => unreachable!("No comparison functions should return SelfChange() when DiffStatus is good."),
|
||||||
Some((status, msg)) => {
|
ComparePropertiesResult::NoChange => {},
|
||||||
this_status = status;
|
result => {
|
||||||
message = msg;
|
new_status.push(result);
|
||||||
},
|
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
)+
|
}
|
||||||
|
)*
|
||||||
|
|
||||||
match this_status {
|
new_status
|
||||||
DiffStatus::Good => {
|
|
||||||
let result: Result<_, Box<dyn std::error::Error>> = Ok(None);
|
|
||||||
result
|
|
||||||
},
|
|
||||||
_ => {
|
|
||||||
Ok(Some((this_status, message)))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Default case for when there are no expected properties except for :standard-properties
|
// For elements with affiliated keywords
|
||||||
($emacs:expr) => {
|
($source:expr, $emacs:expr, $rust:expr, [], $(($emacs_field:expr, $rust_value_getter:expr, $compare_fn: expr)),*) => {
|
||||||
{
|
{
|
||||||
let mut this_status = DiffStatus::Good;
|
let mut new_status = Vec::new();
|
||||||
let mut message: Option<String> = None;
|
|
||||||
let children = $emacs.as_list()?;
|
let children = $emacs.as_list()?;
|
||||||
let attributes_child = children
|
let attributes_child = children
|
||||||
.iter()
|
.iter()
|
||||||
@@ -124,30 +110,193 @@ macro_rules! compare_properties {
|
|||||||
if emacs_keys.contains(":standard-properties") {
|
if emacs_keys.contains(":standard-properties") {
|
||||||
emacs_keys.remove(":standard-properties");
|
emacs_keys.remove(":standard-properties");
|
||||||
} else {
|
} else {
|
||||||
this_status = DiffStatus::Bad;
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
message = Some(format!(
|
|
||||||
"Emacs token lacks :standard-properties field.",
|
"Emacs token lacks :standard-properties field.",
|
||||||
));
|
))));
|
||||||
|
}
|
||||||
|
let affiliated_keywords_names: Vec<String> = affiliated_keywords_names($rust).collect();
|
||||||
|
for additional_field in affiliated_keywords_names.iter().map(String::as_str).map(EmacsField::Required) {
|
||||||
|
match additional_field {
|
||||||
|
EmacsField::Required(name) if emacs_keys.contains(name) => {
|
||||||
|
emacs_keys.remove(name);
|
||||||
|
},
|
||||||
|
EmacsField::Optional(name) if emacs_keys.contains(name) => {
|
||||||
|
emacs_keys.remove(name);
|
||||||
|
},
|
||||||
|
EmacsField::Required(name) => {
|
||||||
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
|
"Emacs token lacks required field: {}",
|
||||||
|
name
|
||||||
|
))));
|
||||||
|
},
|
||||||
|
EmacsField::Optional(_name) => {},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$(
|
||||||
|
match $emacs_field {
|
||||||
|
EmacsField::Required(name) if emacs_keys.contains(name) => {
|
||||||
|
emacs_keys.remove(name);
|
||||||
|
},
|
||||||
|
EmacsField::Optional(name) if emacs_keys.contains(name) => {
|
||||||
|
emacs_keys.remove(name);
|
||||||
|
},
|
||||||
|
EmacsField::Required(name) => {
|
||||||
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
|
"Emacs token lacks required field: {}",
|
||||||
|
name
|
||||||
|
))));
|
||||||
|
},
|
||||||
|
EmacsField::Optional(_name) => {},
|
||||||
|
}
|
||||||
|
)*
|
||||||
|
|
||||||
|
if !emacs_keys.is_empty() {
|
||||||
|
let unexpected_keys: Vec<&str> = emacs_keys.into_iter().collect();
|
||||||
|
let unexpected_keys = unexpected_keys.join(", ");
|
||||||
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
|
"Emacs token had extra field(s): {}",
|
||||||
|
unexpected_keys
|
||||||
|
))));
|
||||||
|
}
|
||||||
|
|
||||||
|
for diff in compare_affiliated_keywords($source, $emacs, $rust)? {
|
||||||
|
new_status.push(diff);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(
|
||||||
|
let emacs_name = match $emacs_field {
|
||||||
|
EmacsField::Required(name) => {
|
||||||
|
name
|
||||||
|
},
|
||||||
|
EmacsField::Optional(name) => {
|
||||||
|
name
|
||||||
|
},
|
||||||
|
};
|
||||||
|
let result = $compare_fn($source, $emacs, $rust, emacs_name, $rust_value_getter)?;
|
||||||
|
match result {
|
||||||
|
ComparePropertiesResult::SelfChange(DiffStatus::Good, _) => unreachable!("No comparison functions should return SelfChange() when DiffStatus is good."),
|
||||||
|
ComparePropertiesResult::NoChange => {},
|
||||||
|
result => {
|
||||||
|
new_status.push(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)*
|
||||||
|
|
||||||
|
new_status
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// Specifies additional properties
|
||||||
|
($source:expr, $emacs:expr, $rust:expr, $additionalproperties: expr, $(($emacs_field:expr, $rust_value_getter:expr, $compare_fn: expr)),*) => {
|
||||||
|
{
|
||||||
|
let mut new_status = Vec::new();
|
||||||
|
let children = $emacs.as_list()?;
|
||||||
|
let attributes_child = children
|
||||||
|
.iter()
|
||||||
|
.nth(1)
|
||||||
|
.ok_or("Should have an attributes child.")?;
|
||||||
|
let attributes_map = attributes_child.as_map()?;
|
||||||
|
let mut emacs_keys: BTreeSet<&str> = attributes_map.keys().map(|s| *s).collect();
|
||||||
|
if emacs_keys.contains(":standard-properties") {
|
||||||
|
emacs_keys.remove(":standard-properties");
|
||||||
|
} else {
|
||||||
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
|
"Emacs token lacks :standard-properties field.",
|
||||||
|
))));
|
||||||
|
}
|
||||||
|
for additional_field in $additionalproperties {
|
||||||
|
match additional_field {
|
||||||
|
EmacsField::Required(name) if emacs_keys.contains(name) => {
|
||||||
|
emacs_keys.remove(name);
|
||||||
|
},
|
||||||
|
EmacsField::Optional(name) if emacs_keys.contains(name) => {
|
||||||
|
emacs_keys.remove(name);
|
||||||
|
},
|
||||||
|
EmacsField::Required(name) => {
|
||||||
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
|
"Emacs token lacks required field: {}",
|
||||||
|
name
|
||||||
|
))));
|
||||||
|
},
|
||||||
|
EmacsField::Optional(_name) => {},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$(
|
||||||
|
match $emacs_field {
|
||||||
|
EmacsField::Required(name) if emacs_keys.contains(name) => {
|
||||||
|
emacs_keys.remove(name);
|
||||||
|
},
|
||||||
|
EmacsField::Optional(name) if emacs_keys.contains(name) => {
|
||||||
|
emacs_keys.remove(name);
|
||||||
|
},
|
||||||
|
EmacsField::Required(name) => {
|
||||||
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
|
"Emacs token lacks required field: {}",
|
||||||
|
name
|
||||||
|
))));
|
||||||
|
},
|
||||||
|
EmacsField::Optional(_name) => {},
|
||||||
|
}
|
||||||
|
)*
|
||||||
|
|
||||||
|
if !emacs_keys.is_empty() {
|
||||||
|
let unexpected_keys: Vec<&str> = emacs_keys.into_iter().collect();
|
||||||
|
let unexpected_keys = unexpected_keys.join(", ");
|
||||||
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
|
"Emacs token had extra field(s): {}",
|
||||||
|
unexpected_keys
|
||||||
|
))));
|
||||||
|
}
|
||||||
|
|
||||||
|
$(
|
||||||
|
let emacs_name = match $emacs_field {
|
||||||
|
EmacsField::Required(name) => {
|
||||||
|
name
|
||||||
|
},
|
||||||
|
EmacsField::Optional(name) => {
|
||||||
|
name
|
||||||
|
},
|
||||||
|
};
|
||||||
|
let result = $compare_fn($source, $emacs, $rust, emacs_name, $rust_value_getter)?;
|
||||||
|
match result {
|
||||||
|
ComparePropertiesResult::SelfChange(DiffStatus::Good, _) => unreachable!("No comparison functions should return SelfChange() when DiffStatus is good."),
|
||||||
|
ComparePropertiesResult::NoChange => {},
|
||||||
|
result => {
|
||||||
|
new_status.push(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)*
|
||||||
|
|
||||||
|
new_status
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// Default case for when there are no expected properties except for :standard-properties
|
||||||
|
($emacs:expr) => {
|
||||||
|
{
|
||||||
|
let mut new_status = Vec::new();
|
||||||
|
let children = $emacs.as_list()?;
|
||||||
|
let attributes_child = children
|
||||||
|
.iter()
|
||||||
|
.nth(1)
|
||||||
|
.ok_or("Should have an attributes child.")?;
|
||||||
|
let attributes_map = attributes_child.as_map()?;
|
||||||
|
let mut emacs_keys: BTreeSet<&str> = attributes_map.keys().map(|s| *s).collect();
|
||||||
|
if emacs_keys.contains(":standard-properties") {
|
||||||
|
emacs_keys.remove(":standard-properties");
|
||||||
|
} else {
|
||||||
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
|
"Emacs token lacks :standard-properties field.",
|
||||||
|
))));
|
||||||
}
|
}
|
||||||
|
|
||||||
if !emacs_keys.is_empty() {
|
if !emacs_keys.is_empty() {
|
||||||
let unexpected_keys: Vec<&str> = emacs_keys.into_iter().collect();
|
let unexpected_keys: Vec<&str> = emacs_keys.into_iter().collect();
|
||||||
let unexpected_keys = unexpected_keys.join(", ");
|
let unexpected_keys = unexpected_keys.join(", ");
|
||||||
this_status = DiffStatus::Bad;
|
new_status.push(ComparePropertiesResult::SelfChange(DiffStatus::Bad, Some(format!(
|
||||||
message = Some(format!(
|
|
||||||
"Emacs token had extra field(s): {}",
|
"Emacs token had extra field(s): {}",
|
||||||
unexpected_keys
|
unexpected_keys
|
||||||
));
|
))));
|
||||||
}
|
|
||||||
match this_status {
|
|
||||||
DiffStatus::Good => {
|
|
||||||
let result: Result<_, Box<dyn std::error::Error>> = Ok(None);
|
|
||||||
result
|
|
||||||
},
|
|
||||||
_ => {
|
|
||||||
Ok(Some((this_status, message)))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
new_status
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user