Skip to content

Commit

Permalink
install: add --with-editor configure option
Browse files Browse the repository at this point in the history
Introduce the --with-editor configure option to choose at installation
time the default editor command to use to interactively edit
modulefiles. Default editor is 'vi'.
  • Loading branch information
xdelaruelle committed Apr 24, 2021
1 parent 3b36ee5 commit c00ecef
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -314,6 +314,7 @@ sed -e 's|@prefix@|$(prefix)|g' \
-e 's|@availterseoutput@|$(availterseoutput)|g' \
-e 's|@listoutput@|$(listoutput)|g' \
-e 's|@listterseoutput@|$(listterseoutput)|g' \
-e 's|@editor@|$(editor)|g' \
-e 's|@autohandling@|$(setautohandling)|g' \
-e 's|@implicitrequirement@|$(setimplicitrequirement)|g' \
-e 's|@availindepth@|$(setavailindepth)|g' \
Expand Down
3 changes: 3 additions & 0 deletions Makefile.inc.in
Expand Up @@ -135,6 +135,9 @@ availterseoutput := @availterseoutput@
listoutput := @listoutput@
listterseoutput := @listterseoutput@

# editor
editor := @editor@

# command location
TCLSH := @TCLSH@
PYTHON := @PYTHON@
Expand Down
7 changes: 6 additions & 1 deletion configure
Expand Up @@ -38,7 +38,7 @@ pageropts verbosity color darkbgcolors lightbgcolors termbg lockedconfigs \
icase unloadmatchorder searchmatch modulepath loadedmodules quarantinevars \
wa277 advversspec ml windowssupport nearlyforbiddendays implicitrequirement \
tagabbrev tagcolorname mcookieversioncheck availoutput availterseoutput \
listoutput listterseoutput"
listoutput listterseoutput editor"
compatarglist=
libarglist=

Expand Down Expand Up @@ -129,6 +129,7 @@ availoutput='modulepath:alias:dirwsym:sym:tag:key'
availterseoutput='modulepath:alias:dirwsym:sym:tag'
listoutput='header:idx:sym:tag:key'
listterseoutput='header'
editor='vi'

# git branch to use to build compat version
compatbranch='c-3.2'
Expand Down Expand Up @@ -392,6 +393,8 @@ Optional Packages:
output. elements accepted in LIST are: \`header',
\`idx', \`sym', \`tag' and \`key' (elements in LIST
are separated by \`:') [$listterseoutput]
--with-editor=BIN name or full path of default editor program to use to
edit modulefiles [$editor]
--with-modulepath=PATHLIST
default modulepaths to set in default configuration
file to be enabled (each path in PATHLIST should
Expand Down Expand Up @@ -760,6 +763,8 @@ for arg in "$@"; do
fi ;
done ;
IFS=$ORIG_IFS ;;
--with-editor=*|--without-editor)
editor=$(get_package_value "$arg") ;;
--with-modulepath=*|--without-modulepath)
modulepath=$(get_package_value "$arg") ;;
--with-loadedmodules=*|--without-loadedmodules)
Expand Down
2 changes: 1 addition & 1 deletion modulecmd.tcl.in
Expand Up @@ -77,7 +77,7 @@ array set g_config_defs [list\
colors {MODULES_COLORS {} 0 {} {} initConfColors}\
csh_limit {{} 4000 0}\
extra_siteconfig {MODULES_SITECONFIG <undef> 1 {}}\
editor {MODULES_EDITOR {vi} 0 {} {} initConfEditor}\
editor {MODULES_EDITOR {@editor@} 0 {} {} initConfEditor}\
home {MODULESHOME @moduleshome@ 0}\
icase {MODULES_ICASE @icase@ 0 {never search always}}\
ignored_dirs {{} {CVS RCS SCCS .svn .git .SYNC .sos} 0}\
Expand Down
2 changes: 2 additions & 0 deletions site.exp.in
Expand Up @@ -91,6 +91,8 @@ set install_availterseoutput "@availterseoutput@"
set install_listoutput "@listoutput@"
set install_listterseoutput "@listterseoutput@"

set install_editor "@editor@"

# command location
set install_tclsh "@TCLSH@"
set install_python "@PYTHON@"

0 comments on commit c00ecef

Please sign in to comment.