[erlang-questions] erlang inside emacs issues

Johan Claesson johanclaesson@REDACTED
Wed Jan 2 16:32:06 CET 2013




I think the problem is that emacs is waiting for the erlang process to
print something.  Normally erlang will always print a promt when you hit
return but not while in the BREAK menu.  As a workaround you should be
able to stop emacs from waiting with C-g.  But a nicer alternative is to
make emacs not wait for erlang output in the first place.  Insert this
in your .emacs:

(add-hook 'erlang-shell-mode-hook
          (lambda ()
            (add-hook 'comint-output-filter-functions
                      'jcl-stop-echo t t)))

(defun jcl-stop-echo (ignored)
  (remove-hook 'comint-output-filter-functions 'jcl-stop-echo t)
  (setq comint-process-echoes nil)
  (insert "io:setopts([{echo, false}]).")
  (comint-send-input nil t))

I agree about the C-g stuff and i have almost exactly the same hack :).

Regards,

/Johan



Rustom Mody <rustompmody@REDACTED> writes:

> On Wed, Jan 2, 2013 at 2:53 AM, Pierpaolo Bernardi <olopierpa@REDACTED>wrote:
>
>> Ctrl-c is bound to the emacs command which means "pass the next
>> keystroke to the inferior process". That's the reason why you use
>> ctrl-c <x> to send <x> uninterpreted to erlang.
>>
>> Well the two keystrokes is hardly the problem !
> That erlang hangs emacs is what I am asking about :D
>
> On a related note surely C-c C-g should have been setup to send C-g to
> erlang shell?
>
> For now I have hacked up this elisp for this
> However I find it hard to believe that I am the first one to want this
>
> ---------------------------------------
> (defun inf-ctl-g ()
>   (interactive)
>   (comint-send-string (current-buffer) (make-string 1 ?\C-g)))
>
> (add-hook 'erlang-shell-mode-hook
>       (lambda ()
>         (define-key erlang-shell-mode-map (kbd "C-c C-g") 'inf-ctl-g)))
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list