Kai Grossjohann wrote:
I suggest that C-u C-c C-v C-b invert the meaning of the jde-read-{make,ant}-args flag.
I often want to issue the same build command, but sometimes a different one. So I set jde-read-make-args to t, but now I have to press an extra key in 99% of the build invocations: C-c C-v C-b RET.
What do people think?
Hi Kai,
sounds quite useful! The diffs below provide an implementation of your suggestion. They are based on the files shipped with JDEE 2.3.5.
Martin
diff -u jde-ant.el.old jde-ant.el --- jde-ant.el.old 2004-12-17 05:29:38.000000000 +0100 +++ jde-ant.el 2004-12-21 17:51:56.000000000 +0100 @@ -377,9 +377,10 @@ buildfile))
;;;###autoload
-(defun jde-ant-build(buildfile target &optional interactive-args)
- "Build the current project using Ant. If interactive, we try to prompt the
- user for certain variables.."
+(defun jde-ant-build (buildfile target &optional interactive-args)
+ "Build the current project using Ant.
+If interactive, we try to prompt the user for certain variables.
+Any prefix argument inverts the meaning of `jde-ant-read-args'."
(interactive
(let* ((buildfile (jde-ant-interactive-get-buildfile))
(build-history (jde-ant-get-from-history buildfile))
@@ -407,10 +408,10 @@
nil
nil
'build-history)))))
- (target
+ (target
(jde-ant-escape (mapconcat 'identity targets " ")))
(interactive-args
- (if jde-ant-read-args
+ (if (if current-prefix-arg (not jde-ant-read-args) jde-ant-read-args)
(read-from-minibuffer
"Additional build args: "
(nth 0 jde-ant-interactive-args-history)
diff -u jde-make.el.old jde-make.el --- jde-make.el.old 2004-12-17 05:29:36.000000000 +0100 +++ jde-make.el 2004-12-21 17:54:34.000000000 +0100 @@ -70,7 +70,6 @@ :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
@@ -78,17 +77,17 @@
(concat " " more-args))
" "))
- ;;;###autoload -(defun jde-make () +(defun jde-make (&optional prefix) "Run the make program specified by `jde-make-program' with the command-line arguments specified by `jde-make-args'. If -`jde-read-make-args' is nonnil, this command also prompts you to enter +`jde-read-make-args' is non-nil, this command also prompts you to enter make arguments in the minibuffer and passes any arguments that you enter to the make program along with the arguments specified by -`jde-make-args'." - (interactive) - (if jde-read-make-args +`jde-make-args'. +Any prefix argument inverts the meaning of `jde-read-make-args'." + (interactive "P") + (if (if prefix (not jde-read-make-args) jde-read-make-args) (setq jde-interactive-make-args (read-from-minibuffer "Make args: "