{"action":"created","issue":{"url":"https://api.github.com/repos/hlissner/doom-emacs/issues/497","repository_url":"https://api.github.com/repos/hlissner/doom-emacs","labels_url":"https://api.github.com/repos/hlissner/doom-emacs/issues/497/labels{/name}","comments_url":"https://api.github.com/repos/hlissner/doom-emacs/issues/497/comments","events_url":"https://api.github.com/repos/hlissner/doom-emacs/issues/497/events","html_url":"https://github.com/hlissner/doom-emacs/pull/497","id":309908279,"number":497,"title":"Add language support for Erlang","user":{"login":"bitwalker","id":955793,"avatar_url":"https://avatars0.githubusercontent.com/u/955793?v=4","gravatar_id":"","url":"https://api.github.com/users/bitwalker","html_url":"https://github.com/bitwalker","followers_url":"https://api.github.com/users/bitwalker/followers","following_url":"https://api.github.com/users/bitwalker/following{/other_user}","gists_url":"https://api.github.com/users/bitwalker/gists{/gist_id}","starred_url":"https://api.github.com/users/bitwalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitwalker/subscriptions","organizations_url":"https://api.github.com/users/bitwalker/orgs","repos_url":"https://api.github.com/users/bitwalker/repos","events_url":"https://api.github.com/users/bitwalker/events{/privacy}","received_events_url":"https://api.github.com/users/bitwalker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-29T21:22:55Z","updated_at":"2018-04-02T11:00:53Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/hlissner/doom-emacs/pulls/497","html_url":"https://github.com/hlissner/doom-emacs/pull/497","diff_url":"https://github.com/hlissner/doom-emacs/pull/497.diff","patch_url":"https://github.com/hlissner/doom-emacs/pull/497.patch"},"body":"Since Elixir is supported out of the box, it seems unfair to leave out Erlang :). I'm still relatively new to working with elisp, so let me know if I could be doing things differently. I added some customizations which add some additional support for rebar3 and some common Erlang files (e.g. `sys.config`). I think there is probably room here to expand this to maybe provide EDTS/Wrangler or something along those lines, but I wanted to start simple - this module is basically what I built for myself so far."},"comment":{"url":"https://api.github.com/repos/hlissner/doom-emacs/issues/comments/377907355","html_url":"https://github.com/hlissner/doom-emacs/pull/497#issuecomment-377907355","issue_url":"https://api.github.com/repos/hlissner/doom-emacs/issues/497","id":377907355,"user":{"login":"hlissner","id":510883,"avatar_url":"https://avatars2.githubusercontent.com/u/510883?v=4","gravatar_id":"","url":"https://api.github.com/users/hlissner","html_url":"https://github.com/hlissner","followers_url":"https://api.github.com/users/hlissner/followers","following_url":"https://api.github.com/users/hlissner/following{/other_user}","gists_url":"https://api.github.com/users/hlissner/gists{/gist_id}","starred_url":"https://api.github.com/users/hlissner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlissner/subscriptions","organizations_url":"https://api.github.com/users/hlissner/orgs","repos_url":"https://api.github.com/users/hlissner/repos","events_url":"https://api.github.com/users/hlissner/events{/privacy}","received_events_url":"https://api.github.com/users/hlissner/received_events","type":"User","site_admin":false},"created_at":"2018-04-02T11:00:53Z","updated_at":"2018-04-02T11:00:53Z","author_association":"OWNER","body":"This is a good start, but requires some work:\r\n\r\n1. The `def-package-hook!` call is unnecessary. erlang is defined no-where else such that it can be reconfigured. Convert it to `def-package!` and move it to config.el (replacing the `(after! erlang ...)` block.\r\n2. Use the `:mode` property in `def-package!` to register those file extensions, e.g.\r\n\r\n```elisp\r\n(def-package! erlang\r\n  :mode \"\\\\.erlang$\"\r\n  :mode \"/rebar\\\\.config\\\\(?:\\\\.script\\\\)?$\"\r\n  :mode \"/\\\\(?:app\\\\|sys\\\\)\\\\.config$\"\r\n  :config\r\n  ...)\r\n```\r\n\r\n3. The two rebar3 functions should be moved into an `autoload.el` file (and the `init.el` file removed), and renamed to follow Doom's naming convention:\r\n   + `+erlang-rebar3-flymake-get-include-dirs`\r\n   + `+erlang-rebar3-flymake-get-code-path-dirs`\r\n4. The `ivy-erlang-complete` and `company-erlang` packages should be conditionally installed in `packages.el`, e.g.\r\n\r\n  ```elisp\r\n  (when (featurep! :completion ivy)\r\n    (package! ivy-erlang-complete))\r\n  (when (featurep! :completion company)\r\n    (package! company-erlang))\r\n  ```\r\n5. In `config.el`, you've defined the company and ivy packages as `erlang-ivy` and `erlang-company`, but these packages do not exist. The real names of these packages are `ivy-erlang-complete` and `company-erlang`, please correct them.\r\n6. Those `:after` blocks are a little excessive, when `:hook` will do. Also, refrain from adding `ivy-erlang-complete-reparse` to the global `after-save-hook` hook, to avoid executing it when saving _any_ buffer:\r\n\r\n```elisp\r\n(def-package! ivy-erlang-complete\r\n  :when (featurep! :completion ivy)\r\n  :hook (erlang-mode . ivy-erlang-complete-init)\r\n  :config\r\n  (add-hook! 'erlang-mode-hook\r\n    (add-hook 'after-save-hook #'ivy-erlang-complete-reparse nil t)))\r\n\r\n(def-package! company-erlang\r\n  :when (featurep! :completion company)\r\n  :hook (erlang-mode . company-erlang-init))\r\n```\r\n\r\n-----\r\n\r\nAlso, side question: is there any reason why you aren't using the [flycheck-rebar3](https://github.com/joedevivo/flycheck-rebar3) plugin? Doom mainly uses `flycheck` over flymake. Unless that plugin is broken or inferior, I'd like to be consistent. I am not an elixir user, so I'm unable to reliably test this myself."}}
{"actor":{"display_login":"hlissner"}}