githwxi / ATS-Postiats

ATS2: Unleashing the Potentials of Types and Templates
www.ats-lang.org
Other
353 stars 52 forks source link

Provide an example of `ats-mode` usage (Emacs) #244

Closed vyorkin closed 4 years ago

vyorkin commented 5 years ago

The problem is that the file name (ats2-mode.el) is different than the feature name (ats-mode).

I've tried to make it work using use-package with or without quelpa, but had no luck.

Here is what I've tried:

  1. With quelpa

    (use-package ats-mode
    :quelpa
    (ats-mode
    :fetcher file
    :path "https://raw.githubusercontent.com/githwxi/ATS-Postiats/master/utils/emacs/ats2-mode.el"))
  2. Without quelpa

    (use-package ats-mode
    :load-path "~/projects/github/ats/ATS-Postiats/utils/emacs")
ashalkhakov commented 5 years ago

Unfortunately there isn't much information about ats-mode. I'll get to my box in the evening and document how I set things up.

ashalkhakov commented 5 years ago

I usually just install ATS from sources.

Here's my Emacs config:

(setenv "ATSHOME" "/home/artyom/projects/ats-lang-anairiats-0.2.12")
(setenv "PATSHOME" "/home/artyom/projects/ATS-Postiats-ashalkhakov")
(setenv "TEMPTORY" "/home/artyom/projects/ATS-Temptory")

(load "/home/artyom/projects/ATS-Postiats/utils/emacs/ats2-mode.el")
(require 'flycheck)
(load "/home/artyom/projects/ATS-Postiats/utils/emacs/flycheck-ats2.el")
(with-eval-after-load 'flycheck
   (flycheck-ats2-setup))

The environment variables are needed for checking to work. I think that as of this year the flycheck integration needs more work, it doesn't support acc. Speaking of which, maybe it's just the right time for me to tweak it. :-)

vyorkin commented 4 years ago

Thank you!

vyp commented 4 years ago

You could try using straight.el instead of quelpa. (For context I was writing the :file fetcher for quelpa but then I found I didn't need to anymore since raxod502 made straight.el , so :file for quelpa might not be as polished/finished and might not work correctly.)