Re: My changes in MC source and some questions



On Sat, 1 Nov 2003, Vyacheslav Filyayev wrote:

Hello everybody.
Having downloading the source of MC mc-4.6.0-src.tar.gz I am trying to
tune this software for my needs. One of them is displaying directories
size (some of them, not all as implemented now in MC). I changed the
src/cmd.c in order to show directory size under cursor (if no one
directories selected by <Insert> key or by any other methods) and selected
only directories (if any selected) when pressing F3 (does anybody use F3
to go into directories?). For example see attachment my-mc.png. The changed
code in do_view_cmd function. Here new code

It's a good idea, but some users may not like it.  Remember that a bug is
a feature that cannot be turned off.  We have more than enough
functionality that cannot be configured interactively from the menu.

Patches are created by "diff -u oldfile newfile".

All changes are done in the first if(? . I take this code from
src/cmd.c function dirsizes_cmd.

Some other changes I've done in MC:
1) current time in right upper corner of MC (see attacment my-mc.png);
2) in view and edit Shift+F8 switches the code page "on the fly";
3) Shift + F1 and Shift + F2 launches quick directory change (directories
   and it's labels are stored in ~/.mc/folders (see my-mc.png in attachment):

I'm afraid all these changes will not be included in CVS if they are
submitted in such form.  Development should be done on the CVS version.

Unfortunately I can't insert separator to menu (two empty lines are
rather fiction than real separator).

That's the fundamental problem we have.  There are enough people who want
to add more and more code, sometimes duplicating existing functionality
and working around bugs in the underlying code.  In the same time, nobody
want to fix the basics first and to make them extensible and reusable.

I know the similar feature is implemented on Ctrl+\ key combination,
but due to my long working with Far I formed some habits.
4) Ctrl + L shows info (as in Far).

We need key remapping.  It's more important than making another hack that
changes one or two keys.

It seems to be all. I hope someone find this useful.

Now I'd like to ask some questions:
1) Can I make nested (or embedded - I don't know how is correct)
   user menu on F2?

It can be done by changing the contents of the listbox.

Be careful here.  The user menu uses an insane concept of hotkeys for list
items.  It needs to be rewritten, and the hotkeys should be handled on the
dialog level.  This would allow non-ASCII hotkeys, such as functional
keys.

2) Can I change the behavior of MC on Ctrl+C key in mcedit? I want
   to use Ctrl+C to copy selected text into clipboard, not to abort
   actions.

You can change any key if you implement key remapping.

-- 
Regards,
Pavel Roskin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]