Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed who_calls/R13 bug

  • Loading branch information...
commit ad6f168ba41c2333ebb1aeda6ebea4e44f6f8020 1 parent c6ed391
@massemanet authored
Showing with 14 additions and 5 deletions.
  1. +5 −2 elisp/erl-service.el
  2. +9 −3 src/distel.erl
View
7 elisp/erl-service.el
@@ -1247,7 +1247,9 @@ The match positions are erl-mfa-regexp-{module,function,arity}-match.")
(list (intern mod) (intern fun) arity))
(message "Request sent..")
(erl-receive ()
- ((['rex calls]
+ ((['rex ['error reason]]
+ (message "Error: %s" reason))
+ (['rex calls]
(with-current-buffer (get-buffer-create "*Erlang Calls*")
(erl-who-calls-mode)
(setq buffer-read-only t)
@@ -1266,7 +1268,8 @@ The match positions are erl-mfa-regexp-{module,function,arity}-match.")
(delete-char 1))
(goto-char (point-min))
(message "")
- (pop-to-buffer (current-buffer))))))))
+ (pop-to-buffer (current-buffer))))
+ ))))
(define-derived-mode erl-who-calls-mode fundamental-mode
"who-calls"
View
12 src/distel.erl
@@ -72,6 +72,9 @@ gl_proxy(GL) ->
{io_request, From, ReplyAs, {put_chars, M, F, A}} ->
GL ! {put_chars, flatten(apply(M, F, A))},
From ! {io_reply, ReplyAs, ok};
+ {io_request, From, ReplyAs, {put_chars,unicode,M,F,A}} ->
+ GL ! {put_chars, flatten(apply(M, F, A))},
+ From ! {io_reply, ReplyAs, ok};
{io_request, From, ReplyAs, {get_until, _, _, _}} ->
%% Input not supported, yet
From ! {io_reply, ReplyAs, eof}
@@ -1036,9 +1039,12 @@ xref_callgraph(A) ->
%% Ret: [{M,F,A,Line}], M = F = list()
who_calls(Mm, Fm, Am) ->
- XREF=xref_callgraph({Mm,Fm,Am}),
- {ok, Calls} = xref_query(XREF),
- append([[xform(M,F,A,L) || L <- Ls] || {{{{M,F,A},_},_}, Ls} <- Calls]).
+ try XREF=xref_callgraph({Mm,Fm,Am}),
+ {ok, Calls} = xref_query(XREF),
+ append([[xform(M,F,A,L) || L <- Ls] || {{{{M,F,A},_},_}, Ls} <- Calls])
+ catch _:_ ->
+ {error,not_found}
+ end.
xform(M, F, A, L) ->
{to_list(M),to_list(F),A,L}.
Please sign in to comment.
Something went wrong with that request. Please try again.