Fossil Wrapper

Check-in [6839e8de1e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Reference the caller's namespace when defining interceptors (close [caeb6df696]).
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6839e8de1e53400ba79a0c4ee6b83e850c10d7c9
User & Date: marc 2012-12-29 13:37:10
Context
2013-01-17
04:43
Personal branch with personal .fslrc tracked. check-in: 9cd347caaa user: michael tags: ttmrichter
2013-01-08
14:06
Simplify the prompt regexp (no need to escape '?' inside a disjunction). check-in: 4038632842 user: marc tags: trunk
2013-01-01
23:48
merged from trunk. check-in: 38deb932f7 user: j tags: dresden
2012-12-29
13:37
Reference the caller's namespace when defining interceptors (close [caeb6df696]). check-in: 6839e8de1e user: marc tags: trunk
13:30
Allow user-defined interceptors to make multiple calls to Fossil via a 'fossil' proc. check-in: 9153a23747 user: marc tags: trunk
13:07
Reference the caller's namespace when defining interceptors (fixes [caeb6df696]). Closed-Leaf check-in: 326a7576f0 user: marc tags: interceptor-ns-fix
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to fsl.

139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# - If an interceptor returns an empty list, the wrapper is expected
#   to exit without calling Fossil, thereby fully intercepting the
#   query. Otherwise, it acts as a pre-processor: the returned list is
#   treated as a revised parameter list and will be supplied to
#   `fossil'.

proc interceptor {command_spec body} {
    set fn [list {params} $body]
    foreach command [triggers_for $command_spec] {
        dict set config::commands $command $fn
    }
}

proc intercept {params} {
    set command [first $params]







|







139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# - If an interceptor returns an empty list, the wrapper is expected
#   to exit without calling Fossil, thereby fully intercepting the
#   query. Otherwise, it acts as a pre-processor: the returned list is
#   treated as a revised parameter list and will be supplied to
#   `fossil'.

proc interceptor {command_spec body} {
    set fn [list {params} $body [uplevel 1 {namespace current}]]
    foreach command [triggers_for $command_spec] {
        dict set config::commands $command $fn
    }
}

proc intercept {params} {
    set command [first $params]