###
### Michael McInerny's (mcinerny@andrew.cmu.edu) ATK initialization file
###

##
## The Media Menu
##
# A handy menu which allows one to insert nifty multi-media objects at the touch of the mouse
# into a text object.  Note that it does not handle insertion into table, etc...
#
# Commonly used items first
#
addmenu textview-insert-inset-here "Media,Equation~1" textview textview noinherit "eq"
addmenu textview-insert-inset-here "Media,Header/Footer~2" textview textview noinherit "header"
addmenu textview-insert-inset-here "Media,PostScript~3" textview textview noinherit "ps"
addmenu textview-insert-inset-here "Media,Raster~4" textview textview noinherit "raster"
addmenu textview-insert-inset-here "Media,Spreadsheet~5" textview textview noinherit "table"
# 
# Less commonly used items next
#
addmenu textview-insert-inset-here "Media,Animation~10" textview textview noinherit "fad"
addmenu textview-insert-inset-here "Media,Hyperlink~11" textview textview noinherit "link"
addmenu textview-insert-inset-here "Media,Layout~12" textview textview noinherit "layout"
addmenu textview-insert-inset-here "Media,Note~13" textview textview noinherit "note"
addmenu textview-insert-inset-here "Media,Voice~14" textview textview noinherit "tape"
addmenu textview-insert-inset-here "Media,Writestamp~15" textview textview noinherit "writestamp"
#
# Finally, a menu-equivalent to Meta-Tab
#
addmenu textview-insert-inset-here "Media,By name ...~99" textview textview noinherit

##
## Differentiate the two typescript clears.
##
# I want the regular clear to leave my command history intact, so that I can still use
# the M-= search facilities after a clear (but not a clear all).
#
addmenu typescript-Clear "Clear All~52" typescript
addmenu typescript-Clear-Text "Clear~51" typescript
#
# ... and here's the command completion bindings (really belongs in a .typescriptinit... )
#
addkey fcomp-complete-command-backward \e= typescript fcomp inherit
addkey fcomp-complete-command-forward \e` typescript fcomp inherit
#
# more filename completion stuff
#
addkey fcomp-complete-filename ^I typescript fcomp inherit
addkey fcomp-possible-completions \e? typescript fcomp inherit
addkey frameview-complete ^I frameview

##
## Foreign Language Support
##
# I want to be able to type certain foreign language characters easily.
# These are the bindings I prefer (e.g. M-' e for e-accent-acute).
#
addkey compchar-acuteaccent \e'e textview compchar inherit "e"
addkey compchar-graveaccent \e`e textview compchar inherit "e"
addkey compchar-umlaut \e:e textview compchar inherit "e"
addkey compchar-acuteaccent \e'a textview compchar inherit "a"
addkey compchar-graveaccent \e`a textview compchar inherit "a"
addkey compchar-umlaut \e:a textview compchar inherit "a"

##
## Gnu-Emacs-like incremental search
##
addkey gsearch-forward ^S textview
addkey gsearch-backward ^R textview
#
# Here's another search package some people use
#
# addkey dynsearch-search-forward ^S view
# addkey dynsearch-search-reverse ^R view


##
## Experimental Alexandria Directory Browser binding
##
addkey browsecmd-visit-file ^Xv frame

##
## Capitalization and UPCASE facilities
##
addkey textview-capitalize-word \ec
addkey textview-uppercase-word \eu

##
## Filter text through a Unix command (ATK->Unix pipes)
##
addkey filter-filter-region ^X| textview filter inherit
addkey filter-filter-region-formatted ^XF textview filter inherit
addkey filter-sink-region ^X> textview filter inherit
#
# ROT13 (for posting offensive material)
#
addkey filter-filter-region-thru-command ^X9 textview filter inherit "tr N-ZA-Mn-za-m A-Za-z"

##
## Ness execute statement
##
# commented out because I hit it accidentally far too often.... :-(
# addkey ness-dostmt \e\e view

##
## Raster keybinding
##
# these make raster a little more livable
#
addkey raster-center-image c rasterview
addkey raster-select-entire a rasterview
addkey raster-uncrop u rasterview
addkey raster-upperleft-image l rasterview

##
## More text conviences
##
# Back/Forwards by a paragraph (M-C-b/M-C-f)
#
addkey textview-backward-para \e^B
addkey textview-forward-para \e^F
#
# Kill whitespace (C-\)
#
addkey textview-kill-white-space ^\\ textview
#
# Expose/Hide styles (M-C-s)
#
addkey textview-toggle-expose-styles \e^S

##
## Describe key
##
# commented out because I hit them accidentally too often
#addkey deskey-describe-key \e? im
#addkey deskey-describe-bound-procs ^XP im
#addkey deskey-describe-bound-keys ^XK im
#addkey deskey-describe-proctable \e- im

##
## Window navigation/management commands:
##
addkey frame-next-window ^Xn
addkey frame-previous-window ^Xp
addkey frame-hide-window ^X^H
addkey frame-expose-window ^X^U
addkey frame-single-window ^X1 frame


##
## American Heritage Dictionary
##
# The following code adds an item to my Search/Spell  menu card allowing me to
# call up the definition of marked words.
#
# load ness
# call ness-load /afs/andrew.cmu.edu/itc/src/projects/alexandria/american_heritage/pieces/dict.n

# end of mcinerny's .atkinit file

# addmenu balloonogram-test "Balloon-o-gram,Test~1" view
# addmenu balloonogram-test "Balloon-o-gram,Test 2~2" textview balloonogram noinherit "Hi Mom!"
# addmenu balloonogram-test "Balloon-o-gram,Test 3~3" view balloonogram
