diff --git a/doc/man/mcedit.1.in b/doc/man/mcedit.1.in index bb7d014fa..22261e3d5 100644 --- a/doc/man/mcedit.1.in +++ b/doc/man/mcedit.1.in @@ -139,8 +139,8 @@ for more detail about format of the script. .PP Following macro definition and directives can be used: .TP -.I #interactive -If this directive is set, then script starts in subshell. +.I #silent +If this directive is set, then script starts without interactive subshell. .TP .I %c The cursor column position number. diff --git a/misc/macros.d/macro.0.sh b/misc/macros.d/macro.0.sh index 983b90715..bc33de8d1 100644 --- a/misc/macros.d/macro.0.sh +++ b/misc/macros.d/macro.0.sh @@ -1,4 +1,3 @@ -#interactive m make TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1 make 2> $TMPFILE diff --git a/misc/macros.d/macro.1.sh b/misc/macros.d/macro.1.sh index 0a881ba15..93ca59feb 100644 --- a/misc/macros.d/macro.1.sh +++ b/misc/macros.d/macro.1.sh @@ -1,3 +1,4 @@ +#silent u Upper case selection TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1 cat %b > $TMPFILE diff --git a/misc/macros.d/macro.2.sh b/misc/macros.d/macro.2.sh index 7e3b8026d..9e58dd451 100644 --- a/misc/macros.d/macro.2.sh +++ b/misc/macros.d/macro.2.sh @@ -1,3 +1,4 @@ +#silent l Lower case selection TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1 cat %b > $TMPFILE diff --git a/misc/macros.d/macro.3.sh b/misc/macros.d/macro.3.sh index db77f3da6..7dfd26397 100644 --- a/misc/macros.d/macro.3.sh +++ b/misc/macros.d/macro.3.sh @@ -1,3 +1,4 @@ +#silent S Sort selection TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1 cat %b > $TMPFILE diff --git a/misc/macros.d/macro.4.sh b/misc/macros.d/macro.4.sh index ee53a8cce..fca306fb3 100644 --- a/misc/macros.d/macro.4.sh +++ b/misc/macros.d/macro.4.sh @@ -1,2 +1,3 @@ +#silent t Indent `C' formatter indent -gnu -fc1 -i4 -bli0 -nut -bap -l100 %b 1>/dev/null 2> %e diff --git a/misc/macros.d/macro.5.sh b/misc/macros.d/macro.5.sh index a64dfc95a..bbd0bf699 100644 --- a/misc/macros.d/macro.5.sh +++ b/misc/macros.d/macro.5.sh @@ -1,3 +1,4 @@ +#silent s snippets a=`cat %b` if [ "$a" = "fori" ]; then diff --git a/misc/macros.d/macro.6.sh b/misc/macros.d/macro.6.sh index fed113a1f..923a5f88f 100644 --- a/misc/macros.d/macro.6.sh +++ b/misc/macros.d/macro.6.sh @@ -1,3 +1,4 @@ +#silent e execute something TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1 cat %b > $TMPFILE diff --git a/misc/macros.d/macro.7.sh b/misc/macros.d/macro.7.sh index e0b8c2471..1f4e66d13 100644 --- a/misc/macros.d/macro.7.sh +++ b/misc/macros.d/macro.7.sh @@ -1,3 +1,4 @@ +#silent w delete trailing whitespace TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1 cat %b > $TMPFILE diff --git a/src/filemanager/usermenu.c b/src/filemanager/usermenu.c index c093776a9..aae5ade57 100644 --- a/src/filemanager/usermenu.c +++ b/src/filemanager/usermenu.c @@ -868,7 +868,7 @@ user_menu_cmd (struct WEdit *edit_widget, const char *menu_file, int selected_en int selected, old_patterns; Listbox *listbox; gboolean res = FALSE; - gboolean interactive = FALSE; + gboolean interactive = TRUE; if (!vfs_current_is_local ()) { @@ -956,8 +956,8 @@ user_menu_cmd (struct WEdit *edit_widget, const char *menu_file, int selected_en if (*p == '#') { /* show prompt if first line of external script is #interactive */ - if (selected_entry >= 0 && strncmp (p, "#interactive", 12) == 0) - interactive = TRUE; + if (selected_entry >= 0 && strncmp (p, "#silent", 7) == 0) + interactive = FALSE; /* A commented menu entry */ accept_entry = 1; }