Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
8 tasks
gracjan opened this issue Feb 6, 2016 · 14 comments
Open
8 tasks

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

gracjan opened this issue Feb 6, 2016 · 14 comments

Comments

@gracjan
Copy link
Contributor

gracjan commented Feb 6, 2016

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)
  • find out if the above snippet is all that is needed for eldoc-mode
  • implement what is missing
  • write some coverage tests
  • remove functionality that duplicates eldoc-mode from haskell-doc.el
  • remove mentions of haskell-doc-mode from texi
  • remove mentions of haskell-doc-mode from wiki
  • remove mentions of haskell-doc-mode from all the random wikis and tutorials out there
  • remove mentions of haskell-doc-mode from spacemacs (if needed)
@gracjan gracjan changed the title Remove haskell-doc-mode in favor of eldoc-mode Make eldoc-mode fully subsume haskell-doc-mode Feb 7, 2016
@fice-t
Copy link
Contributor

fice-t commented Feb 11, 2016

Few things I noticed:

  • haskell-doc-mode already seems to be absent from the wiki and .texi
  • spacemacs doesn't appear to have any mention of it either; they use haddock
  • haskell-doc-prelude-types and its generator haskell-doc-extract-and-insert-types appear to be Haskell 98-specific, which I don't think is terribly useful. That should be changed. The same goes for haskell-doc-strategy-ids.
  • There's a bug where the output of the type isn't prettified (unicode, etc) unless a process is active as the prettifying is done in haskell-process-get-type. This also affects eldoc in its current state.
  • haskell-doc is really old, I even saw some xemacs-specific stuff in there 😧

@gracjan
Copy link
Contributor Author

gracjan commented Feb 11, 2016

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

@fice-t
Copy link
Contributor

fice-t commented Feb 18, 2016

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
Copy link
Contributor Author

gracjan commented Feb 18, 2016

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
Copy link
Contributor Author

gracjan commented Apr 25, 2016

Reference: bbatsov/prelude#989

@fice-t
Copy link
Contributor

fice-t commented May 17, 2016

@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
Copy link
Contributor Author

gracjan commented May 18, 2016

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

@fice-t
Copy link
Contributor

fice-t commented May 18, 2016

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
Copy link
Contributor Author

gracjan commented May 18, 2016

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
Copy link
Contributor

fice-t commented May 19, 2016

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
Copy link
Contributor Author

gracjan commented May 19, 2016

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
Copy link
Contributor

fice-t commented May 20, 2016

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

  • special menu (it doesn't even seem to work, actually 😕)
  • haskell-doc-ask-mouse-for-type, which I'd be a bit surprised if anyone was using.

@gracjan
Copy link
Contributor Author

gracjan commented May 20, 2016

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
Copy link
Contributor

fice-t commented May 20, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants