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

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

[nongnu] elpa/arduino-mode b08dcbb 037/107: Warn if project loading/crea


From: ELPA Syncer
Subject: [nongnu] elpa/arduino-mode b08dcbb 037/107: Warn if project loading/creation files
Date: Sun, 29 Aug 2021 10:58:12 -0400 (EDT)

branch: elpa/arduino-mode
commit b08dcbb2ba749464aab1290c7a7ab7a8f1dd5192
Author: Bernd Wachter <bwachter-spam@lart.info>
Commit: Bernd Wachter <bwachter-spam@lart.info>

    Warn if project loading/creation files
---
 ede-arduino.el | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/ede-arduino.el b/ede-arduino.el
index 6df07d0..da775cf 100644
--- a/ede-arduino.el
+++ b/ede-arduino.el
@@ -112,7 +112,6 @@ to check."
 Return nil if there isn't one.
 Argument DIR is the directory it is created for.
 ROOTPROJ is nil, sinc there is only one project for a directory tree."
-  (ede-arduino-root "~/Arduino/Fade/")
   (let* ((root (ede-arduino-root dir))
          (proj (and root (ede-directory-get-open-project root)))
          (prefs (ede-arduino-sync)))
@@ -121,21 +120,22 @@ ROOTPROJ is nil, sinc there is only one project for a 
directory tree."
           (message "Opening existing project")
           proj)
 
-      (when root
-        ;; Create a new project here.
-        (message "Creating new project")
-        (let* ((name (file-name-nondirectory (directory-file-name root)))
-               (pde (expand-file-name (concat name ".pde") root)))
-          (when (not (file-exists-p pde))
-            (setq pde (expand-file-name (concat name ".ino") root)))
-          (setq proj (ede-arduino-project
-                      name
-                      :name name
-                      :directory (file-name-as-directory dir)
-                      :file pde
-                      :targets nil)))
-        (ede-add-project-to-global-list proj)
-        ))))
+      ;; Create a new project here.
+      (if root
+          (progn
+            (message "Creating new project")
+            (let* ((name (file-name-nondirectory (directory-file-name root)))
+                   (pde (expand-file-name (concat name ".pde") root)))
+              (when (not (file-exists-p pde))
+                (setq pde (expand-file-name (concat name ".ino") root)))
+              (setq proj (ede-arduino-project
+                          name
+                          :name name
+                          :directory (file-name-as-directory dir)
+                          :file pde
+                          :targets nil)))
+            (ede-add-project-to-global-list proj))
+        (message "Project loading/creation failed")))))
 
 ;;;###autoload
 (add-to-list 'ede-project-class-files



reply via email to

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