mcedit bug

Matthias Urban murban at mail.CS.Uni-Magdeburg.De
Fri Dec 21 12:38:14 UTC 2001


Hi Steef,

there is a little bug in the `mc-menu' file:

---
+ ! t t
@       Do something on the current file
	CMD=%{Enter command}
	$CMD ./%0f
---

This only works well for commands without additional arguments. If there
are arguments then only the command itself is assigned to CMD, but the
arguments are passed on to the shell trying to execute them as if they
would be commands. I think it better should look like this:

---
+ ! t t
@       Do something on the current file
	CMD="%{Enter command}"
	$CMD ./%0f
---

By the way, `Do something on the tagged files' has the same problem.

What do you think about a "Create patch files" command in the mc-menu? I
tried the following:

---
= t t  &  T t  &  t r  &  T r
p       Create patch files in current directory
	set %u
	OTHER="%U"
	for file in $OTHER; do
	  if [ $# -eq 0 ]; then break; fi
	  PATCHFILE="`expr "$file" : '\(.*\)\.'`-$1.patch"
	  if [ -x "$PATCHFILE" ]; then
	    mv $PATCHFILE $PATCHFILE.old.$$
	  fi
	  diff -Naur %D/$file %d/$1 > $PATCHFILE
	  shift
	done
---

It's really tiresome to create the patch files for more than one file by
hand (maybe for a whole directory). I've offen have to do this, and I
really missed a menu command doing it for me. I know, the above command
is not the best solution. What do you think about it? I guess it could
be usefull for others, too.

Regards,
Matthias



More information about the mc-devel mailing list