issue-#99 Auto Upper Keywords
-
- Posts: 1700
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Russia
issue-#99 Auto Upper Keywords
http://redmine.blackboxframework.org/issues/99
I think, that it is important feature. It is because modern languages not using upper-case for command words. So for many programmers is difficult to use Shift key in the keyboard. I also think, this it is a kind of anatomical discrimination. There are people with short little fingers. It is very difficult for them to type code in Pascal family languages...
I think, that it is important feature. It is because modern languages not using upper-case for command words. So for many programmers is difficult to use Shift key in the keyboard. I also think, this it is a kind of anatomical discrimination. There are people with short little fingers. It is very difficult for them to type code in Pascal family languages...
Re: issue-#99 Auto Upper Keywords
KWord procedure can be a public procedure variable ,
other oberon/modula2 language provide a KWord procedure to config it.
then BB can satisfied all language need.
other oberon/modula2 language provide a KWord procedure to config it.
then BB can satisfied all language need.
-
- Posts: 1700
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Russia
Re: issue-#99 Auto Upper Keywords
I prepared test version with you code
http://blackboxframework.org/unstable/i ... a1.399.zip
Everybody, please try and comment.
http://blackboxframework.org/unstable/i ... a1.399.zip
Everybody, please try and comment.
-
- Posts: 1700
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Russia
Re: issue-#99 Auto Upper Keywords
The problem I found is that if you want to write some words inside the quoted string
"if module is ..."
you will get
"IF MODULE IS ..."
So this auto-upper should detect if you type inside quoted string.
Also if you preparing some documentation, you will not want auto-upper doing it's job.
So it should work only if textView started with MODULE word.
"if module is ..."
you will get
"IF MODULE IS ..."
So this auto-upper should detect if you type inside quoted string.
Also if you preparing some documentation, you will not want auto-upper doing it's job.
So it should work only if textView started with MODULE word.
- DGDanforth
- Posts: 1061
- Joined: Tue Sep 17, 2013 1:16 am
- Location: Palo Alto, California, USA
- Contact:
Re: issue-#99 Auto Upper Keywords
More than that it should allow such constructs asIvan Denisov wrote:The problem I found is that if you want to write some words inside the quoted string
"if module is ..."
you will get
"IF MODULE IS ..."
So this auto-upper should detect if you type inside quoted string.
Also if you preparing some documentation, you will not want auto-upper doing it's job.
So it should work only if textView started with MODULE word.
TYPE
module = ARRAY OF CHAR;
real = RECORD x: REAL END;
etc.
without capitalization.
So one needs either (1) a context sensitive capitalizer or (2) a one key "Undo last autocapitalized word".
Other than that I tried it and like it!
-Doug
- DGDanforth
- Posts: 1061
- Joined: Tue Sep 17, 2013 1:16 am
- Location: Palo Alto, California, USA
- Contact:
Re: issue-#99 Auto Upper Keywords
I recommend using the "esc" key to undo the last capitalization.
-Doug
-Doug
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#99 Auto Upper Keywords
Sorry, but to me this issue is a complete nonsense.
The problem it tries to solve is nonsense and the solution is nonsense.
If entering keywords needs to be sped up there are much better solutions
available then fiddling with the keywords and creating incompatibilities in
existing source code. Note: if you have a variable named "end" this would be
a key word now. Has this been considered?
Don't do this. There is no need for it.
There are much better and less destructive alternatives.
- Josef
The problem it tries to solve is nonsense and the solution is nonsense.
If entering keywords needs to be sped up there are much better solutions
available then fiddling with the keywords and creating incompatibilities in
existing source code. Note: if you have a variable named "end" this would be
a key word now. Has this been considered?
Don't do this. There is no need for it.
There are much better and less destructive alternatives.
- Josef
Re: issue-#99 Auto Upper Keywords
we are waiting you give us a better solution.Josef Templ wrote:Sorry, but to me this issue is a complete nonsense.
The problem it tries to solve is nonsense and the solution is nonsense.
If entering keywords needs to be sped up there are much better solutions
available then fiddling with the keywords and creating incompatibilities in
existing source code. Note: if you have a variable named "end" this would be
a key word now. Has this been considered?
Don't do this. There is no need for it.
There are much better and less destructive alternatives.
- Josef
Re: issue-#99 Auto Upper Keywords
As a generalisation I do not like this kind of automation.Ivan Denisov wrote:Everybody, please try and comment.
Two alternatives:
- Implement a (Menu) Command that scans the Document and does it - I think there is a "Pretty Printer" in CPC already (CpcBeautifier ?).
- Have a Wrapper that does it as you type.
These approaches are optional for the user, and non-invasive for the Framework.
(What I would like is the option to turn OFF the automatic insertion of Tabs.)
Robert
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#99 Auto Upper Keywords
The better alternative is mentioned in Tutorial 5.
I don't remember all the details but the idea was to type in a macro name optionally preceded by a parameter and
then hit a special key that expands the macro, e.g. for a MODULE macro named 'm' with the name of the module as a parameter you would type:
and this is expanded into something like:
The macros are defined in a separate file and can be adapted/extended by the user.
Such a feature has the following advantages:
- It is useful for all users
- it is adaptable to the user's needs
- the speedup is maximized because multiple keywords can be inserted and the parameter is entered only once.
- it does not introduce incompatibilities in the language
- it does not have any magic and sometimes unwanted behavior.
- Josef
At ETH we had such a feature built in to the text editor of the original Oberon system.One way to make the above command more useful would be to accept a caret as input, instead of a selection. Then you could write a name and hit a keyboard shortcut for the command. The command then reads backwards from the caret position, until it finds the beginning of the name, and then substitutes the appropriate phone number for the name. This would be a simple way to implement keyboard macros.
I don't remember all the details but the idea was to type in a macro name optionally preceded by a parameter and
then hit a special key that expands the macro, e.g. for a MODULE macro named 'm' with the name of the module as a parameter you would type:
Code: Select all
ModuleName m<MacroKey>
Code: Select all
MODULE ModuleName;
IMPORT <caret is placed here>;
END ModuleName.
Such a feature has the following advantages:
- It is useful for all users
- it is adaptable to the user's needs
- the speedup is maximized because multiple keywords can be inserted and the parameter is entered only once.
- it does not introduce incompatibilities in the language
- it does not have any magic and sometimes unwanted behavior.
- Josef