Re: Proposal: make case significant in command names

2019-05-06 Thread Edward K. Ream
On Monday, May 6, 2019 at 8:46:52 AM UTC-5, Josef wrote:

Command names in Chinese? This starts reminding me of the misfeature 
> Microsoft introduced: the command names in Excel depend on the language. 
>

Leo's default command names will always be ascii.  Most are all lowercase.

The new feature simply allows @button and @command nodes to define commands 
using non-ascii characters. This is neither nonsense nor dangerous.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Proposal: make case significant in command names

2019-05-06 Thread Josef

Command names in Chinese? This starts reminding me of the misfeature 
Microsoft introduced: the command names in Excel depend on the language. An 
Excel macro needs to be written in the language of the system where the 
macro is supposed to run. I think this is nonsense. The definition of 
upper/lower case is dependent on the locale! Do you want to have commands 
that work on one locale and not in another? I think best would be no 
canonical translation, therefore also no automatic conversion to  lower 
case.

That said, please keep built-in Leo commands as they are: mostly lower case 
(easier to type), unless there is a compelling reason to depart from that 
(like for compatibility with VIM commands).

- Josef


On Monday, May 6, 2019 at 12:51:26 PM UTC+2, Edward K. Ream wrote:
>
>
>
> On Sat, May 4, 2019 at 4:04 PM > wrote:
>
>> For me as long as auto-complete / tab-complete are case insensitive it's 
>> fine to not lower-case all commands and to match the source case.
>>
>
> I'm not sure I what you suggest can be done.  Almost all present commands 
> are already lower-case-only.  It would not be too difficult to type 
> import-M to get import-MORE-files.
>
> The real question is what happens when commands consist, say, of nothing 
> but Chinese characters.  In that case, lower-casing letters makes no sense 
> anyway.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Proposal: make case significant in command names

2019-05-06 Thread Edward K. Ream
On Sat, May 4, 2019 at 4:04 PM  wrote:

> For me as long as auto-complete / tab-complete are case insensitive it's
> fine to not lower-case all commands and to match the source case.
>

I'm not sure I what you suggest can be done.  Almost all present commands
are already lower-case-only.  It would not be too difficult to type
import-M to get import-MORE-files.

The real question is what happens when commands consist, say, of nothing
but Chinese characters.  In that case, lower-casing letters makes no sense
anyway.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Proposal: make case significant in command names

2019-05-04 Thread maphew
For me as long as auto-complete / tab-complete are case insensitive it's 
fine to not lower-case all commands and to match the source case.

my 2c.

matt

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Proposal: make case significant in command names

2019-05-04 Thread Edward K. Ream
On Saturday, May 4, 2019 at 6:33:27 AM UTC-5, Edward K. Ream wrote:

The idea is easily stated: leave command names unchanged as far as 
> possible.  In particular, do not ever change the case of any letter.
>

Doing this was unexpectedly easy.  Only sc.cleanButtonText in 
mod_scripting.py changed in any significant way.

All my tests have passed, so I have merged the code into devel.  Please 
report any problems.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Proposal: make case significant in command names

2019-05-04 Thread Edward K. Ream
The idea is easily stated: leave command names unchanged as far as 
possible.  In particular, do not ever change the case of any letter.

It's probably unwise to allow blanks in command names.  They will continue 
to be converted to the '-' character.  No other "adjustments" to command 
names will be done, to the first approximation.

*Background*

This proposal is part of the infrastructure behind #1121 
: Allow Chinese 
characters in command names, which aims at fixing problems described in 
#1117 . Basing Leo's 
code on Python 3 should make this whole topic easier.  

This proposal affects menus and their translations, minibuffer completions, 
abbreviations and future enhancement proposals concerning commands. And 
perhaps more.

c.commandsDict is Leo's main commands-related dictionary.  Keys are command 
names; values are functions/methods implementing the command.  
`g.printObj(sorted(c.commandsDict.keys()))` will print all command names.

This dictionary contains entries starting with '@button-' and '@command-' 
for commands defined by @button/@command nodes, as well as the "plain" 
version of those command names, without the '@button-' or '@command-' 
prefixes. This redundancy allows the user to discover commands by tying, 
say:

@but

At present, only two commands contain uppercase letters: import-MORE-files 
and :gT.  The latter is a vim command, in case you are wondering.

*Lower-casing command names looks like an anti-pattern*

Up until a yesterday I thought that "regularizing" command names by 
converting them to lower case simplified matters.  I was influenced by a 
lecture by Randy Pausch in which he recommended that ignoring case would 
make like easier for language newbies.  But now I am thinking that it's 
best (as far as possible) to leave command names alone.

Imo, lower-casing command names makes sense, at best, for names composed 
*only* of ascii characters.  As shown in the first comment of #1121 
, there are many 
upper and lower case unicode "letters".  I'm not going to get involved in 
questions whether to convert those letters to another case!

*Summary*

I wrote this post to present the background to a wide audience.  There are 
many behind-the-scenes complications involved, but it would be pointless to 
discuss them here.

The work speculative and is being done in the #1121 branch.

This proposal might require changes to your myLeoSettings.leo files.  I 
suspect this will happen rarely, if ever, but testing will be required.

All comments welcome.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.