[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Reworking the kate command line
From:       Dominik Haumann <dhdev () gmx ! de>
Date:       2008-10-27 10:12:59
Message-ID: 200810271112.59381.dhdev () gmx ! de
[Download RAW message or body]

On Sunday 26 October 2008, Anders Lund wrote:
> On Søndag 26 oktober 2008, Erlend Hamberg wrote:
> > Common for all those commands is that if "a" or "all" is appended it
> > does its action for all open files
>
> That would be the command argument, to be interpreted by the command, and
> not a command itself.
>
> The commands, when I last touched the feature, would consist of the first
> word.
>
> To support command options (flags) I separated the flags from the command
> with a colon. The idea was that possible flags and their meaning could be
> displayed as a hint when the colon was typed, but I never got around to
> that. The only command that used it was the find related ones, which was
> removed by sebastian when he reworked the find system (personally I think
> that was a shame). They had flags for case sensitivity, starting at
> cursor position, regular expression etc.
>
> To avoid typing those colons (requiring two keys to be pressed), I was
> going to use aliases, so find:r could be aliased findr or fr or whatever
> you'd like.

I also think short terms are simply aliases -- just another way for the same 
thing. And doing this is even possible already now, that is we can add a 
Kate part command 'save-file' with aliases 'save', 'write', 'w' if you 
like. Alias means return all those strings in the function 
KTE::Command::cmds(). And if a command can save 'all', maybe 'wa' should 
expand to 'save-all'.

Having long-term commands is better readable btw, which is good for 
usability. What 'save-all' does is obvious (and users will find it because 
of the completion popup), 'wa' is (usually) not. If it is 'save all' it is 
shown in the popup only as 'save', so it is not immediately clear that this 
command supports an additional 'all' :) We should also stress to have a 
good help system, right now, that is bound to 'help <cmd>'.

> Implementing a set command, you could easily picture a flag for 'global',
> for example.

Interesting point. The semantic so far was to tell a command to do its work 
for all documents. We could also think the other way round: Execute a 
command step by step for all documents. Iirc, there is something like that 
in vim, called 'bufdo ...' (for all buffers do: ...)
...in the KTextEditor interfaces a command can be everything. For example, 
the word completion plugin can register a command called 'popup'. Executing 
this command for all buffers does not make sense.

I suggest we try to find the relevant extension interface. Then it's also 
clear what we are talking about :) Erlend, do you already have a list of 
items that we need to support?

Dominik
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic