Re: Connect via ADB

2015-07-19 Thread Mike Smithson

On Fri, 17 Jul 2015 06:04:26 -0700, Jon M jon.tech...@gmail.com wrote:


Is there a stable implementation to connect to and Android device via
ADB from MC on a desktop?


I used libmtp and rolled my own cli program to talk to my android phone.
Frankly, I was surprised I couldn't find one out there already. It's not
that complicated and you don't need adb to do it. There are a few
peculiarities to be aware of, however.

If you're interested, I could email the tarball (35k). It might get you
started. It works for me.



--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


mc-4.8.14 hangs on select for 10 seconds at startup

2015-05-31 Thread Mike Smithson

I'm working over a Mandriva 2011 distro to get it working just the
way I like it. It came with mc-4.7.53, and it works. I decided to
compile 4.8.14 on the PC, pretty standard stuff:

GNU Midnight Commander 4.8.14
Built with GLib 2.16.6
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish
Data types: char: 8; int: 32; long: 32; void *: 32; size_t: 32; off_t: 64;

On startup it hangs for 10 seconds, apparently on a select() call.
I've edited this strace dump for brevity:

[code]
...
04:20:19 open(/dev/ptmx, O_RDWR)  = 6
04:20:19 statfs(/dev/pts, {f_type=DEVPTS_SUPER_MAGIC, f_bsize=4096,  
f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0},  
f_namelen=255, f_frsize=4096}) = 0
04:20:19 ioctl(6, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or  
TCGETS, {B38400 opost isig icanon echo ...}) = 0

04:20:19 ioctl(6, TIOCGPTN, [3])= 0
04:20:19 stat64(/dev/pts/3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136,  
3), ...}) = 0

04:20:19 getuid32() = 501
04:20:19 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 7
04:20:19 connect(7, {sa_family=AF_FILE, path=/var/run/nscd/socket}, 110)  
= -1 ENOENT (No such file or  
directory)   
04:20:19 close(7)   = 0

04:20:19 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 7
04:20:19 connect(7, {sa_family=AF_FILE, path=/var/run/nscd/socket}, 110)  
= -1 ENOENT (No such file or directory)

04:20:19 close(7)   = 0
04:20:19 open(/etc/group, O_RDONLY|O_CLOEXEC) = 7
04:20:19 fstat64(7, {st_mode=S_IFREG|0644, st_size=669, ...}) = 0
04:20:19 mmap2(NULL, 4096, PROT_READ|PROT_WRITE,  
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7189000

04:20:19 read(7, root:x:0:\nbin:x:1:\ndaemon:x:2:\ns..., 4096) = 669
04:20:19 close(7)   = 0
04:20:19 munmap(0xb7189000, 4096)   = 0
04:20:19 ioctl(6, TIOCSPTLCK, [0])  = 0
04:20:19 ioctl(6, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or  
TCGETS, {B38400 opost isig icanon echo ...}) = 0

04:20:19 ioctl(6, TIOCGPTN, [3])= 0
04:20:19 stat64(/dev/pts/3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136,  
3), ...}) = 0

04:20:19 open(/dev/pts/3, O_RDWR|O_LARGEFILE) = 7
04:20:19 fcntl64(7, F_SETFD, FD_CLOEXEC) = 0
04:20:19 pipe([8, 9])   = 0
04:20:19 clone(child_stack=0,  
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,  
child_tidptr=0xb74f7728) = 12097

