You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1898 Reporter: administrator Status: closed (set by @damiendoligez on 2012-01-27T12:49:40Z) Resolution: fixed Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general)
Using the toplevel directly in a terminal is fine. However, it has bad behavior
when run as a sub-process within Emacs which makes errors unreadable. Fixing
this annoyance in the ocaml toplevel will improve interactive use with (X)Emacs
for many users.
To Reproduce
Run ocaml-mode or tuareg-mode.
Select a large region of ocaml code.
Send the code to the ocaml sub-process.
Symptoms
The result of a multi-line expression (such as a class) will be indented to the
right, often so far that the first line returned from the ocaml toplevel will
not be visible.
Fix
This is a hack, but demonstrates the problem more specifically:
while true do
let input = read_line () in
let line = Str.replace_first (Str.regexp "# *") "" input in
print_string (line ^ "\n")
done
Compile this to "fix". Then, create a shell script called ocaml-fix that
executes "ocaml | fix". Finally, send a large region to the ocaml sub-process
again, this time running ocaml-fix instead of ocaml.
Thank you very much,
Craig
The text was updated successfully, but these errors were encountered:
Original bug ID: 1898
Reporter: administrator
Status: closed (set by @damiendoligez on 2012-01-27T12:49:40Z)
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Craig Samuel Falls
Version: 3.07+2
OS: Debian
Submission from: 152.23.182.246 (152.23.182.246)
Summary
Using the toplevel directly in a terminal is fine. However, it has bad behavior
when run as a sub-process within Emacs which makes errors unreadable. Fixing
this annoyance in the ocaml toplevel will improve interactive use with (X)Emacs
for many users.
To Reproduce
Symptoms
The result of a multi-line expression (such as a class) will be indented to the
right, often so far that the first line returned from the ocaml toplevel will
not be visible.
Fix
This is a hack, but demonstrates the problem more specifically:
while true do
let input = read_line () in
let line = Str.replace_first (Str.regexp "# *") "" input in
print_string (line ^ "\n")
done
Compile this to "fix". Then, create a shell script called ocaml-fix that
executes "ocaml | fix". Finally, send a large region to the ocaml sub-process
again, this time running ocaml-fix instead of ocaml.
Thank you very much,
Craig
The text was updated successfully, but these errors were encountered: