make eldoc-overlay-mode as a global minor mode
[eldoc-overlay.git] / README.md
blob0712266bb452969280eb0a64f27325da8dd591c5
1 # Screenshots
3 ![screenshot](screenshot.png)
5 # eldoc-overlay
7 Eldoc displays the function signature of the closest function call
8 around point either in the minibuffer or in the modeline.  This
9 package modifies Eldoc to display this documentation inline using a
10 buffer text overlay.
12 `eldoc-overlay-mode` is a per-buffer minor mode.  
13    A call to `eldoc-overlay-enable` turns it on.  
14    A call to `eldoc-overlay-disable` turns it off
16    <kbd>C-x C-h</kbd> interactively calls `eldoc-overlay-toggle` and tells
17    you the mode's new state.
19 `global-eldoc-overlay-mode` can be used to toggle this for all buffers.  
20    A call to `global-eldoc-overlay-enable` turns it on.  
21    A call to `global-eldoc-overlay-disable` turns it off
23    <kbd>C-u C-x C-h</kbd> interactively calls `global-eldoc-overlay-toggle` and tells
24    you the mode's new state.
26 By default, the overlay is not used in the minibuffer, eldoc is shown in the modeline
27 in this case.  Set the option `eldoc-overlay-in-minibuffer-flag` non-nil if you want
28 to enable overlay use in the minibuffer.
30 The key used to toggle the mode can be customized by setting the `eldoc-overlay-key`
31 option.
33 # Installation
35 ```emacs-lisp
36 (use-package eldoc-overlay
37   :ensure t
38   :init (eldoc-overlay-mode 1))
39 ```
41 # Configuration
43 ## An example config ##
45 ```elisp
46 (use-package eldoc-overlay
47   :ensure t
48   :delight eldoc-overlay-mode
49   :custom ((eldoc-overlay-backend 'inline-docs)
50            ;; (eldoc-overlay-delay 3)
51            )
52   :custom-face (inline-docs-border-face ((t (:family "DejaVu Sans Mono"))))
53   :hook (eldoc-mode . eldoc-overlay-mode))
54 ```
56 ## overlay display backend ##
58 Check out customize variable `eldoc-overlay-backend`.
60 ## overlay display delay ##
62 Check out customize variable `eldoc-overlay-delay`.
64 # Usage
66 Eldoc displays the function signature of the closest function call around point
67 either in the minibuffer or in the modeline.
69 This package modifies Eldoc to display this documentation inline using a buffer
70 text overlay.
72 - `eldoc-overlay-mode` is a per-buffer minor mode.
73 - A call to `eldoc-overlay-enable' turns it on.
74 - A call to `eldoc-overlay-disable' turns it off
76 {C-x C-h} interactively calls `eldoc-overlay-toggle' and tells you the mode's
77 new state.
79 - `global-eldoc-overlay-mode' can be used to toggle this for all buffers.
80 - A call to `global-eldoc-overlay-enable' turns it on.
81 - A call to `global-eldoc-overlay-disable' turns it off
83 {C-u C-x C-h} interactively calls `global-eldoc-overlay-toggle` and tells you
84 the mode's new state.
86 By default, the overlay is not used in the minibuffer, eldoc is shown in the
87 modeline in this case. Set the option `eldoc-overlay-in-minibuffer-flag` non-nil
88 if you want to enable overlay use in the minibuffer.
90 The key used to toggle the mode can be customized by setting the
91 `eldoc-overlay-key` option.
93 Finally, see the documentation for `eldoc-overlay-backend` if you want to try a
94 different overlay display package backend.
96 # Notices
98 - If you found the eldoc-overlay display border longer than window width, it's caused by the font of
99   face `inline-docs-border-face`. You can fix this by setting face to use another mono font.
101     ```elisp
102     (set-face-attribute 'inline-docs-border-face nil
103                         :family "DejaVu Sans Mono")
104     ```
106 # Change log
108 ## break backward compatible upgrading changes
111 This source code originally came from an answer to [justbur](https://emacs.stackexchange.com/users/14114/justbur)
112 of this [question](https://emacs.stackexchange.com/questions/29256/display-eldoc-help-info-behind-point).