6
6
#
7
7
8
8
register_hooks <- function () {
9
- rebind(" utils" , " View" , .ps.view_data_frame , namespace = TRUE )
10
- rebind(" base" , " debug" , new_ark_debug(base :: debug ), namespace = TRUE )
11
- rebind(" base" , " debugonce" , new_ark_debug(base :: debugonce ), namespace = TRUE )
9
+ rebind(
10
+ " utils" ,
11
+ " View" ,
12
+ .ps.view_data_frame ,
13
+ namespace = TRUE
14
+ )
15
+ rebind(
16
+ " base" ,
17
+ " debug" ,
18
+ new_ark_debug(base :: debug ),
19
+ namespace = TRUE
20
+ )
21
+ rebind(
22
+ " base" ,
23
+ " debugonce" ,
24
+ new_ark_debug(base :: debugonce ),
25
+ namespace = TRUE
26
+ )
27
+ rebind(
28
+ " base" ,
29
+ " browser" ,
30
+ new_ark_browser(base :: browser ),
31
+ namespace = TRUE
32
+ )
12
33
register_getHook_hook()
13
34
}
14
35
@@ -24,7 +45,7 @@ rebind <- function(pkg, name, value, namespace = FALSE) {
24
45
pkg = pkg ,
25
46
name = name ,
26
47
value = value
27
- )
48
+ )
28
49
}
29
50
}
30
51
@@ -42,7 +63,11 @@ pkg_bind <- function(pkg, name, value) {
42
63
env <- as.environment(env )
43
64
44
65
if (! exists(name , envir = env , mode = " function" , inherits = FALSE )) {
45
- msg <- sprintf(" Can't register hook: function `%s::%s` not found." , pkg , name )
66
+ msg <- sprintf(
67
+ " Can't register hook: function `%s::%s` not found." ,
68
+ pkg ,
69
+ name
70
+ )
46
71
stop(msg , call. = FALSE )
47
72
}
48
73
@@ -70,7 +95,12 @@ register_getHook_hook <- function() {
70
95
local_unlock_binding(ns , " getHook" )
71
96
72
97
ns [[" getHook" ]] <- function (hookName , ... ) {
73
- hooks <- get0(hookName , envir = .userHooksEnv , inherits = FALSE , ifnotfound = list ())
98
+ hooks <- get0(
99
+ hookName ,
100
+ envir = .userHooksEnv ,
101
+ inherits = FALSE ,
102
+ ifnotfound = list ()
103
+ )
74
104
75
105
if (! grepl(" ^UserHook::.*::onLoad$" , hookName )) {
76
106
return (hooks )
0 commit comments