Topic: Execute current buffer (1 of 24), Read 46 times
Conf: VEDIT Macro Language Support
From: Scott Lambert
Date: Tuesday, July 12, 2011 09:06 AM


In the macro language reference manual under the heading "Developing complex macros", it offers a way to execute the code in the current buffer, useful for debugging macros.

I have thought of a different way to do it:

reg_copy_block(119,0,end_of_file)
call(119)

Advantages:

uses no text registers, except 119, which is the keyboard subroutine macro register, where the macro will probably execute from anyways once done.

no switching of buffers

shorter

Anyways, just an idea.

Scott

 


Topic: Execute current buffer (2 of 24), Read 38 times
Conf: VEDIT Macro Language Support
From: Scott Lambert
Date: Tuesday, July 12, 2011 09:19 AM

On 7/12/2011 9:06:00 AM, Scott Lambert wrote:
>
>
>reg_copy_block(119,0,end_of_file)
>call(119)

Actually, that should be:

reg_copy_block(119,0,eob_pos)
call(119)

Don't know why I wrote end_of _file???

Scott

 


Topic: Re: Execute current buffer (3 of 24), Read 41 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Tuesday, July 12, 2011 09:59 AM

----- Original Message -----
> From: "Scott Lambert" ( scottmacros@... ) On 7/12/2011 9:06:00 AM, Scott Lambert wrote:
>
> reg_copy_block(119,0,eob_pos)
> call(119)

I could add that to the {MISC} menu. I didn't earlier because of the number of items in the menu, but since the days of 800x600 screens are long gone, I think that would be OK. I would also add a default hot-key.
Or if someone can suggest somewhere else to put it; I don't want to put it in the {TOOLS} or {USER} menus because then the hot-key wouldn't work.

Ted.

 


Topic: Re: Execute current buffer (4 of 24), Read 43 times
Conf: VEDIT Macro Language Support
From: Scott Lambert
Date: Tuesday, July 12, 2011 11:31 AM

On 7/12/2011 9:59:50 AM, Ted Green wrote:
>----- Original Message -----
>> From: "Scott Lambert" ( scottmacros@... ) On 7/12/2011 9:06:00 AM, Scott Lambert wrote:
>>
>> reg_copy_block(119,0,eob_pos)
>> call(119)
>
>I could add that to the {MISC} menu. I
>didn't earlier because of the number of
>items in the menu, but since the days of
>800x600 screens are long gone, I think
>that would be OK. I would also add a
>default hot-key.
>Or if someone can suggest somewhere else
>to put it; I don't want to put it in the
>{TOOLS} or {USER} menus because then the
>hot-key wouldn't work.
>
>Ted.

Hi Ted,

One idea is:

Rename Execute Macro to Execute Macro/Buffer, and then you have 2 options:

1. if user enters a negetive number, it execute current buffer

or

2. have a check box called Current Buffer and if it is checked, it copy current buffer to reg number in the input field and executes it.

Scott

 


Topic: Re: Execute current buffer (17 of 24), Read 27 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Friday, July 15, 2011 07:20 PM

On 7/12/2011 9:59:50 AM, Ted Green wrote:
>----- Original Message -----
>> From: "Scott Lambert" ( scottmacros@... ) On 7/12/2011 9:06:00 AM, Scott Lambert wrote:
>>
>> reg_copy_block(119,0,eob_pos)
>> call(119)
>
>I could add that to the {MISC} menu. I
>didn't earlier because of the number of
>items in the menu, but since the days of
>800x600 screens are long gone, I think
>that would be OK. I would also add a
>default hot-key.
>Or if someone can suggest somewhere else
>to put it; I don't want to put it in the
>{TOOLS} or {USER} menus because then the
>hot-key wouldn't work.
>

Ted.

I wonder whether it is too late for another suggestion ?
I would suggest the {Help} menu because it helps to debug macros. Also the {Help} menu is still small, while the {Misc} menu is large.

In any case, I sure was glad to see the new Help directory. Ted, now I would like to remind you of one of the Pauli comments:

"By the way, wouldn't it be logical to put the PDF files in help directory instead of home directory? "