04:20:19 write(6,  PROMPT_COMMAND=${PROMPT_COMMAND..., 75) = 75
04:20:19 rt_sigaction(SIGINT, {0x8096d10, [], 0}, NULL, 8) = 0
04:20:19 select(9, [6 8], NULL, NULL, {10, 0}) = 1 (in [6], left {9,  
998268})

04:20:19 read(6,  PROMPT_COMMAND=${PROMPT_COMMAND..., 128) = 76
04:20:19 select(9, [6 8], NULL, NULL, {9, 998268}) = 1 (in [6], left {9,  
971360})

04:20:19 read(6, [miven@cobra ~]$  PROMPT_COMMAND..., 128) = 55
04:20:19 select(9, [6 8], NULL, NULL, {9, 971360}) = 1 (in [6], left {9,  
971353})

04:20:19 read(6, MPT_, 128)   = 4
04:20:19 select(9, [6 8], NULL, NULL, {9, 971353}) = 1 (in [6], left {9,  
971347})

04:20:19 read(6, COM, 128)= 3
04:20:19 select(9, [6 8], NULL, NULL, {9, 971347}) = 1 (in [6], left {9,  
971341})

04:20:19 read(6, MAN, 128)= 3
04:20:19 select(9, [6 8], NULL, NULL, {9, 971341}) = 1 (in [6], left {9,  
971335})

04:20:19 read(6, D;, 128) = 2
04:20:19 select(9, [6 8], NULL, NULL, {9, 971335}) = 1 (in [6], left {9,  
971329})

04:20:19 read(6,  }', 128)= 3
04:20:19 select(9, [6 8], NULL, NULL, {9, 971329}) = 1 (in [6], left {9,  
971323})

04:20:19 read(6, pw, 128) = 2
04:20:19 select(9, [6 8], NULL, NULL, {9, 971323}) = 1 (in [6], left {9,  
971317})

04:20:19 read(6, d, 128)= 3
04:20:19 select(9, [6 8], NULL, NULL, {9, 971317}) = 1 (in [6], left {9,  
971311})

04:20:19 read(6, 9;, 128) = 2
04:20:19 select(9, [6 8], NULL, NULL, {9, 971311}) = 1 (in [6], left {9,  
971305})

04:20:19 read(6, kil, 128)= 3
04:20:19 select(9, [6 8], NULL, NULL, {9, 971305}) = 1 (in [6], left {9,  
971299})

04:20:19 read(6, l , 128) = 2
04:20:19 select(9, [6 8], NULL, NULL, {9, 971299}) = 1 (in [6], left {9,  
971293})

04:20:19 read(6, -S, 128) = 2
04:20:19 select(9, [6 8], NULL, NULL, {9, 971293}) = 1 (in [6], left {9,  
971287})

04:20:19 read(6, TO, 128) = 2
04:20:19 select(9, [6 8], NULL, NULL, {9, 971287}) = 1 (in [6], left {9,  
971281})

04:20:19 read(6, P , 128) = 2
04:20:19 select(9, [6 8], NULL, NULL, {9, 971281}) = 1 (in [6], left {9,  
971275})

04:20:19 read(6, $$, 128) = 2
04:20:19 select(9, [6 8], NULL, NULL, {9, 971275}) = 1 

Re: mc is over!?

2015-05-28 Thread Mike Smithson


Bah. Mc is not over. Things change, that's all.

I've been into mc since I don't know when. The first time I
used it. Mid/late 90s I'm guessing. I saw how it floundered
in the 4.6 series. I shrugged and kept tweaking and hacking my
version. A few years went by and I looked it up again, purely
out of curiosity.

I was delighted that someone had given it a full work over into
the 4.8 series. There were some persistent, puzzling, and very
annoying bugs that are now gone.

Excellent work, gentlemen. Thank you very much.

My list of personal patches went from ~30 down to ~5, where they
sit now, mostly minor interface tweaks. Mc works, and it works
very well. If development stagnates for a while, so be it. There
is actually very little to do. Mc is as close to perfect as
software gets. There will always be bugs and minor tweaks, and
that's what needs to be worked on, now and forever.

Yes, mc in its current incarnation is a model from the 1990s. I
like it that way. I'm not a big fan of C++. I also don't like
eye candy in a tool that is all about functionality and utility,
and I very much appreciate a file manager that can operate when
XWindows cannot, or the system is barely bootable.

It's the perfect size: big enough to be feature-rich and highly
usable, yet small enough that a single individual can
(theoretically) get his head around the entire code base. It's
also fun to hack.

I cannot guarantee 20hrs/week, but I would be very interested to
work through bug reports and small enhancement requests at my
own pace, and see what I can get done.

As a last thought for this email:

I suppose what we have here is a complete lack of consensus as to
the direction to take if we were to move into a 5.0 series.
My thinking is along the lines of complete modularity: a basic
interface design (that already exists) and everything else is
plugins. What if I want to use mc for inventory control? Make a
plugin to work with SQL instead of filesystem. Perhaps there
needs to be room for people to experiment with this sort of
thing. A 4.9beta branch that starts off as mess and arguments but
slowly gets sorted into something with vision.

That's my 2 cents worth.

Take care, and best wishes for those who are moving on to bigger
and better things. Thank you for your labors.



--
Peace and Cheer

___
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel


listbox hotkeys

2015-05-24 Thread Mike Smithson


I use Directory hotlist a lot. Constantly, really.

It's always bugged me that I can only access the
first 10 items with the keys 0-9. After sitting on
my TODO list for about 2 years, I finally had a
scratch at the issue.

Keys a-z are very often used by the menu of the
dialog the listbox is in, but keys A-Z are not.

So I did this:

[code]
--- lib/widget/listbox.c~   2015-03-20 11:06:04.0 -0700
+++ lib/widget/listbox.c2015-05-24 09:21:52.0 -0700
@@ -328,10 +328,15 @@ listbox_key (WListbox * l, int key)
 return MSG_NOT_HANDLED;

 /* focus on listbox item N by '0'..'9' keys */
-if (key = '0'  key = '9')
+if ((key = '0'  key = '9')||(key = 'A'  key = 'Z'))
 {
 int oldpos = l-pos;
-listbox_select_entry (l, key - '0');
+if (key = 'A'  key = 'Z') {
+listbox_select_entry (l, key - 55);
+} else {
+listbox_select_entry (l, key - '0');
+}
+

 /* need scroll to item? */
 if (abs (oldpos - l-pos)  WIDGET (l)-lines)
[/code]
Diffed from 4.8.14 tarball.

It seems to work fine. Now I can access the top 36
items instead of just the top 10. But, of course, it
affects all listboxes program-wide. It seems OK to me
so far.

My question this:

Does this seem like a useful feature (ie ticket-worthy)
or am I missing some far-reaching consequence I have not
uncovered yet?



--
Peace and Cheer
___
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel


Re: mc problem in recent versions of fedora/rhel

2015-04-05 Thread Mike Smithson

I'm assuming this happens when you ssh into other box and then
run mc? Not when you do a shell link in mc from your box?

What does your $TERM var say when you ssh into the other box,
before you run mc?

Also, what does it look like when you sit down at the other box
and run mc?



On Sat, 04 Apr 2015 18:48:22 -0700, solarflow99 solarflo...@gmail.com  
wrote:



Hi, first i'd just like to say thanks to all the developers and users
of midnight commander, its been probably the most indispensable tool
i've used for years.

Since installing Fedora 21, using xterm I noticed the line and block
characters don't display properly when sshing to another host.  It
works fine on localhost though.  I files a bug about it in redhat
bugzilla, but no one there bothered to look at it.  Has anyone else
noticed this?

https://bugzilla.redhat.com/show_bug.cgi?id=1190465
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc




--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Idea for new feature - discuss

2015-03-29 Thread Mike Smithson

I agree. What I did was check Never on Pause after run
and put reads in the menu/ext files where I knew I would
want the pause. Something like this:

+ t r  ! t t
@   Do something on the current file
CMD=%{Enter command}
$CMD ./%0f
read -e -n1 -p'Hit a key... '

Otherwise, if I'm going to type a command that I want to see
the output, like make, I hit CTRL-O right before I type to go
into terminal mode.



On Sun, 29 Mar 2015 08:12:12 -0700, Ben 2blkb...@nemontel.net wrote:


MC has three config options for what to do after executing files by
pressing return with the selection on them:

1 Close the shell every time, returning to MC
2 Leave the window open every time, press return to... return
3 Close the window only on dumb terminals (what?)

Number one leaves you unable to see the output of a command. So you type  
ls

and it's kind of useless. Or any other command or script that has output
you need to see.

Number two works for those things where you need to see output, but if  
you

don't, and there are things you routinely execute that do good things for
you that simply need to be done on command (like turning on house lights,
my particular thang) then it eventually becomes a bit of annoyance that  
it

doesn't just get done.

Now, I may be missing something buried in that dumb terminal option,  
but

it seems to me that this would be a nice solution:

You know how the F4 editor keeps track of what line you're on in which
file? That's *lovely*.

Well, how about modifying option two so that if you press return, it does
what it always did, that is, close the shell and return. But if you press
something else, perhaps ESC or whatever, from then on, when that command  
is

run, the shell closes when the run is done.

This implies you'd need an operation to remove the close status in case
the cat stepped on the selected key at the wrong time, but that doesn't
seem like a high hurdle, lots of room in the menus.

Another approach would be an option to pause only if the command has  
output
other than CR and LF, which doesn't require saving file names anywhere,  
but
I think that might be a little unsatisfactory as if a command might  
create
output or not, you might get a little uncertain if you saw what you  
thought

you saw.

Number three... I use the usual terminal types. Are they dumb? I have  
no

idea. I don't see anything in the OS X shell preferences to variably
designate the terminal as dumb or not based on what's executing, so I'm
guessing this can't do what I'm thinking. Is it useful to anyone? If not,
perhaps it could be the pause only if command produces output option
instead.

So, anyone? Feasibility problems? Good? Bad? Stupid? Selfish? Did I
completely miss or misunderstand a feature?

--Ben




--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Screen List (M-`)

2015-01-20 Thread Mike Smithson

I completely agree. It is useless, but could be *very* useful.
It has the look of something that once was useful, but kinda got
left behind in the transition from one thing to another. What was
it supposed to do?

I guess we need to figure out *exactly* what it should do.

I very often have many mc's running on various workspaces/screens/
whatever with many different directories/edits/views/etc.

Are we talking some kind of IPC between running mc's? I recall
there being an mc-server thingy in the 4.6 series. I never used it
nor do I know what it was for.

Any ideas?


--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: External editor with parameters not working?

2015-01-12 Thread Mike Smithson

On Sat, 06 Dec 2014 03:14:38 -0800, Stevko ste...@stevko.info wrote:


Hello.

I tried the following thing:
1) export EDITOR=emacs -nw
2) mc
3) (with internal editor disabled) go to some file and press F4

This opens emacs with the file, however it does not open it in
terminal (which should be done with -nw switch) but in new window in
X. (as if it somehow ignored -nw). If I run the following in shell:

$EDITOR file

it opens file as expected. Why does mc not do that?

I tried setting EDITOR to vim -R and again when run from mc, it does
not honor -R switch.

I have version 4.8.12 (which comes from Fedora 21 package).

Stevko

I am not subscribed to mailing list (so send replies also to me).
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Hello Stevko.

I recall being confounded by this very thing.

In my mc/ini file ($HOME/.config/mc/ini)
I have this:

[External editor or viewer parameters]
vi=%filename +%lineno
vim=%filename +%lineno
ed=+%lineno %filename
/bin/mo=%filename +%lineno
mo=+%lineno %filename
less=%filename +%lineno
joe=%filename +%lineno
more=%filename +%lineno

You can add the command line options here.
It seems mc doesn't *really* call $EDITOR.


--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mc on high resolution monitor with konsole

2015-01-12 Thread Mike Smithson
On Sat, 27 Dec 2014 16:11:34 -0800, Outback Dingo outbackdi...@gmail.com  
wrote:



ive got a samsung 4k, running kde in the proper mode, however in konsole
when i launch mc

it only fills 1/3 of the screen... how can i get it to be full screen?  
ive

attached an image


How many $COLUMNS in that window? 500 or something? I thought I was getting
out of hand with 236 on 1920x1080. :)

Check F9- Options - Layout. It looks like mc is not expecting a  
super-wide
screen and thinks it's in 80 column mode or something. Note that with  
really
wide screen like that your scrolling may be slow. You may want to use  
smaller

terminal window, or much bigger font.

Also, sending SIGWINCH to mc may help fix it automatically: try  
un-maximizing

the window, then re-maximizing it. mc may adjust properly. Then SAVE the
options so it remembers for next time.

--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: error or i don't understend some thing

2015-01-12 Thread Mike Smithson



Message: 2
Date: Wed, 24 Dec 2014 20:47:07 +0600
From: Igor) dubrovi...@gmail.com
To: mc-devel@gnome.org
Subject: error or i don't understend some thing
Message-ID:
canxhswze4u0ty_f-oxssmsozkuwhtyy2plvoa9tvihdrc-4...@mail.gmail.com
Content-Type: text/plain; charset=utf-8

hello, my name is Igor i have a question

how can i create file in mc? shift+f4 not working

now i using echo  flie.name in terminal mode(ctrl+o)

mc version 4.8.11

os ubuntu 14.04



shift+F4 is move file for me. If I want to edit a new file
I type vim file and hit enter. After that F4 will edit it if
it exists. touch file will also create new empty file (easier
to type than echo  file).

--
Peace and Cheer
___
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel


Re: How to know when mc is running in a terminal

2014-11-10 Thread Mike Smithson


Thanks frank. The answer was in front of my nose the whole time.

Environment variable MC_TMPDIR can be used to know that you're being
called from mc. For some reason MC_SID disappears but MC_TMPDIR does
not.

I needed something more specific than just knowing whether I'm
in pts or not. I want to know if it's mc's F4 EDIT command calling, or
at least being called from a terminal with mc running in it.

if [ -n $DISPLAY -a -n $MC_TMPDIR ]; then
# we're being called from mc in XWindow terminal
do_something_odd
fi


On Mon, 10 Nov 2014 02:06:26 -0800, frank y199mp1...@gmail.com wrote:




On 10/11/2014 01:25, Mike Smithson wrote:

how can a script know whether it is being
called from F4 in mc or just a terminal?


Try the shell command 'tty'. In the Linux console it will reply e.g.  
/dev/tty1. In a graphic terminal the reply will be /dev/pts/0.






--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


How to know when mc is running in a terminal

2014-11-09 Thread Mike Smithson


I have a specialized F4 script ($EDITOR) that I need
to know whether my editor is being called from mc or
not.

The MC_ env vars don't seem to exist when F4 is hit.

Question: how can a script know whether it is being
called from F4 in mc or just a terminal?

Thanks in advance.

--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Happy 20th Birthday!

2014-10-30 Thread Mike Smithson

On Thu, 30 Oct 2014 05:00:05 -0700, mc-devel-requ...@gnome.org wrote:


Today's Topics:

   1. Happy 20th Birthday! (Egmont Koblinger)

...

Sadly, as this post points out, mc almost died twice already ? and the
really sad aspect that casts a shadow to the current birthday is that I
personally feel it's dying again for the third time.

The initial passion from the new maintainers has faded.  They hardly have
time to work on the project.  Many patches or important bugreports go
unnoticed for long months or even years.  Some tickets have heated
technical discussions between some non-maintainers, yet the maintainers
remain silent.  Some contributors have already expressed that they've  
lost

motivation due to the lack of response from developers, and alas more
(including myself) are likely to follow.  (This whole issue has been  
raised
in [5].)  I really don't know how this problem could be solved... I'm  
just

hoping that we'll be able to figure out something.

Anyways, for now, let's celebrate 20 years of Midnight Commander :)


1994? Yes, there are few records of the history of this obscure code.

I've been using mc since the days when it sucked. The 4.6 years were
pretty good, it worked well already, and some major things were hacked
out. 4.8 series is awesome. I got away from it for a few years, came
back, and some clever people had worked it right over. Sure, they missed
a few things, but the code cleanup was great.

Thank you who ever you are.

I would help, I have a bunch of patches I apply to every new version.

I don't understand the ticket system. I set one up, someone made a bizarre
reply to it, and that's all that happened. I even showed the exact code
that accomplished it. Nobody said yes or no, there was no dialog whether
it sucked or was good. Someone just told me to make a ticket. Sounds like
Russians to me. :)

I would love to help. Tell me how.

ps I like having my personal hacks for something like mc. It is my file
manager. I don't use Nautilus or whatever. Maybe mc-4.8.13 is getting very
close to as perfect as software can get. It is very effective.

I think forums work better than mailing lists. I want to frame things up
and respond to critique. And make it easy to do so. Developers *are* users.

mc is not Twinkies(tm) in crisp plastic wrap. It's more like something you
cook at home.

There ya go. Midnight Commander Cookbook.

A million magic hacks.




--
Peace and Cheer
___
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel


Re: move/copy file by extension preserving directories hierarchy.

2014-10-22 Thread Mike Smithson
On Wed, 22 Oct 2014 15:25:27 -0700, tizio incognito jeeg...@yahoo.it  
wrote:


I don't know if it has benn already asked, but it could be a nice  
feature the possibility to move/copy files recursively by extension  
preserving the directory structure. I'll better explain by an example:



src dir
|
+- sub dir 1

|  +- file1.png

|  +- file1.jpeg

|

+- sub dir 2

   +- file2.png

   +- file2.jpeg


command: move_by_ext *.pngsrc_dir dest_dir

dest dir
|
+- sub dir 1

|  +- file1.png

|

+- sub dir 2

   +- file2.png


Thanks in advance
Daniele Giglio


I say this is a job for the F2 menu. That's where you can get
all picky and funny with stuff like this. I have never once
required this nitpicking of directory contents in 20 years of
using mc, but I have many other bizarre scripts that do oddball
things like this that I personally require all the time, so
I'll give you a hint:

tar cvf test.tar $(find /path/to/dir -name '*.png')

then move the test.tar where you want, and un-tar it.


--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mc 4.8.13 compile error

2014-10-06 Thread Mike Smithson
On Thu, 18 Sep 2014 06:18:15 -0700, John Kennerson nob...@isis.cpunk.us  
wrote:



mc 4.8.13 compile error


slackware 13.0 with:
 glib-1.2.10-i486-3
 glib2-2.18.4-i486-1
 glibc-2.9-i486-6_slack13.0

Trying to compile mc 4.8.13 results in the following error:
(mc 4.8.12 compiled fine on the same system)

Making all in widget
make[3]: Entering directory `/home/john/tmp/mc-4.8.13/lib/widget'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/john/tmp/mc-4.8.13/lib/widget'
Making all in .
make[3]: Entering directory `/home/john/tmp/mc-4.8.13/lib'
  CC   glibcompat.lo
glibcompat.c: In function 'g_error_new_valist':
glibcompat.c:156: error: 'ap' undeclared (first use in this function)
glibcompat.c:156: error: (Each undeclared identifier is reported only  
once

glibcompat.c:156: error: for each function it appears in.)
glibcompat.c:156: error: 'va_start' used in function with fixed args
glibcompat.c:151: warning: unused parameter 'args' [-Wunused-parameter]
make[3]: *** [glibcompat.lo] Error 1
make[3]: Leaving directory `/home/john/tmp/mc-4.8.13/lib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/john/tmp/mc-4.8.13/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/john/tmp/mc-4.8.13'
make: *** [all] Error 2

Any ideas as to the problem?
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc



It looks like you are still using glib-1.2. I think it should be glib-2.0.



--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Trailing type field (instead of leading)

2014-08-26 Thread Mike Smithson

On Fri, 22 Aug 2014 06:27:55 -0700, w3m...@hushmail.com wrote:

I want type fields to trail (instead of lead) each file or folder name.  
Example: folder/ instead of /folder, link@ instead of @link like 'ls -F'  
does. How can I change the default behavior ?


In F9-listing mode select 'User defined' and type

name type | size | perm

into the input field.



--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Select/Unselect Files cannot mark directories only

2014-08-26 Thread Mike Smithson


I can no longer select *only* directories in the Select File dialog.
I used to be able to do it by typing / before the pattern. Now that
does nothing.

In cmd.c:select_unselect_cmd():260 we have the line:

[code]
   if (S_ISDIR (current_panel-dir.list[i].st.st_mode)  files_only  
!= 0)

continue;
[/code]

But there is no way, as far as I can see, to select dirs only.

In mc-4.6.2 we had this:

[code]
/* Check if they specified a directory */
if (*reg_exp_t == PATH_SEP) {
dirflag = 1;
reg_exp_t++;
}
[/code]

Any notion why this got dropped?


BTW the hack seems quite trivial, something like this:
[code]
--- src/filemanager/cmd.c~  2014-04-01 03:54:01.0 -0700
+++ src/filemanager/cmd.c   2014-08-26 10:47:50.319707218 -0700
@@ -215,9 +215,10 @@ select_unselect_cmd (const char *title,
 int case_sens = (select_flags  SELECT_MATCH_CASE) != 0;
 int shell_patterns = (select_flags  SELECT_SHELL_PATTERNS) != 0;

-char *reg_exp;
+char *reg_exp, *p;
 mc_search_t *search;
 int i;
+int dirflag = 0;

 quick_widget_t quick_widgets[] = {
 /* *INDENT-OFF* */
@@ -246,6 +247,10 @@ select_unselect_cmd (const char *title,
 {
 g_free (reg_exp);
 return;
+} else if ( *reg_exp == PATH_SEP ) {
+   dirflag = 1;
+   p = reg_exp;
+   memmove ( p, p+1, strlen (p) );
 }

 search = mc_search_new (reg_exp, -1, NULL);
@@ -257,8 +262,11 @@ select_unselect_cmd (const char *title,
 {
 if (DIR_IS_DOTDOT (current_panel-dir.list[i].fname))
 continue;
-if (S_ISDIR (current_panel-dir.list[i].st.st_mode)  files_only  
!= 0)

-continue;
+if (S_ISDIR (current_panel-dir.list[i].st.st_mode) ) {
+   if ( files_only != 0  ! dirflag )
+   continue;
+   } else if ( dirflag )
+   continue;

 if (mc_search_run (search, current_panel-dir.list[i].fname,
0, current_panel-dir.list[i].fnamelen, NULL))
[/code]



--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: colored bash prompt

2014-06-18 Thread Mike Smithson
On Tue, 17 Jun 2014 23:48:55 -0700, Eugene M. Zheganin e...@norma.perm.ru  
wrote:



Is it possible to have a colored prompt in mc when both panels are on ?
It's colored in a subshell when panels are off (after a couple of
Enters) but not when panels are on.


I tried that once. I wanted my root login prompt to be bright red or  
something.


What I recall is the extra characters used to color the prompt messes up  
the
line length calculations used by readline or whatever command line library  
you

use.

It's fine and all pretty looking if your command is short and doesn't go
anywhere near the right edge of the screen, but if it goes onto a second  
line

(like a fancy for... loop) everything gets messed up and becomes mostly
unusable.

So I stopped doing it and stuck with non-colored prompts.


--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: file size format displayed in mc

2014-04-10 Thread Mike Smithson
On Wed, 09 Apr 2014 14:43:24 -0700, Konrad Vrba konrad.v...@gmail.com  
wrote:



Hello,

I am wondering whether it is possible to display the file size in  
midnight
commander (in the size column) with a thousand separator (i.e.  
1,234,567).


This works for ls
BLOCK_SIZE='1 ls -lAF

and I find it very convenient and human friendly.

is there any way to have the same in mc?

regards,
Konrad


printf has the ' flag that supposedly does this, but it doesn't
seem well supported. It's locale dependent and doesn't work on
my system.

BLOCK_SIZE='1 ls -lAF also doesn't work on my system.

Also, it would take up extra columns in the panel. Maybe with big
screen it would be OK, but I'm only 1024x768. The columns are
precious. I don't even use vertical separator bars between the fields
in my panels.

The file size field seems to be limited to 7 characters, after that it
goes 123456K or 123456M.

--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Compile from git clone fails.

2014-01-09 Thread Mike Smithson
On Thu, 26 Dec 2013 22:38:24 -0800, Andrew Borodin aboro...@vmail.ru  
wrote:



Could you please show config.log and full make log:
make V=1  make.log 21  tar cjf mc-log.tar.bz2 config.log make.log


Certainly. See attached.


--
Peace and Cheer

mc-log.tar.bz2
Description: Unix tar archive
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Incorrect behavior in Hotlist - Insert

2013-12-31 Thread Mike Smithson

I use directory hotlist a lot. Often I have project that
I work heavily on for a few days or a week, then it's
finished. I like my new hotlist entries to appear at (or near)
the top of the list so I can just go C-\ ENTER and I'm there.
Then when project is done, I remove the entry, or move it
down the list. I think this is a super-useful feature of mc
and one of the things that makes it so effective. But...

In the panel, if I do:

C-\ (for hotlist)
...scroll down a few entries...
e (new entry)
M-I (Insert)

the new entry gets inserted before the cursor, but the
cursor jumps to the entry *before* the new one; that is,
the cursor jumps up two places. This seems disorienting
and incorrect to me.

I've traced it to

[code]
--- lib/widget/listbox.c~   2013-11-29 10:27:07.0 -0800
+++ lib/widget/listbox.c2013-12-02 09:11:26.191188317 -0800
@@ -336,8 +336,9 @@ listbox_append_item (WListbox * l, WLEnt

 case LISTBOX_APPEND_BEFORE:
 l-list = g_list_insert_before (l-list, g_list_nth (l-list,  
l-pos), e);

-if (l-pos  0)
-l-pos--;
+/*
+ * Why do we decrement here?
+ * if (l-pos  0)
+ *   l-pos--;
+ */
 break;

 case LISTBOX_APPEND_AFTER:
[/code]

Not decrementing (as I have done here by commenting out the lines)
leaves the cursor on the new entry. This seems *more* correct than
jumping up two entries. Incrementing l-pos would leave the cursor
on the entry it was on before the insertion.

I know this is trivial issue, because LISTBOX_APPEND_BEFORE is
rarely used in the code, but still, I believe the decrement is
incorrect, and the only reason nobody notices this bug is because
the cursor position is often set deliberately right after the
insert.

Any comments? Is this ticket worthy?

--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Compile from git clone fails (SOLVED).

2013-12-27 Thread Mike Smithson

Problem solved:

I just now upgraded m4, autoconf, and automake to the freshest from
http://ftp.gnu.org/gnu, and then it couldn't even get through
autogen.sh.

I upgraded libtool, and now everything works.

Strange thing too, because I remembered upgrading these within the
last year, but when I looked at the versions, I must have done a
deliberate *minimal* upgrade, because even though they were compiled
on Jan 29 2013, the versions were ancient (2006).

Heh, you can see what a dinosaur I am. :)

Anyway, now I can keep going on my git tutorial and stuff.

Thank you very much.

--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Compile from git clone fails.

2013-12-26 Thread Mike Smithson

Normally I compile from tarball.

git clone git://github.com/MidnightCommander/mc.git

I used standard process: autogen.sh, ./configure, make,
and everything goes fine until the very end.

I get this:

gcc -std=gnu99 -Wcomment -Wdeclaration-after-statement -Wfloat-equal  
-Wformat -Wformat-security -Wimplicit -Wmissing-braces  
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs  
-Wno-long-long -Wno-unreachable-code -Wparentheses -Wreturn-type  
-Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wuninitialized  
-Wunused-but-set-variable -Wunused-function -Wunused-label  
-Wunused-parameter -Wunused-value -Wunused-variable -Wwrite-strings -g -O2  
-o mc main.o  ./.libs/libinternal.al -L/usr/lib ../lib/.libs/libmc.al  
-lslang -lgpm /usr/lib/libgmodule-2.0.so -ldl /usr/lib/libglib-2.0.so

./.libs/libinternal.al(mcviewer.lo)(.text+0x2c1): In function `mcview_new':
/home/miven/src/Managers/mc/git/mc-4.8.11-131225b/src/viewer/mcviewer.c:214:  
undefined reference to `mcview_init'
./.libs/libinternal.al(mcviewer.lo)(.text+0x304):/home/miven/src/Managers/mc/git/mc-4.8.11-131225b/src/viewer/mcviewer.c:217:  
undefined reference to `mcview_toggle_hex_mode'
./.libs/libinternal.al(mcviewer.lo)(.text+0x324):/home/miven/src/Managers/mc/git/mc-4.8.11-131225b/src/viewer/mcviewer.c:219:  
undefined reference to `mcview_toggle_nroff_mode'
./.libs/libinternal.al(mcviewer.lo)(.text+0x344):/home/miven/src/Managers/mc/git/mc-4.8.11-131225b/src/viewer/mcviewer.c:221:  
undefined reference to `mcview_toggle_wrap_mode'
./.libs/libinternal.al(mcviewer.lo)(.text+0x364):/home/miven/src/Managers/mc/git/mc-4.8.11-131225b/src/viewer/mcviewer.c:223:  
undefined reference to `mcview_toggle_magic_mode'


... etc etc etc ...

I've never seen this before and I haven't been able to track it down yet.

Any ideas?

--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


panel scrolling

2013-12-23 Thread Mike Smithson

I just post this here because it's a personal itch of mine.

I have many programs that are essentially list managers.

mc is one. xmms another. xmms I've abandoned for my own music player,
but mc I keep using. It's so *effective* at getting shit done.

That said, I have peeve that's been going on since 1983:

One thing I despise is a list manager that, when you hit the down arrow,
the cursor goes to the bottom of the window and *then* starts scrolling.

This drives me batty. I hate it. I cannot see what I'm going for. It's
like driving forward with a tarp over your windshield. mc does that silly
jump scroll thing which is better, but still sucks.

I have patch, I call panel_scroll_center, where the cursor *tends* to
stay in the center of the panel. If you scroll down, when the cursor hits
the middle of the panel, the panel starts scrolling. Only when the list
runs out does the cursor scroll to the bottom. Vice versa for up-scroll.

It's not a fancy patch, it's just a math issue in panels.c. This is the
first thing I always patch new versions with. Always.

Try it, you'll like it. It also demonstrates how easy it is to add new
option to mc these days.

[code]
--- src/setup.h~2013-11-29 10:27:07.0 -0800
+++ src/setup.h 2013-12-02 09:42:32.720215654 -0800
@@ -48,6 +48,7 @@ typedef struct
 gboolean navigate_with_arrows;  /* If TRUE: lr arrows are used  
to chdir if the input line is empty */
 gboolean scroll_pages;  /* If TRUE, panel is scrolled by half the  
display when the cursor reaches
the end or the beginning of the panel  
*/
+gboolean scroll_center;/* If TRUE, scroll when the cursor hits  
the middle of the panel */

 gboolean mouse_move_pages;  /* Scroll page/item using mouse wheel */
 gboolean filetype_mode; /* If TRUE then add per file type  
hilighting */
 gboolean permission_mode;   /* If TRUE, we use permission hilighting  
*/

--- src/setup.c~2013-11-29 10:27:07.0 -0800
+++ src/setup.c 2013-12-02 09:44:08.287525675 -0800
@@ -142,6 +142,7 @@ panels_options_t panels_options = {
 .auto_save_setup = FALSE,
 .navigate_with_arrows = FALSE,
 .scroll_pages = TRUE,
+.scroll_center = TRUE,
 .mouse_move_pages = TRUE,
 .filetype_mode = TRUE,
 .permission_mode = FALSE,
@@ -399,6 +400,7 @@ static const struct
 { auto_save_setup_panels, panels_options.auto_save_setup },
 { navigate_with_arrows, panels_options.navigate_with_arrows },
 { panel_scroll_pages, panels_options.scroll_pages },
+{ panel_scroll_center, panels_options.scroll_center },
 { mouse_move_pages,  panels_options.mouse_move_pages },
 { filetype_mode, panels_options.filetype_mode },
 { permission_mode, panels_options.permission_mode },
--- src/filemanager/boxes.c~2013-11-29 10:27:07.0 -0800
+++ src/filemanager/boxes.c 2013-12-02 09:45:22.143627364 -0800
@@ -554,6 +554,7 @@ panel_options_box (void)
 QUICK_CHECKBOX (N_(Lynx-like motion),  
panels_options.navigate_with_arrows,

 NULL),
 QUICK_CHECKBOX (N_(Page scrolling),  
panels_options.scroll_pages, NULL),
+QUICK_CHECKBOX (N_(Center scrolling),  
panels_options.scroll_center, NULL),
 QUICK_CHECKBOX (N_(Mouse page scrolling),  
panels_options.mouse_move_pages,

 NULL),
 QUICK_STOP_GROUPBOX,
--- src/filemanager/panel.c~2013-11-29 10:27:07.0 -0800
+++ src/filemanager/panel.c 2013-12-02 09:47:46.553407483 -0800
@@ -2018,6 +2018,12 @@ move_down (WPanel * panel)
 if (panel-top_file  panel-dir.len - ITEMS (panel))
 panel-top_file = panel-dir.len - ITEMS (panel);
 paint_dir (panel);
+} else if ( panels_options.scroll_center 
+   (panel-selected - panel-top_file)  (ITEMS (panel)/2) ) {
+   /* Scroll window when cursor is halfway down */
+   panel-top_file++;
+   if (panel-top_file  panel-dir.len - ITEMS (panel))
+   panel-top_file = panel-dir.len - ITEMS (panel);
 }
 select_item (panel);
 }
@@ -2039,6 +2045,11 @@ move_up (WPanel * panel)
 if (panel-top_file  0)
 panel-top_file = 0;
 paint_dir (panel);
+} else if ( panels_options.scroll_center 
+   panel-selected  (panel-top_file + ITEMS (panel)/2)) {
+   /* Scroll window when cursor is halfway up */
+panel-top_file--;
+if (panel-top_file  0) panel-top_file = 0;
 }
 select_item (panel);
 }
[/code]

Merry Christmas.

--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Subject Lines

2013-12-20 Thread Mike Smithson

On Fri, 20 Dec 2013 04:00:03 -0800, mc-requ...@gnome.org wrote:



Message: 1
Date: Thu, 19 Dec 2013 08:11:18 -0600
From: /dev/rob0 r...@gmx.co.uk
To: mc@gnome.org
Subject: Re: mc Digest, Vol 116, Issue 5
Message-ID: 20131219141118.gf16...@harrier.slackbuilds.org
Content-Type: text/plain; charset=us-ascii

Mike, when replying to the mailing list, please change the Subject to
something relevant, generally to the one set by the original poster.


Yes, my oversight. I've modified my subscription options.



--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mc Digest, Vol 116, Issue 6

2013-12-19 Thread Mike Smithson

On Thu, 19 Dec 2013 04:00:03 -0800, mc-requ...@gnome.org wrote:


Message: 1
Date: Thu, 19 Dec 2013 00:02:38 +0100
From: Konrad Vrba konrad.v...@gmail.com
To: mc@gnome.org
Subject: disk usage status in right bottom corner
Message-ID:
CAF2Nc0zH_Ew_tbEm44ZS9mJiUiqL0A=iyev1maj6krttyqu...@mail.gmail.com
Content-Type: text/plain; charset=iso-8859-1

hello,

I would like to ask whether it is possible to change the disk  
status/usage

information, which is displayed in the botom right corner in midnight
commander (sorry if I am not using the correct terminology).

The information displayed in my MC is free/total free%

I would prefer to have % of used space, rather than % of free space. It
might seem trivial, but I canot get used to the idea and it still  
confuses
me. It seems to me logical to see what *is*on my disk, rather than what  
*is

not*.

Is there some way to adjust this, so that I can for example see just the
%usage ?

thanks,
Konrad


You know, that confused me too. It shows free space instead of used space.
df shows size used avail and use%, but mc shows avail/size (free%).

Once again, src/filemanager/panels.c being hacked, around line :
[code]
static void
show_free_space (WPanel * panel)
{
/* Used to figure out how many free space we have */
static struct my_statfs myfs_stats;
/* Old current working directory for displaying free space */
static char *old_cwd = NULL;

/* Don't try to stat non-local fs */
if (!vfs_file_is_local (panel-cwd_vpath) || !free_space)
return;

if (old_cwd == NULL || strcmp (old_cwd, vfs_path_as_str  
(panel-cwd_vpath)) != 0)

{
char rpath[PATH_MAX];

init_my_statfs ();
g_free (old_cwd);
old_cwd = g_strdup (vfs_path_as_str (panel-cwd_vpath));

if (mc_realpath (old_cwd, rpath) == NULL)
return;

my_statfs (myfs_stats, rpath);
}

if (myfs_stats.avail != 0 || myfs_stats.total != 0)
{
Widget *w = WIDGET (panel);
char buffer1[6], buffer2[6], tmp[BUF_SMALL];

size_trunc_len (buffer1, sizeof (buffer1) - 1, myfs_stats.avail, 1,
panels_options.kilobyte_si);
size_trunc_len (buffer2, sizeof (buffer2) - 1, myfs_stats.total, 1,
panels_options.kilobyte_si);
g_snprintf (tmp, sizeof (tmp),  %s/%s (%d%%) , buffer1, buffer2,
myfs_stats.total == 0 ? 0 :
(int) (100 * (long double) myfs_stats.avail /  
myfs_stats.total));

widget_move (w, w-lines - 1, w-cols - 2 - (int) strlen (tmp));
tty_setcolor (NORMAL_COLOR);
tty_print_string (tmp);
}
}
[/code]
First, I'd rename the func to panel_show_disk_usage(). Then a bool whether
to show free space or used space. Then mod those size_trunc_len()s on the
bool.

But, in the meantime, for a quick and usable hack, I'd just change that
last bit to:
[code]
if (myfs_stats.avail != 0 || myfs_stats.total != 0)
{
Widget *w = WIDGET (panel);
char buffer1[6], buffer2[6], tmp[BUF_SMALL];
uintmax_t used = myfs_stats.total - myfs_stats.avail;

//size_trunc_len (buffer1, sizeof (buffer1) - 1, myfs_stats.avail,  
1,

//panels_options.kilobyte_si);
size_trunc_len (buffer1, sizeof (buffer1) - 1, used, 1,
panels_options.kilobyte_si);
size_trunc_len (buffer2, sizeof (buffer2) - 1, myfs_stats.total, 1,
panels_options.kilobyte_si);
//g_snprintf (tmp, sizeof (tmp),  %s/%s (%d%%) , buffer1,  
buffer2,

//myfs_stats.total == 0 ? 0 :
//(int) (100 * (long double) myfs_stats.avail /  
myfs_stats.total));
g_snprintf (tmp, sizeof (tmp),  Used %s/%s (%d%%) , buffer1,  
buffer2,

myfs_stats.total == 0 ? 0 :
(int) (100 * (long double) used / myfs_stats.total));
widget_move (w, w-lines - 1, w-cols - 2 - (int) strlen (tmp));
tty_setcolor (NORMAL_COLOR);
tty_print_string (tmp);
}
[/code]

Works for me. I think I'll clean it up and keep it.


--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mc Digest, Vol 116, Issue 5

2013-12-18 Thread Mike Smithson

On Tue, 17 Dec 2013 04:00:03 -0800, mc-requ...@gnome.org wrote:



Message: 1
Date: Mon, 16 Dec 2013 14:05:48 +
From: James Wonnacott ja...@tregillis.eclipse.co.uk
To: mc@gnome.org
Subject: Changed behaviour of clicking at the top.
Message-ID: 52af08bc.5020...@tregillis.eclipse.co.uk
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Dear All,

Sorry to raise this again but it's driving me nuts and I only got one
reply last time which didn't help.

###
#Warning! if you don't think a mouse is an appropriate#
#input device to use on mc please don't read any more.#
#I use a mouse a lot in mc and I like it! #
###

I've been using mc for many years and I love it- thanks!

I've recently installed version 4.8.3 on a few Debian servers I've built
and found that I can no longer click at the top of a panel to move up-
it now reverses the sort order instead.
Now, I really would like to get the old behaviour back- is this
possible? please!

Thanks,

James.



It's true. I don't use the mouse much, tend to be a keyboard hotkey
kind of guy. But your question got me playing with mc  mouse. The
mouse support seems to be highly improved over the last time (years
ago) that I fiddled with mouse support.

If you want to change it, the relevant code is in
src/filemanager/panel.c, around line 3645:

[code]
/* sort on clicked column; don't handle wheel events */
if (mouse_down  (local.buttons  (GPM_B_UP | GPM_B_DOWN)) == 0   
local.y == 2)

{
mouse_sort_col (panel, local.x);
goto finish;
}

/* Mouse wheel events */
if (mouse_down  (local.buttons  GPM_B_UP) != 0)
{
if (is_active)
{
if (panels_options.mouse_move_pages  (panel-top_file  0))
prev_page (panel);
else/* We are in first page */
move_up (panel);
}
goto finish;
}
[/code]

Frankly, I like the sort/reverse sort feature. I didn't even know I
could do that. Very handy. Thank you for drawing it to my attention.


--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: directory in wrong panel (Michael Panteleit)

2013-11-24 Thread Mike Smithson

On Sun, 24 Nov 2013 04:00:04 -0800, mc-requ...@gnome.org wrote:


Message: 1
Date: Sat, 23 Nov 2013 13:27:48 +0100
From: Michael Panteleit pante...@web.de
To: mc@gnome.org
Subject: Re: directory in wrong panel
Message-ID: 87bo1be20r@derry.pan
Content-Type: text/plain

I found, if I revert this patch

diff --git a/src/setup.c b/src/setup.c
index 1e5e8c6..dcbf929 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -984,13 +989,13 @@ load_setup (void)
 if (startup_left_mode != view_listing  startup_right_mode !=  
view_listing)

 startup_left_mode = view_listing;
-if (mc_run_param1 == NULL)
 {
 vfs_path_t *vpath;
+
 buffer = mc_config_get_string (mc_panels_config, Dirs,  
other_dir, .);

 vpath = vfs_path_from_str (buffer);
 if (vfs_file_is_local (vpath))
-mc_run_param1 = buffer;
+saved_other_dir = buffer;
 else
 g_free (buffer);
 vfs_path_free (vpath);


the old behaviour is back. I like this much better (btw I am using mc  
4.8.10)


Is there a reason the old behaviour was changed?

Bye,
Michael



I posted about this a little while ago too.
Somehow it got goofed up for 4.8.10, but it's fixed in the git repo.
Check midnight.c:576, create_panels().


--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


mc startup with single specified path

2013-10-18 Thread Mike Smithson

Hello.

I'm having some puzzlement over the initial startup behavior of mc-4.8.10  
when paths are specified on the command line.


To quote the manual:

[quote]
   If  both  paths  are specified, the first path name is the  
directory to
   show in the left panel; the second path name is  the  directory   
to  be

   shown in the right panel.

   If one path is specified, the path name is the directory to show in  
the

   active panel; current directory is shown in the passive panel.

   If no paths are specified, current directory is  shown  in  the   
active
   panel;  value  of  other_dir  from  panels.ini is the directory  
to be

   shown in the passive panel.
[/quote]

Paragraph #1:
This seems correct and intuitive.

Paragraph #2:
What I *expect* to happen when I specify only one path on the command  
line, is for that directory to appear in the left panel with the focus on  
it. As it works right now, it appears to be random which panel it shows up  
in, and which panel has focus. I know that it depends on the last time I  
hit Save Setup and the setting of current_is_left in panels.ini, but it  
always seems to do the wrong thing. As a matter of fact, the behavior I'm  
witnessing, is that that specified directory appears in the *inactive*  
panel, and the CWD appears in the *active* panel. I think that is  
counter-intuitive, a bit annoying, and exactly *not* what the manual says.


Paragraph #3:
This also seems correct and intuitive. Resort to default behavior if  
nothing is specified.


---

I believe the issue is in midnight.c, static void create_panels(), around  
lines 619-624 and 646-651, both bits are identical, and they shouldn't be:

[code]
else/* mc_run_param0 != NULL  mc_run_param1  
== NULL */

{
/* one argument */
current_dir = NULL; /* assume current dir */
other_dir = (char *) mc_run_param0;
}
[/code]
Is it just me, or does this seem *exactly* backwards?

I've changed these bits like this (the 1st is when the left panel is  
active):


[code]
--- midnight.c~ 2013-08-02 11:02:40.0 -0700
+++ midnight.c  2013-10-16 13:59:48.541659334 -0700
@@ -619,8 +619,8 @@ create_panels (void)
 else/* mc_run_param0 != NULL  mc_run_param1  
== NULL */

 {
 /* one argument */
-current_dir = NULL; /* assume current dir */
-other_dir = (char *) mc_run_param0; /* Wrong. */
+current_dir = (char *) mc_run_param0; /* Left panel gets the  
path */

+other_dir = NULL; /* assume other dir */
 }
 }
 else
@@ -648,6 +648,7 @@ create_panels (void)
 /* one argument */
 current_dir = NULL; /* assume current dir */ ;
 other_dir = (char *) mc_run_param0; /* Left panel gets the  
path */
+boot_current_is_left = TRUE; /* make left panel active (user  
called it, there must be a reason.) */

 }
 }
