Git Product home page Git Product logo

distel's Introduction

distel -- Distributed Emacs Lisp for Erlang.
------------------------------------------------------------

Distel is a library for Emacs<->Erlang communication, plus a suite of
tools built on top of it, such as a debugger front-end. It works by
using the Erlang distribution protocol to connect Emacs with regular
Erlang nodes, turning it into a very convenient user-interface
toolkit.

After the INSTALL procedure, you will have an extended Erlang mode any
time you edit erlang files. You can see that this is enabled from the
mode-line string "Erlang EXT", instead of just "Erlang". To see the
available commands, use `describe-mode' (C-h m), which describes all
the currently activated modes. Near the bottom of its output you will
find this description:

  Extensions to erlang-mode for communicating with a running Erlang node.

These commands generally communicate with an Erlang node. The first
time you use one, you will be prompted for the name of the node to
use.

Here's a subset of the available commands. Use `describe-mode' (C-h m)
on any Distel buffer when you want to know what commands are
available.

C-c C-d n - set the erlang node name
C-c C-d g - upload the distel modules to the erlang node

M-/       - Complete a module or remote function name.
M-.       - Jump from a function call to its definition.
M-,       - Jump back from a function definition (multi-level).
C-c C-d : - Evaluate an erlang expression from the minibuffer.
C-c C-d f - Refactor expressions in the region as a new function.
C-c C-d F - Find a module.
C-c C-d i - Toggle debug interpretping of the module.
C-c C-d b - Toggle a debugger breakpoint at the current line.
C-c C-d p - Profile (with fprof) an expression from the minibuffer.
C-c C-d L - Reload an Erlang module.
C-c C-d r - Reload all Erlang modules that are out of date.
C-c C-d w - Who calls function under point.
C-c C-d H - Show the html documentation for a function.
C-c C-d Z - Show the signature for a function.

To get more information about a particular command, use "C-h k"
followed by the command's key sequence. For general information about
Emacs' online help, use "C-h ?".

If you want to write new commands of your own, the programmer's manual
tells you how. You can make a postscript copy with "make postscript",
or an Info version with "make info" and "make info_install".

For more background about the "Session" commands, have a look in
README.ie-session.

Hope you enjoy, and please send hacks or feedback to [email protected](*)!

PS: The "dynamic TAGS" with M-. and M-, is the coolest bit to get
started with!

Compatibility notes:

  The profiler front end requires >= R8B (to get fprof)
  The debugger front end requires >= R8B-1

  Distel itself is not formally tested, but it has enough savvy users
that it'll typically run on the last 2 versions of Erlang and Emacs
(as of 2008 OTP R11/R12 and Emacs 21/22).

(*) Luke Gorrie is unfortunately no longer involved with Distel, and
Blutail no longer exists...
  there is of course the distel-hackers mailing list;
https://lists.sourceforge.net/lists/listinfo/distel-hackers

  and the issue tracker at google;
http://code.google.com/p/distel

FAQ
1. Can't handle event closed in state  derl-recv-challenge-ack

this is what you get if the erlang node and the distel node disagree
one what cookie to use.

Use (in erl)
 erlang:get_cookie()
and (in emacs)
 M-x erl-get-cookie
to check the cookies.

distel's People

Contributors

alexjgriffith avatar bjnortier avatar ericliang avatar legoscia avatar leoliu avatar lmmilewski avatar mads-hartmann avatar massemanet avatar pickme467 avatar pvmart avatar tarsius avatar wcy123 avatar yantonov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

distel's Issues

distel:get_arglists("json2", "encode") crash distel every time

So I was using distel with yaws and found this bug. Tested on Mac OS X with Erlang R16B03 and yaws 1.98.

(devel@localhost)23> catch distel:src_args(Forms, encode, 1).
{'EXIT',{function_clause,[{distel,src_args,
                                  [[],encode,1],
                                  [{file,"distel.erl"},{line,938}]}]}}

distel:src_args has this comment: %% if we get to [] we have a serious error.

This is due to the pattern match in distel:src_args doesn't match against func but function. An example element of the Forms argument looks like this:

{tree,function,
       {attr,98,[],none},
       {func,{tree,atom,{attr,98,[],none},encode_string},
             [{tree,clause,
                    {attr,98,[],none},
                    {clause,[{var,98,'B'}],
                            {tree,disjunction,{...},...},
                            [{tree,...}]}},
              {tree,clause,
                    {attr,99,[],none},
                    {clause,[{var,99,...}],none,[{...}]}}]}}

`make: *** No rule to make target 'ebin'. Stop.` warning on every emacs run

