Hi,

        I use jde-build in 'make' mode.  In my current project I often need
to make targets other than the default, so I don't always want to use the
value of my jde-make-args variable.  Therefore, I modified jde-make and
jde-build so that when invoked with a prefix argument they prompt for a
target to use in the make process.  The following diffs are on jde-make.el
and jde.el, and are against 2.2.7beta11.

        This might not be the best way to do this.  For one thing, there is
no "history list" of previous targets used, so I have to type in the target
I want every time.

(I'm not sure how I should include the diff files.  Sorry if this way is
awkward.)

Cheers,
Rory Molinari
[EMAIL PROTECTED]


jde-make.el.patch:
-------------------snip----------------------
--- jde-make.el Fri Apr 27 13:04:00 2001
+++ jde-make.el.new     Fri Apr 27 13:03:49 2001
@@ -56,34 +56,41 @@
   :type 'boolean
 )
 
-
-(defun jde-make-make-command (more-args)
-  "Constructs the java compile command as: jde-compiler + options + buffer
file name."
-  (concat jde-make-program " " jde-make-args
+(defun jde-make-make-command (more-args &optional ignore-jde-make-args)
+  "Constructs the java compile command as: jde-compiler + options + buffer
file name.
+   If ignore-jde-make-args in non-nil then we do not use the contents of
the jde-make-args variable.
+   Otherwise we do"
+  (concat jde-make-program
+         (if ignore-jde-make-args
+             ""
+           (concat " " jde-make-args))
          (if (not (string= more-args ""))
              (concat " " more-args))
          " "))
 
-
 ;;;###autoload
-(defun jde-make ()
-  "Run the JDE make program."
-  (interactive)
-  (if jde-read-make-args
-      (setq jde-interactive-make-args
+(defun jde-make (&optional ignore-jde-make-args)
+  "Run the JDE make program.  If prefix argument is non-nil then prompt for
make
+   command-line arguments, which will be used instead of the contents of
jde-make-args."
+  (interactive "P")
+  (let (jde-interactive-make-args)
+    (if (or jde-read-make-args
+           ignore-jde-make-args)
+       (setq jde-interactive-make-args
              (read-from-minibuffer 
               "Make args: "
               jde-interactive-make-args
               nil nil
               '(jde-interactive-make-arg-history . 1))))
 
-  (let ((make-command
-        (jde-make-make-command 
-         jde-interactive-make-args))
-       (default-directory 
-         (if (string= jde-make-working-directory "")
-             default-directory
-           (jde-normalize-path 'jde-make-working-directory))))
+    (let ((make-command
+          (jde-make-make-command 
+           jde-interactive-make-args
+           ignore-jde-make-args))
+         (default-directory 
+           (if (string= jde-make-working-directory "")
+               default-directory
+             (jde-normalize-path 'jde-make-working-directory))))
 
     ;; Force save-some-buffers to use the minibuffer
     ;; to query user about whether to save modified buffers.
@@ -101,7 +108,7 @@
          (save-some-buffers (not compilation-ask-about-save) nil)
          (setq last-nonmenu-event temp))
       (save-some-buffers (not compilation-ask-about-save) nil))
-    (compile-internal make-command "No more errors")))
+    (compile-internal make-command "No more errors"))))
 
 ; (defun jde-make (args)
 ;   "Run the JDE make program."
-----------------------snip-----------------------------


jde.el.patch
-----------------------snip-----------------------------
--- jde.el      Fri Apr 27 13:04:14 2001
+++ jde.el.new  Fri Apr 27 13:05:26 2001
@@ -574,7 +574,7 @@
                         jde-run-application-class))))))))
     
 ;;;###autoload
-(defun jde-build ()
+(defun jde-build (&optional ignore-jde-make-args)
   "Rebuild the entire project.
 This command has two operating modes: java and make. In java mode,
 this command uses javac's built-in make facility to rebuild a
@@ -589,9 +589,9 @@
 file specified by `jde-run-app-class', with the -depend option. This
 causes javac to recompile all missing or out-of-date files required
 to run the application's main class."
-  (interactive)
+  (interactive "P")
   (if jde-build-use-make
-      (jde-make)
+      (jde-make ignore-jde-make-args)
     (jde-java-build)))
 
 (defun jde-mode-internal ()
-------------------------snip-----------------------------

Reply via email to