[/code]

and it now behaves the way I would expect.

After doing a bit more research, it looks as if create_panels() was  
freshly re-written for 4.8.10. In 4.8.9 I see this bit:

[code]
if (mc_run_param0 != NULL)
{
current_dir = NULL;
other_dir = (char *) mc_run_param0;
}
else
{
current_dir = NULL;
other_dir = mc_run_param1;
}
[/code]
Hmmm... Is it even possible to have mc_run_param1 *without* mc_run_param0?  
Also, what if both are set? No wonder it got re-written.


--
Peace and Cheer
___
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel


Re: Suppress directory not empty message

2013-09-09 Thread Mike Smithson

On Mon, 09 Sep 2013 05:00:03 -0700, mc-requ...@gnome.org wrote:



Message: 1
Date: Wed, 4 Sep 2013 17:32:33 +0200
From: Marco li...@homerow.info
To: mc@gnome.org
Subject: Re: Suppress directory not empty message
Message-ID: 20130904153233.GC27101@homerow
Content-Type: text/plain; charset=utf-8

On 2013?08?05 Marco wrote:


When deleting a directory tree mc displays the following message:

  Delete directory directory?

  [Yes] [No]

I hit ?Yes?, then another message pops up:

  Directory not empty.
  Delete it recursively?

  [Yes] [No] [All] [None] [Abort]