If you have any Makefile on home directory, or another default root path, you'll receive that warning for every emacs run, when (require 'distel) applies:

-*- mode: compilation; default-directory: "~/" -*-
Compilation started at Tue Sep 11 17:54:04

make ebin erl
make: *** No rule to make target 'ebin'.  Stop.

Compilation exited abnormally with code 2 at Tue Sep 11 17:54:05

Problem there is

(eval-when-compile

Enviroment:
OS: Debian Buster 4.16.16-2 (2018-06-22) x86_64 GNU/Linux
Emacs: GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-07-04

related emacs config:

(defun maybe-add-to-load-path (path)
  (let ((absolute-path (expand-file-name path)))
    (when (file-exists-p absolute-path)
    (add-to-list 'load-path absolute-path))))

(maybe-add-to-load-path "/usr/share/distel/elisp")
(maybe-add-to-load-path "/usr/local/share/distel/elisp")
(maybe-add-to-load-path "~/.local/share/distel/elisp")

(when (not (require 'distel nil t))
  (message "Cloning and installing distel")
  (shell-command "git clone https://github.com/massemanet/distel.git distel-src --depth 1 && cd distel-src && make && make install prefix=~/.local && cd ../ && rm -rf distel-src"))

(require 'distel)
(distel-setup)

edbproc window is empty

when i test emacs23.3 + distel 4.0.3 on RHL5 followed the Bill's blog, http://bc.tech.coop/blog/070528.html, Open the source member (e.g. - "beersong1.erl") in Emacs
Start an Erlang Shell ("C-c C-z")
Connect Distel to the Erlang Shell ("C-c C-d n" + node name)
Compile the source member for debugging in the Erlang Shell ("c("beersong1", [debug_info]).")
Reload the Erlang module ("C-c C-d L") in the source buffer
Toggle debug interpreting of the module ("C-c C-d i")
Set a breakpoint at a line in the module ("C-x SPC")
From the Erlang Shell, run a function in the module ("beersong1:sing().")
The debugger's process list comes up in a browse window and I press RET on the process to select it for debugging (there can potentially be multiple processes that are being debugged at the same time)
The debugger window pops up
when i stop into "The debugger's process list comes up in a browse window and I press RET on the process to select it for debugging (there can potentially be multiple processes that are being debugged at the same time) ", and i press RET, i got one edbproc window, but the content is empty, anybody know why? and when i input command "n", the minbuffer show "peculiar error: [badarg [not-registered nil]]".
like this :http://www.digipedia.pl/usenet/thread/14327/360/

Evaluating an expression while debugging.

The only thing lacking for my ideal workflow with distel compared to the graphical debugger, is the ability to evaluate expressions from what I'm currently debugging.

Is there any way currently to have an interactive session within the debugger ?

I cannot get autocomplete to work

I am new to erlang so I am not sure how to troubleshoot yet.

I am using the 2018 branch without the last commit.

Trying to autocomplete otp_doc:fire with M-TAB It does not work. Albeit I can still jump into code source definition with M-. above otp_doc:firefox.

This is after I tried to fix my installation, because on my system code:root_dir(). is /usr/lib64/erlang and in that dir there isn't a doc dir so I copied it from /usr/share

> cd /usr/lib64/erlang
> mkdir doc
> sudo cp -r /usr/share/doc/erlang-21.1.1/* doc/
> ls -l  doc/man_index.html doc/kernel-6.1/doc/html/index.html
-rw-r--r-- 1 root root 53377 Mar 13 17:00 doc/kernel-6.1/doc/html/index.html
-rw-r--r-- 1 root root 97435 Mar 13 17:00 doc/man_index.html

Logs:

On *messages*

epmd-process - msg: \0�zemacs
epmd-recv-port-resp - Event: data
epmd-recv-port-resp - data: w\0M\0\0�\0�\0�emacs\0\0
epmd-recv-port-resp - arg: w\0M\0\0�\0�\0�emacs\0\0
nodeup: emacs@sabayon
nodedown: emacs@sabayon [2 times]
error in process filter: cl--assertion-failed: Assertion failed: (eq (erlext-get-code (quote null)) (erlext-read1))
error in process filter: Assertion failed: (eq (erlext-get-code (quote null)) (erlext-read1))

On *trace*

>> REG_SEND: [TYPE erl-pid distel_19038@sabayon 11 0 0] rex [[TYPE erl-pid distel_19038@sabayon 11 0 0] [call code ensure_loaded (distel) [TYPE erl-pid distel_19038@sabayon 1 0 0]]]
>> REG_SEND: [TYPE erl-pid distel_19038@sabayon 10 0 0] rex [[TYPE erl-pid distel_19038@sabayon 10 0 0] [call distel rpc_entry (distel functions (otp_doc "fir")) [TYPE erl-pid distel_19038@sabayon 1 0 0]]]
<< SEND: [TYPE erl-pid distel_19038@sabayon 11 0 0] [rex [module distel]]

Distel fails with OTP 23

There are apparently changes to the external term format that need to be supported. I'll look into it further.

Connection attempt from node 'distel_38187\@machine.local' rejected since it cannot handle ["BIG_CREATION"].**

got a corrupted external term

Hi,

I keep running into this error and I'm a bit lost regarding how to start debugging it. I'm not quite sure how it happens, but in very vague terms it seems to happen when I send too much logging data from Erlang to Emacs. Once this error triggers, the distel communication gets into a bad state, and the only way I've found to fix it is to restart emacs.

=WARNING REPORT==== 12-Apr-2020::10:37:00 ===
'[email protected]' got a corrupted external term from 'distel_27211@panda' on distribution channel 28280
<<...,131,104,4,97,6,103,100,0,18,100,105,115,116,101,108,95,50,55,50,49,49,64,112,97,110,100,97,0,0,188,139,0,0,0,0,0,100,0,0,100,0,3,114,101,120,131,104,2,103,100,0,18,100,105,115,116,101,108,95,50,55,50,49,49,64,112,97,110,100,97,0,0,188,139,0,0,0,0,0,104,5,100,0,4,99,97,108,108,100,0,4,99,111,100,101,100,0,13,101,110,115,117,114,101,95,108,111,97,100,101,100,108,0,0,0,1,100,0,6,100,105,115,116,101,108,106,103,100,0,18,100,105,115,116,101,108,95,50,55,50,49,49,64,112,97,110,100,97,0,0,0,1,0,0,0,0,0>>
ATOM_CACHE_REF translations: none

`default-enable-multibyte-characters' is an obsolete variable (as of Emacs 23.2)

From http://code.google.com/p/distel/issues/detail?id=23

Reported by peerst, Jul 30, 2010

What steps will reproduce the problem?

  1. svn checkout revision 94
  2. run make

What is the expected output? What do you see instead?

In erlext-binary-to-term:
erlext.el:77:9:Warning: `default-enable-multibyte-characters' is an obsolete
variable (as of Emacs 23.2); use enable-multibyte-characters or
set-buffer-multibyte instead

In erlext-term-to-binary:
erlext.el:85:9:Warning: `default-enable-multibyte-characters' is an obsolete
variable (as of Emacs 23.2); use enable-multibyte-characters or
set-buffer-multibyte instead

What version of the product are you using? On what operating system?

R94 on FreeBSD 8.0-RELEASE
Erlang R13B04 (erts-5.7.5) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
GNU Emacs 23.2.1

Please provide any additional information below.

Comment 1 by project member [email protected], Aug 3, 2010

unsure of how to make this backwards compatible.

Owner: mats.cronqvist

got error "Module is not interpreted, can't set breakpoints." after interpreting

From http://code.google.com/p/distel/issues/detail?id=20

Reported by [email protected], Oct 29, 2009

What steps will reproduce the problem?

  • compile with debug info
    (emacs@f11)> c(test, debug_info).

  • distel connect to node emacs@f11 ( C-c C-d n )

(emacs@f11)5> i().
....
<0.31.0> erlang:apply/2 1597 4850
0
shell:shell_rep/4 17
<0.32.0> kernel_config:init/1 233 42
0
gen_server:loop/6 9
<0.33.0> supervisor:kernel/1 233 57
0
kernel_safe_sup gen_server:loop/6 9
<0.36.0> erlang:apply/2 2584 28119
0
rpc:local_call/3 49
Total 28903 761511
0

271

  • distel reload erlang module test ( C-c C-d L)
    now I am seeing distel in i() output

(emacs@f11)6> i().
... ...
<0.33.0> supervisor:kernel/1 233 57
0
kernel_safe_sup gen_server:loop/6 9
<0.36.0> erlang:apply/2 2584 40333
0
rpc:local_call/3 49
<0.46.0> inet_tcp_dist:do_accept/6 610 516
0
dist_util:con_loop/9 11
<0.50.0> distel:gl_proxy/1 233 1
0
'distel_gl_for_<8785. distel:gl_proxy/1 4
Total 28992 812442
0
286
ok

  • Toggle debug interpreting of the module ( C-c C-d i)
    got messsage : Interpreting: test
    got distel:debug_subscriber* in i() output

(emacs@f11)7> i().

... ...
<0.46.0> inet_tcp_dist:do_accept/6 987 803
0
dist_util:con_loop/9 11
<0.50.0> distel:gl_proxy/1 233 1
0
'distel_gl_for_<8785. distel:gl_proxy/1 4
<0.53.0> distel:debug_subscriber_init/2 233 37
0
distel:debug_subscriber/1 5
<0.55.0> dbg_iserver:init/1 377 104
0
dbg_iserver gen_server:loop/6 9
Total 29945 901441
0
303

  • Toggle a breakpoint at current line ( C-c SPC)
    got messsage : Module is not interpreted, can't set breakpoints.
    i() output doesn't change much.

    When distel worked before, it showed two new process
    distel:attach_init/2, distel:attach_loop/1, but now it doesn't:

(emacs@f11)8> i().
... ...

<0.46.0> inet_tcp_dist:do_accept/6 987 1248
0
dist_util:con_loop/9 11
<0.50.0> distel:gl_proxy/1 233 1
0
'distel_gl_for_<8785. distel:gl_proxy/1 4
<0.53.0> distel:debug_subscriber_init/2 233 37
0
distel:debug_subscriber/1 5
<0.55.0> dbg_iserver:init/1 377 104
0
dbg_iserver gen_server:loop/6 9
Total 30322 967176
1

distel:functions(io, "").
{ok,["columns","format","fread","fwrite","get_chars",
"get_line","get_password","getopts","nl","parse_erl_exprs",
"parse_erl_form","put_chars","read","request","requests",
"rows","scan_erl_exprs","scan_erl_form","setopts","write"]}

distel:functions(rpc, "").
{ok,["abcast","async_call","block_call","call","cast",
"code_change","eval_everywhere","handle_call","handle_cast",
"handle_info","init","multi_server_call","multicall",
"nb_yield","parallel_eval","pinfo","pmap",
"proxy_user_flush","safe_multi_server_call","sbcast",
"server_call","start","start_link","stop","terminate",
"yield"]}

What is the expected output? What do you see instead?

got error "Module is not interpreted, can't set breakpoints." after
interpreting

What version of the product are you using? On what operating system?

GNU Emacs 23.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.16.5)
of 2009-08-03 on x86-4.fedora.phx.redhat.com

Erlang R13B02 (erts-5.7.3) [source] [64-bit] [smp:2:2] [rq:2] [async-
threads:0] [hipe] [kernel-poll:false](trying Erlang R12 also get the same result of interpret error)

Linux Fedora release 11: fc11.x86_64

URL: http://distel.googlecode.com/svn/trunk
Repository Root: http://distel.googlecode.com/svn
Repository UUID: d5f8e727-742a-0410-b67d-dd739a6cc792
Revision: 93
Node Kind: directory
Schedule: normal
Last Changed Author: lukego
Last Changed Rev: 93
Last Changed Date: 2009-08-02 16:38:33 -0700 (Sun, 02 Aug 2009)

Please provide any additional information below.

I tried reload and interpret the module multiple times and also switched to
erlang R12, still got the same result.

I tried to connect to a erlang node outside of emacs, emacs showed a popup
windows "Attach debugger to xyz@f11 instead of emacs@f11" when
intrepreting, still got the same error "Module is not interpreted, can't
set breakpoints."

Comment 1 by project member [email protected], Nov 3, 2009

I only occasionally reproduce this :<
There is a workaround;
C-c C-d m (opens the monitor buffer)
k (kills the monitor buffer)
C-c C-d i (start interpreting) in the .erl buffer will now work.

Status: Accepted
Owner: mats.cronqvist
Comment 2 by [email protected], Nov 14, 2009

I have exactly same problem on:

MacOSX 10.6 (Snow Leopard),
Erlang 13B02,
Emacs 22 (Carbon) or Emacs 23 (cocoa).

Comment 3 by [email protected], Dec 26, 2009

I've set a breakpoint and did some debugging with r64 from trunk, although it may be
not the last rev where debugging is still working.
You can check out this rev with
% svn checkout -r 64 http://distel.googlecode.com/svn/trunk distel-r64

I followed instructions in http://bc.tech.coop/blog/070528.html.
Also, I had to fix install path in Makefile:

--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ infodir = ${prefix}/info
erlc = erlc
emacs = emacs

-ELISP_DIR = ${datadir}/${emacs}/site-lisp/distel
+ELISP_DIR = ${datadir}/distel/elisp
EBIN_DIR = ${datadir}/distel/ebin
ERL_SRC_DIR = ${datadir}/distel/src

Comment 4 by [email protected], Jan 24, 2010

I'm having this problem, also, and it's 100% of the time, not intermittent. However,
the work around posted above seems to work.

Comment 5 by [email protected], Jan 24, 2010

If there's anything I can do to help troubleshoot this, let me know:
[email protected]. Even pointing me in the direction of things to look at would
be helpful.

Also, it'd be cool if the official repo for this were moved to github, like the
official erlang repo was. I think you might get a little more help, e.g., I'd be much
more likely to submit patches.

Comment 6 by project member [email protected], Jan 25, 2010

I believe there's a race condition in the interpreter init code (on the emacs side).
hairy stuff, unfortunately...

I agree a move to github would be a good thing. just need to reach my mental tipping
point...

OSX Install instructions

I'm having issues setting distel up on OS X 10.10 (Yosemite).
The instructions mention using NetInfo Manager.app which no longer exists in modern OS X.

Running C-c C-d n gives

EXIT: <0.4.0> [emacs-error "(file-error \"make client process failed\" \"connection refused\" :name \"netfsm\" :buffer #<killed buffer> :host \"phobos.local\" :service 4369 :nowait nil)"] 

Is anyone using distel on a recent Mac and how did you set it up to work?

the ditel support unicode or chinese ?

when i use C-d C-d d to run the erl-fdoc-describe ,when the function's comment contains chinese ,the foc output is someting like this
\347\255\233\345\205\210\346\216\250\350\215\220\345\210\227\350\241\250

Parameterized modules are not interpreted

From http://code.google.com/p/distel/issues/detail?id=21

Reported by [email protected], Feb 20, 2010

What steps will reproduce the problem?

  1. Create a parametized module
  2. Try to interpret it (C-c C-d i)

What is the expected output? What do you see instead?
It should show that the module will is being interpreted, besides the
output is "Can't determine module for current buffer."

What version of the product are you using? On what operating system?
Latest repo trunk version, Erlang R13B03, and Ubuntu 9.10 Linux 2.6.31-19

Please provide any additional information below.

Comment 1 by project member [email protected], Aug 3, 2010

i'm not sure if the interpreter can handle parametrized modules.

Owner: mats.cronqvist

Map handling

R17 saw the introduction of maps, and I just checked -- they're supported by the erlang distribution protocol. They're a great addition, and it would be swell for distel to support them.

I can work on this, but I'm not sure what the best translation for an erlang map would be -- an emacs hash-table?

Thanks in advance

OSX-["NEW_FUN_TAGS"] issue

Hi,

When i try to use erl-complete i get this error on Erlang side;

Connection attempt from node '[email protected]' rejected since it cannot handle ["NEW_FUN_TAGS"].**

And "nodedown: emacs@Barss-MacBook-Pro\.local" message on emacs side.

I also get "Buffer "*derl [email protected]*" has a running process; kill it? (yes or no)" message.

I'm using Emacs 26.1, Erlang/OTP 21 and latest git version of Distel. My .emacs is;

(add-to-list 'load-path "~/emacsbm/distel/elisp")
(require 'distel)
(distel-setup)

;; prevent annoying hang-on-compile
(defvar inferior-erlang-prompt-timeout t)
;; default node name to emacs@localhost
(setq inferior-erlang-machine-options '("-sname" "emacs"))
;; tell distel to default to that node
(setq erl-nodename-cache
      (make-symbol
       (concat
        "emacs@"
        ;; Mac OS X uses "name.local" instead of "name", this should work
        ;; pretty much anywhere without having to muck with NetInfo
        ;; ... but I only tested it on Mac OS X.
                (car (split-string (shell-command-to-string "hostname"))))))

Is there anything wrong with my configuration or my setup?

Thanks in advance.

erl-ie-evaluate and indentation by tabs

Hello,

In case indentation is done with spaces(sigh... don't ask), C-j in distel-ie-session buffer won't work as intendent, consuming part of value returned by erlang process.
It happens because indent-rigidly inserts tabs(and not 5, as stated in arguments), not spaces, so later delete-region erases part of returned value.
I think it can be fixed fast by changing(https://github.com/massemanet/distel/blob/master/elisp/distel-ie.el#L135)

(indent-rigidly beg (point) 5)

to

(indent-rigidly (+ beg 1) (point) 5)

And removing line https://github.com/massemanet/distel/blob/master/elisp/distel-ie.el#L137

More efficient guessing source file

For projects that have big folder trees for source files the guessing mechanism in function guess_source_file is not quite efficient. Erlang has a perfect mean to find a file in a folder subtree. I suggest to substitute the following:

guess_source_file(Mod, BeamFName) ->
  Erl = to_list(Mod) ++ ".erl",
  Dir = dirname(BeamFName),
  DotDot = dirname(Dir),
  try_srcs([src_from_beam(Mod),
            join([Dir, Erl]),
            join([DotDot, "src", Erl]),
            join([DotDot, "src", "*", Erl]),
            join([DotDot, "esrc", Erl]),
            join([DotDot, "erl", Erl])).

With this:

guess_source_file(Mod, BeamFName) ->
  Erl = to_list(Mod) ++ ".erl",
  Dir = dirname(BeamFName),
  DotDot = dirname(Dir),
  try_srcs([filelib:wildcard(join([DotDot, "**", Erl]))]).

Please specify the license for this package

Could you please specify the license used for this package?

Assuming that you want to release under "the GPL v3 or any later version", the best way to do that would be to add this permission statement to the library header:

;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.

;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also consider adding a LICENSE file containing the text of the GPL-3. You could add just that file without also adding the above persmission statement, but if you do that, then the "or (at your option) any later version" bit won't be known. So I recommend that you add both the actual license and the permission statement.

If you find the permission statement to be too noisy, then you could instead add one of these following lines to the header. If you do that, then it becomes more important to also add the LICENSE file - a judge might decide that such a line by itself is not sufficient. Still, adding just such a line is better than not specifing the license at all.

;; License: GNU General Public License version 3, or (at your option) any later version
;; License: GNU General Public License version 3, or any later version
;; License: GNU GPL version 3, or (at your option) any later version
;; License: GPL version 3, or (at your option) any later version
;; License: GPL version 3, or any later version
;; License: GPL v3, or (at your option) any later version
;; License: GPL v3, or any later version
;; License: GPL-3+

Possible to avoid first Buffer " *net-fsm*" has a running process?

This occurs every time I start up everything and send the ping. Often I don't notice the message and prompt. By the time I do and press Y, I get:

error in process filter: epmd-recv-port-resp: Assertion failed: (> (length arg) 2)
error in process filter: Assertion failed: (> (length arg) 2)

don't jump to definition when function parameters contain a binary

emacs+distel don't jump to function when the function parameters contain a binary. That's it.
debian testing,
emacs 23.4+1-3,
distel from git,
the simplest program:

-module(u2).

-export([save_test/0]).

save_test() ->
F1 = fun(Val) ->
save1(Val), % does not work
save1(now(), Val), % does not work
save2(Val), % works
save2(now(), Val), % works
save3(Val) % works
end,
L = [
<<"save_test1">>,
<<"save_test2">>,
save_test1,
save_test2
],
lists:foreach(F1, L).

save1(<<"save_test1">>) ->
error;
save1(<<"save_test2">>) ->
ok.

save1(Info, <<"save_test1">>) ->
error;
save1(Info, <<"save_test2">>) ->
ok.

save2(save_test1) ->
error;
save2(save_test2) ->
ok.

save2(Info, {<<"save_test1">>, true}) ->
error;
save2(Info, {<<"save_test2">>, false}) ->
ok.

save3({<<"save_test1">>, true}) ->
error;
save3({<<"save_test2">>, false}) ->
ok.

otp_doc bug

Could someone try

otp_doc:functions("code", "").

to see why the completion list is incomplete? For example, root_dir is missing.

Not connect to any erlang node

From http://code.google.com/p/distel/issues/detail?id=25

Reported by kosmonaFFFt, Jan 15, 2011

What steps will reproduce the problem?

  1. Run node (test@fff-W7)
  2. Set node in emacs (C-c C-d n test@fff-W7)
  3. Try to complete symbol (M-/)

What is the expected output? What do you see instead?
nodedown test@fff-W7

What version of the product are you using? On what operating system?
OS Windows 7 x64, emacs 22.3, erlang 5.8.2, distel-4.3

Please provide any additional information below.
emacs.exe, erl.exe, werl.exe, epmd.exe are has all rights in windows firewall...

Distel and erlang-mode configuration in ~/.emacs file:

;erlang-mode
(add-to-list 'load-path "C:\erlang\erl5.8.2\lib\tools-2.6.6.2\emacs")
(add-to-list 'exec-path "C:\erlang\erl5.8.2\erts-5.8.2\bin")
(setq erlang-root-dir "C:\erlang\erl5.8.2")
(setq inferior-erlang-machine-options '("-sname" "emacs"))
(require 'erlang-start)

;distel
(add-to-list 'load-path "C:\emacs-23.2\site-lisp\distel-4.03\elisp")
(require 'distel)
(distel-setup)

Warning: erl_scan:token_info/2: deprecated (will be removed in OTP 19)

Compilation produces this warning:

erlc -W -o ebin +debug_info src/fdoc.erl
src/fdoc.erl:254: Warning: erl_scan:token_info/2: deprecated (will be removed in OTP 19); use erl_scan:{category,column,line,location,symbol,text}/1 instead

It looks like the individual items queryable with token_info/2 each have their own specific query function now.

Could not make on Ubuntu, compilation error: "elisp/erl-test.el:3:1:Error: Cannot open load file: No such file or directory, erlang""

Excuse me, I have git cloned the package from the master branch and save it to my ~/.emacs.d/site-lisp/.

Then, I cd into the folder and run make. The output shows:

emacs -batch -L elisp -f batch-byte-compile elisp/erl-test.el

In toplevel form:
elisp/erl-test.el:3:1:Error: Cannot open load file: No such file or directory, erlang
Makefile:64: recipe for target 'elisp/erl-test.elc' failed
make: *** [elisp/erl-test.elc] Error 1

But, erlang is already installed:

zw@DESKTOP-TTOPQ58:~/.emacs.d/site-lisp/distel$ erl
Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:10] [kernel-poll:false]

Eshell V9.2  (abort with ^G)
1>

zw@DESKTOP-TTOPQ58:~/.emacs.d/site-lisp/distel$ which erl
/usr/bin/erl

And my Emacs configuration is

(cond (*win64*
       (setq erlang-root-dir "c:/Program Files/erl-23.0/")
       (setq erlang-man-root-dir (concat erlang-root-dir "man"))
       (add-to-list 'exec-path (concat erlang-root-dir "bin/"))
       (add-to-list 'load-path (concat erlang-root-dir "lib/tools-3.4/emacs")))
      (t
       (setq erlang-root-dir "/usr/lib/erlang/")
       (setq erlang-man-root-dir (concat erlang-root-dir "man"))
       (add-to-list 'exec-path (concat erlang-root-dir "bin"))
       (add-to-list 'load-path (concat erlang-root-dir "lib/tools-2.11.1/emacs"))))

(when (executable-find "erl")
  (require 'erlang-start)

  (after-load 'erlang
    ;; ref: http://alexott.net/en/writings/emacs-devenv/EmacsErlang.html
    ;; Installation & customization of distel
    ;; for loading https://github.com/massemanet/distel
    (add-to-list 'load-path "~/.emacs.d/site-lisp/distel/elisp")
    (require 'distel)
    (distel-setup)))

Now, when I start up Emacs and edit any ".erl" file. I could see in modes:

Erlang-Extended minor mode (indicator EXT):
Extensions to erlang-mode for communicating with a running Erlang node.

Does this mean Distel's feature could work properly?

The message buffer shows no error, but the compilation buffer shows same error:

-*- mode: compilation; default-directory: "~/.emacs.d/site-lisp/distel/elisp/" -*-
Compilation started at Tue Apr 27 12:42:12

pwd && make -C.. all
/home/zw/.emacs.d/site-lisp/distel/elisp
make: Entering directory '/home/zw/.emacs.d/site-lisp/distel'
emacs -batch -L elisp -f batch-byte-compile elisp/erl-test.el

In toplevel form:
elisp/erl-test.el:3:1:Error: Cannot open load file: No such file or directory, erlang
Makefile:64: recipe for target 'elisp/erl-test.elc' failed
make: *** [elisp/erl-test.elc] Error 1
make: Leaving directory '/home/zw/.emacs.d/site-lisp/distel'

Compilation exited abnormally with code 2 at Tue Apr 27 12:42:12

How to fix this?

Missing completion on io

From http://code.google.com/p/distel/issues/detail?id=15

Reported by [email protected], Mar 2, 2009

What steps will reproduce the problem?

  1. Writing io:<M-?>

What is the expected output?
"Possible completions are:
columns format fread fwrite
get_chars get_line get_password nl
parse_erl_exprs parse_erl_form put_chars read
request requests rows scan_erl_exprs
scan_erl_form setopts write"

What do you see instead?
There are no completions.

What version of the product are you using? On what operating system?
Both distel from SVN revision 89 and the Xmas edition gives me this.
erl -version == Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 5.6.3
Ubuntu 8.10.

Possible fix? I don't know if this is preferable or not.
$ svn diff distel.erl

Index: distel.erl

--- distel.erl (revision 89)
+++ distel.erl (working copy)
@@ -672,7 +672,7 @@

xref_completions(F,A) ->
fun(server) -> distel_completions;

  •   (opts)   -> [{xref_mode, modules}];
    
  •   (opts)   -> [code:lib_dir()];
    (otp)    -> true;
    (query_) -> to_list(fmt(F,A))
    
    end.

This fixes the problem for me. But maybe it breaks something else I don't
know about.

Best,
Ivar Refsdal.

Comment 1 by project member [email protected], Mar 6, 2009

works for me. please try (in the erlang shell);
distel:functions(io,"").

should print;

{ok,["columns","format","fread","fwrite","get_chars",
"get_line","nl","parse_erl_exprs","parse_erl_form",
"put_chars","read","rows","scan_erl_exprs","scan_erl_form",
"setopts","write"]}

Status: Started
Owner: mats.cronqvist
Comment 2 by [email protected], Mar 8, 2009

distel:functions(io, "").
{ok,[]}

distel:functions(rpc, "").
{ok,["abcast","async_call","block_call","call","cast",
"code_change","eval_everywhere","handle_call","handle_cast",
"handle_info","init","multi_server_call","multicall",
"nb_yield","parallel_eval","pinfo","pmap",
"safe_multi_server_call","sbcast","server_call","start",
"start_link","stop","terminate","yield"]}

Also tried installing Erlang from source, including erlang-mode. Same result.

What about to compile and load code directly from source file we edit?

src/distel.erl

- reload_module(Mod, File) ->
-    case c:l(to_atom(Mod)) of
-        {error,R} ->
-            case Mod == basename(File,".erl") of
-                true ->
-                    Beams = [join([dirname(File),Mod]),
-                             join([dirname(dirname(File)),ebin,Mod])],
-                        case filter(fun is_beam/1, Beams) of
-                            [] -> {error, R};
-                            [Beam|_] ->
-                                code:add_patha(dirname(Beam)),
-                                c:l(to_atom(Mod))
-                        end;
-                false ->
-                    {error,modname_and_filename_differs}
-            end;
-        R -> R
-    end.
+    c:c(File, [debug_info, {outdir, dirname(File)}]).

Maybe there is another way to do what i want?
It is useful for me. What about to add this functionality in distel?

OTP20. Connection rejected since distel node cannot handle UTF8_ATOMS

Following my upgrade to OTP20 I began getting this error when attempting to connect.

(server@dev)2> 
=ERROR REPORT==== 17-Nov-2017::00:32:12 ===
** server@dev: Connection attempt from node distel_11815@dev rejected since it cannot handle ["UTF8_ATOMS"].**

The only Distel related response to this error I could find was here.

This issue seams to be pretty wide spread among other applications following the release of OTP20, for example and another.

EDIT

From the OTP20 Release notes

In the OTP 20 release candidates the function erlang:term_to_binary/1 changed the encoding of all atoms from ATOM_EXT to ATOM_UTF8_EXT and SMALL_ATOM_UTF8_EXT. This is now changed so that only atoms actually containing unicode characters are encoded with the UTF8 tags while other atoms are encoded ATOM_EXT just as before.

and

Atoms can now contain arbitrary unicode characters which means that the DFLAG_UTF8_ATOMS capability in the distribution protocol must be supported if an OTP 20 node should accept the connection with another node or library. Third party libraries which uses the distribution protocol need to be updated with this.

EDIT 2

Details for ATOM_UTF8_EXT and SMALL_ATOM_UTF8_EXT can be found here . These need to be implemented in exterl.el.

Details for the DFLAG_UTF8_ATOMS can be found here. This needs to be updated in derl.el.

Symbol's value as variable is void: erlang-emacs-major-version

I'm trying to set up Wrangler but when I activate it I get the following error:

starting Wrangler...
Event: data
data: w\0M\0\0\0\0
wrangler92\0\0
arg: w\0M\0\0\0\0
wrangler92\0\0
error in process filter: cond: Symbol's value as variable is void: erlang-emacs-major-version
error in process filter: Symbol's value as variable is void: erlang-emacs-major-version

Here is my erlang log:

(wrangler92@localhost)1> =ERROR REPORT==== 7-Jul-2021::18:47:21.796296 ===
** wrangler92@localhost: Connection attempt from node '\204distel_2263@dominik-VirtualBo' rejected since it cannot handle ["EXTENDED_REFERENCES"].**

I'm using erlang OTP 22.3 and the distel version comes with Wrangler, and in erlang/lib/kernel-6.5.2/include/dist.hrl I have -define(DFLAG_EXTENDED_REFERENCES,4). added.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.