stan-dev / stan-mode

Emacs mode for Stan.
GNU General Public License v3.0
71 stars 15 forks source link

wishlist: completion, function argument hints #7

Closed tpapp closed 10 years ago

tpapp commented 10 years ago

It would be nice to have

  1. completion for functions (mostly distributions),
  2. some kind of hints that could either be shown with a command, or automatically, in the minibuffer or as a popup hint. For example, for normal(...) it would display something like normal(mu, sigma). Since STAN sometimes uses different semantics for functions that are also present in R etc (eg in R the normal uses variance), this could help prevent some coding errors.

I don't know how to implement these features in Emacs, but once a framework is in place, I would be happy to fill it in the actual definitions.

jrnold commented 10 years ago

I very much agree. So much, so that I've incorporated auto-completing using ac-mode and yasnippet in the development branch. I just haven't merged it into the main branch. Try using the develop branch and let me know how it works for you.

tpapp commented 10 years ago

I could not use it, I get the following debug trace when I try to open a file:

Debugger entered--Lisp error: (void-variable stan--load-ac)
  (if stan--load-ac (progn stan-ac-mode-setup))
  stan-mode()
  set-auto-mode-0(stan-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer foo.stan> "/tmp/foo.stan" nil nil "/tmp/foo.stan" (11511902 65025))
  find-file-noselect("/tmp/foo.stan" nil nil)
  ido-file-internal(raise-frame)
  ido-find-file()
  call-interactively(ido-find-file nil nil)
jrnold commented 10 years ago

Sorry about that. I just fixed it in the current devel commit.

jrnold commented 10 years ago

autocomplete features using ac-mode and yasnippet are now included in the package.