|
8 | 8 | @c %**end of header
|
9 | 9 |
|
10 | 10 | @copying
|
11 |
| -Copyright (C) 2013-2022 by Greg Hendershott. |
| 11 | +Copyright (C) 2013-2024 by Greg Hendershott. |
12 | 12 |
|
13 | 13 | SPDX-License-Identifier: GPL-3.0-or-later
|
14 | 14 | @end copying
|
@@ -215,6 +215,7 @@ General variables
|
215 | 215 | * racket-xp-after-change-refresh-delay::
|
216 | 216 | * racket-xp-highlight-unused-regexp::
|
217 | 217 | * racket-xp-add-binding-faces::
|
| 218 | +* racket-xp-eldoc-level:: |
218 | 219 | * racket-documentation-search-location::
|
219 | 220 | * racket-expand-hiding::
|
220 | 221 |
|
@@ -822,20 +823,21 @@ You can customize where the REPL buffer is displayed by adding an item to the Em
|
822 | 823 | @node eldoc
|
823 | 824 | @section eldoc
|
824 | 825 |
|
825 |
| -By default Racket Mode sets @code{eldoc-documentation-function} to @code{nil} --- no @code{eldoc-mode} support. You may set it to @code{racket-eldoc-function} in a @code{racket-mode-hook} and @code{racket-repl-mode-hook} if you really want to use @code{eldoc-mode} with Racket. But it is not a very satisfying experience because Racket is not a very ``eldoc-friendly'' language. Although Racket Mode attempts to discover argument lists, contracts, or types this doesn't work in many common cases: |
| 826 | +Various modes add local hooks to @code{eldoc-documentation-functions}. |
826 | 827 |
|
827 | 828 | @itemize
|
828 | 829 | @item
|
829 |
| -Many Racket primitives are defined in @code{#%kernel} or @code{#%runtime}. There's no easy way to determine their argument lists. Most do not @code{provide} a contract. |
| 830 | +The minor mode @code{racket-xp-mode} adds hooks to document the identifiers at point or at an apparent s-expression application head position. The identifiers are documented from check-syntax annotations. You may customize the variable @ref{racket-xp-eldoc-level} to choose how much information is shown. |
830 | 831 |
|
831 | 832 | @item
|
832 |
| -Many of the interesting Racket forms are syntax (macros) not functions. There's no easy way to determine their ``argument lists''. |
833 |
| - |
834 |
| -@item |
835 |
| -When a form has documentation, Racket Mode can show the \``bluebox\'' -- but often that does not fit in a single line as you would normally expect with eldoc. |
| 833 | +The major mode @code{racket-repl-mode} adds hooks to describe the namespace identifers at point or at an apparent s-expression application head position. The description is a signature from surface syntax, or a Typed Racket type, or a ``bluebox'' for the namespace identifier. |
836 | 834 | @end itemize
|
837 | 835 |
|
838 |
| -A more satisfying experience is to use @ref{racket-xp-describe} or @ref{racket-xp-documentation}. |
| 836 | +Tip: With an @code{eldoc-documentation-strategy} of @code{eldoc-documentation-default}, these hooks show info about point when available, @emph{or else} for the s-expression application head. You may change that to @code{eldoc-documentation-compose} to show info for @emph{both} positions when available. |
| 837 | + |
| 838 | +Tip: Some people use the third-party package @code{eldoc-box} to show information in a child frame (near point, or in a corner of the main frame) instead of the echo area. |
| 839 | + |
| 840 | +Note: Racket Mode does not support the ``old'' eldoc API that uses @code{eldoc-documentation-function}, singular. |
839 | 841 |
|
840 | 842 | @node Start faster
|
841 | 843 | @section Start faster
|
@@ -1298,21 +1300,6 @@ even ``let'' forms:
|
1298 | 1300 |
|
1299 | 1301 | Minor mode to let you always type @code{[}' to insert @code{(} or @code{[} automatically.
|
1300 | 1302 |
|
1301 |
| -This is a minor mode. If called interactively, toggle the |
1302 |
| -@code{Racket-Smart-Open-Bracket mode} mode. If the prefix argument is |
1303 |
| -positive, enable the mode, and if it is zero or negative, disable |
1304 |
| -the mode. |
1305 |
| - |
1306 |
| -If called from Lisp, toggle the mode if ARG is @code{toggle}. Enable |
1307 |
| -the mode if ARG is nil, omitted, or is a positive number. |
1308 |
| -Disable the mode if ARG is a negative number. |
1309 |
| - |
1310 |
| -To check whether the minor mode is enabled in the current buffer, |
1311 |
| -evaluate @ref{racket-smart-open-bracket-mode}. |
1312 |
| - |
1313 |
| -The mode's hook is called both when the mode is enabled and when |
1314 |
| -it is disabled. |
1315 |
| - |
1316 | 1303 | Behaves like the ``Automatically adjust opening square brackets''
|
1317 | 1304 | feature in Dr. Racket.
|
1318 | 1305 |
|
@@ -1355,6 +1342,21 @@ Tip: When using this with @ref{racket-hash-lang-mode}, you may want
|
1355 | 1342 | to use @ref{racket-hash-lang-module-language-hook} to enable it IFF
|
1356 | 1343 | the module langugage is something like ``racket''.
|
1357 | 1344 |
|
| 1345 | +This is a minor mode. If called interactively, toggle the |
| 1346 | +@code{Racket-Smart-Open-Bracket mode} mode. If the prefix argument is |
| 1347 | +positive, enable the mode, and if it is zero or negative, disable |
| 1348 | +the mode. |
| 1349 | + |
| 1350 | +If called from Lisp, toggle the mode if ARG is @code{toggle}. Enable |
| 1351 | +the mode if ARG is nil, omitted, or is a positive number. |
| 1352 | +Disable the mode if ARG is a negative number. |
| 1353 | + |
| 1354 | +To check whether the minor mode is enabled in the current buffer, |
| 1355 | +evaluate @ref{racket-smart-open-bracket-mode}. |
| 1356 | + |
| 1357 | +The mode's hook is called both when the mode is enabled and when |
| 1358 | +it is disabled. |
| 1359 | + |
1358 | 1360 | @node racket-insert-closing
|
1359 | 1361 | @subsection racket-insert-closing
|
1360 | 1362 |
|
@@ -1724,20 +1726,6 @@ anything else, do @code{prog-indent-sexp}.
|
1724 | 1726 |
|
1725 | 1727 | A minor mode that analyzes expanded code to explain and explore.
|
1726 | 1728 |
|
1727 |
| -This is a minor mode. If called interactively, toggle the |
1728 |
| -@code{Racket-Xp mode} mode. If the prefix argument is positive, |
1729 |
| -enable the mode, and if it is zero or negative, disable the mode. |
1730 |
| - |
1731 |
| -If called from Lisp, toggle the mode if ARG is @code{toggle}. Enable |
1732 |
| -the mode if ARG is nil, omitted, or is a positive number. |
1733 |
| -Disable the mode if ARG is a negative number. |
1734 |
| - |
1735 |
| -To check whether the minor mode is enabled in the current buffer, |
1736 |
| -evaluate @ref{racket-xp-mode}. |
1737 |
| - |
1738 |
| -The mode's hook is called both when the mode is enabled and when |
1739 |
| -it is disabled. |
1740 |
| - |
1741 | 1729 | This minor mode is an optional enhancement to @ref{racket-mode} edit
|
1742 | 1730 | buffers. Like any minor mode, you can turn it on or off for a
|
1743 | 1731 | specific buffer. If you always want to use it, put the following
|
@@ -1879,7 +1867,7 @@ will stop after the first syntax error, some like Typed Racket
|
1879 | 1867 | will try to collect and report multiple errors.
|
1880 | 1868 |
|
1881 | 1869 | You may use @code{xref-find-definitions} @kbd{M-.} ,
|
1882 |
| -@code{xref-pop-marker-stack} @kbd{M-,} , and |
| 1870 | +@code{xref-pop-marker-stack} @kbd{M-x} @code{xref-pop-marker-stack}, and |
1883 | 1871 | @code{xref-find-references}: @ref{racket-xp-mode} adds a backend to the
|
1884 | 1872 | variable @code{xref-backend-functions}. This backend uses information
|
1885 | 1873 | from the drracket/check-syntax static analysis. Its ability to
|
@@ -1936,6 +1924,22 @@ commands directly to whatever keys you prefer.
|
1936 | 1924 | @tab @ref{racket-xp-next-definition}
|
1937 | 1925 | @end multitable
|
1938 | 1926 |
|
| 1927 | + |
| 1928 | + |
| 1929 | +This is a minor mode. If called interactively, toggle the |
| 1930 | +@code{Racket-Xp mode} mode. If the prefix argument is positive, |
| 1931 | +enable the mode, and if it is zero or negative, disable the mode. |
| 1932 | + |
| 1933 | +If called from Lisp, toggle the mode if ARG is @code{toggle}. Enable |
| 1934 | +the mode if ARG is nil, omitted, or is a positive number. |
| 1935 | +Disable the mode if ARG is a negative number. |
| 1936 | + |
| 1937 | +To check whether the minor mode is enabled in the current buffer, |
| 1938 | +evaluate @ref{racket-xp-mode}. |
| 1939 | + |
| 1940 | +The mode's hook is called both when the mode is enabled and when |
| 1941 | +it is disabled. |
| 1942 | + |
1939 | 1943 | @node racket-xp-describe
|
1940 | 1944 | @subsection racket-xp-describe
|
1941 | 1945 |
|
@@ -2181,7 +2185,7 @@ Racket Describe buffer for that module's version of the thing.
|
2181 | 2185 | Major mode for Racket REPL@.
|
2182 | 2186 |
|
2183 | 2187 | You may use @code{xref-find-definitions} @kbd{M-.} and
|
2184 |
| -@code{xref-pop-marker-stack} @kbd{M-,} : |
| 2188 | +@code{xref-pop-marker-stack} @kbd{M-x} @code{xref-pop-marker-stack}: |
2185 | 2189 | @ref{racket-repl-mode} adds a backend to the variable
|
2186 | 2190 | @code{xref-backend-functions}. This backend uses information about
|
2187 | 2191 | identifier bindings and modules from the REPL's namespace.
|
@@ -2547,20 +2551,6 @@ or penultimate step during initialization.
|
2547 | 2551 |
|
2548 | 2552 | Minor mode for debug breaks.
|
2549 | 2553 |
|
2550 |
| -This is a minor mode. If called interactively, toggle the |
2551 |
| -@code{Racket-Debug mode} mode. If the prefix argument is positive, |
2552 |
| -enable the mode, and if it is zero or negative, disable the mode. |
2553 |
| - |
2554 |
| -If called from Lisp, toggle the mode if ARG is @code{toggle}. Enable |
2555 |
| -the mode if ARG is nil, omitted, or is a positive number. |
2556 |
| -Disable the mode if ARG is a negative number. |
2557 |
| - |
2558 |
| -To check whether the minor mode is enabled in the current buffer, |
2559 |
| -evaluate @ref{racket-debug-mode}. |
2560 |
| - |
2561 |
| -The mode's hook is called both when the mode is enabled and when |
2562 |
| -it is disabled. |
2563 |
| - |
2564 | 2554 | This feature is @strong{@strong{EXPERIMENTAL}}!!! It is likely to have
|
2565 | 2555 | significant limitations and bugs. You are welcome to open an
|
2566 | 2556 | issue to provide feedback. Please understand that this feature
|
@@ -2628,6 +2618,22 @@ provides shortcut keys:
|
2628 | 2618 | @tab @code{racket-debug-step}
|
2629 | 2619 | @end multitable
|
2630 | 2620 |
|
| 2621 | + |
| 2622 | + |
| 2623 | +This is a minor mode. If called interactively, toggle the |
| 2624 | +@code{Racket-Debug mode} mode. If the prefix argument is positive, |
| 2625 | +enable the mode, and if it is zero or negative, disable the mode. |
| 2626 | + |
| 2627 | +If called from Lisp, toggle the mode if ARG is @code{toggle}. Enable |
| 2628 | +the mode if ARG is nil, omitted, or is a positive number. |
| 2629 | +Disable the mode if ARG is a negative number. |
| 2630 | + |
| 2631 | +To check whether the minor mode is enabled in the current buffer, |
| 2632 | +evaluate @ref{racket-debug-mode}. |
| 2633 | + |
| 2634 | +The mode's hook is called both when the mode is enabled and when |
| 2635 | +it is disabled. |
| 2636 | + |
2631 | 2637 | @node racket-repl-clear
|
2632 | 2638 | @subsection racket-repl-clear
|
2633 | 2639 |
|
@@ -3102,6 +3108,7 @@ Delete the ``compiled'' directories made by @ref{racket-mode-start-faster}.
|
3102 | 3108 | * racket-xp-after-change-refresh-delay::
|
3103 | 3109 | * racket-xp-highlight-unused-regexp::
|
3104 | 3110 | * racket-xp-add-binding-faces::
|
| 3111 | +* racket-xp-eldoc-level:: |
3105 | 3112 | * racket-documentation-search-location::
|
3106 | 3113 | * racket-expand-hiding::
|
3107 | 3114 | @end menu
|
@@ -3246,6 +3253,29 @@ local definitions, using @ref{racket-xp-binding-local-face} and
|
3246 | 3253 | This has a visible effect only when there is @emph{not} also a
|
3247 | 3254 | 'face property applied by the major mode's fontification.
|
3248 | 3255 |
|
| 3256 | +@node racket-xp-eldoc-level |
| 3257 | +@subsection racket-xp-eldoc-level |
| 3258 | + |
| 3259 | +How much documentation to show via @code{eldoc}. |
| 3260 | + |
| 3261 | +Used by @code{racket-xp-eldoc-point} and @code{racket-xp-eldoc-sexp-app}. |
| 3262 | + |
| 3263 | +@itemize |
| 3264 | +@item |
| 3265 | +Minimal: Only the help-echo string. |
| 3266 | + |
| 3267 | +@item |
| 3268 | +Summary: Also the signature a.k.a. ``blubox'' from the |
| 3269 | +documentation. |
| 3270 | + |
| 3271 | +@item |
| 3272 | +Complete: Also the complete prose documentation. |
| 3273 | +@end itemize |
| 3274 | + |
| 3275 | +A third-party package like @code{eldoc-box} can be useful for all but |
| 3276 | +the minimal level. Even some bluebox signatures can take many |
| 3277 | +lines to show on screen. |
| 3278 | + |
3249 | 3279 | @node racket-documentation-search-location
|
3250 | 3280 | @subsection racket-documentation-search-location
|
3251 | 3281 |
|
@@ -4361,4 +4391,4 @@ Face @ref{racket-repl-mode} uses for output to current-error-port.
|
4361 | 4391 |
|
4362 | 4392 | Face @ref{racket-hash-lang-mode} uses for text tokens.
|
4363 | 4393 |
|
4364 |
| -@bye |
| 4394 | +@bye |
0 commit comments