Commits

Stephen Weeks  committed ec86d0e

allowed Omake.setenv to run in a project that is building

  • Participants
  • Parent commits 734b080

Comments (0)

Files changed (2)

+changes
+=======
+- allowed Omake.setenv to run in a project that is building
+
+--------------------------------------------------------------------------------
+
 features
 ========
 
 changes
 =======
 
-- Omake.errors-follow-point {t,nil} ---> 
+- Omake.errors-follow-point {t,nil} --->
   Omake.show-buffer-for-next-error-in {'dedicated-code-window, 'selected-window}
-- changed tmp directory 
+- changed tmp directory
   /tmp/omake-server/seanmcl/-home-seanmcl-ocaml/elisp --->
   /tmp/omake-server/seanmcl/home/seanmcl/ocaml/elisp
 - Added version numbers in mismatch message
 
 (defun Omake.Env.set (id)
   (let ((ids (Omake.id-to-string id)))
-    (if (Omake.Model.has id)
-        (message "Project %s is already running.  Kill it to set env variables." ids)
-      (let ((var (completing-read "Var: " Omake.Env.vars nil t))
-            (value (completing-read "Value: " '("true" "false") nil t)))
-        (Omake.Server.setenv id var value)))))
+    (if (or (not (Omake.Model.has id))
+            (y-or-n-p
+             (format
+              "Project %s is building.\nThis will only affect subsequent builds.  Proceed? "
+              ids)))
+        (let ((var (completing-read "Var: " Omake.Env.vars nil t))
+              (value (completing-read "Value: " '("true" "false") nil t)))
+          (Omake.Server.setenv id var value))
+      ;; The [(message nil)] is necessary to clear the minibuffer.
+      (message nil))))
 
 (defun Omake.Env.get (id)
   (let ((var (completing-read "Var: " Omake.Env.vars nil t)))