I believe the reference is, webboard.vedit.con?read67407,41.html



Thanks,

-peter

 


Topic: Re: Execute current buffer (18 of 24), Read 27 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Friday, July 15, 2011 09:27 PM

----- Original Message -----
> From: "peter rejto" ( rejto@... ) On 7/12/2011 9:59:50 AM,
>
> I wonder whether it is too late for another suggestion ?
> I would suggest the {Help} menu because it helps to debug macros.
> Also the {Help} menu is still small, while the {Misc} menu is large.

Peter:

Items in the "Help" menu should be safe and not modify files. Since "Execute current buffer" certainly can modify a file, it should not be in the Help menu. Similarly the View and Goto menus should not modify files.

> "By the way, wouldn't it be logical to put the PDF files in help
> directory instead of home directory? "
>
> I believe the reference is, webboard.vedit.con?read67407,41.html

I will likely make that change, but I simply ran out of time this week. I'm currently thinking that 6.21.1 is done.
But I can soon start working on 6.22. :)

Ted.

 


Topic: Execute current buffer (7 of 24), Read 39 times
Conf: VEDIT Macro Language Support
From: Pauli Lindgren
Date: Wednesday, July 13, 2011 10:04 AM

On 7/12/2011 9:19:10 AM, Scott Lambert wrote:
>
>reg_copy_block(119,0,eob_pos)
>call(119)

That destroys the contents of T-Reg 119.
T-Reg 119 is reserved for for subroutine macros set up within a ".key" file.
It is used at least in html.key file (and I am using it on my vi.key and wiki.key files).
See "Text Register Usage" in the section "Block Operations" in the Help.

--
Pauli

 


Topic: Re: Execute current buffer (8 of 24), Read 40 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Wednesday, July 13, 2011 10:33 AM

----- Original Message -----
> From: "Pauli Lindgren" ( pauli0212@... ) On 7/12/2011 9:19:10
> AM, Scott Lambert wrote:
> >
> >reg_copy_block(119,0,eob_pos)
> >call(119)
>
> That destroys the contents of T-Reg 119.
> T-Reg 119 is reserved for for subroutine macros set up within a
> ".key" file.
> It is used at least in html.key file (and I am using it on my vi.key
> and wiki.key files).
> See "Text Register Usage" in the section "Block Operations" in the
> Help.

Pauli:

You are correct. I will change my internal code to use another register.
I also need to add more registers soon! (I will add named string variables later too.)

Ted.

 


Topic: Re: Execute current buffer (10 of 24), Read 44 times
Conf: VEDIT Macro Language Support
From: Scott Lambert
Date: Wednesday, July 13, 2011 10:44 AM

On 7/13/2011 10:33:20 AM, Ted Green wrote:
>----- Original Message -----
>> From: "Pauli Lindgren" ( pauli0212@... ) On 7/12/2011 9:19:10
>> AM, Scott Lambert wrote:
>> >
>> >reg_copy_block(119,0,eob_pos)
>> >call(119)
>>
>> That destroys the contents of T-Reg 119.
>> T-Reg 119 is reserved for for subroutine macros set up within a
>> ".key" file.
>> It is used at least in html.key file (and I am using it on my vi.key
>> and wiki.key files).
>> See "Text Register Usage" in the section "Block Operations" in the
>> Help.
>
>Pauli:
>
>You are correct. I will change
>my internal code to use
>another register.
>I also need to add more
>registers soon! (I will add
>named string variables later
>too.)
>
>Ted.

Interesting, I have always thought what the manual meant was that 119 was to be used when you wanted to do a call_file to a macro because it was too big for a keystoke macro.

Scott

 


Topic: Execute current buffer (5 of 24), Read 41 times
Conf: VEDIT Macro Language Support
From: Ian Binnie
Date: Tuesday, July 12, 2011 08:53 PM

On 7/12/2011 9:06:00 AM, Scott Lambert wrote:
>
>In the macro language
>reference manual under the
>heading "Developing complex
>macros", it offers a way to
>execute the code in the
>current buffer, useful for
>debugging macros.
>
>I have thought of a different
>way to do it:
>
>reg_copy_block(119,0,end_of_fi
>le)
>call(119)
>
>Advantages:
>
>uses no text registers, except
>119, which is the keyboard
>subroutine macro register,
>where the macro will probably
>execute from anyways once
>done.
>
>no switching of buffers
>
>shorter
>
>Anyways, just an idea.
>

