aboutsummaryrefslogtreecommitdiff
path: root/README.org
blob: 6a5b27750b465cd633dd9e338a124cd579e7fd1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#+title: hc.el

hc.el (or hcel in ELPA) is a client to [[https://g.ypei.me/hcel.git/][hcel]] and an Emacs package for
Haskell code browsing and exploring.  Features include:

- Jump to definition across packages
- Find references across packages
- Search identifiers in a package or globally
- Highlight the identifier at point
- Browse packages, modules and identifiers in an outline mode buffer
- Eldoc integration, showing type and documentation of the identifier
  at point, or the selected expression.
- Syntax highlight, either with builtin font-locks or haskell-mode
- Show info about an identifier in a help buffer
- Integration with [[https://g.ypei.me/haddock.git/about][haddorg]], allowing jumps between identifier
  definition site and its org entry in documentation generated by
  haddorg.

* Install

Clone this repo, and add to load path (assuming you clone to
~~/.emacs.d~):

#+begin_src sh
cd ~/.emacs.d
git clone https://g.ypei.me/hc.el.git
#+end_src

#+begin_src elisp
(add-to-list 'load-path "~/.emacs.d/hc.el")
#+end_src

You'll also need an hcel server.  To host one yourself, clone the [[https://g.ypei.me/hcel.git][repo]]
and follow the instructions there.

Once you have a server set up (say at ~localhost:8080~) and serving
source info about indexed packages, do the following and you are all
set.

#+begin_src elisp
(require 'hcel)
(setq hcel-host "localhost:8080")
#+end_src

* Use

There are several entry points:
- ~hcel~ opens up an hcel-outline mode buffer, where you can
  browse all packages, modules and identifiers in outline mode, and
  open any module source or jump to the definition of any identifier you like;
- ~hcel-package~ prompts you for a package id, followed by a module
  path, to open the module source.
- ~hcel-global-ids~ lets you search for identifiers globally, and
  either jump to the source (in case of a hit) or display search
  results.
- ~hcel-help~ lets you search for identifiers globally and displays
  the result in a help buffer.

* TODOs

Most of these TODOs likely require changes to the server program.

- Navigation between identifiers within the help buffer.
- Awareness of all modules exporting an identifier (like hoogle)
- Requesting server to index a new package, or re-index an updated
  one.

* Contact and Copyright

~hc.el~ is maintained by Yuchen Pei <id@ypei.org> and covered by [[https://www.gnu.org/licenses/agpl-3.0.en.html][GNU
AGPLv3+]].  You may find the license text in a file named COPYING.agpl3
in the project tree.