I hit ?All? since I want to delete the entire tree. This is very
cumbersome. Is is possible to suppress both messages entirely or at
least suppress the second message?

Is it possible to suppress the deletion window displaying the
deleted files list with the [Skip] [Abort] buttons as well? Since
the deletion/copy/move processes often take several minutes, mc
becomes totally unusable until those operations are finished. The
only way to continue working is to open up a second mc instance.

I couldn't find anything relevant in the manual.


So apparently there is no way of suppressing those messages?

Marco


I can think of 2 options:

1. Write a special dialog where the user can choose which dialogs
get shown, and which don't. I believe there is more to this than
meets the eye. Easier said than done, as they say. Which dialogs
should be optional, and what should they default to if they don't
get shown?

2. Hack your source and comment out the offending dialog calls.
I have done this myself with the Edit extension file dialog
where it always asks [Local] [User] [System Wide].
The only one I ever edit is [User], so I made it skip the dialog
and go for that one automatically. Hey, that's what having
the source code means to me:)

I, for one, very much appreciate the second 'Directory not empty'
dialog, because my usual habits are to go through work directories
once in a while on garbage cleanup duty. Accidentally removing a
sprawling subtree seems to me far worse than having to hit ENTER
one more time.

As an addendum, after a quick peek at the source, in
filemanager/file.c, you could just add a line 672:

