haskell / haskell-mode

Emacs mode for Haskell
http://haskell.github.io/haskell-mode/
GNU General Public License v3.0
1.33k stars 342 forks source link

Make eldoc-mode fully subsume haskell-doc-mode #1138

Open gracjan opened 8 years ago

gracjan commented 8 years ago

In light of issues mulled over in #649 and #820 haskell-doc-mode should be removed, functionality should be put in eldoc-mode. eldoc actually works already with haskell-mode:

  (set (make-local-variable 'eldoc-documentation-function)
       'haskell-doc-current-info)
fice-t commented 8 years ago

Few things I noticed:

gracjan commented 8 years ago

Hmm, is there anything of value to salvage from haskell-doc-mode?

fice-t commented 8 years ago

The unicode output of function type signatures seems helpful. For example, haskell-process-do-type could use that.

Otherwise I don't immediately see a whole lot. There's a lot of code that seems like it would have to be updated for this century. For example, there's an option to use inf-haskell to do completions, but a new version might as well use interactive-haskell-mode instead.

gracjan commented 8 years ago

So now we need a brave decision to kill it wholesale. Lets do like this:

  1. In Monthly Report we announce the killing.
  2. Wait one month so that people can chime in.
  3. Do the kill after a month.

It seems to be a good time to do stable release before this happens.

gracjan commented 8 years ago

Reference: https://github.com/bbatsov/prelude/issues/989

fice-t commented 8 years ago

@gracjan I'm not sure what the best way to do it is, but since Emacs 25 uses global-eldoc-mode by default, I'd say something should be done before 25.1 releases (~1 month I believe).

gracjan commented 8 years ago

Just yesterday we have fixed the 'async' message from haskell-doc-mode so there are people using it.

fice-t commented 8 years ago

True (though it did take a bit for a report to come in). I was thinking the least that could be done is to make-obsolete haskell-doc-mode and perhaps make it an obsolete alias of eldoc-mode, which would give people warnings when byte-compiling files using it.

The issue that might want to be avoided though is having both (global)eldoc-mode and haskell-doc-mode on at the same time.

gracjan commented 8 years ago

People do not enable haskell-doc-mode because they know what they are doing, they just copy some config from somewhere and run with it. For example Emacs Prelude stopped using haskell-doc-mode only just recently on my request.

fice-t commented 8 years ago

Well, it doesn't seem like the eldoc functionality is given much spotlight (it's not in the manual). If one didn't read the source code, read the 1.45 NEWS section, or already use eldoc mode in their prog-mode hook then it's not surprising they don't know about it.

Are you saying that a byte-compilation warning might not be good enough (i.e. they wouldn't byte-compile their init file)? If so, then one option is to straight up:

 (defun haskell-doc-mode (&optional arg)
  (interactive)
  (warn "Please use `eldoc-mode' instead.")
  (eldoc-mode arg))

I don't care either way, but as yesterday reminded me, it might be best to just get it out of the way as with Emacs 25 there's going to be a lot more eldoc-mode users.

gracjan commented 8 years ago

We can do defalias and make-obsolete, I just wanted to make sure that eldoc-mode has all the funcitionality of haskell-doc-mode before we kill it.

fice-t commented 8 years ago

Don't take my word for it, but from what I can see all that's haskell-doc-mode-specific is:

gracjan commented 8 years ago

So lets kill it. @fice-t, can you:

  1. Make a defalias from haskell-doc-mode to eldoc-mode.
  2. Remove the whole file haskell-doc-mode.el

?

fice-t commented 8 years ago

Sorry, I suppose I wasn't clear before. There's still a bunch of stuff for eldoc-mode to work in haskell-mode still in haskell-doc.el (haskell-doc-current-info and everything it uses), but there's also a bunch of stuff (some unused anyway) that can get ripped out.

But it probably should get a rewrite (by someone else who understands it better) later down the road.