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
|
|