From: <sv...@va...> - 2008-06-10 20:13:00
|
Author: cerion Date: 2008-06-07 14:34:53 +0100 (Sat, 07 Jun 2008) New Revision: 418 Log: Better editor support in configure: gvim, gview, kate Thanks to Pim Nijdamd, Anton Dudarenko Modified: trunk/configure.in Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2008-06-07 13:29:10 UTC (rev 417) +++ trunk/configure.in 2008-06-07 13:34:53 UTC (rev 418) @@ -69,7 +69,7 @@ # Check for source editor AC_ARG_WITH([editor], - [ --with-editor=PROGRAM Source-code editor [[PROGRAM=$EDITOR|emacs|nedit]] ], + [ --with-editor=PROGRAM Source-code editor [[PROGRAM=$EDITOR|emacs|nedit|gvim|gview|kate]] ], [ # given # TODO: proper way of handling both --xyz=/path/to/foo, and --xyz=foo ? if test -x $withval; then @@ -82,10 +82,14 @@ AC_MSG_ERROR([Editor '$withval' not found]) fi - # if !emacs && !nedit, give warning + # if unknown editor, give warning VK_ED_NAME=`echo $VK_EDITOR | sed "s/.*\///" | sed "s/-.*//"` - if test "$VK_ED_NAME" != "emacs" && test "$VK_ED_NAME" != "nedit"; then - AC_MSG_WARN([Unknown editor '$withval'. If possible, setup an editor flag to go to the target line-number, where %n will be replaced with the line-number.]) + if test "$VK_ED_NAME" != "emacs" && \ + test "$VK_ED_NAME" != "nedit" && \ + test "$VK_ED_NAME" != "gvim" && \ + test "$VK_ED_NAME" != "gview" && \ + test "$VK_ED_NAME" != "kate"; then + AC_MSG_WARN([Unknown editor '$withval'. If possible, set editor options in valkyrie to go to the target line-number, e.g. 'gvim +%n', where %n will be replaced with the line-number.]) fi ], [ # not given @@ -100,9 +104,9 @@ AC_PATH_PROG([VK_EDITOR], [$EDITOR]) fi fi - #if $EDITOR wasn't set, or failed check, try emacs|nedit + #if $EDITOR wasn't set, or failed check, try likely editors if test x"$VK_EDITOR" = x ; then - AC_PATH_PROGS([VK_EDITOR], [emacs nedit]) + AC_PATH_PROGS([VK_EDITOR], [emacs nedit gvim kate]) if test x"$VK_EDITOR" = x ; then # Editor not found AC_MSG_WARN([No suitable editor found: may be configured at runtime.]) @@ -110,10 +114,17 @@ fi ]) -#if emacs|nedit: add 'replacement' flags for line +#Setup 'line' flag for known editors VK_ED_NAME=`echo $VK_EDITOR | sed "s/.*\///" | sed "s/-.*//"` -if test "$VK_ED_NAME" = "emacs" || test "$VK_ED_NAME" == "nedit"; then +if test "$VK_ED_NAME" == "emacs" || \ + test "$VK_ED_NAME" == "nedit" || \ + test "$VK_ED_NAME" == "gvim" || \ + test "$VK_ED_NAME" == "gview"; then VK_EDITOR="$VK_EDITOR +%n" +else + if test "$VK_ED_NAME" == "kate"; then + VK_EDITOR="$VK_EDITOR --line %n" + fi fi |