# This standard system-wide initialization file provides various
# reasonable defaults. However, it is probably best seen as a starting
# point, with examples of interesting possibilities, from which
# sysadmins can hack their own versions.

pushlibd

# This macro deletes the line containing the cursor.
# It is used in several of the jove.rc.TERM files and  is intended
# for binding to the delete-line key on terminals which have it.
# It is placed in the kill ring for subsequent yanking.
define-macro kill-line ^[xbeginning-of-line^M^[xset-mark^M^[xnext-line^M^[xkill-region^M^[xpop-mark^M

# Set fill mode when Jove is fired up automatically by certain
# mail/news readers.
1 auto-execute-command auto-fill-mode /tmp/\{Re\|article\|rnmail\|pn\}

# The following is if you prefer fill-mode to be on for all
# files except the ones you want it off for (but on the other hand it could
# be argued that defaults in editors should be the "least surprising"
# alternative).

# Sets auto-fill-mode for every file and then turns it off as required.
# 1 auto-execute-command auto-fill-mode .*
# 0 auto-execute-command auto-fill-mode .*\.[lcChyfp]$\|.*\.lisp$\|.*\.scm$\|.*\.c++$

# set various language modes.
1 auto-execute-command c-mode .*\.[cChy]$\|.*\.c++$
1 auto-execute-command lisp-mode .*\.l$\|.*\.lisp$\|.*\.scm$
# all the languages need show-match-mode.
1 auto-execute-command show-match-mode .*\.[lcChyfp]$\|.*\.lisp$\|.*\.scm$\|.*\.c++$

# if you have job control, this puts Jove out of the way temporarily.
bind-to-key pause-jove ^[S
bind-to-key pause-jove ^[s

# This is for the shell window. Supports sh, csh and ksh.
set process-prompt ^[^%$#]*[%$#] 

# The following apply to shell windows. Note the use of ^C^C, ^C^D etc.,
# thus leaving ^D available for delete-next-character.
# This conforms to current emacs usage.
process-bind-to-key interrupt-process ^C^C
process-bind-to-key eof-process ^C^D
process-bind-to-key quit-process ^C^\
process-bind-to-key stop-process ^C^Z
process-bind-to-key dstop-process ^C^Y

# This makes the arrow keys work on most terminals.
bind-to-key previous-line ^[[A
bind-to-key next-line ^[[B
bind-to-key forward-character ^[[C
bind-to-key backward-character ^[[D
bind-to-key previous-line ^[OA
bind-to-key next-line ^[OB
bind-to-key forward-character ^[OC
bind-to-key backward-character ^[OD

# An alternative modeline with better usage of the space.
set mode-line %[Jove%]%w%w%c(%M)%3c[%b:%n]%2c"%f"%c%i# %m*-%2c%p%2s%(%d%e(%t)%)

# Modern terminals do not need ^S/^Q for flow control.
# The exceptions (e.g. vt100) should turn it off again in jove.rc.TERM.
set allow-^S-and-^Q on

# Ancient UNIXes can mess up the screen with biff when mail arrives.
# It does no harm to turn this on anyway.
set disable-biff on

# This causes the previous file version to remain as '#filename~'.
# set make-backup-files on

# source any TERMinal-specific rc file
1 source jove.rc.$TERM

# source local custom rc file, if present
1 source jove-local.rc

popd
