Arc Forumnew | comments | leaders | submitlogin
3 points by malisper 2824 days ago | link | parent

Reader macros work on a per file basis so I don't think there is a way to set the proper syntax from a separate file.

You might want to consider trying to setup Slime, as it provides some really amazing Smalltalk-esque features. I detailed most of them in my blog series, Debugging Lisp[0]. Some of the ones I covered in the post are: recompilation of code at runtime, restarting of a stack frame at runtime, an object inspector, interactive restarts (restarts are a better form of try/catch), various forms of function lookup (e.g. list all functions who call function X). I haven't yet covered it, but I eventually want to, is slime-macrostep[1]. It lets you interactively expand parts of a macro step by step.

[0] http://malisper.me/2015/07/07/debugging-lisp-part-1-recompil...

[1] http://kvardek-du.kerno.org/2016/02/slime-macrostep.html



1 point by akkartik 2822 days ago | link

I'm trying to work through http://malisper.me/2015/07/07/debugging-lisp-part-1-recompil... but I got this error when I tried to restart from any of the stack frames:

  Cannot restart frame: #<SB-DI::COMPILED-FRAME EVAL>

-----

1 point by akkartik 2823 days ago | link

Ah, I figured out a way to run it with just:

  $ clamp
https://github.com/malisper/Clamp/pull/5

-----

1 point by akkartik 2824 days ago | link

Yes, I'll certainly try to add Slime back now that I have the foundation working well together.

-----

1 point by akkartik 2822 days ago | link

I've gotten Slime working, but so far I'm still doing the same things I would do in an interactive session:

  $ emacs
  M-x slime RET
  # in the slime buffer
  * (ql:quickload :clamp)
  * (in-package :clamp)
  * (use-syntax :clamp)
Is that what do you typically do?

Also, when I try to C-x C-e an arc expression in some random buffer after the above steps, it doesn't seem to remember the above commands anymore. The only thing that works is running commands at the repl.

-----

4 points by malisper 2822 days ago | link

> I've gotten Slime working, but so far I'm still doing the same things I would do in an interactive session:

Yes, that's what I typically do. If you wanted to, you could add those instructions to your .sbclrc, and that should load Clamp on start up.

> Also, when I try to C-x C-e an arc expression in some random buffer after the above steps, it doesn't seem to remember the above commands anymore.

You need to have slime-mode enable in the buffer you are editing. You can add the following code to your .emacs:

    (require 'slime)
    (add-hook 'lisp-mode-hook (lambda () (slime-mode t)))
and then whenever you open a file that ends in .lisp, it will enable slime-mode.

If you are going to get into programming Lisp with Emacs, you should look into Evil (vim bindings for Emacs), paredit (smart paren editing), ac-slime (autocomplete for slime), show-paren-mode (shows matching parens), and undo-tree (a better version of undo/redo). Although I've never used it, you might want to look at Spacemacs which is supposed to supply sane defaults for Emacs.

-----

3 points by zck 2821 days ago | link

>If you are going to get into programming Lisp with Emacs, you should look into Evil (vim bindings for Emacs), paredit (smart paren editing), ac-slime (autocomplete for slime), show-paren-mode (shows matching parens), and undo-tree (a better version of undo/redo).

Yes, customizing Emacs is really useful for making it better to use. To help with that, here are some of my config's settings for things you've mentioned. My show-paren-mode settings are here (https://bitbucket.org/zck/.emacs.d/src/default/init.el?filev...).

Instead of paredit, I use smartparens. They do similar things, but when I looked at the two, I thought smartparens was better, although I can't remember why right now. My config is here (https://bitbucket.org/zck/.emacs.d/src/default/init.el?filev...).

I should similarly check out the other things you've mentioned (except Evil, 'cause I don't like modal editing).

-----

1 point by akkartik 2822 days ago | link

Ah, that hook was what I needed. Thanks! I'll check out all your tips.

-----