;OCL{{{}}} ;OCL{{{ notes @if-using (FOO) @if-using not(FOO) Modifying this Binding ********************** ;OCL{{{ bindings You can add new commands simply by including this binding in your file: ;OCL{{{ your binding file ;OCL{{{F modeori.keys ;OCL:::F modeori.keys ;OCL}}} ;OCL{{{ your additional macros :-) ;OCL}}} ;OCL{{{ your additional bindings ;OCL}}} ;OCL}}} Or you can use completely different bindings (but the same functions!): ;OCL{{{ your binding file @use ( ALIEN-KEYTABLES ) ;OCL{{{F modeori.keys ;OCL:::F modeori.keys ;OCL}}} ;OCL}}} ;OCL{{{ your keytable file, named modeori.ktb @if-using ( ALIASES ) ;OCL{{{ definition of your aliases! ;OCL}}} @fi @if-using ( ABORT-KEY ) ;OCL{{{ definition of your abort key ;OCL}}} @fi @if-using ( PARA-MODE ) ;OCL{{{ definition of your bindings in prompts ;OCL}}} @fi @if-using ( MOVE-INDENT ) ;OCL{{{ definition of your bindings for shifting regions in move mode ;OCL}}} @fi @if-using ( EDIT-MODE ) ;OCL{{{ definition of your bindings for editing ;OCL}}} @fi @if-using ( MOVE-MODE ) ;OCL{{{ definition of your bindings for move mode ;OCL}}} @fi @if-using ( BUFFER-MOVE-MODE ) ;OCL{{{ definition of your bindings for buffer move mode ;OCL}}} @fi @if-using ( SHELL-MODES ) ;OCL{{{ define the tables for the shell ;OCL}}} @fi ;OCL}}} ;OCL}}} ;OCL{{{ alien mode hooks If the tag ALIEN-HOOKS is set, the following functions have to be defined. They will be executed in front of the following hooks. They hace to use return-value-from-macro with value <>0, if the default hook should not be executed. alien-begin-prompt-macro alien-end-prompt-macro alien-read-newfile-macro alien-change-buffer-macro alien-abort-macro alien-view-macro alien-key-not-bound-macro ;OCL}}} ;OCL{{{ C extensions The semantic of { and ; in for C and PASCALL can be changed by adding the following befor you include modeori.keys: @use (MY-L-SEMICOLON) ( deffun my-l-semicolon ( ... ) ) @use (MY-C-CB) ( deffun my-c-cb ( ... ) ) @use (MY-P-CB) ( deffun my-p-cb ( ... ) ) ...F modeori.keys ;OCL}}} ;OCL{{{ switches Defining the tag NO-STANDARDS gives you the possibility to define your own set of used tags. @use (NO-STANDARDS) @use ( 'your tags' ) ...F modeori.keys ;OCL}}} ;OCL{{{ new file macro The new-file macro can do an additionbal macro-call, if you define the macro add-new-file and set the ocl-tag ADD-NEWFILE ;OCL}}} @fi @fi @rc-comment origami bindings modeori 1.93, W. Stumvoll ;OCL}}} ;OCL{{{ useful @use ; ; using -U NO-STANDARDS overwrites the following section ; ; using -U BASE compiles this bindings with the default keybindings , control ; commands and simulted function keys. ; @if-using not(NO-STANDARDS) ;OCL{{{ choose features @use ( W-GET-X-SEL ; enable compilation of get-selection L-EXT ; enable some folding-language-dependent extensions ; occam,c and pascal: { ( [ ; and tab-stops ; NO-HELP-BROWSER ; don't support the menu driven info-viewer SHELL-MODE ; prepare the compilation of an additional shell-/filemanager-.. mode GAMES ; compile towers-of-hanoi .. ) ;OCL}}} ;OCL{{{ choose terminals @if-using not(BASE) @use ( sun ; enable compilation of sun-specific terminal-keys SUNEDT ; enable the compilation of sun specific edt simulation linux ; enable compilation of linux-specific terminal-keys ; uses the keypad in a sun like way linuxEDT ; enable the compilation of the EDT simualtion for linux consoles ; it can be accessed by using TERM/ORIGAMITERM==con80x25EDT xterm ; enable the compilation of xterm-keymap amiga ; compile the amiga keytables, for $TERM=amiga ; AMIGA ; enable the compilation of amiga keybindings. ; The amiga bindings will be the default binding and the ; other terminals won't be used. ) @fi @if-using ( BASE ) @use not( sun xterm AMIGA SUNEDT amiga ) @fi ;OCL}}} ;OCL{{{ AMIGA overwrites @if-using (AMIGA) @use not( sun xterm SUNEDT linux linuxEDT SHELL-MODE amiga ) @fi ;OCL}}} @fi ;OCL}}} ;OCL{{{ cmd and shell-mode default values @if-using not( EXTERNAL-CMD-MACS ) ;OCL{{{ cmd-separator ( defmac cmd-separator ( "; ) ) ;OCL}}} ;OCL{{{ cd-cmd ( defmac cd-cmd ( "cd ) ) ;OCL}}} ;OCL{{{ make-cmd ( defmac get-make-cmd-var ( getenv "MAKE_CMD ) ) ( defmac make-cmd-def ( "make ) ) ;OCL}}} ;OCL{{{ spell-cmd ( defmac get-spell-cmd-var ( getenv "SPELL_CMD ) ) @use ( NEW-DEF-SPELL ) ( defmac default-spell-command ( "spell ) ) ;OCL}}} ;OCL{{{ mail-cmd ( defmac mail-cmd-def ( "mail ) ) ( defmac get-mail-cmd-var ( getenv "MAIL_CMD ) ) ;OCL}}} @if-using ( SHELL-MODE ) ;OCL{{{ cp-cmd ( defmac cp-cmd ( "/bin/cp ) ) ;OCL}}} ;OCL{{{ mv-vmd ( defmac mv-cmd ( "/bin/mv ) ) ;OCL}}} ;OCL{{{ rm-cmd ( defmac rm-cmd ( "/bin/rm " "-f ) ) ;OCL}}} ;OCL{{{ nn-cmd ( defmac get-nn-cmd-var ( getenv "NN_CMD ) ) ( defmac nn-cmd-def ( "nn ) ) ;OCL}}} ;OCL{{{ edit-cmd ( defmac get-edit-cmd-var ( getenv "EDIT_CMD ) ) ;OCL}}} ;OCL{{{ browser-file ( defmac default-browser-file ( "~/.oriinfo ) ) ;OCL}}} ;OCL{{{ menu-file ( defmac default-menu-file ( "~ ) ) ;OCL}}} ;OCL{{{ edit-file ( defmac default-edit-file ( "/dev/null ) ) ;OCL}}} @fi @fi ;OCL}}} ;OCL{{{ marktypes ;OCL{{{ pascal (defmark pascal ( ("< "< "<) (". ". ".) (": ": ":) ("> "> ">) ) ) ;OCL}}} ;OCL{{{ script (defmark script ( ("# "# "@) (". ". ".) ("# "# ":) ("# "# "$) ) ) ;OCL}}} ;OCL}}} ;OCL{{{ name of the bindings and its options ( defbinding ModeOri ( "noshell ">15=0 ) ( "shell ">15=1 ) ( "xshell ">15=-1 ) ( "nold ">0|8192 ) ( "ld ">0|8192^8192 ) ( "center ">0|4096 ) ( "nocenter ">0|4096^4096 ) ( "notime ">0|2048 ) ( "time ">0|2048^2048 ) ( "nooverstrike ">0|1024 ) ( "noal ">0|512 ) ( "al ">0|512^512 ) ( "nofull ">0|256 ) ( "full ">0|256^256 ) ( "noai ">0|128 ) ( "ai ">0|128^128 ) ( "nomagic ">0|96 ) ( "magic ">0|96^32 ) ( "xmagic ">0|96^96 ) ( "nohigh ">0|16 ) ( "high ">0|16^16 ) ( "nopos ">0|8 ) ( "pos ">0|8^8 ) ( "bs ">0|4 ) ( "nobs ">0|4^4 ) ( "noext ">0|2 ) ( "ext ">0|2^2 ) ( "nostat ">0|1 ) ( "stat ">0|1^1 ) ( "default ">0=0 ) ( "slow ">0=10616 ) ; == ( "slow ">0=0|16|8|96|256|2048|8192 ) ; use: nohigh nopos nofull notime nomagic nold ( "tags ">1+1>2<1@ ) ( "gotags ">1+1>3<1@ ) ( "spell ">1+1>4<1@ ) ( "make ">1+1>5<1@ ) ( "mail ">1+1>6<1@ ) ( "nn ">1+1>7<1@ ) ) ( mode-limiter " ) ( line-limiter "< ) ( shift-mark "> ) ;OCL}}} ;OCL{{{ multiple mode stuff (declaration and Modestrings) ;OCL{{{ kbd-tables ( defmodes ( edit ; editing moves ; mark regions for modified actions buffer-move ; vary buffers para ; dummy for prompts mv-indent ; special table for indent region @if-using ( SHELL-MODE ) I-Main-Menu ; Main-menu keys I-File-Menu ; file handling keys, selecting is allowed too I-Browser ; Show info mode @fi ) ) ;OCL}}} ;OCL{{{ modestrings @if-using ( SHELL-MODE ) ( defmodestring I-ENT "Sublevel: "Sub: ) ( defmodestring I-XS-FILE "<=Shell=File=> "<=Shell=File=> ) ( defmodestring I-XS-BROWSE "<=Shell=Browse=> "<=Shell=Browse=> ) ( defmodestring I-XS-EDIT "<=Shell=Edit=> "<=Shell=Edit=> ) ( defmodestring I-XS-MAIN "<=Shell=> "<=Shell=> ) @fi @if-using ( SUNEDT ) ( defmodestring EDT-TAG "EDT "EDT ) @fi ( defmodestring ED "Edit "E ) ( defmodestring MV "Move "M ) ( defmodestring NOEX "Raw "R ) @if-using (L-EXT) ( defmodestring LEXT "Ext "X ) @fi ( defmodestring STEP "% "% ) ( defmodestring AI "> "> ) ( defmodestring SH "ShiftRegion "ShiftRegion ) ( defmodestring BM "BufferCmd "BufferCmd ) ( defmodestring BC "BufferChg "BufferChg ) ( defmodestring BZ "BufferSize "BufferSize ) ( defmodestring BN "BufferNew "BufferNew ) ( defmodestring FM "FileCommand "FileCommand ) ( defmodestring TM "ToggleModes "ToggleModes ) ( defmodestring PM "SetParameter "SetParameter ) ( defmodestring BS "BuSa "B ) @if-using ( SUNEDT ) ( defmodestring EDT-backup "<- "< ) @fi ;OCL}}} ;OCL{{{ overload prefix ( overload-prefix ( m-m- ; move-mode variants e-m- ; edit-mode variants b-m- ; buffer-handling variants mori- ; modeori variants raw- ; for deletings @if-using ( SHELL-MODE ) I- ; ModeOriShell @fi @if-using ( SUNEDT ) EDT- @fi ) ) ;OCL}}} ;OCL}}} ;OCL{{{ character-classes ( defset word-char-text ( alpha digit ) ) ( defset word-char-coding ( alpha digit "_ ) ) ( defset word-char-ocl ( alpha digit "_ "- ) ) ( defset word-char ( word-char-text ) ) ;OCL}}} @lib modeori-fun/functions @lib modeori-fun/spec-fun @lib modeori-fun/bindings ;OCL{{{ some unneeded macros, towers.. @if-using ( GAMES ) ( demand-load ( ;OCL{{{ towers of hanoy @lib towers ( mode edit ( keybind tower-display ( $esc "t "o "1 ) ) ( keybind towers-of-hanoi ( $esc "t "o "2 ) ) ) ;OCL}}} ;OCL{{{ sokoban ;OCL{{{ define the game ( defmac SOKOBAN-RESET-KBD ( edit ) ) @lib sokoban ;OCL{{{ redefine the game, handling prompting,shift and position ( deffun mori-sokoban ( add-mode-full-shift set prompting true if show-position ( delete-mode-position sokoban add-mode-position ) else ( sokoban ) fi set prompting false if not(full-shifting) ( delete-mode-full-shift ) fi ) ) ;OCL}}} ;OCL{{{ abort-hook-add @if-using not(ABORT-HOOK-ADD) @use (ABORT-HOOK-ADD) ( defmac abort-hook-add ( ) ) @fi ( defmac abort-hook-add-saved ( abort-hook-add ) ) ( undeclare ( abort-hook-add ) ) ( defmac abort-hook-add ( abort-hook-add-saved if not(full-shifting) ( delete-mode-full-shift ) fi ) ) ( undeclare ( abort-hook-add-saved ) ) ;OCL}}} ;OCL}}} ;OCL{{{ bind it ( mode edit ( keybind mori-sokoban ( $esc "s "o ) ) ) ;OCL}}} ;OCL{{{ bind the cursor keys to the game @if-using not( ALIEN-KEYS ) ( mode sokoban-kbd @if-using ( cursor-key ) ;OCL{{{ cursor-maps ( terminal ( @use ( use-cursor-key ) @lib modeori-fun/terms @use not( use-cursor-key ) ) ( keybind soko-go-or-push-left ( $left ) ) ( keybind soko-go-or-push-right ( $right ) ) ( keybind soko-go-or-push-down ( $down ) ) ( keybind soko-go-or-push-up ( $up ) ) ) ;OCL}}} @fi @if-using ( r-key ) ;OCL{{{ SUN-terminal R-keys ( terminal ( @use( use-r-key ) @lib modeori-fun/terms @use not( use-r-key ) ) ( keybind soko-go-or-push-left ( $R10 ) ) ( keybind soko-go-or-push-right ( $R12 ) ) ( keybind soko-go-or-push-up ( $R8 ) ) ( keybind soko-go-or-push-down ( $R14 ) ) ) ;OCL}}} @fi ;OCL{{{ some control keys (wordstar like?) ( keybind soko-go-or-push-left ( C-S ) ) ( keybind soko-go-or-push-right ( C-D ) ) ( keybind soko-go-or-push-up ( C-E ) ) ( keybind soko-go-or-push-down ( C-X ) ) @if-using ( ctrl-h-key ) ;OCL{{{ ctrl-h ( terminal ( @use ( use-ctrl-h-key ) @lib modeori-fun/terms @use not( use-ctrl-h-key ) ) ) ;OCL}}} @fi ;OCL}}} @if-using ( edt-key ) ;OCL{{{ some keypad simualtion bindings for edt ( terminal ( @use ( use-edt-key ) @lib modeori-fun/terms @use not( use-edt-key ) ) ) ;OCL}}} @fi ) @fi ;OCL}}} ;OCL}}} ) ) @fi ;OCL}}} ;OCL{{{ now define unloading all demand stuff ( deffun lib-abort-hooks ( @if-using ( ABORT-HOOK-ADD ) abort-hook-add @fi ) ) ;OCL}}} @lib modeori-fun/references