jgh2@cisunx.UUCP (John G. Hardie) (01/24/88)
Hi folks, I have been playing around with Matt's DME recently (VERY NICE!) and have been trying to complete some menu items. I am having some difficulty getting the editor to prompt me for information needed to complete a command. For example, I am trying to set up a 'compile' command which will run my C compiler on the current file. At the moment the command is defined as follows: `saveold escimm `execute `lc -v -b -r '' (Yes, I know the quotes aren't closed). This command will save the file prompt me for a file name and then compile it. The only real problem is that I must type the file name and the last closing quote. This upsets my sense of aesthetics :-) Does anyone know of a way to prompt for just the file name, or (even better) to get at the current file name without need to prompt? Thanks for the help, J. Hardie -- John G. Hardie UUCP: cisunx!jgh2@ecn Dept. of Physics, -or- jgh2@cisunx.UUCP Univ. of Pittsburgh BIX: jhardie Pittsburgh, PA 15260 BITNET: JGH2@PITTVMS
dillon@CORY.BERKELEY.EDU (Matt Dillon) (01/24/88)
: `saveold escimm `execute `lc -v -b -r '' : :(Yes, I know the quotes aren't closed). This command will save the file :prompt me for a file name and then compile it. The only real problem is :that I must type the file name and the last closing quote. This upsets :my sense of aesthetics :-) Does anyone know of a way to prompt for :just the file name, or (even better) to get at the current file name without :need to prompt? : :Thanks for the help, :J. Hardie Now there's an idea... This will be possible in the next release through the use of remote-control, but currently you are stuck. The only way to do it now is to have only one argument to a command. Another approach you might try is to use the SCANF command to pick off a command sequence from the text (say, from a comment line in a certain format) and completely automate the sequence like this: /* * CHARLIE.C * * * COMPILE: lc -v -b -r charlie.c * */ map cs-c (top first find COMPILE: repeat 8 right scanf %[~]s execute $scanf) -go to line 1, column 1, search for the command specifier, move past specifier so text beyond cursor is the command string, scanf the string (%[~]s == take the entire line), execute the string. Poof. -Matt