Commit Graph

187 Commits

Author SHA1 Message Date
Yuan Fu
0a3b4a8c0e
Bump version 2018-12-13 20:25:18 -05:00
Yuan Fu
310e08a0d5
Update eldoc-box-max-pixel-height and README doc
- height max 1400 -> 700
- add doc in readme about them
2018-12-12 21:58:54 -05:00
Yuan Fu
614c318fdb
Hide eldoc doc buffer in buffer list 2018-12-12 21:54:18 -05:00
Yuan Fu
fe9483dd3c
Minor cleanup 2018-12-12 21:51:38 -05:00
Yuan Fu
f0b1bd23c5
Fix: scroll/click doc frame make it disappear after 1s
- Add eldoc-box--last-point
- eldoc-box--display sets eldoc-box-hover-mode to t in doc buffer
- eldoc-box--maybe-cleanup checks more things to decide whether to
  clear frame
- eldoc-box--eldoc-message-function sets eldoc-box--last-point to
  (point)
2018-12-12 21:49:20 -05:00
Yuan Fu
152d422aba
Minor fixup
eldoc-box--maybe-cleanup: Fix docstring typo
Add comment

eldoc-box--eldoc-message-function: Fix docstring
Add comment
minor code fix
2018-12-12 13:28:40 -05:00
Yuan Fu
27605bd370
Merge pull request #2 from joaotavora/master
Misc cleanup to eldoc-box 

- Define customization group
- Simplify timer management
- Rearrange to make compiler happy
- Reformat header
2018-12-12 13:13:04 -05:00
João Távora
2d6b9c3765 Clean up file header a bit
* eldoc-box.el (Copyright): Clear up situation.
(Maintainer): New field.
(Commentary): Add very brief commentary.
2018-12-12 14:24:09 +00:00
João Távora
ff11ef9392 Shoosh compilation warnings
* eldoc-box.el (eldoc-box): New group.
(eldoc-box-hover-mode, eldoc-box--frame): Move up in file.
compilation warning.
2018-12-12 14:21:43 +00:00
João Távora
8232e5eb60 Simplify timer management
* eldoc-box.el (eldoc-box--maybe-cleanup): Set timer var to nil
unconditionally.
(eldoc-box--eldoc-message-function): Rescheduler timer here.
(eldoc-box-hover-mode): Simplify.
(eldoc-box--maybe-cancel-timer, eldoc-box--enabled-buffer-list):
Not needed.
2018-12-12 14:16:29 +00:00
João Távora
c9693eddb0 Play nice with further customizations of eldoc-message-function
Uses a :before-until advice on the local value of
eldoc-message-function instead of setting it directly.  Thus, when we
give up because of eldoc-box-only-multi-line (or some other future
criteria), other :before-until handlers can kick in.

* eldoc-box.el (eldoc-box--eldoc-message-function): Control return of
t or nil.
(eldoc-box-hover-mode): Use add-function and
remove-function.
2018-12-12 13:53:33 +00:00
Yuan Fu
fcfd701f57
Manager the global timer gracefully
Don't cancel and create new timers naively.
Only cancel timer (and set to nil) when there is no live buffer
with eldoc-box-hover-mode enabled;
and only create new timer when none exists.
2018-12-12 01:58:56 -05:00
Yuan Fu
388282f59f
Clean up childframe after ElDoc
Add cleanup function and a idle timer

Why a timer? ElDoc is mainly use in minibuffer,
where the text is constantly being flushed by other commands
so ElDoc doesn't try very hard to cleanup
2018-12-12 00:14:53 -05:00
Yuan Fu
3fab3fb571
Say no documentation available if no documentation is available 2018-12-11 17:17:25 -05:00
Yuan Fu
ae91043e87
Minor change 2018-12-11 16:42:08 -05:00
Yuan Fu
f8de3466f5
Change copyright stuff 2018-12-11 16:40:48 -05:00
Yuan Fu
349e4738ec
Clear childframe on exit of minor mode 2018-12-11 16:38:02 -05:00
Yuan Fu
317cd2ddfc
Follow ElDoc convension
Instead of clearing childframe on pre-command hook,
clear when display function is passed a nil argument
2018-12-11 16:36:34 -05:00
Yuan Fu
34004bf492
Fix frame cleanup problem
I forgot to change the frame creation part to follow up with
the change to reuse frame instead of deleting them
2018-12-11 16:35:31 -05:00
Yuan Fu
5bb3e5533e
Fix face 2018-12-11 16:34:37 -05:00
Yuan Fu
001c421ce6
License is not really license so there is no license in fact sorry
I removed the license
2018-12-11 15:49:17 -05:00
Yuan Fu
2859a28afb
Make childframe invisible instead of delete it
It works fine with my python script.
2018-12-11 15:45:13 -05:00
Yuan Fu
60f758a24a
Speed up
Originally I have (when str (display)), but that leaves childdrame
unchanged.
To work around that I added (eldoc-box-quit-frame).
Now childframes are cleared up nicely but it lagging.

(when (stringp str) (display)) works. (although I don't know why (when
str) doesn't, even though eldoc-messaeg passes nil to message function)
2018-12-11 15:39:31 -05:00
Yuan Fu
f0c99152d2
childframe flickrs on some machine, maybe this fixes it 2018-12-11 15:20:11 -05:00
Yuan Fu
531fbaa5aa
Add version require and url info 2018-12-11 12:24:52 -05:00
Yuan Fu
210eb8858c
Don't forget dependency! 2018-12-11 11:27:54 -05:00
Yuan Fu
651e0810d7
Update readme 2018-12-11 11:17:17 -05:00
Yuan Fu
194ff4136a
Add option to leave message in minibuffer when there's only one line 2018-12-11 11:16:02 -05:00
Yuan Fu
445a56e2fb
Update readme
Suggest how to use with eglot.
2018-12-11 10:33:52 -05:00
Yuan Fu
13a948fb4b
Update README 2018-12-11 09:17:31 -05:00
Yuan Fu
77250ae7da
Rename to eldoc-box 2018-12-11 09:15:00 -05:00
Yuan Fu
8a11b796d4
Remove elgot dependency 2018-12-11 09:13:44 -05:00
Yuan Fu
00f3b665bb
Add some padding between childframe and main frame 2018-12-11 00:20:34 -05:00
Yuan Fu
75a2f7d06e
Add support for body background color 2018-12-11 00:20:21 -05:00
Yuan Fu
9a6c21b644
Add border
This doesn't work for some reason, maybe it's because I'm on Mac?

It might be my machine's fault because
lsp-ui's childframe doesn't have border when they clain to do, either.

Anyway, the internal-border-width parameter works fine,
and internal-border face looks good, too.
So I guess the code is ok.
2018-12-10 21:02:24 -05:00
Yuan Fu
a5d2a7eccd
Add readme 2018-12-10 20:30:33 -05:00
Yuan Fu
bfda87893d
init 2018-12-10 20:26:08 -05:00