Topic: Auto-save (1 of 19), Read 20 times
Conf: VEDIT Suggestions
From: Pauli Lindgren
Date: Monday, June 01, 2009 11:02 AM

I do not use Auto-save because I do not want my original file to be overwritten unintentionally.

On the other hand, Auto-save would be useful for safety.

Would it be possible to change the operation of auto-save so that it would not overwrite the original file?
The changed file will be a new file anyway and the old file will become .bak file.
So, why not just write the changes to a temp file (as it is done with large files) and then only change the filename when the user saves or closes the file?
And if Vedit crashes (because of power failure perhaps), then next time you open the file Vedit would prompt whether you want to use the autosave file or not.

--
Pauli

 


Topic: Re: Auto-save (2 of 19), Read 18 times
Conf: VEDIT Suggestions
From: Ted Green
Date: Monday, June 01, 2009 11:42 AM

At 11:03 AM 6/1/2009, you wrote:
>From: "Pauli Lindgren"
>
>I do not use Auto-save because I do not want my original file to be overwritten unintentionally.
>
>On the other hand, Auto-save would be useful for safety.
>
>Would it be possible to change the operation of auto-save so that it would not overwrite the original file?
>The changed file will be a new file anyway and the old file will become .bak file.
>So, why not just write the changes to a temp file (as it is done with large files) and then only change the filename when the user saves or closes the file?
>And if Vedit crashes (because of power failure perhaps), then next time you open the file Vedit would prompt whether you want to use the autosave file or not.

I have been thinking of such a scheme and will add this to the suggestions.

BTW - I just finished my latest work on our anti-spam product and am finally working on VEDIT again. I need to quickly fix a serial number problem and then plan a very minor update with your (and other) new macros.

Ted.

 