Scott,

I don't remember what is in the manual, but I use a couple of keystroke macros for development. (I have been using these for years.)

I can see little use for executing the code in the current buffer. What I usually want to do is run a macro on text in a buffer.

I type Alt-F7 in the macro buffer to "register" it.
This only need to be done once, even if you modify the macro.

I can then select a text buffer and run the macro on it by typing Alt-F8. In fact I can have a number of test cases in different buffers and test the macro on each.

Alt-F7 [VISUAL EXIT] Reg_Set(103,'[VISUAL') Reg_Set(103,' EXIT] Call(',APPEND) Num_Str(bn(),104,LEFT|NOCR) Reg_Set(103,@104,APPEND) Reg_Set(103,"+BUFFER)",APPEND) Key_Add("Alt-F8",@103,NOCONFIRM)

Alt-F8 [VISUAL EXIT] Call(12+BUFFER)

 


Topic: Execute current buffer (6 of 24), Read 42 times
Conf: VEDIT Macro Language Support
From: Scott Lambert
Date: Wednesday, July 13, 2011 09:30 AM

On 7/12/2011 8:53:26 PM, Ian Binnie wrote:
>
>Alt-F7 [VISUAL EXIT]
>Reg_Set(103,'[VISUAL') Reg_Set(103,'
>EXIT] Call(',APPEND)
>Num_Str(bn(),104,LEFT|NOCR)
>Reg_Set(103,@104,APPEND)
>Reg_Set(103,"+BUFFER)",APPEND)
>Key_Add("Alt-F8",@103,NOCONFIRM)
>
>Alt-F8 [VISUAL EXIT]
>Call(12+BUFFER)
>

Hi Ian,

That is a clever solution. I have not had my coffee yet, so please pardon what is probably a stupid question, but I am wondering why you just don't have the following in your key file:

Alt-F7 [visual exit]#103=buf_num
Alt-F8 [visual exit] Call(#103+Buffer)

I will look at this again after I have had some coffee and wake up a bit more.

Scott

 


Topic: Execute current buffer (9 of 24), Read 40 times
Conf: VEDIT Macro Language Support
From: Scott Lambert
Date: Wednesday, July 13, 2011 10:34 AM

On 7/13/2011 9:30:47 AM, Scott Lambert wrote:
>On 7/12/2011 8:53:26 PM, Ian Binnie
>wrote:
>>
>>Alt-F7 [VISUAL EXIT]
>>Reg_Set(103,'[VISUAL') Reg_Set(103,'
>>EXIT] Call(',APPEND)
>>Num_Str(bn(),104,LEFT|NOCR)
>>Reg_Set(103,@104,APPEND)
>>Reg_Set(103,"+BUFFER)",APPEND)
>>Key_Add("Alt-F8",@103,NOCONFIRM)
>>
>>Alt-F8 [VISUAL EXIT]
>>Call(12+BUFFER)
>>
>
>Hi Ian,
>
>That is a clever solution. I have not
>had my coffee yet, so please pardon what
>is probably a stupid question, but I am
>wondering why you just don't have the
>following in your key file:
>
>Alt-F7 [visual exit]#103=buf_num
>Alt-F8 [visual exit] Call(#103+Buffer)
>
>I will look at this again after I have
>had some coffee and wake up a bit more.
>
>Scott
>
>

Hi Ian,

I figured it out. It was a stupid question. my way, you have to worry about #103 being overwritten. Your way the buffer number is hard coded. Yes that is a clever solution.

Scott

 


Topic: Execute current buffer (12 of 24), Read 36 times
Conf: VEDIT Macro Language Support
From: Pauli Lindgren
Date: Thursday, July 14, 2011 05:09 AM

On 7/13/2011 10:34:22 AM, Scott Lambert wrote:
>>That is a clever solution. I have not
>>had my coffee yet, so please pardon what
>>is probably a stupid question, but I am
>>wondering why you just don't have the
>>following in your key file:
>>
>>Alt-F7 [visual exit]#103=buf_num
>>Alt-F8 [visual exit] Call(#103+Buffer)
>>
>>I will look at this again after I have
>>had some coffee and wake up a bit more.
>>
>>Scott
>>
>
>Hi Ian,
>
>I figured it out. It was a stupid
>question. my way, you have to worry
>about #103 being overwritten. Your way
>the buffer number is hard coded. Yes
>that is a clever solution.

Well, you have to either worry about #103 being overwritten, or @103 being overwritten. What is the big difference?

Anyway, both of the implementations have the problem that you can not run them if the buffer containing the macro is the active buffer.

--
Pauli

 


Topic: Execute current buffer (11 of 24), Read 36 times
Conf: VEDIT Macro Language Support
From: Pauli Lindgren
Date: Thursday, July 14, 2011 04:57 AM

On 7/12/2011 8:53:26 PM, Ian Binnie wrote:
>
>Alt-F7 [VISUAL EXIT]
>Reg_Set(103,'[VISUAL') Reg_Set(103,'
>EXIT] Call(',APPEND)
>Num_Str(bn(),104,LEFT|NOCR)
>Reg_Set(103,@104,APPEND)
>Reg_Set(103,"+BUFFER)",APPEND)
>Key_Add("Alt-F8",@103,NOCONFIRM)
>
>Alt-F8 [VISUAL EXIT] Call(12+BUFFER)

Shouldn't that be:

Alt-F8 [VISUAL EXIT] Call(103)

--
Pauli

 


Topic: Execute current buffer (13 of 24), Read 39 times
Conf: VEDIT Macro Language Support
From: Scott Lambert
Date: Thursday, July 14, 2011 09:04 AM

On 7/14/2011 4:57:41 AM, Pauli Lindgren wrote:
>On 7/12/2011 8:53:26 PM, Ian Binnie
>wrote:
>>
>>Alt-F7 [VISUAL EXIT]
>>Reg_Set(103,'[VISUAL') Reg_Set(103,'
>>EXIT] Call(',APPEND)
>>Num_Str(bn(),104,LEFT|NOCR)
>>Reg_Set(103,@104,APPEND)
>>Reg_Set(103,"+BUFFER)",APPEND)
>>Key_Add("Alt-F8",@103,NOCONFIRM)
>>
>>Alt-F8 [VISUAL EXIT] Call(12+BUFFER)
>
>Shouldn't that be:
>
>Alt-F8 [VISUAL EXIT]
>Call(103)
>
>--
>Pauli
>

Hi Pauli,

You are making the same mistake I did. The alt-f7 macro is creating the alt-f8 keystroke macro. Note the numstr command converts the buffer number into text. That is why I said it hard codes it. Note the key_add command at the end. t-reg 103 contains a keystroke macro so no call statement is needed.

Scott

 


Topic: Re: Execute current buffer (14 of 24), Read 45 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Thursday, July 14, 2011 10:08 AM

----- Original Message -----
> Hi Pauli,
>
> You are making the same mistake I did. The alt-f7 macro is creating
> the alt-f8 keystroke macro. Note the numstr command converts the
> buffer number into text. That is why I said it hard codes it. Note
> the key_add command at the end. t-reg 103 contains a keystroke macro
> so no call statement is needed.

Correct. However I find such "self-modifying" code too complex to ever include with VEDIT. I still don't fully understand everything and even Pauli missed part of it. I can only imagine the tech support calls after a novice user tries to change it in even the tiniest way.

I currently have {MISC, Execute current buffer} implemented with this built-in code:

regpush(118,118)
rs(118,file_ext)
if (rcomp(118,".vdm")==0 || rsize(118)==0) {
rcb(118,0,eobpos)
call(118)
}
else {
di1(0,^`ERROR - Execute current buffer`,`Only buffers with no open file or a .vdm filename can be executed.`^,APP+CENTER,0,0)
}
regpop(118,118)

----
For one thing I want to execute the macro from a text registers; there are some *tiny* differences between
executing a macro from a text register versus a buffer.

I suspect {MISC, Execute current buffer} will mostly be used to test small sequences of commands, such as a complex search() or match() command.

Ted.

 


Topic: Re: Execute current buffer (20 of 24), Read 22 times
Conf: VEDIT Macro Language Support
From: Pauli Lindgren
Date: Sunday, July 17, 2011 08:24 AM

On 7/14/2011 10:08:32 AM, Ted Green wrote:
>
>I currently have {MISC,
>Execute current buffer}
>implemented with this built-in
>code:
>
>regpush(118,118)
>rs(118,file_ext)
>if (rcomp(118,".vdm")==0 || rsize(118)==0) {
> rcb(118,0,eobpos)
> call(118)
>}
>else {
> di1(0,^`ERROR - Execute current buffer`,`Only buffers
> with no open file or a .vdm filename can be
> executed.`^,APP+CENTER,0,0)
>}
>regpop(118,118)
>
>----
>
>I suspect {MISC, Execute
>current buffer} will mostly be
>used to test small sequences
>of commands, such as a complex
>search() or match() command.
>
>Ted.

The "Execute current buffer" function would be more useful if it had option to execute just the highlighted block.

Quite often, I have multiple fragments of code in a single file.
Or, I may insert a small piece of macro code in the text file I am currently editing.
Then I copy the block into T-Reg 100 and use Execute Macro.
However, this could be made easier.

So, I suggest that if a block is highlighted in current buffer, "Execute current buffer" would only copy the highlighted block for executing. In this case, it should not check the filename.

However, executing current buffer is often not sufficient, since most macros are used to do something on the text file being edited.
So, I suggest that in addition to adding "Execute current buffer", you would also improve the "Execute macro" menu function.
Add a tickbox "[] Buffer". When it is checked, the "Register number" field would refer to buffer instead of register.
In order to make this more useful, Vedit should remember the settings in this dialog at least during the current session.

--
Pauli

 


Topic: Re: Execute current buffer (21 of 24), Read 20 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Sunday, July 17, 2011 03:37 PM

On 7/17/2011 8:24:13 AM, Pauli Lindgren wrote:
>On 7/14/2011 10:08:32 AM, Ted Green
>wrote:
>>
>>I currently have {MISC,
>>Execute current buffer}
>>implemented with this built-in
>>code:
>>
>>regpush(118,118)
>>rs(118,file_ext)
>>if (rcomp(118,".vdm")==0 || rsize(118)==0) {
>> rcb(118,0,eobpos)
>> call(118)
>>}
>>else {
>> di1(0,^`ERROR - Execute current buffer`,`Only buffers
>> with no open file or a .vdm filename can be
>> executed.`^,APP+CENTER,0,0)
>>}
>>regpop(118,118)
>>
>>----
>>
>>I suspect {MISC, Execute
>>current buffer} will mostly be
>>used to test small sequences
>>of commands, such as a complex
>>search() or match() command.
>>
>>Ted.
>
>The "Execute current buffer" function
>would be more useful if it had option to
>execute just the highlighted block.
>
>Quite often, I have multiple fragments
>of code in a single file.
>Or, I may insert a small piece of macro
>code in the text file I am currently
>editing.
>Then I copy the block into T-Reg 100 and
>use Execute Macro.
>However, this could be made easier.
>
>So, I suggest that if a block is
>highlighted in current buffer, "Execute
>current buffer" would only copy the
>highlighted block for executing. In this
>case, it should not check the filename.
>
>However, executing current buffer is
>often not sufficient, since most macros
>are used to do something on the text
>file being edited.
>So, I suggest that in addition to adding
>"Execute current buffer", you would also
>improve the "Execute macro" menu
>function.
>Add a tickbox "[] Buffer". When it is
>checked, the "Register number" field
>would refer to buffer instead of
>register.
>In order to make this more useful, Vedit
>should remember the settings in this
>dialog at least during the current
>session.
>
>--
>Pauli
>
>

Dear All,

Thank you for sharing your various suggestions about Executing the Current Buffer macro with me. I find them fascinating ! At the same time, I must tell you that the specifics are above my head.

Do I understand it correctly ? There are many excellent suggestions on the table !

So, just a thought ? Run this macro by calling a .vdm file.
Then, Ian would have a chance to replace his macro on his {USER} menu by another one of his favorite macros. (I have a hunch that Ian has more favorite macros than place on his User menu.)

Personally, I would try to take up Pauli's suggestion
saying that,

>if a block is
>highlighted in current buffer, "Execute
>current buffer" would only copy the
>highlighted block for executing. In this
>case, it should not check the filename.

In fact, this is exactly the way I have been using it before. That is to say, by copying the highlighted block
to a new buffer and then invoking the {Misc, Execute current buffer} menu command.

For my own records: I am rereading the code

rcb(118,0,eobpos)

,which says that copy the block consisting of the entire file to T-reg 118. Well, there is nothing to be gained by restricting the block to the special case of the entire file. So, I would replace this segment of the code by,

Register_Copy_Block(118, Block_Begin, Block_End)

PS: Another uninformed question. All the other such cases I know of invoke the OpenCurs.vdm macro. Would it be possible to invoke this suggested Execute_Curent_Buffer.vdm via an enhanced OpenCurs.vdm command ?

Thanks, I have learned an awful lot.!


-peter

 


Topic: Re: Execute current buffer (24 of 24), Read 16 times
Conf: VEDIT Macro Language Support
From: Ian Binnie
Date: Sunday, July 17, 2011 08:05 PM

On 7/17/2011 3:37:44 PM, peter rejto wrote:
>Then, Ian would have a chance to replace
>his macro on his {USER} menu by another
>one of his favorite macros. (I have a
>hunch that Ian has more favorite macros
>than place on his User menu.)

I do have hundreds of macros.

I don't put most of them in Menus.
For the infrequently used macros I load them into a buffer and execute using my Alt+F7 Alt+F8 combo.

Most of my User Menu is devoted to loading specialised Tools Menus, where I group related macros for specific tasks.
I delete a number of the supplied macros, which I use infrequently, if ever.

 


Topic: Execute current buffer (15 of 24), Read 39 times
Conf: VEDIT Macro Language Support
From: Ian Binnie
Date: Thursday, July 14, 2011 08:24 PM

On 7/14/2011 9:04:44 AM, Scott Lambert wrote:
>On 7/14/2011 4:57:41 AM, Pauli Lindgren
>wrote:
>>On 7/12/2011 8:53:26 PM, Ian Binnie
>>wrote:
>>>
>>>Alt-F7 [VISUAL EXIT]
>>>Reg_Set(103,'[VISUAL') Reg_Set(103,'
>>>EXIT] Call(',APPEND)
>>>Num_Str(bn(),104,LEFT|NOCR)
>>>Reg_Set(103,@104,APPEND)
>>>Reg_Set(103,"+BUFFER)",APPEND)
>>>Key_Add("Alt-F8",@103,NOCONFIRM)
>>>
>>>Alt-F8 [VISUAL EXIT] Call(12+BUFFER)
>>
>>Shouldn't that be:
>>
>>Alt-F8 [VISUAL EXIT]
>>Call(103)
>>
>>--
>>Pauli
>>
>
>Hi Pauli,
>
>You are making the same mistake I did.
>The alt-f7 macro is creating the alt-f8
>keystroke macro. Note the numstr command
>converts the buffer number into text.
>That is why I said it hard codes it.
>Note the key_add command at the end.
>t-reg 103 contains a keystroke macro so
>no call statement is needed.
>
>Scott

I probably should have made it clear that the
Alt-F7 macro creates the Alt-F8 keystroke macro.

I included the Alt-F8 macro to show what is being called.

I admit I had to spend some time myself to work out how it worked. As I said I wrote this some years ago.

Initially I had hardcoded just the Alt-F8 keystroke macro, but this required the macro to be in a dedicated buffer.
I added the Alt-F7 to make this more flexible, and it also lets me test alternatives in different buffers.

This is an incredible timesaver for complex macro development.

I cannot agree with Ted that this is self modifying code.
The Alt-F7 macro creates/modifies a keyboard shortcut, not itself. If course this does not need to be a keystroke macro, it could be an ordinary macro.

I do, however, agree that it is probably too complex for most users. I was not suggesting it be included with vedit, but would be of use to those who write complex macros.

 


Topic: Execute current buffer (16 of 24), Read 45 times
Conf: VEDIT Macro Language Support
From: Scott Lambert
Date: Friday, July 15, 2011 10:44 AM

On 7/14/2011 8:24:41 PM, Ian Binnie wrote:
>
>I cannot agree with Ted that this is
>self modifying code.
>The Alt-F7 macro creates/modifies a
>keyboard shortcut, not itself. If course
>this does not need to be a keystroke
>macro, it could be an ordinary macro.

I agree with you Ian, your macro is created another separate macro "on the fly", and is not modifying itself.

Scott

 


Topic: Execute current buffer (19 of 24), Read 26 times
Conf: VEDIT Macro Language Support
From: Pauli Lindgren
Date: Sunday, July 17, 2011 08:05 AM

On 7/14/2011 8:24:41 PM, Ian Binnie wrote:
>
>I probably should have made it clear
>that the
>Alt-F7 macro creates the Alt-F8
>keystroke macro.
...
>
>I added the Alt-F7 to make this more
>flexible, and it also lets me test
>alternatives in different buffers.
>
>This is an incredible timesaver for
>complex macro development.
>
>I cannot agree with Ted that this is
>self modifying code.
>The Alt-F7 macro creates/modifies a
>keyboard shortcut, not itself. If course
>this does not need to be a keystroke
>macro, it could be an ordinary macro.

Indeed, your macro seems to be very useful.
I would probably implement it as an ordinary macro, call it from Tools menu and add keyboard shortcut to the menu item. This way it would not be necessary to remember the key. And the normal macro is easier to read than a single-line keyboard entry.

Note that when you are developing Vedit macros, you do not need those Compile, Link etc. options in Tools menu. You can have a different Tools menu for Vedit macro development. Again, a good reason to use projects! When you open a Vedit Macro project, you will have the correct Tools menu and keyboard configuration automatically in use.

--
Pauli

 


Topic: Execute current buffer (22 of 24), Read 23 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Sunday, July 17, 2011 05:46 PM

At 08:24 AM 7/17/2011, you wrote:

> The "Execute current buffer" function would be more useful if it had option to execute just the highlighted block.

I implemented that today in my 07/17/2011 release candidate. A good suggestion.

> So, I suggest that if a block is highlighted in current buffer, "Execute current buffer" would only copy the highlighted block for executing. In this case, it should not check the filename.

However, I still check the file extension to protect novice users.

> However, executing current buffer is often not sufficient, since most macros are used to do something on the text file being edited.
> So, I suggest that in addition to adding "Execute current buffer", you would also improve the "Execute macro" menu function.
> Add a tickbox "[] Buffer". When it is checked, the "Register number" field would refer to buffer instead of register.
> In order to make this more useful, Vedit should remember the settings in this dialog at least during the current session.

Another good suggestion for the future.

Ted.

 


Topic: Execute current buffer (23 of 24), Read 26 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Sunday, July 17, 2011 05:51 PM

On 7/17/2011 5:46:04 PM, Ted Green wrote:
>At 08:24 AM 7/17/2011, you
>wrote:
>
>> The "Execute current buffer" function would be more useful if it had option to execute just the highlighted block.
>
>I implemented that today in my
>07/17/2011 release candidate.
>A good suggestion.
>
>> So, I suggest that if a block is highlighted in current buffer, "Execute current buffer" would only copy the highlighted block for executing. In this case, it should not check the filename.
>
>However, I still check the
>file extension to protect
>novice users.
>
>> However, executing current buffer is often not sufficient, since most macros are used to do something on the text file being edited.
>> So, I suggest that in addition to adding "Execute current buffer", you would also improve the "Execute macro" menu function.
>> Add a tickbox "[] Buffer". When it is checked, the "Register number" field would refer to buffer instead of register.
>> In order to make this more useful, Vedit should remember the settings in this dialog at least during the current session.
>
>Another good suggestion for
>the future.
>
>Ted.

Great,

Looking forward to using the enhanced version.

-peter