emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/osm 2b8d06a2c9 1/2: Revert "Bail out earlier if depende


From: ELPA Syncer
Subject: [elpa] externals/osm 2b8d06a2c9 1/2: Revert "Bail out earlier if dependencies are missing"
Date: Wed, 11 May 2022 02:58:04 -0400 (EDT)

branch: externals/osm
commit 2b8d06a2c9393e38da82e729378e26815f9e1552
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Revert "Bail out earlier if dependencies are missing"
    
    This reverts commit 05ac461360f32692f91305e9b42726334fcc81da.
---
 osm.el | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/osm.el b/osm.el
index 742438e8f1..299408197c 100644
--- a/osm.el
+++ b/osm.el
@@ -47,22 +47,6 @@
   (require 'cl-lib)
   (require 'subr-x))
 
-;; Check that Emacs is compiled with the necessary libraries.
-(let (req)
-  (unless (display-graphic-p)
-    (push "graphical display" req))
-  (dolist (type '(svg jpeg png))
-    (unless (image-type-available-p type)
-      (push (format "%s support" type) req)))
-  (unless (libxml-available-p)
-    (push "libxml" req))
-  ;; json-available-p is not available on Emacs 27
-  (unless (ignore-errors (equal [] (json-parse-string "[]")))
-    (push "libjansson" req))
-  (when req
-    (error "Osm: Please compile Emacs with the required libraries, %s needed 
to proceed"
-           (string-join req ", "))))
-
 (defgroup osm nil
   "OpenStreetMap viewer."
   :group 'web
@@ -762,9 +746,27 @@ Should be at least 7 days according to the server usage 
policies."
                   (* 60 60 24 osm-max-age))
            (delete-file file)))))))
 
+(defun osm--check-libraries ()
+  "Check that Emacs is compiled with the necessary libraries."
+  (let (req)
+    (unless (display-graphic-p)
+      (push "graphical display" req))
+    (dolist (type '(svg jpeg png))
+      (unless (image-type-available-p type)
+        (push (format "%s support" type) req)))
+    (unless (libxml-available-p)
+      (push "libxml" req))
+    ;; json-available-p is not available on Emacs 27
+    (unless (ignore-errors (equal [] (json-parse-string "[]")))
+      (push "libjansson" req))
+    (when req
+      (error "Osm: Please compile Emacs with the required libraries, %s needed 
to proceed"
+             (string-join req ", ")))))
+
 (define-derived-mode osm-mode special-mode "Osm"
   "OpenStreetMap viewer mode."
   :interactive nil
+  (osm--check-libraries)
   (setq-local osm-server osm-server
               line-spacing nil
               cursor-type nil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]