sistema_progs

Programas para customizar o meu entorno de traballo nos meus equipos persoais
Log | Files | Refs

def.sh (3450B)


      1 # -*- mode: sh; mode: sh-bash -*-
      2 
      3 # Constants (様々な箇所から使うので此処に置く)
      4 _ble_term_nl=$'\n'
      5 _ble_term_FS=$'\034'
      6 _ble_term_SOH=$'\001'
      7 _ble_term_DEL=$'\177'
      8 _ble_term_IFS=$' \t\n'
      9 _ble_term_CR=$'\r'
     10 _ble_term_space=$' \t' # WA #D2055
     11 
     12 function blehook/declare {
     13   local name=$1
     14   builtin eval "_ble_hook_h_$name=()"
     15   builtin eval "_ble_hook_c_$name=0"
     16 }
     17 
     18 # ble.pp
     19 
     20 blehook/declare EXIT
     21 blehook/declare INT
     22 # blehook/declare ERR # inactive
     23 # blehook/declare RETURN # inactive
     24 # blehook/declare DEBUG # inactive
     25 blehook/declare internal_EXIT
     26 blehook/declare internal_INT
     27 blehook/declare internal_ERR
     28 blehook/declare internal_RETURN
     29 blehook/declare internal_DEBUG
     30 blehook/declare unload
     31 blehook/declare ATTACH
     32 blehook/declare DETACH
     33 
     34 # util.sh
     35 
     36 blehook/declare term_DA1R
     37 blehook/declare term_DA2R
     38 blehook/declare idle_after_task
     39 
     40 # color.sh
     41 
     42 blehook/declare color_defface_load
     43 blehook/declare color_setface_load
     44 
     45 # history.sh
     46 
     47 blehook/declare ADDHISTORY
     48 blehook/declare history_reset_background
     49 blehook/declare history_leave
     50 blehook/declare history_change
     51 blehook/declare history_message
     52 
     53 # edit.sh
     54 
     55 blehook/declare WINCH
     56 blehook/declare internal_WINCH
     57 blehook/declare CHPWD
     58 blehook/declare PRECMD
     59 blehook/declare internal_PRECMD
     60 blehook/declare PREEXEC
     61 blehook/declare internal_PREEXEC
     62 blehook/declare POSTEXEC
     63 blehook/declare ERREXEC
     64 blehook/declare widget_bell
     65 blehook/declare textarea_render_defer
     66 blehook/declare info_reveal
     67 blehook/declare exec_register
     68 blehook/declare exec_end
     69 
     70 # deprecated function
     71 function ble-edit/prompt/print { ble/prompt/print "$@"; }
     72 function ble-edit/prompt/process-prompt-string { ble/prompt/process-prompt-string "$@"; }
     73 
     74 # keymap
     75 
     76 blehook/declare keymap_load
     77 blehook/declare keymap_vi_load
     78 blehook/declare keymap_emacs_load
     79 
     80 # core-syntax.sh
     81 
     82 blehook/declare syntax_load
     83 
     84 # core-complete.sh
     85 
     86 blehook/declare complete_load
     87 blehook/declare complete_insert
     88 
     89 #------------------------------------------------------------------------------
     90 
     91 # for compatibility:
     92 function blehook/.compatibility-ble-0.3 {
     93   blehook keymap_load!='ble/util/invoke-hook _ble_keymap_default_load_hook'
     94   blehook keymap_emacs_load!='ble/util/invoke-hook _ble_keymap_emacs_load_hook'
     95   blehook keymap_vi_load!='ble/util/invoke-hook _ble_keymap_vi_load_hook'
     96   blehook complete_load!='ble/util/invoke-hook _ble_complete_load_hook'
     97 }
     98 function blehook/.compatibility-ble-0.3/check {
     99   if ble/is-array _ble_keymap_default_load_hook ||
    100       ble/is-array _ble_keymap_vi_load_hook ||
    101       ble/is-array _ble_keymap_emacs_load_hook ||
    102       ble/is-array _ble_complete_load_hook
    103   then
    104     ble/bin/cat << EOF
    105 # [Change in ble-0.4.0]
    106 #
    107 # Please update your blerc settings for ble-0.4+.
    108 # In ble-0.4+, use the following form:
    109 # 
    110 #   blehook/eval-after-load keymap SHELL-COMMAND
    111 #   blehook/eval-after-load keymap_vi SHELL-COMMAND
    112 #   blehook/eval-after-load keymap_emacs SHELL-COMMAND
    113 #   blehook/eval-after-load complete SHELL-COMMAND
    114 # 
    115 # instead of the following older form:
    116 # 
    117 #   ble/array#push _ble_keymap_default_load_hook SHELL-COMMAND
    118 #   ble/array#push _ble_keymap_vi_load_hook SHELL-COMMAND
    119 #   ble/array#push _ble_keymap_emacs_load_hook SHELL-COMMAND
    120 #   ble/array#push _ble_complete_load_hook SHELL-COMMAND
    121 # 
    122 # Note: "blehook/eval-after-load" should be called
    123 #   after you defined SHELL-COMMAND.
    124 #
    125 EOF
    126   fi
    127 }
    128 
    129 # Deprecated names
    130 function ble/complete/action/inherit-from {
    131   ble/complete/action#inherit-from "$@"
    132 }