Trailing type field (instead of leading)

2014-08-26 Thread w3mbox
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 ?

___
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