Re: Quoting of variables in fsusage.m4 and ls-mntd-fs.m4

2006-05-30 Thread Roland Illig

Pavel Tsekov wrote:

On Mon, 29 May 2006, Roland Illig wrote:


Roland Illig wrote:

The quoting hid one bug that appeared due to one variable being used, 
which had never been defined before. I think it has been fixed upstream.



It has, and I updated our version of ls-mntd-fs.m4 to the one of 
coreutils. I also documented that in the ChangeLog. Sorry that it took 
so long.



What do you think about my suggestion to move your changes in configure.ac
to acinclude.m4 ?


As a new macro? I don't think it's necessary, because I have added only 
a few lines, which would blow up the size of the configure script 
unnecessarily. But if you have some better reasons, please tell me.


Roland
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: Quoting of variables in fsusage.m4 and ls-mntd-fs.m4

2006-05-30 Thread Pavel Tsekov

On Tue, 30 May 2006, Roland Illig wrote:


Pavel Tsekov wrote:

On Mon, 29 May 2006, Roland Illig wrote:


Roland Illig wrote:

The quoting hid one bug that appeared due to one variable being used, 
which had never been defined before. I think it has been fixed upstream.



It has, and I updated our version of ls-mntd-fs.m4 to the one of 
coreutils. I also documented that in the ChangeLog. Sorry that it took so 
long.



What do you think about my suggestion to move your changes in configure.ac
to acinclude.m4 ?


As a new macro? I don't think it's necessary, because I have added only a few 
lines, which would blow up the size of the configure script unnecessarily. 
But if you have some better reasons, please tell me.


I told you already. There is an existing macro in acinclude.m4 - 
AC_GET_FS_INFO. Move your changes there - and some of the test you 
introduced for header files and functions are unnecessary since the

code in AC_GET_FS_INFO already checks for that.
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: Quoting of variables in fsusage.m4 and ls-mntd-fs.m4

2006-05-30 Thread Pavel Tsekov

On Tue, 30 May 2006, Roland Illig wrote:


Pavel Tsekov wrote:
I told you already. There is an existing macro in acinclude.m4 - 
AC_GET_FS_INFO. Move your changes there - and some of the test you 
introduced for header files and functions are unnecessary since the

code in AC_GET_FS_INFO already checks for that.


What about the files m4/fsusage.m4 and m4/lst-mntd-fs.m4? I think the code 
belongs here instead of acinclude.m4.


What are you talking about ? AC_GET_FS_INFO is calling macros supplied
by m4/fsusage.m4 and m4/lst-mntd-fs.m4. I.e. configure.ac is using
m4/fsusage.m4 and m4/lst-mntd-fs.m4 through AC_GET_FS_INFO.

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


Re: [RFE][PATCH] Display free space on device in panels

2006-05-30 Thread Jindrich Novy
On Tue, 2006-05-30 at 11:36 +0300, Pavel Tsekov wrote:
 Please, do not send patches generated against UTF8-ized version of MC.

Ah, done that again. Attaching the cleanly applicable variant then.

Jindrich

-- 
Jindrich Novy [EMAIL PROTECTED]
--- mc/src/screen.c.orig	2006-02-08 11:10:37.0 +0100
+++ mc/src/screen.c	2006-05-30 13:09:46.0 +0200
@@ -47,7 +47,7 @@
 #include widget.h
 #include menu.h		/* menubar_visible */
 #define WANT_WIDGETS
-#include main.h		/* the_menubar */
+#include main.h		/* the_menubar, show_free_space() */
 #include unixcompat.h
 
 #define ELEMENTS(arr) ( sizeof(arr) / sizeof((arr)[0]) )
@@ -761,6 +761,7 @@
 hline ((slow_terminal ? '-' : ACS_HLINE) | NORMAL_COLOR,
 	   panel-widget.cols - 2);
 #endif/* !HAVE_SLANG */
+show_free_space (panel);
 }
 
 static void
@@ -802,6 +803,8 @@
 widget_move (panel-widget, 0, panel-widget.cols - 3);
 addstr (v);
 
+mini_info_separator (panel);
+
 if (panel-active)
 	standend ();
 }
