Skip to content

Commit c00ecef

Browse files
committed
install: add --with-editor configure option
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'.
1 parent 3b36ee5 commit c00ecef

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ sed -e 's|@prefix@|$(prefix)|g' \
314314
-e 's|@availterseoutput@|$(availterseoutput)|g' \
315315
-e 's|@listoutput@|$(listoutput)|g' \
316316
-e 's|@listterseoutput@|$(listterseoutput)|g' \
317+
-e 's|@editor@|$(editor)|g' \
317318
-e 's|@autohandling@|$(setautohandling)|g' \
318319
-e 's|@implicitrequirement@|$(setimplicitrequirement)|g' \
319320
-e 's|@availindepth@|$(setavailindepth)|g' \

Makefile.inc.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ availterseoutput := @availterseoutput@
135135
listoutput := @listoutput@
136136
listterseoutput := @listterseoutput@
137137

138+
# editor
139+
editor := @editor@
140+
138141
# command location
139142
TCLSH := @TCLSH@
140143
PYTHON := @PYTHON@

configure

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pageropts verbosity color darkbgcolors lightbgcolors termbg lockedconfigs \
3838
icase unloadmatchorder searchmatch modulepath loadedmodules quarantinevars \
3939
wa277 advversspec ml windowssupport nearlyforbiddendays implicitrequirement \
4040
tagabbrev tagcolorname mcookieversioncheck availoutput availterseoutput \
41-
listoutput listterseoutput"
41+
listoutput listterseoutput editor"
4242
compatarglist=
4343
libarglist=
4444

@@ -129,6 +129,7 @@ availoutput='modulepath:alias:dirwsym:sym:tag:key'
129129
availterseoutput='modulepath:alias:dirwsym:sym:tag'
130130
listoutput='header:idx:sym:tag:key'
131131
listterseoutput='header'
132+
editor='vi'
132133

133134
# git branch to use to build compat version
134135
compatbranch='c-3.2'
@@ -392,6 +393,8 @@ Optional Packages:
392393
output. elements accepted in LIST are: \`header',
393394
\`idx', \`sym', \`tag' and \`key' (elements in LIST
394395
are separated by \`:') [$listterseoutput]
396+
--with-editor=BIN name or full path of default editor program to use to
397+
edit modulefiles [$editor]
395398
--with-modulepath=PATHLIST
396399
default modulepaths to set in default configuration
397400
file to be enabled (each path in PATHLIST should
@@ -760,6 +763,8 @@ for arg in "$@"; do
760763
fi ;
761764
done ;
762765
IFS=$ORIG_IFS ;;
766+
--with-editor=*|--without-editor)
767+
editor=$(get_package_value "$arg") ;;
763768
--with-modulepath=*|--without-modulepath)
764769
modulepath=$(get_package_value "$arg") ;;
765770
--with-loadedmodules=*|--without-loadedmodules)

modulecmd.tcl.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ array set g_config_defs [list\
7777
colors {MODULES_COLORS {} 0 {} {} initConfColors}\
7878
csh_limit {{} 4000 0}\
7979
extra_siteconfig {MODULES_SITECONFIG <undef> 1 {}}\
80-
editor {MODULES_EDITOR {vi} 0 {} {} initConfEditor}\
80+
editor {MODULES_EDITOR {@editor@} 0 {} {} initConfEditor}\
8181
home {MODULESHOME @moduleshome@ 0}\
8282
icase {MODULES_ICASE @icase@ 0 {never search always}}\
8383
ignored_dirs {{} {CVS RCS SCCS .svn .git .SYNC .sos} 0}\

site.exp.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ set install_availterseoutput "@availterseoutput@"
9191
set install_listoutput "@listoutput@"
9292
set install_listterseoutput "@listterseoutput@"
9393

94+
set install_editor "@editor@"
95+
9496
# command location
9597
set install_tclsh "@TCLSH@"
9698
set install_python "@PYTHON@"

0 commit comments

Comments
 (0)