ctx-recursive_result = RECURSIVE_ALWAYS;

cd ../..; make; make install

It will never pester you again. And from the look of things,
someone has already done this before, otherwise line 673
wouldn't even ask. So there is likely others who make this
one of their favorite first hacks when they get new code.
As a matter of fact,

if (ctx-recursive_result  RECURSIVE_ALWAYS) {
... show dialog ...
}

goes back to at least 4.6 in 2005. I don't have any mc source
code left from before that date.

--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


little bug in option.c

2003-02-09 Thread Mike Smithson
I was playing with option.c and ran across this tiny
bug. If you change PANEL_OPTIONS the dialog doesn't
display properly anymore. Atached is the diff to make
it work and be consistent with the way OTHER_OPTIONS
is handled also.



--- mc-cvs-4.6.0-030207/src/option.cSat Dec  7 20:16:30 2002
+++ mc-draft-4.6.0-030207/src/option.c  Sun Feb  9 11:16:02 2003
@@ -229,7 +230,7 @@
 /* Add checkboxes for panel options */
 for (i = 0; i  PANEL_OPTIONS; i++) {
check_options[i + OTHER_OPTIONS].widget =
-   check_new (PY + (6 - i), PX + 2, XTRACT (i + OTHER_OPTIONS));
+   check_new (PY + (PANEL_OPTIONS - i), PX + 2, XTRACT (i + OTHER_OPTIONS));
add_widget (conf_dlg, check_options[i + OTHER_OPTIONS].widget);
 }
 }