--- mc/src/main.c.orig	2006-05-30 13:09:46.0 +0200
+++ mc/src/main.c	2006-05-30 13:09:46.0 +0200
@@ -60,6 +60,7 @@
 #include listmode.h
 #include execute.h
 #include ext.h		/* For flush_extension_file() */
+#include mountlist.h		/* my_statfs */
 
 /* Listbox for the command history feature */
 #include widget.h
@@ -230,6 +231,12 @@
 /* We need to paint it after CONSOLE_RESTORE, see: load_prompt */
 int update_prompt = 0;
 
+/* Old current working directory for displaying free space */
+char *old_cwd = NULL;
+
+/* Used to figure out how many free space we have */
+struct my_statfs myfs_stats;
+
 /* The home directory */
 const char *home_dir = NULL;
 
@@ -395,6 +402,8 @@
 int reload_other = !(force_update  UP_ONLY_CURRENT);
 WPanel *panel;
 
+show_free_space(current_panel);
+
 update_one_panel (get_current_index (), force_update, current_file);
 if (reload_other)
 	update_one_panel (get_other_index (), force_update, UP_KEEPSEL);
@@ -460,6 +469,37 @@
 }
 }
 
+void
+show_free_space(WPanel *panel)
+{
+struct stat st;
+
+/* Don't try to stat non-local fs */
+if (!vfs_file_is_local(panel-cwd) || !free_space)
+	return;
+   
+if (old_cwd == NULL || strcmp(old_cwd, panel-cwd) != 0) {
+	init_my_statfs();
+	g_free(old_cwd);
+	old_cwd = g_strdup(panel-cwd);
+	my_statfs (myfs_stats, panel-cwd);
+}
+   
+st = panel-dir.list [panel-selected].st;
+   
+if (myfs_stats.avail  0 || myfs_stats.total  0) {
+	char buffer1 [6], buffer2[6], *tmp;
+	size_trunc_len (buffer1, 5, myfs_stats.avail, 1);
+	size_trunc_len (buffer2, 5, myfs_stats.total, 1);
+	tmp = g_strdup_printf (_(%s (%d%%) of %s), buffer1, myfs_stats.total  0 ?
+			   (int)(100 * (double)myfs_stats.avail / myfs_stats.total) : 0,
+			   buffer2);
+	widget_move (panel-widget, panel-widget.lines-3, panel-widget.cols-2-strlen(tmp));
+	addstr (tmp);
+	g_free (tmp);
+}
+}
+ 
 static int
 quit_cmd_internal (int quiet)
 {
--- mc/src/setup.c.orig	2006-02-23 16:32:18.0 +0100
+++ mc/src/setup.c	2006-05-30 13:30:43.0 +0200
@@ -134,6 +134,7 @@
 { show_mini_info, show_mini_info },
 { permission_mode, permission_mode },
 { filetype_mode, filetype_mode },
+{ free_space, free_space },
 { 0, 0 }
 };
 
--- mc/src/main.h.orig	2006-02-03 18:07:39.0 +0100
+++ mc/src/main.h	2006-05-30 13:09:46.0 +0200
@@ -55,6 +55,7 @@
 extern int show_all_if_ambiguous;
 extern int slow_terminal;
 extern int update_prompt;	/* To comunicate with subshell */
+extern char *old_cwd;
 extern int safe_delete;
 extern int confirm_delete;
 extern int confirm_directory_hotlist_delete;
@@ -100,6 +101,7 @@
 int load_prompt (int, void *);
 void save_cwds_stat (void);
 void quiet_quit_cmd (void);	/* For cmd.c and command.c */
+void show_free_space(WPanel *panel);
 
 void touch_bar  (void);
 void update_xterm_title_path (void);
--- mc/src/layout.c.orig	2006-02-28 17:15:21.0 +0100
+++ mc/src/layout.c	2006-05-30 13:10:03.0 +0200
@@ -99,6 +99,9 @@
 /* Set to show current working dir in xterm window title */
 int xterm_title = 1;
 
+/* Set to show free space on device assigned to current directory */
+int free_space = 1;
+
 /* The starting line for the output of the subprogram */
 int output_start_y = 0;
 
@@ -128,6 +131,7 @@
 static int _keybar_visible;
 static int _message_visible;
 static int _xterm_title;
+static int _free_space;
 static int _permission_mode;
 static int _filetype_mode;
 
@@ -158,6 +162,7 @@
 int*variable;
 WCheck *widget;
 } check_options [] = {
+{ N_(show free spAce),  free_space,  0 },
 { N_(Xterm window title), xterm_title,   0 },
 { N_(hIntbar visible),  message_visible, 0 },
 { N_(Keybar visible),   

Re: [RFE][PATCH] Display free space on device in panels

2006-05-30 Thread Pavel Tsekov

On Mon, 29 May 2006, Jindrich Novy wrote:


On Fri, 2006-05-19 at 14:29 -0400, Pavel Roskin wrote:

Can we avoid any highlighting?  I think Far Manager does it right:
http://red-bean.com/proski/mc/far.png


Attaching the patch without highlighting. The main changes are that I
moved the show_free_space() into main.c since screen.c lacks a header
file and a call is needed from cmd.c to minimize frequency of gathering
filesys info. The free space widget isn't displayed at all when browsing
a non-local fs. Filesystem statistics are updated immediately when mc
requests a reread (ctrl-r is pressed).

Please review, some further mistakes are possible.


Now, after I reviewed the patch for a second time I am pretty convinced 
that the free space info should be displayed in the mini status area
and not on its upper frame i.e. as it is in FAR manager (what Pavel 
Rosking suggested). Here is why:


MC tries to optimize the screen drawing by updating only certain parts
of the screen (the directory contents, the mini status) when not otherwise 
necessary. Simply put MC doesn't update the whole screen when you go down 
one file in the panel, when you change a directory, etc. With the current 
patch you actually break that optimization by inserting a call to

mini_info_separator() in show_dir() which is called each time you move
through the file list for example.

Your patch may be modified to so that it will work properly i.e. it wont
break the optimization but it becomes ugly (codewise). It may be modified
to be not so ugly by sacrificing the optimization a bit i.e. put
a call to mini_info_separator () in panel_update_contents(). It also
can be made to fit into the current scheme by making the free space info
part of the mini status area.

Now, there are some other small issues with the patch as-is:

--- mc-4.6.1a/src/main.c.showfree   2006-05-29 12:41:36.0 +0200
+++ mc-4.6.1a/src/main.c2006-05-29 13:04:50.0 +0200
@@ -402,6 +409,8 @@
 int reload_other = !(force_update  UP_ONLY_CURRENT);
 WPanel *panel;

+show_free_space(current_panel);
+
 update_one_panel (get_current_index (), force_update, current_file);
 if (reload_other)
update_one_panel (get_other_index (), force_update, UP_KEEPSEL);

This part is not necessary. And it will draw the free_space_info() even
if there is no mini status (though you won't see it).

@@ -467,6 +476,37 @@
 }
 }

+void
+show_free_space(WPanel *panel)
+{
+struct stat st;

This is not necessary as well as the code which fills it.


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


Re: Quoting of variables in fsusage.m4 and ls-mntd-fs.m4

2006-05-30 Thread Leonard den Ottolander
Hello Pavel, Roland,

On Tue, 2006-05-30 at 14:00 +0300, Pavel Tsekov wrote:
 On Tue, 30 May 2006, Roland Illig wrote:
  What about the files m4/fsusage.m4 and m4/lst-mntd-fs.m4? I think the code 
  belongs here instead of acinclude.m4.
 
 What are you talking about ? AC_GET_FS_INFO is calling macros supplied
 by m4/fsusage.m4 and m4/lst-mntd-fs.m4. I.e. configure.ac is using
 m4/fsusage.m4 and m4/lst-mntd-fs.m4 through AC_GET_FS_INFO.

I agree with Pavel. These included m4 files are like libraries. We
should try to avoid to touch them as much as possible (unless in case of
severe bugs). If you are missing functionality in these m4 files that
should be reported to the coreutils maintainers. I don't think this case
applies though.

Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research


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


[bug #16303] More functionally u7z

2006-05-30 Thread SGh

Follow-up Comment #3, bug #16303 (project mc):

What's the difference if I've wrote my own version or changed the existent
one? I've written it just a bit earlier before I've downloaded the CVS. I
don't exactly remember but deleting wasn't worked in that CVS anyway. Seems
like there was just an empty delete function.

___

Reply to this item at:

  http://savannah.gnu.org/bugs/?func=detailitemitem_id=16303

___
  Message sent via/by Savannah
  http://savannah.gnu.org/

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