From 5ab251cd8d21319bd300ce2a5b37ae932c384ae4 Mon Sep 17 00:00:00 2001
From: David Byers <david.byers@liu.se>
Date: Tue, 21 Jul 2020 16:04:32 +0200
Subject: [PATCH] Removed the valid-digit functions and fixed byte-compilation
 errors.

---
 .gitignore |  2 +-
 README.md  | 11 +++++++++++
 olc.el     | 16 ++--------------
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/.gitignore b/.gitignore
index 820e90a..0a131f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
 *~
 \#*
 .#*
-.elc
+*.elc
diff --git a/README.md b/README.md
index d51b5bf..13316d5 100644
--- a/README.md
+++ b/README.md
@@ -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.
diff --git a/olc.el b/olc.el
index a431ecb..be38e8e 100644
--- a/olc.el
+++ b/olc.el
@@ -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
-- 
GitLab