Arc Forumnew | comments | leaders | submitlogin
arc-mode.el for emacs
19 points by lojic 5906 days ago | 21 comments
Has anyone whipped up an arc-mode.el for emacs? If not, which existing mode would you expect to be the best one to modify - scheme, lisp ?


13 points by raymyers 5906 days ago | link

"extras/arc.el" on the git. We have Eric and Nathan to thank.

http://git.nex-3.com/arc-wiki.git?a=blob_plain;f=extras/arc....

-----

3 points by lojic 5906 days ago | link

I guess I found my motivation for finally installing and learning git :) Did Eric or Nathan submit a post or comment about this? I'd like to give those boys some points.

-----

4 points by nex3 5906 days ago | link

I didn't, and I don't think Eric did either.

-----

6 points by cooldude127 5906 days ago | link

thing that annoys me is there is nothing for arc that is anything close to what slime is for cl. i would settle for an inferior arc mode. my emacs skills are not good enough to take this into my own hands, i'm afraid.

-----

9 points by sjs 5906 days ago | link

Me neither, but I gave it a shot. I use it and it works, there may be bugs though. Maybe an Emacs guru will be kind enough to point out the errors I may have introduced while adapting cmuscheme.el.

http://samhuri.net/inferior-arc.el

In my dot-emacs:

  (setq arc-program-name "~/src/anarki/arc.sh")
  (load "~/.emacs.d/inferior-arc.el")
Then go ahead and do run-arc, arc-send-definition{,-and-go} (C-c C-e, C-c M-e) arc-send-region{,-and-go} (C-c C-r, C-c M-r), etc.

-----

5 points by nex3 5906 days ago | link

I've added this to Anarki. I'm working on making a few improvements.

-----

1 point by cooldude127 5906 days ago | link

i look forward to seeing what you come up with

-----

1 point by cooldude127 5906 days ago | link

it's a good start. the bugs i see immediately are it lets you erase the prompt and the prompt appears when results are printed too. i might see if there is a way to solve these problems.

-----

1 point by raymyers 5906 days ago | link

I think Slime lets you erase the prompt too. I wonder if there is a good reason for that...

-----

1 point by cooldude127 5906 days ago | link

just tried it. emacs says "text is read-only". which is what it should do. i haven't the slightest idea how it pulls this off, though.

-----

1 point by nex3 5905 days ago | link

Turns out it's just a simple option: comint-prompt-read-only. I've set it in Anarki.

-----

1 point by cooldude127 5905 days ago | link

that was far too easy. i wonder if it is possible to make it pretty print.

-----

1 point by nex3 5905 days ago | link

I think it just outputs whatever Arc sends its way. So this would really involve getting Arc to pretty-print its output.

-----

2 points by cooldude127 5905 days ago | link

that might not even be that difficult, but my main problem is arc's pretty printing (in "pprint.arc") is rather flawed.

-----

1 point by cooldude127 5906 days ago | link

the latest changes in anarki for the --no-rl option fix the problem with the repeated prompt. so now it's just that the prompt can be deleted, which is a really minor issue.

-----

4 points by sacado 5906 days ago | link

Anybody interested in doing the same thing for vi ?

-----

7 points by lojic 5906 days ago | link

From what I've read, pg uses vi, so I expect he's developed a filetype for Arc. I was actually a heavy vim user for a couple years, but recently switched to Emacs in part because of the Lisp support. I was back to my vim productivity level in about 3 days, so maybe you could give it a shot :)

-----

2 points by prime2 5901 days ago | link

Might be of interest: http://arclanguage.com/item?id=685

-----

1 point by bd 5903 days ago | link

I tried out arc.el and inferior-arc.el from Anarki in Xemacs, and arc.el gave the following error:

Invalid syntax description flag: "\" 23bn"

I traced it down to line 74 of the version I downloaded yesterday, but I'm unfamiliar with what it does, and why it would differ between the emacsen:

(modify-syntax-entry ?\| "\" 23bn" st)

Any ideas? Works great in Emacs.

-----

2 points by nex3 5903 days ago | link

No clue... I'm totally unfamiliar with Xemacs. Likely it just has slightly different syntax for syntax-tables. I think that line was copied from lisp.el, though... maybe whatever Xemacs' equivalent file is has a compatible version.

-----

1 point by bd 5900 days ago | link

The only other reference to "modify-syntax-entry" I found was in slime.el, both for Emacs and XEmacs. lisp.el doesn't have it. There were only two "modify-syntax-entry" lines used, vs. the many in arc.el. Lines 6451-6462 from slime.el:

  (defvar sldb-mode-syntax-table
    (let ((table (copy-syntax-table lisp-mode-syntax-table)))
      ;; We give < and > parenthesis syntax, so that #< ... >    is treated
      ;; as a balanced expression.  This enables autodoc-mode to match
      ;; #<unreadable> actual arguments in the backtraces with formal
      ;; arguments of the function.  (For Lisp mode, this is not
      ;; desirable, since we do not wish to get a mismatched paren
      ;; highlighted everytime we type < or >.)
      (modify-syntax-entry ?< "(" table)
      (modify-syntax-entry ?> ")" table)
      table)
    "Syntax table for SLDB mode.")

-----