Topic: Do_Visual('\ID\') (3 of 19), Read 21 times
Conf: VEDIT Suggestions
From: Ian Binnie
Date: Monday, June 01, 2009 08:48 PM

On 6/1/2009 11:42:17 AM, Ted Green wrote:

>BTW - I just finished my
>latest work on our anti-spam
>product and am finally working
>on VEDIT again. I need to
>quickly fix a serial number
>problem and then plan a very
>minor update with your (and
>other) new macros.

Ted,

I use Do_Visual("\ID\") to Indent Block
This is not documented since Vedit 5.0, but still works

Could you clarify in any future release.

 


Topic: Re: Do_Visual('\ID\') (4 of 19), Read 22 times
Conf: VEDIT Suggestions
From: Ted Green
Date: Tuesday, June 02, 2009 09:56 AM

At 08:49 PM 6/1/2009, you wrote:

>I use Do_Visual("\ID\") to Indent Block
>This is not documented since Vedit 5.0, but still works

Ian:

Thank you for pointing that out. I will add it to the master doco files.
(Obviously there is an Undent too.)

Ted.

 


Topic: Re: Do_Visual('\ID\') (5 of 19), Read 21 times
Conf: VEDIT Suggestions
From: Ted Green
Date: Tuesday, June 02, 2009 05:47 PM

At 08:49 PM 6/1/2009, you wrote:
>From: Ian Binnie
>I use Do_Visual("\ID\") to Indent Block
>This is not documented since Vedit 5.0, but still works
>
>Could you clarify in any future release.

Ian:

I researched this today. Is there any reason not to use Do_Visual("\ME\EFI")?

I could document the 7 "obsolete" edit functions, but that seems confusing.

Ted.

 


Topic: Re: Do_Visual('\ID\') (6 of 19), Read 22 times
Conf: VEDIT Suggestions
From: Ian Binnie
Date: Tuesday, June 02, 2009 06:50 PM

On 6/2/2009 5:47:50 PM, Ted Green wrote:
>At 08:49 PM 6/1/2009, you
>wrote:
>>From: Ian Binnie
>>I use Do_Visual("\ID\") to Indent Block
>>This is not documented since Vedit 5.0, but still works
>>
>>Could you clarify in any future release.
>
>Ian:
>
>I researched this today. Is
>there any reason not to use
>Do_Visual("\ME\EFI")?

I use \ID\ because I wrote the macro in 1996.

I did not even know these were hidden in the Edit/Formatting menu. (I memorised F7/F8 20 years ago.)

 


Topic: Re: Do_Visual('\ID\') (7 of 19), Read 19 times
Conf: VEDIT Suggestions
From: Pauli Lindgren
Date: Wednesday, June 03, 2009 10:51 AM

On 6/2/2009 5:47:50 PM, Ted Green wrote:
>
>I could document the 7
>"obsolete" edit functions, but
>that seems confusing.

Is there some reason why they are "obsolete"?

Talking about indent, I don't like the way Indent and Undent work when there is no block highlighted. I think it should work the same way as when a single line has been highlighted, i.e. change the indent level of the current line.

--
Pauli

 


Topic: Re: Do_Visual('\ID\') (8 of 19), Read 18 times
Conf: VEDIT Suggestions
From: Christian Ziemski
Date: Wednesday, June 03, 2009 12:26 PM

On 03.06.2009 16:51 in vedit-suggest Pauli Lindgren wrote:
>
> Talking about indent, I don't like the way Indent and Undent work
> when there is no block highlighted.
> I think it should work the same way as when a single line has
> been highlighted, i.e. change the indent level of the current line.

When I tried to understand/test what you are referring to my first
impression was: "What's that a crazy behaviour of F7+F8".
(I can't remember when/whether I used it the last time.)

After some more testing my opinion is:
In principle the idea of the intelligent indent/undent is great.

But there seems to be a bug. Or at least I don't understand it ;-)

F7/F8 seem to count/remember the amount of their usage to know where
they are. Unfortunately they count the invalid usages as well.
For example when the cursor is within a word or at EOL.
An indent/undent then does nothing visible but counts its usage.
When the next valid indent/undent is done, all the invalid counts are
taken into acount as well and the new indention goes somewhere really
unexpected.

Christian

 


Topic: Re: Do_Visual('\ID\') (9 of 19), Read 18 times
Conf: VEDIT Suggestions
From: Ted Green
Date: Wednesday, June 03, 2009 02:42 PM

At 12:27 PM 6/3/2009, you wrote:
>From: "Christian Ziemski"
>But there seems to be a bug. Or at least I don't understand it ;-)
>
>F7/F8 seem to count/remember the amount of their usage to know where
>they are. Unfortunately they count the invalid usages as well.
>For example when the cursor is within a word or at EOL.
>An indent/undent then does nothing visible but counts its usage.
>When the next valid indent/undent is done, all the invalid counts are
>taken into acount as well and the new indention goes somewhere really
>unexpected.

Well, that is exactly how I designed it. It seemed to make sense back in the 80's when few (if any other) editors had any type of automatic indenting.

Perhaps it no longer makes sense and I should change it to only change the indent amount when you can actively see it changing.

Ted.

 


Topic: Re: Do_Visual('\ID\') (10 of 19), Read 23 times
Conf: VEDIT Suggestions
From: Christian Ziemski
Date: Wednesday, June 03, 2009 03:10 PM

On 03.06.2009 20:43 in vedit-suggest Ted Green wrote:
>
> At 12:27 PM 6/3/2009, you wrote:
>> From: "Christian Ziemski"
>> But there seems to be a bug. Or at least I don't understand it ;-)
>>
>> F7/F8 seem to count/remember the amount of their usage to know where
>> they are. Unfortunately they count the invalid usages as well.
>> For example when the cursor is within a word or at EOL.
>> An indent/undent then does nothing visible but counts its usage.
>> When the next valid indent/undent is done, all the invalid counts are
>> taken into acount as well and the new indention goes somewhere really
>> unexpected.
>
> Well, that is exactly how I designed it.
> It seemed to make sense back in the 80's when few (if any other)
> editors had any type of automatic indenting.
>
> Perhaps it no longer makes sense and I should change it to
> only change the indent amount when you can actively see it changing.

Aaaah, now I found my misinterpretation.
I always thought of (only) _active_ indenting here.

But the doco says:
"Indent (left margin) Increases the left margin by ...".
The left *MARGIN*!

The mainly confusing part (for me) was that it remembers the count even
if I navigated to a completely different part of the text.

Now when seeing it as margin and not only as automatic indention while
typing code it makes sense how it is designed.


It is always interesting if the picture of something in one's mind
doesn't match with the reality (or with the picture of the same in
someone other's mind). ;-)


Let's see what Pauli's saying.


Christian

 


Topic: Re: Do_Visual('\ID\') (11 of 19), Read 24 times
Conf: VEDIT Suggestions
From: Pauli Lindgren
Date: Thursday, June 04, 2009 07:22 AM

On 6/3/2009 3:10:45 PM, Christian Ziemski wrote:
>
>Now when seeing it as margin and not
>only as automatic indention while
>typing code it makes sense how it is
>designed.

Changing the margin works when you are entering new text. But when you move cursor to other part of the document, the margin is likely to be in wrong place.

In addition, the auto indent mode changes the margin, too.

This could be less confusing if the margin position was displayed somehow. At least in the ruler. But maybe there could be a vertical line (similar to the printed page boundaries, put perhaps as dotted line).

Indenting with margin may be OK for text documents, but it is not very useful for editing program source. Of course you could use different keyboard configurations for text projects and programming projects. I tried the following keyboard assignments that set block markers temporarily:
F8      [VISUAL EXIT]if (BB==-1){ BB(BOL_pos) BE(EOL_pos) Do_Visual("\ME\EFI") BB(-1)} else {Do_Visual("\ME\EFI")} 
F7 [VISUAL EXIT]if (BB==-1){ BB(BOL_pos) BE(EOL_pos) Do_Visual("\ME\EFU") BB(-1)} else {Do_Visual("\ME\EFU")}
It works, but you can see the block highlighting flash shortly, which does not look nice.

--
Pauli

 


Topic: Re: Do_Visual('\ID\') (12 of 19), Read 25 times
Conf: VEDIT Suggestions
From: Pauli Lindgren
Date: Thursday, June 04, 2009 07:47 AM

On 6/4/2009 7:22:49 AM, Pauli Lindgren wrote:
>I tried the following keyboard assignments that set
>block markers temporarily:

These work better:
F8      [VISUAL EXIT]if (BB==-1){ BOL Match("|W",ADVANCE) ML(Cur_Col) } Do_Visual("\ME\EFI")
F7 [VISUAL EXIT]if (BB==-1){ BOL Match("|W",ADVANCE) ML(Cur_Col) } Do_Visual("\ME\EFU")

--
Pauli

 


Topic: Re: Do_Visual('\ID\') (13 of 19), Read 22 times
Conf: VEDIT Suggestions
From: Christian Ziemski
Date: Thursday, June 04, 2009 10:15 AM

On 6/4/2009 7:47:39 AM, Pauli Lindgren wrote:
>
>>I tried the following keyboard assignments that set
>>block markers temporarily:
>
>These work better:
>F8 [VISUAL EXIT]if (BB==-1){ BOL
>Match("|W",ADVANCE) ML(Cur_Col) }
>Do_Visual("\ME\EFI")
>F7 [VISUAL EXIT]if (BB==-1){ BOL
>Match("|W",ADVANCE) ML(Cur_Col) }
>Do_Visual("\ME\EFU")

That may be confusing too if there is a persistent block set elsewhere because it then behaves differently without notice.

One could try to check whether the current cursor position is inside the block...


Christian

 


Topic: Re: Do_Visual('\ID\') (16 of 19), Read 20 times
Conf: VEDIT Suggestions
From: Pauli Lindgren
Date: Friday, June 05, 2009 08:55 AM

On 6/4/2009 10:15:27 AM, Christian Ziemski wrote:
> That may be confusing too if there is a
> persistent block set elsewhere because
> it then behaves differently without
> notice.
>
> One could try to check whether the
> current cursor position is inside the
> block...

Here is a version that checks if cursor is inside highlighted block:
F8      [VISUAL EXIT]if (CP>BE || CP<BB){ BOL Match("|W",ADVANCE) ML(Cur_Col) } Do_Visual("\ME\EFI")
F7 [VISUAL EXIT]if (CP>BE || CP<BB){ BOL Match("|W",ADVANCE) ML(Cur_Col) } Do_Visual("\ME\EFU")

--
Pauli

 


Topic: Re: Do_Visual('\ID\') (15 of 19), Read 20 times
Conf: VEDIT Suggestions
From: Ted Green
Date: Thursday, June 04, 2009 12:01 PM

At 07:23 AM 6/4/2009, you wrote:
>From: "Pauli Lindgren"
>Changing the margin works when you are entering new text. But when you move cursor to other part of the document, the margin is likely to be in wrong place.
>...
>Indenting with margin may be OK for text documents, but it is not very useful for editing program source.

Yes, this is what bothers me too.
Perhaps I should add an option to auto-change the "current" indentation value when the cursor is moved, changing it to the indentation of the new line. Then [Indent]/[Undent] will start from this value, instead of a meaningless value from another file position.

Ted.

 


Topic: Re: Do_Visual('\ID\') (17 of 19), Read 18 times
Conf: VEDIT Suggestions
From: Pauli Lindgren
Date: Friday, June 05, 2009 09:03 AM

On 6/4/2009 12:01:13 PM, Ted Green wrote:
>
>Yes, this is what bothers me too.
>Perhaps I should add an option
>to auto-change the "current"
>indentation value when the
>cursor is moved, changing it
>to the indentation of the new
>line. Then [Indent]/[Undent]
>will start from this value,
>instead of a meaningless value
>from another file position.

It is not necessary to change the indention level all the time when cursor is moved. Just set the margin when [Indent]/[Undent] is called. That is what my new keyboard macros do.

But it would be better if indent worked that way internally. There could be a configuration option (buffer dependent) for the behavior, so that it could be file type specific. Keyboard configuration is not file type specific.

--
Pauli

 


Topic: Re: Do_Visual('\ID\') (14 of 19), Read 19 times
Conf: VEDIT Suggestions
From: Ted Green
Date: Thursday, June 04, 2009 11:53 AM

At 03:11 PM 6/3/2009, you wrote:
>The mainly confusing part (for me) was that it remembers the count even
>if I navigated to a completely different part of the text.
>
>Now when seeing it as margin and not only as automatic indention while
>typing code it makes sense how it is designed.

Well, at least I do document things very precisely, even if my design doesn't make sense.

I will continue to read your comments about Indent/Undent, but won't make any changes right away. For one thing, since can perform [INDENT], if I change how [INDENT] works, I may need to change the relationship between and [INDENT].
Also, I prefer the automatic language-specific indenting found in most IDEs now.

Ted.

 


Topic: Re: Do_Visual('\ID\') (18 of 19), Read 18 times
Conf: VEDIT Suggestions
From: Pauli Lindgren
Date: Friday, June 05, 2009 11:45 AM

On 6/4/2009 11:53:57 AM, Ted Green wrote:
>
>I will continue to read your
>comments about Indent/Undent,
>but won't make any changes
>right away. For one thing,
>since can perform [INDENT],
>if I change how [INDENT]
>works, I may need to change
>the relationship between and
>[INDENT].

Looks like something has disappeared from your message??

>Also, I prefer the automatic
>language-specific indenting
>found in most IDEs now.

There is not much need for language-specific indenting if template editing is used.

Language specific smart indent is not easy to do.
I have made smart indenting for C, the macro c_indent.vdm:
http://koti.mbnet.fi/pkl/vedit/c_tools.htm#c_indent

I have developed it for many years, but it still does not work correctly in all cases, so I would not let it automatically indent the whole file.

You could have automatic smart indenting if you configure Return key and curly braces keys in your keyboard configuration to call c_indent.vdm. I have tried that, and it works quite well (after doing some small modifications to c_indent.vdm).

However, keyboard configuration is not file type specific. I thought template editing event macro could be used, but Return key does not call the template macro.

Another situation when smart indenting is needed is when you copy a block to another place. It would be nice if you could configure an event macro that would be called after block copy. This event macro would then call smart indent macro to indent the copied block correctly.

You could have a file type specific string value that contains the name of the smart indent macro. Both the event macro and keyboard configuration could use it to call file type specific indenting macro.

--
Pauli

 


Topic: Re: Do_Visual('\ID\') (19 of 19), Read 18 times
Conf: VEDIT Suggestions
From: Christian Ziemski
Date: Friday, June 05, 2009 12:54 PM

On 6/5/2009 11:45:31 AM, Pauli Lindgren wrote:
>On 6/4/2009 11:53:57 AM, Ted Green wrote:
>>
>>I will continue to read your
>>comments about Indent/Undent,
>>but won't make any changes
>>right away. For one thing,
>>since can perform [INDENT],
>>if I change how [INDENT]
>>works, I may need to change
>>the relationship between and
>>[INDENT].
>
>Looks like something has disappeared
>from your message??

When using the mail interface of Webboard that can happen when ">" and "<" are contained in the text.
Reading those messages via mail renders them still "normal", but the web interface sees (invalid) html tags there and ignores them.

Ted's original sentence was (manually made html save):

> I will continue to read your comments about
> Indent/Undent, but won't make any changes right away.
> For one thing, since <Tab> can perform [INDENT],
> if I change how [INDENT] works, I may need to change
> the relationship between <Tab> and [INDENT].

Christian