mouse behavior discussion

2003-01-30 Thread Mike Smithson
Hello.

I wonder amongst mc-users, what should the
mousewheel do in the panels?

Right now, for me, it scrolls by a page every time,
and moves the selected along with it.

This behavior I do not like, and is always the
first patch I apply to fresh cvs.

I have two questions:

1. Should mousewheel scroll_by_pages or scroll_by_line?
 (IMHO that's what that artifact panel_scroll_pages
 was originally for, although I don't know for sure.)

2. Behavior of panel-selected:
 In editor the traditional way is to have cursor
 follow mousewheel to avoid typing in wrong area
 of file after scrolling with mouse, but in a file
 listing (in all other file managers I've used),
 it stays in place while only the listing scrolls.

The adjustments are simple, but I'm not sure if others
like what it does now, and if so, why.

Maybe nobody uses mousewheel? They are so common where I
live I throw 2 button mice in garbage :)

Please reply to mailing list to help discussion on
this matter.

Cheers and thank you in advance.




___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



pre2a Xevent problem?

2003-01-05 Thread Mike Smithson
Oh boy, there's something really wrong here.

I just compiled the freshest cvs AS IS, the
configure options seemed appropriate to my
uses. It works fine from the console, but in
a gnome-terminal (mandrake8.2) it seems to
buffer Xevents (keyboard and mouse) and then
spew them out after about three have happened.

I haven't yet had a chance to inspect the
problem much closer. Does anyone know where
this is coming from?

I'm sorry I don't have the time to figure this
one out for myself at this point.

The closest I can get is that I used to use
both --with-x and --with-tm-x-support.

Perhaps it has to do with the changes to
the default configuration?

Cheers.

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Panel_Mousewheel_Scroll.patch

2002-12-19 Thread Mike Smithson
Trivial Patch #10262:
This patch scrolls one line at at time instead of one page at a time
when spinning the mousewheel.

Does anyone like it or find it useful?




--- mc-cvs-4.6.0-pre1b-021217/src/screen.c  Sun Dec 15 22:42:17 2002
+++ mc-draft-4.6.0-pre1b-021217/src/screen.cTue Dec 17 12:31:22 2002
@@ -2261,11 +2261,22 @@ panel_event (Gpm_Event *event, WPanel *p
 
 /* Mouse wheel events */
 if ((event-buttons  GPM_B_UP)  (event-type  GPM_DOWN)) {
-   prev_page (panel);
+   if ( panel_scroll_pages ) {
+   panel-top_file -= 1;
+   if (panel-top_file  0) panel-top_file = 0;
+   paint_dir (panel);
+}
return MOU_NORMAL;
 }
 if ((event-buttons  GPM_B_DOWN)  (event-type  GPM_DOWN)) {
-   next_page (panel);
+   if ( panel-count  ITEMS (panel)  panel_scroll_pages ){
+   panel-top_file += 1;
+   if (panel-top_file  panel-count - ITEMS (panel))
+   panel-top_file = panel-count - ITEMS (panel);
+   paint_dir (panel);
+}
return MOU_NORMAL;
 }