Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
olc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Byers
olc
Commits
5ab251cd
Commit
5ab251cd
authored
4 years ago
by
David Byers
Browse files
Options
Downloads
Patches
Plain Diff
Removed the valid-digit functions and fixed byte-compilation errors.
parent
21a40826
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-1
1 addition, 1 deletion
.gitignore
README.md
+11
-0
11 additions, 0 deletions
README.md
olc.el
+2
-14
2 additions, 14 deletions
olc.el
with
14 additions
and
15 deletions
.gitignore
+
1
−
1
View file @
5ab251cd
*~
\#*
.#*
.elc
*
.elc
This diff is collapsed.
Click to expand it.
README.md
+
11
−
0
View file @
5ab251cd
...
...
@@ -104,3 +104,14 @@ The OLC parse is a structure mainly used internally. Unless you call
geographical reference to coordinates. Please make sure you follow
the acceptable use policy for the API (e.g., one request per second,
tops, allowed).
`(olc-is-valid CODE)`
: Returns non-nil if
`CODE`
is a valid open location code.
`(olc-is-short CODE)`
: Returns non-nil if
`CODE`
is a valid short location code. Returns
nil for valid short and for invalid codes.
`(olc-is-full CODE)`
: Returns non-nil if
`CODE`
is a valid full open location code.
Returns nil for valid long and for invalid codes.
This diff is collapsed.
Click to expand it.
olc.el
+
2
−
14
View file @
5ab251cd
...
...
@@ -91,8 +91,7 @@
(
pairs
nil
:read-only
t
)
(
grid
nil
:read-only
t
)
(
short
nil
:read-only
t
)
(
precision
nil
:read-only
t
)
(
code
nil
:read-only
t
))
(
precision
nil
:read-only
t
))
(
defsubst
olc-parse-length
(
parse
)
"Get length from a parsed open location code PARSE."
...
...
@@ -224,24 +223,13 @@
(
olc-parse-create
:pairs
(
nreverse
pairs
)
:grid
(
nreverse
grid
)
:short
short
:precision
precision
:code
code
))))
:precision
precision
))))
;;; ========================================================================
;;; Public functions
;;; ========================================================================
(
defsubst
olc-valid-digits
(
value
)
"Return non-nil if VALUE consists of valid digits.
VALUE can be a character or sequence of characters."
(
condition-case
nil
(
if
(
characterp
value
)
(
olc-digit-value
char
)
(
mapc
'olc-digit-value
char
))
(
error
nil
)))
(
defun
olc-is-valid
(
code
)
"Return non-nil if CODE is a valid open location code."
(
condition-case
nil
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment