Remove use of ‘if-let’ for Emacs 26+ compatibility
[pelican-mode.git] / pelican-mode.el
index 02d9078..9886e8c 100644 (file)
@@ -51,7 +51,7 @@
 ;; Or with ‘use-package’ and deferred loading:
 ;;
 ;;     (use-package pelican-mode
-;;       :after (:any org rst markdown-mode adoc-mode)
+;;       :demand :after (:any org rst markdown-mode adoc-mode)
 ;;       :config
 ;;       (pelican-global-mode))
 ;;
@@ -269,10 +269,11 @@ has no status."
 (defun pelican-make (target)
   "Execute TARGET in a Makefile at the root of the site."
   (interactive "sMake Pelican target: ")
-  (if-let (default-directory (pelican-mode-find-root))
-      (compilation-start (format "make %s" target)
-                         nil (lambda (_) "*pelican*"))
-    (user-error "No Pelican site root could be found")))
+  (let ((default-directory (pelican-mode-find-root)))
+    (if default-directory
+        (compilation-start (format "make %s" target)
+                           nil (lambda (_) "*pelican*"))
+      (user-error "No Pelican site root could be found"))))
 
 (defun pelican-make-html ()
   "Generate HTML via a Makefile at the root of the site."