diff --git a/acinclude.m4 b/acinclude.m4 index 4cde65f02..b1562965d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -11,7 +11,7 @@ m4_include([m4.include/mc-get-fs-info.m4]) m4_include([m4.include/mc-with-x.m4]) m4_include([m4.include/mc-use-termcap.m4]) m4_include([m4.include/mc-with-screen.m4]) -m4_include([m4.include/mc-with-edit.m4]) +m4_include([m4.include/mc-with-internal-edit.m4]) m4_include([m4.include/mc-subshell.m4]) m4_include([m4.include/mc-background.m4]) m4_include([m4.include/ac-glib.m4]) diff --git a/configure.ac b/configure.ac index 63fef7f82..c12c2e779 100644 --- a/configure.ac +++ b/configure.ac @@ -383,7 +383,7 @@ dnl ############################################################################ dnl MC options dnl ############################################################################ -MC_WITH_EDIT +MC_WITH_INTERNAL_EDIT dnl Diff viewer support. AC_ARG_WITH([diff_viewer], @@ -478,7 +478,7 @@ AC_SUBST(LIBS) AM_CONDITIONAL(USE_NLS, [test x"$USE_NLS" = xyes]) AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes]) AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang]) -AM_CONDITIONAL(USE_EDIT, [test x"$use_edit" = xyes ]) +AM_CONDITIONAL(USE_INTERNAL_EDIT, [test x"$use_internal_edit" = xyes ]) AM_CONDITIONAL(USE_ASPELL, [test x"$enable_aspell" = xyes ]) AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"]) AM_CONDITIONAL(CHARSET, [test -n "$have_charset"]) diff --git a/m4.include/mc-with-edit.m4 b/m4.include/mc-with-internal-edit.m4 similarity index 77% rename from m4.include/mc-with-edit.m4 rename to m4.include/mc-with-internal-edit.m4 index cbfd95988..8b24ec7e7 100644 --- a/m4.include/mc-with-edit.m4 +++ b/m4.include/mc-with-internal-edit.m4 @@ -1,16 +1,18 @@ dnl dnl Internal editor support. dnl -AC_DEFUN([MC_WITH_EDIT], [ +AC_DEFUN([MC_WITH_INTERNAL_EDIT], [ - AC_ARG_WITH([edit], AS_HELP_STRING([--with-edit], [Enable internal editor @<:@yes@:>@])) + AC_ARG_WITH([internal_edit], + AS_HELP_STRING([--with-internal-edit], [Enable internal editor @<:@yes@:>@])) - if test x$with_edit != xno; then + if test x$with_internal_edit != xno; then AC_DEFINE(USE_INTERNAL_EDIT, 1, [Define to enable internal editor]) - use_edit=yes + use_internal_edit=yes AC_MSG_NOTICE([using internal editor]) + edit_msg="yes" else - use_edit=no + use_internal_edit=no edit_msg="no" fi @@ -27,7 +29,7 @@ AC_DEFUN([MC_WITH_EDIT], [ [enable_aspell=no] ) - if test x$with_edit != xno -a x$enable_aspell != xno; then + if test x$with_internal_edit != xno -a x$enable_aspell != xno; then AC_CHECK_HEADERS([aspell.h], [], [ AC_ERROR([Could not find aspell development headers]) ], []) @@ -40,7 +42,5 @@ AC_DEFUN([MC_WITH_EDIT], [ enable_aspell=no AC_MSG_NOTICE([aspell support is disabled because gmodule support is not available]) fi - else - edit_msg="yes" fi ]) diff --git a/misc/syntax/Makefile.am b/misc/syntax/Makefile.am index 71df3d9bc..53242abd5 100644 --- a/misc/syntax/Makefile.am +++ b/misc/syntax/Makefile.am @@ -79,7 +79,7 @@ SYNTAXFILES = \ yum-repo.syntax \ yxx.syntax -if USE_EDIT +if USE_INTERNAL_EDIT syntaxdir = $(pkgdatadir)/syntax syntax_DATA = $(SYNTAX_OUT) \ $(SYNTAXFILES) diff --git a/src/Makefile.am b/src/Makefile.am index 09bede5ad..13edbab0d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = filemanager man2hlp vfs viewer -if USE_EDIT +if USE_INTERNAL_EDIT SUBDIRS += editor endif @@ -29,7 +29,7 @@ pkglibexecdir = $(libexecdir)/@PACKAGE@ bin_PROGRAMS = mc -if USE_EDIT +if USE_INTERNAL_EDIT EDITLIB = editor/libedit.la endif @@ -90,7 +90,7 @@ EXTRA_DIST = $(SRC_maintainer) $(SRC_charset) install-exec-hook: $(MAKE) install_mcview -if USE_EDIT +if USE_INTERNAL_EDIT $(MAKE) install_mcedit endif if USE_DIFF @@ -111,7 +111,7 @@ install_mcdiff: uninstall-hook: rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview -if USE_EDIT +if USE_INTERNAL_EDIT rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit endif if USE_DIFF diff --git a/src/editor/Makefile.am b/src/editor/Makefile.am index 8f013597a..0f03de1de 100644 --- a/src/editor/Makefile.am +++ b/src/editor/Makefile.am @@ -1,6 +1,6 @@ EXTRA_DIST = -if USE_EDIT +if USE_INTERNAL_EDIT noinst_LTLIBRARIES = libedit.la else noinst_LTLIBRARIES = diff --git a/src/execute.c b/src/execute.c index 79bbeadae..d61fe345b 100644 --- a/src/execute.c +++ b/src/execute.c @@ -633,12 +633,16 @@ execute_external_editor_or_viewer (const char *command, const vfs_path_t * filen char **argv_cmd_options; int argv_count; - g_shell_parse_argv (extern_cmd_options, &argv_count, &argv_cmd_options, NULL); + if (g_shell_parse_argv (extern_cmd_options, &argv_count, &argv_cmd_options, NULL)) + { + do_executev (command, EXECUTE_INTERNAL, argv_cmd_options); + g_strfreev (argv_cmd_options); + } + else + do_executev (command, EXECUTE_INTERNAL, NULL); + g_free (extern_cmd_options); - do_executev (command, EXECUTE_INTERNAL, argv_cmd_options); - - g_strfreev (argv_cmd_options); } execute_cleanup_with_vfs_arg (filename_vpath, &localcopy_vpath, &mtime); diff --git a/src/filemanager/cmd.c b/src/filemanager/cmd.c index 569170815..9f169bcf9 100644 --- a/src/filemanager/cmd.c +++ b/src/filemanager/cmd.c @@ -790,6 +790,8 @@ do_edit_at_line (const vfs_path_t * what_vpath, gboolean internal, long start_li else #endif /* USE_INTERNAL_EDIT */ { + (void) internal; + if (editor == NULL) { editor = getenv ("EDITOR"); diff --git a/tests/src/Makefile.am b/tests/src/Makefile.am index 92b045c30..0d31c3b85 100644 --- a/tests/src/Makefile.am +++ b/tests/src/Makefile.am @@ -1,4 +1,8 @@ -SUBDIRS = . editor filemanager +SUBDIRS = . filemanager + +if USE_INTERNAL_EDIT +SUBDIRS += editor +endif AM_CPPFLAGS = \ $(GLIB_CFLAGS) \