From 0abf4ac8a85e3980e94d711a9198e290b015b2c7 Mon Sep 17 00:00:00 2001 From: Marcus Kammer <2262664-marcuskammer@user.noreply.gitlab.com> Date: Tue, 24 Mar 2020 18:20:37 +0100 Subject: [PATCH] Upgrade packages --- .../company-abbrev.el | 0 .../company-abbrev.elc | Bin .../company-autoloads.el | 0 .../company-bbdb.el | 0 .../company-bbdb.elc | Bin .../company-capf.el | 0 .../company-capf.elc | Bin .../company-clang.el | 0 .../company-clang.elc | Bin .../company-cmake.el | 0 .../company-cmake.elc | Bin .../company-css.el | 0 .../company-css.elc | Bin .../company-dabbrev-code.el | 0 .../company-dabbrev-code.elc | Bin .../company-dabbrev.el | 0 .../company-dabbrev.elc | Bin .../company-eclim.el | 0 .../company-eclim.elc | Bin .../company-elisp.el | 0 .../company-elisp.elc | Bin .../company-etags.el | 0 .../company-etags.elc | Bin .../company-files.el | 0 .../company-files.elc | Bin .../company-gtags.el | 0 .../company-gtags.elc | Bin .../company-ispell.el | 0 .../company-ispell.elc | Bin .../company-keywords.el | 0 .../company-keywords.elc | Bin .../company-nxml.el | 0 .../company-nxml.elc | Bin .../company-oddmuse.el | 0 .../company-oddmuse.elc | Bin .../company-pkg.el | 2 +- .../company-semantic.el | 0 .../company-semantic.elc | Bin .../company-template.el | 0 .../company-template.elc | Bin .../company-tempo.el | 0 .../company-tempo.elc | Bin .../company-tng.el | 0 .../company-tng.elc | Bin .../company-xcode.el | 0 .../company-xcode.elc | Bin .../company-yasnippet.el | 22 +- .../company-yasnippet.elc | Bin 4457 -> 4444 bytes .../company.el | 14 +- .../company.elc | Bin 106599 -> 106701 bytes .../ein-autoloads.el | 2 +- .../ein-cell.el | 0 .../ein-cell.elc | Bin .../ein-classes.el | 0 .../ein-classes.elc | Bin .../ein-completer.el | 0 .../ein-completer.elc | Bin .../ein-connect.el | 0 .../ein-connect.elc | Bin .../ein-contents-api.el | 0 .../ein-contents-api.elc | Bin 21677 -> 21655 bytes .../ein-core.el | 0 .../ein-core.elc | Bin 14084 -> 14082 bytes .../ein-dev.el | 0 .../ein-dev.elc | Bin 13089 -> 13086 bytes .../ein-events.el | 0 .../ein-events.elc | Bin .../ein-file.el | 0 .../ein-file.elc | Bin .../ein-ipdb.el | 0 .../ein-ipdb.elc | Bin .../ein-ipynb-mode.el | 0 .../ein-ipynb-mode.elc | Bin .../ein-jupyter.el | 5 +- .../ein-jupyter.elc | Bin 13182 -> 13397 bytes .../ein-jupyterhub.el | 0 .../ein-jupyterhub.elc | Bin .../ein-kernel.el | 0 .../ein-kernel.elc | Bin 37747 -> 37745 bytes .../ein-kernelinfo.el | 0 .../ein-kernelinfo.elc | Bin .../ein-kill-ring.el | 0 .../ein-kill-ring.elc | Bin .../ein-log.el | 0 .../ein-log.elc | Bin .../ein-markdown-mode.el | 0 .../ein-markdown-mode.elc | Bin .../ein-node.el | 0 .../ein-node.elc | Bin .../ein-notebook.el | 0 .../ein-notebook.elc | Bin 216010 -> 216008 bytes .../ein-notebooklist.el | 7 +- .../ein-notebooklist.elc | Bin 43708 -> 43747 bytes .../ein-notification.el | 0 .../ein-notification.elc | Bin .../ein-output-area.el | 0 .../ein-output-area.elc | Bin .../ein-pager.el | 0 .../ein-pager.elc | Bin .../ein-pkg.el | 2 +- .../ein-process.el | 0 .../ein-process.elc | Bin .../ein-pytools.el | 0 .../ein-pytools.elc | Bin .../ein-query.el | 0 .../ein-query.elc | Bin .../ein-scratchsheet.el | 0 .../ein-scratchsheet.elc | Bin .../ein-shared-output.el | 0 .../ein-shared-output.elc | Bin .../ein-traceback.el | 0 .../ein-traceback.elc | Bin .../ein-utils.el | 0 .../ein-utils.elc | Bin 27820 -> 27807 bytes .../ein-websocket.el | 0 .../ein-websocket.elc | Bin 6461 -> 6458 bytes .../ein-worksheet.el | 79 +- .../ein-worksheet.elc | Bin 50373 -> 50866 bytes .../ein.el | 0 .../ein.elc | Bin .../ob-ein.el | 0 .../ob-ein.elc | Bin 17019 -> 17077 bytes .../poly-ein.el | 0 .../poly-ein.elc | Bin elpa/elisp-lint-20200217.38/elisp-lint-pkg.el | 2 - .../elisp-lint-autoloads.el | 0 .../elisp-lint-pkg.el | 2 + .../elisp-lint.el | 109 +- .../elisp-lint.elc | Bin 12294 -> 13201 bytes elpa/elpy-20200202.2031/elpy/__init__.py | 41 - elpa/elpy-20200202.2031/elpy/__main__.py | 25 - elpa/elpy-20200202.2031/elpy/auto_pep8.py | 27 - elpa/elpy-20200202.2031/elpy/blackutil.py | 69 - elpa/elpy-20200202.2031/elpy/compat.py | 33 - elpa/elpy-20200202.2031/elpy/jedibackend.py | 382 --- elpa/elpy-20200202.2031/elpy/pydocutils.py | 91 - elpa/elpy-20200202.2031/elpy/refactor.py | 381 --- elpa/elpy-20200202.2031/elpy/rpc.py | 151 -- elpa/elpy-20200202.2031/elpy/server.py | 271 -- .../elpy-20200202.2031/elpy/tests/__init__.py | 8 - elpa/elpy-20200202.2031/elpy/tests/compat.py | 18 - elpa/elpy-20200202.2031/elpy/tests/support.py | 986 ------- .../elpy/tests/test_auto_pep8.py | 21 - .../elpy/tests/test_black.py | 55 - .../elpy/tests/test_jedibackend.py | 395 --- .../elpy/tests/test_pydocutils.py | 88 - .../elpy/tests/test_refactor.py | 545 ---- .../elpy-20200202.2031/elpy/tests/test_rpc.py | 209 -- .../elpy/tests/test_server.py | 389 --- .../elpy/tests/test_support.py | 19 - .../elpy/tests/test_yapf.py | 33 - elpa/elpy-20200202.2031/elpy/yapfutil.py | 38 - .../elpy-autoloads.el | 0 .../elpy-django.el | 0 .../elpy-django.elc | Bin .../elpy-pkg.el | 2 +- .../elpy-profile.el | 0 .../elpy-profile.elc | Bin .../elpy-refactor.el | 0 .../elpy-refactor.elc | Bin .../elpy-rpc.el | 9 +- .../elpy-rpc.elc | Bin 38249 -> 38386 bytes .../elpy-shell.el | 0 .../elpy-shell.elc | Bin .../elpy.el | 41 +- .../elpy.elc | Bin 118143 -> 120417 bytes .../snippets/python-mode/.yas-setup.el | 0 .../snippets/python-mode/.yas-setup.elc | Bin .../snippets/python-mode/__abs__ | 0 .../snippets/python-mode/__add__ | 0 .../snippets/python-mode/__and__ | 0 .../snippets/python-mode/__bool__ | 0 .../snippets/python-mode/__call__ | 0 .../snippets/python-mode/__cmp__ | 0 .../snippets/python-mode/__coerce__ | 0 .../snippets/python-mode/__complex__ | 0 .../snippets/python-mode/__contains__ | 0 .../snippets/python-mode/__del__ | 0 .../snippets/python-mode/__delattr__ | 0 .../snippets/python-mode/__delete__ | 0 .../snippets/python-mode/__delitem__ | 0 .../snippets/python-mode/__div__ | 0 .../snippets/python-mode/__divmod__ | 0 .../snippets/python-mode/__enter__ | 0 .../snippets/python-mode/__eq__ | 0 .../snippets/python-mode/__exit__ | 0 .../snippets/python-mode/__float__ | 0 .../snippets/python-mode/__floordiv__ | 0 .../snippets/python-mode/__ge__ | 0 .../snippets/python-mode/__get__ | 0 .../snippets/python-mode/__getattr__ | 0 .../snippets/python-mode/__getattribute__ | 0 .../snippets/python-mode/__getitem__ | 0 .../snippets/python-mode/__gt__ | 0 .../snippets/python-mode/__hash__ | 0 .../snippets/python-mode/__hex__ | 0 .../snippets/python-mode/__iadd__ | 0 .../snippets/python-mode/__iand__ | 0 .../snippets/python-mode/__idiv__ | 0 .../snippets/python-mode/__ifloordiv__ | 0 .../snippets/python-mode/__ilshift__ | 0 .../snippets/python-mode/__imod__ | 0 .../snippets/python-mode/__imul__ | 0 .../snippets/python-mode/__index__ | 0 .../snippets/python-mode/__init__ | 0 .../snippets/python-mode/__instancecheck__ | 0 .../snippets/python-mode/__int__ | 0 .../snippets/python-mode/__invert__ | 0 .../snippets/python-mode/__ior__ | 0 .../snippets/python-mode/__ipow__ | 0 .../snippets/python-mode/__irshift__ | 0 .../snippets/python-mode/__isub__ | 0 .../snippets/python-mode/__iter__ | 0 .../snippets/python-mode/__itruediv__ | 0 .../snippets/python-mode/__ixor__ | 0 .../snippets/python-mode/__le__ | 0 .../snippets/python-mode/__len__ | 0 .../snippets/python-mode/__long__ | 0 .../snippets/python-mode/__lshift__ | 0 .../snippets/python-mode/__lt__ | 0 .../snippets/python-mode/__mod__ | 0 .../snippets/python-mode/__mul__ | 0 .../snippets/python-mode/__ne__ | 0 .../snippets/python-mode/__neg__ | 0 .../snippets/python-mode/__new__ | 0 .../snippets/python-mode/__nonzero__ | 0 .../snippets/python-mode/__oct__ | 0 .../snippets/python-mode/__or__ | 0 .../snippets/python-mode/__pos__ | 0 .../snippets/python-mode/__pow__ | 0 .../snippets/python-mode/__radd__ | 0 .../snippets/python-mode/__rand__ | 0 .../snippets/python-mode/__rdivmod__ | 0 .../snippets/python-mode/__repr__ | 0 .../snippets/python-mode/__reversed__ | 0 .../snippets/python-mode/__rfloordiv__ | 0 .../snippets/python-mode/__rlshift__ | 0 .../snippets/python-mode/__rmod__ | 0 .../snippets/python-mode/__rmul__ | 0 .../snippets/python-mode/__ror__ | 0 .../snippets/python-mode/__rpow__ | 0 .../snippets/python-mode/__rrshift__ | 0 .../snippets/python-mode/__rshift__ | 0 .../snippets/python-mode/__rsub__ | 0 .../snippets/python-mode/__rtruediv__ | 0 .../snippets/python-mode/__rxor__ | 0 .../snippets/python-mode/__set__ | 0 .../snippets/python-mode/__setattr__ | 0 .../snippets/python-mode/__setitem__ | 0 .../snippets/python-mode/__slots__ | 0 .../snippets/python-mode/__str__ | 0 .../snippets/python-mode/__sub__ | 0 .../snippets/python-mode/__subclasscheck__ | 0 .../snippets/python-mode/__truediv__ | 0 .../snippets/python-mode/__unicode__ | 0 .../snippets/python-mode/__xor__ | 0 .../snippets/python-mode/_abs | 0 .../snippets/python-mode/_add | 0 .../snippets/python-mode/_and | 0 .../snippets/python-mode/_bool | 0 .../snippets/python-mode/_call | 0 .../snippets/python-mode/_cmp | 0 .../snippets/python-mode/_coerce | 0 .../snippets/python-mode/_complex | 0 .../snippets/python-mode/_contains | 0 .../snippets/python-mode/_del | 0 .../snippets/python-mode/_delattr | 0 .../snippets/python-mode/_delete | 0 .../snippets/python-mode/_delitem | 0 .../snippets/python-mode/_div | 0 .../snippets/python-mode/_divmod | 0 .../snippets/python-mode/_enter | 0 .../snippets/python-mode/_eq | 0 .../snippets/python-mode/_exit | 0 .../snippets/python-mode/_float | 0 .../snippets/python-mode/_floordiv | 0 .../snippets/python-mode/_ge | 0 .../snippets/python-mode/_get | 0 .../snippets/python-mode/_getattr | 0 .../snippets/python-mode/_getattribute | 0 .../snippets/python-mode/_getitem | 0 .../snippets/python-mode/_gt | 0 .../snippets/python-mode/_hash | 0 .../snippets/python-mode/_hex | 0 .../snippets/python-mode/_iadd | 0 .../snippets/python-mode/_iand | 0 .../snippets/python-mode/_idiv | 0 .../snippets/python-mode/_ifloordiv | 0 .../snippets/python-mode/_ilshift | 0 .../snippets/python-mode/_imod | 0 .../snippets/python-mode/_imul | 0 .../snippets/python-mode/_index | 0 .../snippets/python-mode/_init | 0 .../snippets/python-mode/_instancecheck | 0 .../snippets/python-mode/_int | 0 .../snippets/python-mode/_invert | 0 .../snippets/python-mode/_ior | 0 .../snippets/python-mode/_ipow | 0 .../snippets/python-mode/_irshift | 0 .../snippets/python-mode/_isub | 0 .../snippets/python-mode/_iter | 0 .../snippets/python-mode/_itruediv | 0 .../snippets/python-mode/_ixor | 0 .../snippets/python-mode/_le | 0 .../snippets/python-mode/_len | 0 .../snippets/python-mode/_long | 0 .../snippets/python-mode/_lshift | 0 .../snippets/python-mode/_lt | 0 .../snippets/python-mode/_mod | 0 .../snippets/python-mode/_mul | 0 .../snippets/python-mode/_ne | 0 .../snippets/python-mode/_neg | 0 .../snippets/python-mode/_new | 0 .../snippets/python-mode/_nonzero | 0 .../snippets/python-mode/_oct | 0 .../snippets/python-mode/_or | 0 .../snippets/python-mode/_pos | 0 .../snippets/python-mode/_pow | 0 .../snippets/python-mode/_radd | 0 .../snippets/python-mode/_rand | 0 .../snippets/python-mode/_rdivmod | 0 .../snippets/python-mode/_repr | 0 .../snippets/python-mode/_reversed | 0 .../snippets/python-mode/_rfloordiv | 0 .../snippets/python-mode/_rlshift | 0 .../snippets/python-mode/_rmod | 0 .../snippets/python-mode/_rmul | 0 .../snippets/python-mode/_ror | 0 .../snippets/python-mode/_rpow | 0 .../snippets/python-mode/_rrshift | 0 .../snippets/python-mode/_rshift | 0 .../snippets/python-mode/_rsub | 0 .../snippets/python-mode/_rtruediv | 0 .../snippets/python-mode/_rxor | 0 .../snippets/python-mode/_set | 0 .../snippets/python-mode/_setattr | 0 .../snippets/python-mode/_setitem | 0 .../snippets/python-mode/_slots | 0 .../snippets/python-mode/_str | 0 .../snippets/python-mode/_sub | 0 .../snippets/python-mode/_subclasscheck | 0 .../snippets/python-mode/_truediv | 0 .../snippets/python-mode/_unicode | 0 .../snippets/python-mode/_xor | 0 .../snippets/python-mode/ase | 0 .../snippets/python-mode/asne | 0 .../snippets/python-mode/asr | 0 .../snippets/python-mode/class | 0 .../snippets/python-mode/def | 0 .../snippets/python-mode/defs | 0 .../snippets/python-mode/enc | 0 .../snippets/python-mode/env | 0 .../snippets/python-mode/from | 0 .../snippets/python-mode/pdb | 0 .../snippets/python-mode/py3 | 0 .../snippets/python-mode/super | 0 .../pos-tip-autoloads.el | 22 + elpa/pos-tip-20191227.1356/pos-tip-pkg.el | 2 + elpa/pos-tip-20191227.1356/pos-tip.el | 981 +++++++ elpa/pos-tip-20191227.1356/pos-tip.elc | Bin 0 -> 25349 bytes .../racket-complete.el | 307 --- .../racket-complete.elc | Bin 12101 -> 0 bytes .../racket-custom.elc | Bin 14607 -> 0 bytes elpa/racket-mode-20200218.1623/racket-edit.el | 891 ------- .../racket-mode-20200218.1623/racket-edit.elc | Bin 29886 -> 0 bytes elpa/racket-mode-20200218.1623/racket-repl.el | 815 ------ .../racket-mode-20200218.1623/racket-repl.elc | Bin 31107 -> 0 bytes .../racket/channel.rkt | 70 - .../racket/command-server.rkt | 235 -- .../racket/commands/check-syntax.rkt | 61 - .../racket/commands/describe.rkt | 73 - .../racket/commands/help.rkt | 120 - .../racket/commands/macro.rkt | 125 - .../racket-mode-20200218.1623/racket/find.rkt | 235 -- .../racket/fresh-line.rkt | 37 - .../racket/interactions.rkt | 84 - elpa/racket-mode-20200218.1623/racket/md5.rkt | 8 - .../racket/namespace.rkt | 270 -- elpa/racket-mode-20200218.1623/racket/run.rkt | 255 -- .../racket/syntax.rkt | 110 - .../racket-mode-20200218.1623/racket/util.rkt | 39 - .../racket/welcome.rkt | 19 - .../dir | 0 .../racket-bug-report.el | 2 - .../racket-bug-report.elc | Bin 2645 -> 2597 bytes elpa/racket-mode-20200323.1739/racket-cmd.el | 224 ++ elpa/racket-mode-20200323.1739/racket-cmd.elc | Bin 0 -> 8274 bytes .../racket-collection.el | 63 +- .../racket-collection.elc | Bin 8625 -> 8253 bytes .../racket-common.el | 4 - .../racket-common.elc | Bin 10324 -> 10201 bytes .../racket-complete.el | 52 + .../racket-complete.elc | Bin 0 -> 1185 bytes .../racket-custom.el | 279 +- .../racket-custom.elc | Bin 0 -> 17232 bytes .../racket-debug.el | 6 +- .../racket-debug.elc | Bin 12517 -> 12605 bytes .../racket-describe.el | 122 + .../racket-describe.elc | Bin 0 -> 5447 bytes elpa/racket-mode-20200323.1739/racket-edit.el | 405 +++ .../racket-mode-20200323.1739/racket-edit.elc | Bin 0 -> 11702 bytes .../racket-mode-20200323.1739/racket-eldoc.el | 47 + .../racket-eldoc.elc | Bin 0 -> 928 bytes .../racket-font-lock.el | 0 .../racket-font-lock.elc | Bin .../racket-imenu.el | 0 .../racket-imenu.elc | Bin .../racket-indent.el | 51 +- .../racket-indent.elc | Bin 12407 -> 12692 bytes .../racket-keywords-and-builtins.el | 0 .../racket-keywords-and-builtins.elc | Bin .../racket-logger.el | 5 +- .../racket-logger.elc | Bin 10943 -> 10966 bytes .../racket-mode-autoloads.el | 243 +- .../racket-mode-pkg.el | 7 +- .../racket-mode.el | 31 +- .../racket-mode.elc | Bin 7406 -> 7664 bytes .../racket-mode.info | 2259 ++++++++++------- .../racket-parens.el | 0 .../racket-parens.elc | Bin .../racket-ppss.el | 0 .../racket-ppss.elc | Bin .../racket-profile.el | 8 +- .../racket-profile.elc | Bin 7327 -> 7343 bytes .../racket-repl-buffer-name.el | 101 + .../racket-repl-buffer-name.elc | Bin 0 -> 3006 bytes elpa/racket-mode-20200323.1739/racket-repl.el | 947 +++++++ .../racket-mode-20200323.1739/racket-repl.elc | Bin 0 -> 33200 bytes elpa/racket-mode-20200323.1739/racket-show.el | 69 + .../racket-mode-20200323.1739/racket-show.elc | Bin 0 -> 2236 bytes .../racket-smart-open.el | 0 .../racket-smart-open.elc | Bin .../racket-stepper.el | 41 +- .../racket-stepper.elc | Bin 8164 -> 8779 bytes .../racket-unicode-input-method.el | 0 .../racket-unicode-input-method.elc | Bin .../racket-util.el | 60 +- .../racket-util.elc | Bin 5044 -> 5882 bytes .../racket-mode-20200323.1739/racket-visit.el | 124 + .../racket-visit.elc | Bin 0 -> 3090 bytes .../racket-wsl.el | 0 .../racket-wsl.elc | Bin .../racket-xp-complete.el | 112 + .../racket-xp-complete.elc | Bin 0 -> 3936 bytes elpa/racket-mode-20200323.1739/racket-xp.el | 804 ++++++ elpa/racket-mode-20200323.1739/racket-xp.elc | Bin 0 -> 28854 bytes .../racket/command-server.rkt | 192 ++ .../racket/commands/check-syntax.rkt | 379 +++ .../racket/commands/coverage.rkt | 0 .../racket/commands/describe.rkt | 127 + .../racket/commands/find-module.rkt | 0 .../racket/commands/help.rkt | 51 + .../racket/commands/macro.rkt | 169 ++ .../racket/commands/module-names.rkt | 90 + .../racket/commands/profile.rkt | 0 .../racket/commands/requires.rkt | 0 .../racket/debug-annotator.rkt | 0 .../racket/debug.rkt | 30 +- .../racket/elisp.rkt | 21 +- .../racket/error.rkt | 77 +- .../racket/example/example.rkt | 0 .../racket/example/example.rkt.faceup | 0 .../racket/example/indent.rkt | 0 .../racket/example/indent.rkt.faceup | 0 .../racket/find-module-path-completions.rkt | 18 +- .../racket-mode-20200323.1739/racket/find.rkt | 338 +++ .../racket/fresh-line.rkt | 37 + .../racket/gui.rkt | 0 .../racket/identifier.rkt | 190 ++ .../racket/image.rkt | 0 .../racket/imports.rkt | 268 ++ .../racket/instrument.rkt | 13 +- .../racket/interactions.rkt | 76 + .../racket/keywords.rkt | 0 .../racket/logger.rkt | 0 .../racket-mode-20200323.1739/racket/main.rkt | 35 + .../racket/mod.rkt | 0 .../racket/print.rkt | 0 .../racket-mode-20200323.1739/racket/repl.rkt | 435 ++++ .../racket/scribble.rkt | 101 +- .../racket/syntax.rkt | 227 ++ .../racket/test/find-examples.rkt | 8 +- .../racket/test/find.rkt | 87 +- .../racket-mode-20200323.1739/racket/util.rkt | 110 + .../spacemacs-common.el | 1018 -------- .../spacemacs-dark-theme.el | 7 - .../spacemacs-dark-theme.elc | Bin 647 -> 0 bytes .../spacemacs-light-theme.el | 7 - .../spacemacs-light-theme.elc | Bin 651 -> 0 bytes .../spacemacs-theme-autoloads.el | 45 - .../spacemacs-theme-pkg.el | 6 - .../spacemacs-common.el | 2 +- .../spacemacs-dark-theme.el | 0 .../spacemacs-dark-theme.elc | Bin .../spacemacs-light-theme.el | 0 .../spacemacs-light-theme.elc | Bin .../spacemacs-theme-autoloads.el | 0 .../spacemacs-theme-pkg.el | 2 +- 498 files changed, 9053 insertions(+), 10511 deletions(-) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-abbrev.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-abbrev.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-autoloads.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-bbdb.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-bbdb.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-capf.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-capf.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-clang.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-clang.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-cmake.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-cmake.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-css.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-css.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-dabbrev-code.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-dabbrev-code.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-dabbrev.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-dabbrev.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-eclim.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-eclim.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-elisp.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-elisp.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-etags.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-etags.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-files.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-files.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-gtags.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-gtags.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-ispell.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-ispell.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-keywords.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-keywords.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-nxml.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-nxml.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-oddmuse.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-oddmuse.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-pkg.el (80%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-semantic.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-semantic.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-template.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-template.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-tempo.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-tempo.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-tng.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-tng.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-xcode.el (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-xcode.elc (100%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-yasnippet.el (93%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company-yasnippet.elc (84%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company.el (99%) rename elpa/{company-20200317.1124 => company-20200317.2312}/company.elc (92%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-autoloads.el (99%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-cell.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-cell.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-classes.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-classes.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-completer.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-completer.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-connect.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-connect.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-contents-api.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-contents-api.elc (92%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-core.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-core.elc (97%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-dev.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-dev.elc (84%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-events.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-events.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-file.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-file.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-ipdb.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-ipdb.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-ipynb-mode.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-ipynb-mode.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-jupyter.el (98%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-jupyter.elc (90%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-jupyterhub.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-jupyterhub.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-kernel.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-kernel.elc (99%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-kernelinfo.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-kernelinfo.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-kill-ring.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-kill-ring.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-log.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-log.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-markdown-mode.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-markdown-mode.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-node.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-node.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-notebook.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-notebook.elc (54%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-notebooklist.el (99%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-notebooklist.elc (83%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-notification.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-notification.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-output-area.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-output-area.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-pager.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-pager.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-pkg.el (77%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-process.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-process.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-pytools.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-pytools.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-query.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-query.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-scratchsheet.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-scratchsheet.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-shared-output.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-shared-output.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-traceback.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-traceback.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-utils.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-utils.elc (93%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-websocket.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-websocket.elc (89%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-worksheet.el (95%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein-worksheet.elc (92%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ein.elc (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ob-ein.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/ob-ein.elc (96%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/poly-ein.el (100%) rename elpa/{ein-20200314.443 => ein-20200319.1342}/poly-ein.elc (100%) delete mode 100644 elpa/elisp-lint-20200217.38/elisp-lint-pkg.el rename elpa/{elisp-lint-20200217.38 => elisp-lint-20200322.2355}/elisp-lint-autoloads.el (100%) create mode 100644 elpa/elisp-lint-20200322.2355/elisp-lint-pkg.el rename elpa/{elisp-lint-20200217.38 => elisp-lint-20200322.2355}/elisp-lint.el (83%) rename elpa/{elisp-lint-20200217.38 => elisp-lint-20200322.2355}/elisp-lint.elc (78%) delete mode 100644 elpa/elpy-20200202.2031/elpy/__init__.py delete mode 100644 elpa/elpy-20200202.2031/elpy/__main__.py delete mode 100644 elpa/elpy-20200202.2031/elpy/auto_pep8.py delete mode 100644 elpa/elpy-20200202.2031/elpy/blackutil.py delete mode 100644 elpa/elpy-20200202.2031/elpy/compat.py delete mode 100644 elpa/elpy-20200202.2031/elpy/jedibackend.py delete mode 100644 elpa/elpy-20200202.2031/elpy/pydocutils.py delete mode 100644 elpa/elpy-20200202.2031/elpy/refactor.py delete mode 100644 elpa/elpy-20200202.2031/elpy/rpc.py delete mode 100644 elpa/elpy-20200202.2031/elpy/server.py delete mode 100644 elpa/elpy-20200202.2031/elpy/tests/__init__.py delete mode 100644 elpa/elpy-20200202.2031/elpy/tests/compat.py delete mode 100644 elpa/elpy-20200202.2031/elpy/tests/support.py delete mode 100644 elpa/elpy-20200202.2031/elpy/tests/test_auto_pep8.py delete mode 100644 elpa/elpy-20200202.2031/elpy/tests/test_black.py delete mode 100644 elpa/elpy-20200202.2031/elpy/tests/test_jedibackend.py delete mode 100644 elpa/elpy-20200202.2031/elpy/tests/test_pydocutils.py delete mode 100644 elpa/elpy-20200202.2031/elpy/tests/test_refactor.py delete mode 100644 elpa/elpy-20200202.2031/elpy/tests/test_rpc.py delete mode 100644 elpa/elpy-20200202.2031/elpy/tests/test_server.py delete mode 100644 elpa/elpy-20200202.2031/elpy/tests/test_support.py delete mode 100644 elpa/elpy-20200202.2031/elpy/tests/test_yapf.py delete mode 100644 elpa/elpy-20200202.2031/elpy/yapfutil.py rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy-autoloads.el (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy-django.el (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy-django.elc (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy-pkg.el (76%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy-profile.el (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy-profile.elc (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy-refactor.el (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy-refactor.elc (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy-rpc.el (98%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy-rpc.elc (90%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy-shell.el (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy-shell.elc (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy.el (99%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/elpy.elc (79%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/.yas-setup.el (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/.yas-setup.elc (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__abs__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__add__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__and__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__bool__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__call__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__cmp__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__coerce__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__complex__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__contains__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__del__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__delattr__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__delete__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__delitem__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__div__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__divmod__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__enter__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__eq__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__exit__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__float__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__floordiv__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__ge__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__get__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__getattr__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__getattribute__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__getitem__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__gt__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__hash__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__hex__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__iadd__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__iand__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__idiv__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__ifloordiv__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__ilshift__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__imod__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__imul__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__index__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__init__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__instancecheck__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__int__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__invert__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__ior__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__ipow__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__irshift__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__isub__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__iter__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__itruediv__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__ixor__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__le__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__len__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__long__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__lshift__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__lt__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__mod__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__mul__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__ne__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__neg__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__new__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__nonzero__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__oct__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__or__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__pos__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__pow__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__radd__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__rand__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__rdivmod__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__repr__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__reversed__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__rfloordiv__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__rlshift__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__rmod__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__rmul__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__ror__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__rpow__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__rrshift__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__rshift__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__rsub__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__rtruediv__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__rxor__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__set__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__setattr__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__setitem__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__slots__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__str__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__sub__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__subclasscheck__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__truediv__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__unicode__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/__xor__ (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_abs (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_add (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_and (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_bool (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_call (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_cmp (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_coerce (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_complex (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_contains (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_del (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_delattr (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_delete (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_delitem (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_div (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_divmod (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_enter (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_eq (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_exit (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_float (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_floordiv (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_ge (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_get (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_getattr (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_getattribute (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_getitem (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_gt (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_hash (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_hex (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_iadd (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_iand (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_idiv (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_ifloordiv (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_ilshift (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_imod (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_imul (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_index (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_init (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_instancecheck (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_int (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_invert (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_ior (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_ipow (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_irshift (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_isub (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_iter (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_itruediv (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_ixor (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_le (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_len (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_long (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_lshift (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_lt (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_mod (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_mul (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_ne (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_neg (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_new (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_nonzero (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_oct (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_or (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_pos (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_pow (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_radd (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_rand (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_rdivmod (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_repr (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_reversed (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_rfloordiv (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_rlshift (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_rmod (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_rmul (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_ror (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_rpow (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_rrshift (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_rshift (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_rsub (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_rtruediv (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_rxor (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_set (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_setattr (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_setitem (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_slots (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_str (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_sub (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_subclasscheck (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_truediv (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_unicode (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/_xor (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/ase (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/asne (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/asr (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/class (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/def (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/defs (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/enc (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/env (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/from (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/pdb (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/py3 (100%) rename elpa/{elpy-20200202.2031 => elpy-20200323.1647}/snippets/python-mode/super (100%) create mode 100644 elpa/pos-tip-20191227.1356/pos-tip-autoloads.el create mode 100644 elpa/pos-tip-20191227.1356/pos-tip-pkg.el create mode 100644 elpa/pos-tip-20191227.1356/pos-tip.el create mode 100644 elpa/pos-tip-20191227.1356/pos-tip.elc delete mode 100644 elpa/racket-mode-20200218.1623/racket-complete.el delete mode 100644 elpa/racket-mode-20200218.1623/racket-complete.elc delete mode 100644 elpa/racket-mode-20200218.1623/racket-custom.elc delete mode 100644 elpa/racket-mode-20200218.1623/racket-edit.el delete mode 100644 elpa/racket-mode-20200218.1623/racket-edit.elc delete mode 100644 elpa/racket-mode-20200218.1623/racket-repl.el delete mode 100644 elpa/racket-mode-20200218.1623/racket-repl.elc delete mode 100644 elpa/racket-mode-20200218.1623/racket/channel.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/command-server.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/commands/check-syntax.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/commands/describe.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/commands/help.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/commands/macro.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/find.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/fresh-line.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/interactions.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/md5.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/namespace.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/run.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/syntax.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/util.rkt delete mode 100644 elpa/racket-mode-20200218.1623/racket/welcome.rkt rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/dir (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-bug-report.el (97%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-bug-report.elc (65%) create mode 100644 elpa/racket-mode-20200323.1739/racket-cmd.el create mode 100644 elpa/racket-mode-20200323.1739/racket-cmd.elc rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-collection.el (87%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-collection.elc (71%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-common.el (98%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-common.elc (83%) create mode 100644 elpa/racket-mode-20200323.1739/racket-complete.el create mode 100644 elpa/racket-mode-20200323.1739/racket-complete.elc rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-custom.el (72%) create mode 100644 elpa/racket-mode-20200323.1739/racket-custom.elc rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-debug.el (98%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-debug.elc (88%) create mode 100644 elpa/racket-mode-20200323.1739/racket-describe.el create mode 100644 elpa/racket-mode-20200323.1739/racket-describe.elc create mode 100644 elpa/racket-mode-20200323.1739/racket-edit.el create mode 100644 elpa/racket-mode-20200323.1739/racket-edit.elc create mode 100644 elpa/racket-mode-20200323.1739/racket-eldoc.el create mode 100644 elpa/racket-mode-20200323.1739/racket-eldoc.elc rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-font-lock.el (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-font-lock.elc (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-imenu.el (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-imenu.elc (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-indent.el (93%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-indent.elc (85%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-keywords-and-builtins.el (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-keywords-and-builtins.elc (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-logger.el (98%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-logger.elc (85%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-mode-autoloads.el (56%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-mode-pkg.el (57%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-mode.el (87%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-mode.elc (60%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-mode.info (62%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-parens.el (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-parens.elc (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-ppss.el (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-ppss.elc (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-profile.el (97%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-profile.elc (88%) create mode 100644 elpa/racket-mode-20200323.1739/racket-repl-buffer-name.el create mode 100644 elpa/racket-mode-20200323.1739/racket-repl-buffer-name.elc create mode 100644 elpa/racket-mode-20200323.1739/racket-repl.el create mode 100644 elpa/racket-mode-20200323.1739/racket-repl.elc create mode 100644 elpa/racket-mode-20200323.1739/racket-show.el create mode 100644 elpa/racket-mode-20200323.1739/racket-show.elc rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-smart-open.el (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-smart-open.elc (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-stepper.el (84%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-stepper.elc (72%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-unicode-input-method.el (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-unicode-input-method.elc (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-util.el (74%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-util.elc (68%) create mode 100644 elpa/racket-mode-20200323.1739/racket-visit.el create mode 100644 elpa/racket-mode-20200323.1739/racket-visit.elc rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-wsl.el (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket-wsl.elc (100%) create mode 100644 elpa/racket-mode-20200323.1739/racket-xp-complete.el create mode 100644 elpa/racket-mode-20200323.1739/racket-xp-complete.elc create mode 100644 elpa/racket-mode-20200323.1739/racket-xp.el create mode 100644 elpa/racket-mode-20200323.1739/racket-xp.elc create mode 100644 elpa/racket-mode-20200323.1739/racket/command-server.rkt create mode 100644 elpa/racket-mode-20200323.1739/racket/commands/check-syntax.rkt rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/commands/coverage.rkt (100%) create mode 100644 elpa/racket-mode-20200323.1739/racket/commands/describe.rkt rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/commands/find-module.rkt (100%) create mode 100644 elpa/racket-mode-20200323.1739/racket/commands/help.rkt create mode 100644 elpa/racket-mode-20200323.1739/racket/commands/macro.rkt create mode 100644 elpa/racket-mode-20200323.1739/racket/commands/module-names.rkt rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/commands/profile.rkt (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/commands/requires.rkt (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/debug-annotator.rkt (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/debug.rkt (94%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/elisp.rkt (73%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/error.rkt (79%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/example/example.rkt (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/example/example.rkt.faceup (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/example/indent.rkt (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/example/indent.rkt.faceup (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/find-module-path-completions.rkt (76%) create mode 100644 elpa/racket-mode-20200323.1739/racket/find.rkt create mode 100644 elpa/racket-mode-20200323.1739/racket/fresh-line.rkt rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/gui.rkt (100%) create mode 100644 elpa/racket-mode-20200323.1739/racket/identifier.rkt rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/image.rkt (100%) create mode 100644 elpa/racket-mode-20200323.1739/racket/imports.rkt rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/instrument.rkt (92%) create mode 100644 elpa/racket-mode-20200323.1739/racket/interactions.rkt rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/keywords.rkt (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/logger.rkt (100%) create mode 100644 elpa/racket-mode-20200323.1739/racket/main.rkt rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/mod.rkt (100%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/print.rkt (100%) create mode 100644 elpa/racket-mode-20200323.1739/racket/repl.rkt rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/scribble.rkt (69%) create mode 100644 elpa/racket-mode-20200323.1739/racket/syntax.rkt rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/test/find-examples.rkt (89%) rename elpa/{racket-mode-20200218.1623 => racket-mode-20200323.1739}/racket/test/find.rkt (58%) create mode 100644 elpa/racket-mode-20200323.1739/racket/util.rkt delete mode 100644 elpa/spacemacs-theme-20200127.1656/spacemacs-common.el delete mode 100644 elpa/spacemacs-theme-20200322.1408/spacemacs-dark-theme.el delete mode 100644 elpa/spacemacs-theme-20200322.1408/spacemacs-dark-theme.elc delete mode 100644 elpa/spacemacs-theme-20200322.1408/spacemacs-light-theme.el delete mode 100644 elpa/spacemacs-theme-20200322.1408/spacemacs-light-theme.elc delete mode 100644 elpa/spacemacs-theme-20200322.1408/spacemacs-theme-autoloads.el delete mode 100644 elpa/spacemacs-theme-20200322.1408/spacemacs-theme-pkg.el rename elpa/{spacemacs-theme-20200322.1408 => spacemacs-theme-20200324.1107}/spacemacs-common.el (99%) rename elpa/{spacemacs-theme-20200127.1656 => spacemacs-theme-20200324.1107}/spacemacs-dark-theme.el (100%) rename elpa/{spacemacs-theme-20200127.1656 => spacemacs-theme-20200324.1107}/spacemacs-dark-theme.elc (100%) rename elpa/{spacemacs-theme-20200127.1656 => spacemacs-theme-20200324.1107}/spacemacs-light-theme.el (100%) rename elpa/{spacemacs-theme-20200127.1656 => spacemacs-theme-20200324.1107}/spacemacs-light-theme.elc (100%) rename elpa/{spacemacs-theme-20200127.1656 => spacemacs-theme-20200324.1107}/spacemacs-theme-autoloads.el (100%) rename elpa/{spacemacs-theme-20200127.1656 => spacemacs-theme-20200324.1107}/spacemacs-theme-pkg.el (72%) diff --git a/elpa/company-20200317.1124/company-abbrev.el b/elpa/company-20200317.2312/company-abbrev.el similarity index 100% rename from elpa/company-20200317.1124/company-abbrev.el rename to elpa/company-20200317.2312/company-abbrev.el diff --git a/elpa/company-20200317.1124/company-abbrev.elc b/elpa/company-20200317.2312/company-abbrev.elc similarity index 100% rename from elpa/company-20200317.1124/company-abbrev.elc rename to elpa/company-20200317.2312/company-abbrev.elc diff --git a/elpa/company-20200317.1124/company-autoloads.el b/elpa/company-20200317.2312/company-autoloads.el similarity index 100% rename from elpa/company-20200317.1124/company-autoloads.el rename to elpa/company-20200317.2312/company-autoloads.el diff --git a/elpa/company-20200317.1124/company-bbdb.el b/elpa/company-20200317.2312/company-bbdb.el similarity index 100% rename from elpa/company-20200317.1124/company-bbdb.el rename to elpa/company-20200317.2312/company-bbdb.el diff --git a/elpa/company-20200317.1124/company-bbdb.elc b/elpa/company-20200317.2312/company-bbdb.elc similarity index 100% rename from elpa/company-20200317.1124/company-bbdb.elc rename to elpa/company-20200317.2312/company-bbdb.elc diff --git a/elpa/company-20200317.1124/company-capf.el b/elpa/company-20200317.2312/company-capf.el similarity index 100% rename from elpa/company-20200317.1124/company-capf.el rename to elpa/company-20200317.2312/company-capf.el diff --git a/elpa/company-20200317.1124/company-capf.elc b/elpa/company-20200317.2312/company-capf.elc similarity index 100% rename from elpa/company-20200317.1124/company-capf.elc rename to elpa/company-20200317.2312/company-capf.elc diff --git a/elpa/company-20200317.1124/company-clang.el b/elpa/company-20200317.2312/company-clang.el similarity index 100% rename from elpa/company-20200317.1124/company-clang.el rename to elpa/company-20200317.2312/company-clang.el diff --git a/elpa/company-20200317.1124/company-clang.elc b/elpa/company-20200317.2312/company-clang.elc similarity index 100% rename from elpa/company-20200317.1124/company-clang.elc rename to elpa/company-20200317.2312/company-clang.elc diff --git a/elpa/company-20200317.1124/company-cmake.el b/elpa/company-20200317.2312/company-cmake.el similarity index 100% rename from elpa/company-20200317.1124/company-cmake.el rename to elpa/company-20200317.2312/company-cmake.el diff --git a/elpa/company-20200317.1124/company-cmake.elc b/elpa/company-20200317.2312/company-cmake.elc similarity index 100% rename from elpa/company-20200317.1124/company-cmake.elc rename to elpa/company-20200317.2312/company-cmake.elc diff --git a/elpa/company-20200317.1124/company-css.el b/elpa/company-20200317.2312/company-css.el similarity index 100% rename from elpa/company-20200317.1124/company-css.el rename to elpa/company-20200317.2312/company-css.el diff --git a/elpa/company-20200317.1124/company-css.elc b/elpa/company-20200317.2312/company-css.elc similarity index 100% rename from elpa/company-20200317.1124/company-css.elc rename to elpa/company-20200317.2312/company-css.elc diff --git a/elpa/company-20200317.1124/company-dabbrev-code.el b/elpa/company-20200317.2312/company-dabbrev-code.el similarity index 100% rename from elpa/company-20200317.1124/company-dabbrev-code.el rename to elpa/company-20200317.2312/company-dabbrev-code.el diff --git a/elpa/company-20200317.1124/company-dabbrev-code.elc b/elpa/company-20200317.2312/company-dabbrev-code.elc similarity index 100% rename from elpa/company-20200317.1124/company-dabbrev-code.elc rename to elpa/company-20200317.2312/company-dabbrev-code.elc diff --git a/elpa/company-20200317.1124/company-dabbrev.el b/elpa/company-20200317.2312/company-dabbrev.el similarity index 100% rename from elpa/company-20200317.1124/company-dabbrev.el rename to elpa/company-20200317.2312/company-dabbrev.el diff --git a/elpa/company-20200317.1124/company-dabbrev.elc b/elpa/company-20200317.2312/company-dabbrev.elc similarity index 100% rename from elpa/company-20200317.1124/company-dabbrev.elc rename to elpa/company-20200317.2312/company-dabbrev.elc diff --git a/elpa/company-20200317.1124/company-eclim.el b/elpa/company-20200317.2312/company-eclim.el similarity index 100% rename from elpa/company-20200317.1124/company-eclim.el rename to elpa/company-20200317.2312/company-eclim.el diff --git a/elpa/company-20200317.1124/company-eclim.elc b/elpa/company-20200317.2312/company-eclim.elc similarity index 100% rename from elpa/company-20200317.1124/company-eclim.elc rename to elpa/company-20200317.2312/company-eclim.elc diff --git a/elpa/company-20200317.1124/company-elisp.el b/elpa/company-20200317.2312/company-elisp.el similarity index 100% rename from elpa/company-20200317.1124/company-elisp.el rename to elpa/company-20200317.2312/company-elisp.el diff --git a/elpa/company-20200317.1124/company-elisp.elc b/elpa/company-20200317.2312/company-elisp.elc similarity index 100% rename from elpa/company-20200317.1124/company-elisp.elc rename to elpa/company-20200317.2312/company-elisp.elc diff --git a/elpa/company-20200317.1124/company-etags.el b/elpa/company-20200317.2312/company-etags.el similarity index 100% rename from elpa/company-20200317.1124/company-etags.el rename to elpa/company-20200317.2312/company-etags.el diff --git a/elpa/company-20200317.1124/company-etags.elc b/elpa/company-20200317.2312/company-etags.elc similarity index 100% rename from elpa/company-20200317.1124/company-etags.elc rename to elpa/company-20200317.2312/company-etags.elc diff --git a/elpa/company-20200317.1124/company-files.el b/elpa/company-20200317.2312/company-files.el similarity index 100% rename from elpa/company-20200317.1124/company-files.el rename to elpa/company-20200317.2312/company-files.el diff --git a/elpa/company-20200317.1124/company-files.elc b/elpa/company-20200317.2312/company-files.elc similarity index 100% rename from elpa/company-20200317.1124/company-files.elc rename to elpa/company-20200317.2312/company-files.elc diff --git a/elpa/company-20200317.1124/company-gtags.el b/elpa/company-20200317.2312/company-gtags.el similarity index 100% rename from elpa/company-20200317.1124/company-gtags.el rename to elpa/company-20200317.2312/company-gtags.el diff --git a/elpa/company-20200317.1124/company-gtags.elc b/elpa/company-20200317.2312/company-gtags.elc similarity index 100% rename from elpa/company-20200317.1124/company-gtags.elc rename to elpa/company-20200317.2312/company-gtags.elc diff --git a/elpa/company-20200317.1124/company-ispell.el b/elpa/company-20200317.2312/company-ispell.el similarity index 100% rename from elpa/company-20200317.1124/company-ispell.el rename to elpa/company-20200317.2312/company-ispell.el diff --git a/elpa/company-20200317.1124/company-ispell.elc b/elpa/company-20200317.2312/company-ispell.elc similarity index 100% rename from elpa/company-20200317.1124/company-ispell.elc rename to elpa/company-20200317.2312/company-ispell.elc diff --git a/elpa/company-20200317.1124/company-keywords.el b/elpa/company-20200317.2312/company-keywords.el similarity index 100% rename from elpa/company-20200317.1124/company-keywords.el rename to elpa/company-20200317.2312/company-keywords.el diff --git a/elpa/company-20200317.1124/company-keywords.elc b/elpa/company-20200317.2312/company-keywords.elc similarity index 100% rename from elpa/company-20200317.1124/company-keywords.elc rename to elpa/company-20200317.2312/company-keywords.elc diff --git a/elpa/company-20200317.1124/company-nxml.el b/elpa/company-20200317.2312/company-nxml.el similarity index 100% rename from elpa/company-20200317.1124/company-nxml.el rename to elpa/company-20200317.2312/company-nxml.el diff --git a/elpa/company-20200317.1124/company-nxml.elc b/elpa/company-20200317.2312/company-nxml.elc similarity index 100% rename from elpa/company-20200317.1124/company-nxml.elc rename to elpa/company-20200317.2312/company-nxml.elc diff --git a/elpa/company-20200317.1124/company-oddmuse.el b/elpa/company-20200317.2312/company-oddmuse.el similarity index 100% rename from elpa/company-20200317.1124/company-oddmuse.el rename to elpa/company-20200317.2312/company-oddmuse.el diff --git a/elpa/company-20200317.1124/company-oddmuse.elc b/elpa/company-20200317.2312/company-oddmuse.elc similarity index 100% rename from elpa/company-20200317.1124/company-oddmuse.elc rename to elpa/company-20200317.2312/company-oddmuse.elc diff --git a/elpa/company-20200317.1124/company-pkg.el b/elpa/company-20200317.2312/company-pkg.el similarity index 80% rename from elpa/company-20200317.1124/company-pkg.el rename to elpa/company-20200317.2312/company-pkg.el index 17b5f560..acffe8dd 100644 --- a/elpa/company-20200317.1124/company-pkg.el +++ b/elpa/company-20200317.2312/company-pkg.el @@ -1,4 +1,4 @@ -(define-package "company" "20200317.1124" "Modular text completion framework" +(define-package "company" "20200317.2312" "Modular text completion framework" '((emacs "24.3")) :keywords '("abbrev" "convenience" "matching") diff --git a/elpa/company-20200317.1124/company-semantic.el b/elpa/company-20200317.2312/company-semantic.el similarity index 100% rename from elpa/company-20200317.1124/company-semantic.el rename to elpa/company-20200317.2312/company-semantic.el diff --git a/elpa/company-20200317.1124/company-semantic.elc b/elpa/company-20200317.2312/company-semantic.elc similarity index 100% rename from elpa/company-20200317.1124/company-semantic.elc rename to elpa/company-20200317.2312/company-semantic.elc diff --git a/elpa/company-20200317.1124/company-template.el b/elpa/company-20200317.2312/company-template.el similarity index 100% rename from elpa/company-20200317.1124/company-template.el rename to elpa/company-20200317.2312/company-template.el diff --git a/elpa/company-20200317.1124/company-template.elc b/elpa/company-20200317.2312/company-template.elc similarity index 100% rename from elpa/company-20200317.1124/company-template.elc rename to elpa/company-20200317.2312/company-template.elc diff --git a/elpa/company-20200317.1124/company-tempo.el b/elpa/company-20200317.2312/company-tempo.el similarity index 100% rename from elpa/company-20200317.1124/company-tempo.el rename to elpa/company-20200317.2312/company-tempo.el diff --git a/elpa/company-20200317.1124/company-tempo.elc b/elpa/company-20200317.2312/company-tempo.elc similarity index 100% rename from elpa/company-20200317.1124/company-tempo.elc rename to elpa/company-20200317.2312/company-tempo.elc diff --git a/elpa/company-20200317.1124/company-tng.el b/elpa/company-20200317.2312/company-tng.el similarity index 100% rename from elpa/company-20200317.1124/company-tng.el rename to elpa/company-20200317.2312/company-tng.el diff --git a/elpa/company-20200317.1124/company-tng.elc b/elpa/company-20200317.2312/company-tng.elc similarity index 100% rename from elpa/company-20200317.1124/company-tng.elc rename to elpa/company-20200317.2312/company-tng.elc diff --git a/elpa/company-20200317.1124/company-xcode.el b/elpa/company-20200317.2312/company-xcode.el similarity index 100% rename from elpa/company-20200317.1124/company-xcode.el rename to elpa/company-20200317.2312/company-xcode.el diff --git a/elpa/company-20200317.1124/company-xcode.elc b/elpa/company-20200317.2312/company-xcode.elc similarity index 100% rename from elpa/company-20200317.1124/company-xcode.elc rename to elpa/company-20200317.2312/company-xcode.elc diff --git a/elpa/company-20200317.1124/company-yasnippet.el b/elpa/company-20200317.2312/company-yasnippet.el similarity index 93% rename from elpa/company-20200317.1124/company-yasnippet.el rename to elpa/company-20200317.2312/company-yasnippet.el index f7753bc8..c2c26886 100644 --- a/elpa/company-20200317.1124/company-yasnippet.el +++ b/elpa/company-20200317.2312/company-yasnippet.el @@ -110,20 +110,20 @@ It has to accept one argument: the snippet's name.") (mode major-mode) (file-name (buffer-file-name))) (with-current-buffer (company-doc-buffer) - (setq-local buffer-file-name file-name) - (yas-minor-mode 1) - (condition-case error - (yas-expand-snippet (yas--template-content template)) - (error - (message "%s" (error-message-string error)))) - (delay-mode-hooks - (let ((inhibit-message t)) - (if (eq mode 'web-mode) + (let ((buffer-file-name file-name)) + (yas-minor-mode 1) + (condition-case error + (yas-expand-snippet (yas--template-content template)) + (error + (message "%s" (error-message-string error)))) + (delay-mode-hooks + (let ((inhibit-message t)) + (if (eq mode 'web-mode) (progn (setq mode 'html-mode) (funcall mode)) - (funcall mode))) - (ignore-errors (font-lock-ensure))) + (funcall mode))) + (ignore-errors (font-lock-ensure)))) (current-buffer)))) ;;;###autoload diff --git a/elpa/company-20200317.1124/company-yasnippet.elc b/elpa/company-20200317.2312/company-yasnippet.elc similarity index 84% rename from elpa/company-20200317.1124/company-yasnippet.elc rename to elpa/company-20200317.2312/company-yasnippet.elc index 1c380a15d96b42e0f3fb85d2ec091b1602d9cfe6..3699b892ac05fc39ea89ebe84e8394d3e2f1db04 100644 GIT binary patch delta 208 zcmaEcs?5fB?I#uynI02wBR#tcBp6o}1Y(iHh*?P81!Ote8_<}t=b zKqW?oF=;L_N?`SAK(3L8q5)8iku8Iq9FS`a#3n#&$|t87qofHj*2rw~MGkq!u*n}e zgta3XxD`OcnlZ-4#)c_Cqm4}zz(!;+fRzIc%LKEuChK#SPTs-UD4d&^ovNFYpPZPZ ZTb5XqnV6K5y4iy37aNn2MK=p=(a^iCG+(3?@El{^{6wn4^BapbT0$2~w#8?JyFk2HSWo(!MQemP1 zwkwALrY0B6(wwZsSt^{Hn4PMdlb@WJqg$3(l$n^6lR9}CXVYdKuAgj7CPtIh1x*20 CQ$TY7 diff --git a/elpa/company-20200317.1124/company.el b/elpa/company-20200317.2312/company.el similarity index 99% rename from elpa/company-20200317.1124/company.el rename to elpa/company-20200317.2312/company.el index 34f90de4..12ba0c89 100644 --- a/elpa/company-20200317.1124/company.el +++ b/elpa/company-20200317.2312/company.el @@ -1146,7 +1146,8 @@ can retrieve meta-data for them." ;; It's mory efficient to fix it only when they are displayed. ;; FIXME: Adopt the current text's capitalization instead? (if (eq (company-call-backend 'ignore-case) 'keep-prefix) - (concat company-prefix (substring candidate (length company-prefix))) + (let ((prefix (company--clean-string company-prefix))) + (concat prefix (substring candidate (length prefix)))) candidate)) (defun company--should-complete () @@ -2282,6 +2283,7 @@ character, stripping the modifiers. That character must be a digit." (defun company-doc-buffer (&optional string) (with-current-buffer (get-buffer-create "*company-documentation*") (erase-buffer) + (fundamental-mode) (when string (save-excursion (insert string) @@ -2527,7 +2529,7 @@ If SHOW-VERSION is non-nil, show the version in the echo area." (if company-common (string-width company-common) 0))) - (_ (setq value (company--pre-render value) + (_ (setq value (company-reformat (company--pre-render value)) annotation (and annotation (company--pre-render annotation t)))) (ann-ralign company-tooltip-align-annotations) (ann-truncate (< width @@ -2788,7 +2790,7 @@ If SHOW-VERSION is non-nil, show the version in the echo area." (dotimes (_ len) (let* ((value (pop lines-copy)) (annotation (company-call-backend 'annotation value))) - (setq value (company--clean-string (company-reformat value))) + (setq value (company--clean-string value)) (when annotation (setq annotation (company--clean-string annotation)) (when company-tooltip-align-annotations @@ -3165,7 +3167,7 @@ Delay is determined by `company-tooltip-idle-delay'." comp msg) (while candidates - (setq comp (company-reformat (pop candidates)) + (setq comp (company-reformat (company--clean-string (pop candidates))) len (+ len 1 (length comp))) (if (< i 10) ;; Add number. @@ -3174,10 +3176,10 @@ Delay is determined by `company-tooltip-idle-delay'." 'face 'company-echo)) (cl-incf len 3) (cl-incf i) - (add-text-properties 3 (+ 3 (length company-common)) + (add-text-properties 3 (+ 3 (string-width company-common)) '(face company-echo-common) comp)) (setq comp (propertize comp 'face 'company-echo)) - (add-text-properties 0 (length company-common) + (add-text-properties 0 (string-width company-common) '(face company-echo-common) comp)) (if (>= len limit) (setq candidates nil) diff --git a/elpa/company-20200317.1124/company.elc b/elpa/company-20200317.2312/company.elc similarity index 92% rename from elpa/company-20200317.1124/company.elc rename to elpa/company-20200317.2312/company.elc index e4d26d4f5ee8a7461f87ace1f889b7be61f86546..0afef2466e3df5c51128fc1e95c863766763ee25 100644 GIT binary patch delta 2654 zcmZuzeQ;FO72k8;?%R!95=uyk5oD81A=|RyzI)%tZfb^*I>c73SnWW=OCW}Xq>_yZ z0ig^{J2-_IMjE;!S87G*SpBCq=u_^rju5T3Q%5Q7)KZbj)HGBoy_yUy5l zIQ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su!6)D* zWum0+-3B8xl%C2D!YJ{%IyVUKV(-=`w?hh41X6F>0Ur_^fok1OxI$&X_1#~Gew@`M zJ6P259WX`zdKVn8z@DtX_AQtRlwr?Hz76NGy)wP=8ED3#>L&rNiYQ|LReVbI9f!&4iwX`CCNcL+mHPpFZfLt{0t}&HY>9ytd!f&fAyZV? z3A6YTPWk3#jl{Qntu$T|p8%gQn{C1>u|39KQA8SVyeXN0XNhIfG#TtUD8)p!6Jle@ zHph_}B}n8t8_;x$PlUPUBheo3HCm&w4?_JEY$jN6SpUK-m})-=iF*Ga zEYt0W;A83p0fJNiL)fZbIRphYb`;)lWF$j9bPOl%EFRkNI(O@~fgNAj_-K9WhJh_x KzudpGIQc)nai1^% diff --git a/elpa/ein-20200314.443/ein-autoloads.el b/elpa/ein-20200319.1342/ein-autoloads.el similarity index 99% rename from elpa/ein-20200314.443/ein-autoloads.el rename to elpa/ein-20200319.1342/ein-autoloads.el index 62ad5955..32ea6660 100644 --- a/elpa/ein-20200314.443/ein-autoloads.el +++ b/elpa/ein-20200319.1342/ein-autoloads.el @@ -322,7 +322,7 @@ Deal with security before main entry of ein:notebooklist-open*. CALLBACK takes two arguments, the buffer created by ein:notebooklist-open--success and the url-or-port argument of ein:notebooklist-open*. -\(fn URL-OR-PORT CALLBACK &optional COOKIE-PLIST)" t nil) +\(fn URL-OR-PORT CALLBACK &optional COOKIE-PLIST TOKEN)" t nil) (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ein-notebooklist" '("ein:" "render-" "generate-breadcrumbs"))) diff --git a/elpa/ein-20200314.443/ein-cell.el b/elpa/ein-20200319.1342/ein-cell.el similarity index 100% rename from elpa/ein-20200314.443/ein-cell.el rename to elpa/ein-20200319.1342/ein-cell.el diff --git a/elpa/ein-20200314.443/ein-cell.elc b/elpa/ein-20200319.1342/ein-cell.elc similarity index 100% rename from elpa/ein-20200314.443/ein-cell.elc rename to elpa/ein-20200319.1342/ein-cell.elc diff --git a/elpa/ein-20200314.443/ein-classes.el b/elpa/ein-20200319.1342/ein-classes.el similarity index 100% rename from elpa/ein-20200314.443/ein-classes.el rename to elpa/ein-20200319.1342/ein-classes.el diff --git a/elpa/ein-20200314.443/ein-classes.elc b/elpa/ein-20200319.1342/ein-classes.elc similarity index 100% rename from elpa/ein-20200314.443/ein-classes.elc rename to elpa/ein-20200319.1342/ein-classes.elc diff --git a/elpa/ein-20200314.443/ein-completer.el b/elpa/ein-20200319.1342/ein-completer.el similarity index 100% rename from elpa/ein-20200314.443/ein-completer.el rename to elpa/ein-20200319.1342/ein-completer.el diff --git a/elpa/ein-20200314.443/ein-completer.elc b/elpa/ein-20200319.1342/ein-completer.elc similarity index 100% rename from elpa/ein-20200314.443/ein-completer.elc rename to elpa/ein-20200319.1342/ein-completer.elc diff --git a/elpa/ein-20200314.443/ein-connect.el b/elpa/ein-20200319.1342/ein-connect.el similarity index 100% rename from elpa/ein-20200314.443/ein-connect.el rename to elpa/ein-20200319.1342/ein-connect.el diff --git a/elpa/ein-20200314.443/ein-connect.elc b/elpa/ein-20200319.1342/ein-connect.elc similarity index 100% rename from elpa/ein-20200314.443/ein-connect.elc rename to elpa/ein-20200319.1342/ein-connect.elc diff --git a/elpa/ein-20200314.443/ein-contents-api.el b/elpa/ein-20200319.1342/ein-contents-api.el similarity index 100% rename from elpa/ein-20200314.443/ein-contents-api.el rename to elpa/ein-20200319.1342/ein-contents-api.el diff --git a/elpa/ein-20200314.443/ein-contents-api.elc b/elpa/ein-20200319.1342/ein-contents-api.elc similarity index 92% rename from elpa/ein-20200314.443/ein-contents-api.elc rename to elpa/ein-20200319.1342/ein-contents-api.elc index 836c8b41c8294eb8358c8ee9bbac2a993c969328..1f8e55d5a960129c1fd0a9b7d233590bf1f96633 100644 GIT binary patch delta 389 zcmX}oy-Gtt5QbsSt_LIp8w(+*ENr1i5YNn>{WAnaQR5GaU?mEYLhQW&ufS>rZy-$y zLD<6E@CIxJD-nxeAvk0p-OINy5A5@(cp4QiKdXn0(ypgB_o22*doHJR;POgGuAns3 zoRJbH2{k2hLfWkcCrCrXgQ2vXga9i*3NQo206RbqFa!i4LlDznbsLcoWCVfIOl~4c z$P$u-EFnqA652dmJD!nE#Pq#1pRU(u^W4TlDH@+wnywHgO!s@&DW&ysI=ps2O9`e* zMI7XE`>T*X#5~^lE!rly>Z)q#E&8$aRxanx-hq%I+I-W$kS&A!O6q%mF@GH0NofM) T%Tp&rZSv#USO|~l;avR#ekEXD delta 376 zcmXZVJxfC|6vlDxi3L~DNhk)gScj4)H_5%Rlp^8_D5ymo9G!G?bMq63ONP#l1qC6W z$HCD-xZ)sg9`$VhJc09@&8w$*_58U$O-Y+LHk*5Zwc0e2(597i+9b(Z8(3-24e7w` zq+=crF3xPjlb5OG4${m)Jg^4=!5~Bgix3h_Iw9fn``~f{Fz19rSIXPAyzE?)N@&XQ{<)&y%j3aJ@lRcLk0Ox^<@V%@DEWMIs(%1PPF)%R diff --git a/elpa/ein-20200314.443/ein-core.el b/elpa/ein-20200319.1342/ein-core.el similarity index 100% rename from elpa/ein-20200314.443/ein-core.el rename to elpa/ein-20200319.1342/ein-core.el diff --git a/elpa/ein-20200314.443/ein-core.elc b/elpa/ein-20200319.1342/ein-core.elc similarity index 97% rename from elpa/ein-20200314.443/ein-core.elc rename to elpa/ein-20200319.1342/ein-core.elc index 93d7eb3b0423554068cdb689b9cf9d79b0dcbe9b..b8d547aa50254a93a2f7d3d195043c0d8cbf4323 100644 GIT binary patch delta 43 zcmZq4Ys%ZOPKU?HOhMVqR@utk(8zrA9vyxbCL_(s^9{u|KQ>@tV>Ful!b}DLDP|2R delta 69 zcmZq5YsuTNPKVFX$WTGq%vRaT-O$j;X!9-|eikMZ&B=jAVw)ctu&~LRXe#7o=EQ1p ZX%rOYmu04;DyXMs=IJKq7o}=)0RYD>6ixsD diff --git a/elpa/ein-20200314.443/ein-dev.el b/elpa/ein-20200319.1342/ein-dev.el similarity index 100% rename from elpa/ein-20200314.443/ein-dev.el rename to elpa/ein-20200319.1342/ein-dev.el diff --git a/elpa/ein-20200314.443/ein-dev.elc b/elpa/ein-20200319.1342/ein-dev.elc similarity index 84% rename from elpa/ein-20200314.443/ein-dev.elc rename to elpa/ein-20200319.1342/ein-dev.elc index 09fc7c8f938b96dd53926dd30c05d3aa54785f33..4397ff60b65c63d15adad8849c70164b27207b06 100644 GIT binary patch delta 143 zcmV;A0C4}IW}arSY7hc4IJ0dKdIkY9v*;Gw0Rc9Xu^J<@=orWW0W-6)8tVZ8HM5-@ zW&{K};98zKDyGC7msC(g6!BJ~6UGC8y1CpH2BGP4*eIRXJOlbswJvu!Lt x0s=8Nv#u@|0s=KRv&S$#0vt0bAZ}@FT`3AEaB^>UX=G&}CuM1FEo5bODGJ2=E{gyF delta 144 zcmbQ2wlHl&mH@M%k@4mnfhsmesgReM6RXLkQBag$mYI^Opq`qUr<;;mrpW~Wz;-S? diff --git a/elpa/ein-20200314.443/ein-events.el b/elpa/ein-20200319.1342/ein-events.el similarity index 100% rename from elpa/ein-20200314.443/ein-events.el rename to elpa/ein-20200319.1342/ein-events.el diff --git a/elpa/ein-20200314.443/ein-events.elc b/elpa/ein-20200319.1342/ein-events.elc similarity index 100% rename from elpa/ein-20200314.443/ein-events.elc rename to elpa/ein-20200319.1342/ein-events.elc diff --git a/elpa/ein-20200314.443/ein-file.el b/elpa/ein-20200319.1342/ein-file.el similarity index 100% rename from elpa/ein-20200314.443/ein-file.el rename to elpa/ein-20200319.1342/ein-file.el diff --git a/elpa/ein-20200314.443/ein-file.elc b/elpa/ein-20200319.1342/ein-file.elc similarity index 100% rename from elpa/ein-20200314.443/ein-file.elc rename to elpa/ein-20200319.1342/ein-file.elc diff --git a/elpa/ein-20200314.443/ein-ipdb.el b/elpa/ein-20200319.1342/ein-ipdb.el similarity index 100% rename from elpa/ein-20200314.443/ein-ipdb.el rename to elpa/ein-20200319.1342/ein-ipdb.el diff --git a/elpa/ein-20200314.443/ein-ipdb.elc b/elpa/ein-20200319.1342/ein-ipdb.elc similarity index 100% rename from elpa/ein-20200314.443/ein-ipdb.elc rename to elpa/ein-20200319.1342/ein-ipdb.elc diff --git a/elpa/ein-20200314.443/ein-ipynb-mode.el b/elpa/ein-20200319.1342/ein-ipynb-mode.el similarity index 100% rename from elpa/ein-20200314.443/ein-ipynb-mode.el rename to elpa/ein-20200319.1342/ein-ipynb-mode.el diff --git a/elpa/ein-20200314.443/ein-ipynb-mode.elc b/elpa/ein-20200319.1342/ein-ipynb-mode.elc similarity index 100% rename from elpa/ein-20200314.443/ein-ipynb-mode.elc rename to elpa/ein-20200319.1342/ein-ipynb-mode.elc diff --git a/elpa/ein-20200314.443/ein-jupyter.el b/elpa/ein-20200319.1342/ein-jupyter.el similarity index 98% rename from elpa/ein-20200314.443/ein-jupyter.el rename to elpa/ein-20200319.1342/ein-jupyter.el index 9ec335c8..afc9e968 100644 --- a/elpa/ein-20200314.443/ein-jupyter.el +++ b/elpa/ein-20200319.1342/ein-jupyter.el @@ -184,7 +184,10 @@ via a call to `ein:notebooklist-open'." (interactive) (when (ein:jupyter-server-process) (multiple-value-bind (url-or-port password) (ein:jupyter-server-conn-info) - (ein:notebooklist-login url-or-port callback)))) + (if-let ((token (ein:notebooklist-token-or-password url-or-port))) + (ein:notebooklist-login url-or-port callback nil token) + (ein:log 'error "`(ein:notebooklist-token-or-password %s)` must return non-nil" + url-or-port))))) (defsubst ein:set-process-sentinel (proc url-or-port) "URL-OR-PORT might get redirected from (ein:jupyter-server-conn-info). diff --git a/elpa/ein-20200314.443/ein-jupyter.elc b/elpa/ein-20200319.1342/ein-jupyter.elc similarity index 90% rename from elpa/ein-20200314.443/ein-jupyter.elc rename to elpa/ein-20200319.1342/ein-jupyter.elc index 46fafb1e12296fccd15200a50cf1c881cbe99c11..8a47ecc6b902a0da1512956a13ad25ed62e01373 100644 GIT binary patch delta 352 zcmZWiPfG$p6i-*NLWv;I%?{7qLWLG~X7-N?f*v9WJOx2Cl16KZ>x|5fc&pD4^9ee4 z3AV2i^ieuRqa8c^c<=rGy`RbFxH=<07 z2pwq$vDXevSxFBgvQEq&oRt_a7LkBR2rj_B(VBX#A6zd*ya{q4VZz0HEWsKz)+xqibjSHDo+i@y z_W@3l<_PA?M1qLqQZQhgIl9#v0vQe=NZ-thtkFVY`d!`48D0>idDzPu9uCv8byhIi xek;9gJ{O840Nd}{opVG&)yEZ;Lvhh_!45a1htw1LD3KP}$o;dm(?0HIegVS9XRiPN delta 182 zcmcbb@h@$|4GB%t7-Iu74n@TnBLh=$1|Y{=A;!qiP|`t))6qdX#@NsxCNCx}MoD|} z2UU&9!IG+z>m)-ta`MwN^I{cDHg`yQF>#w(nrX&ra%mKlmP}qCExq}N%yVXDBNNlj zj}-Wsn2ij~Hh)oaWoI@wHs5TcRnN|6Xl$sUY-+1)qQBag$mYI^Opq`qU Or<CUxU8fQW`l`VeIXS^WXcZ^iiwfmdke+)FS zya9a=vtUG4ND|qvIbW+-kAiR}cPY(}wJ@$)){;<1osSkgAS^6RwbSspaH4bZmWh4< z!|~Ze(&T3bN`y*No9qZxw|?M79$1(>(@*S_1wDVA0MN^}XWkC-h$>@dHiXgQYT7y5 z$ho4+c+$5KUv;g=-r^CeegDp0fsS84%sFWnKK9tD8no@xF2}Ze?h=4%koU`F&J?=w zt)`x9^1}~rv`Xc1JJc^Sy-#rz~u4_GI$KDVMmKOH{VN(^gsrnw30PN0)L2Nu;BVc&pt=GY)Qb#)@D|q;s3&h4h z&mYK@ndrXE16Zx_k>xUtYN|LD=oP!)Zoz$T_E2gVsyG?gju+mgDR4u4e81{#s`_D+ zP;RNBvC@O-m57&_T^$FXX{pCl@npFNcYHccNenN4E(Clm!kCHbuQNj}bY~M}bg9io z7YuZ_`S@ly+u`rM@Y-zqwWAQO6YhRV&^(Z+d*TqS`{X&Cq<7?(HaogI)AR=U2cRS4 AAOHXW diff --git a/elpa/ein-20200314.443/ein-notebooklist.el b/elpa/ein-20200319.1342/ein-notebooklist.el similarity index 99% rename from elpa/ein-20200314.443/ein-notebooklist.el rename to elpa/ein-20200319.1342/ein-notebooklist.el index 8555cd2e..b7a2c33e 100644 --- a/elpa/ein-20200314.443/ein-notebooklist.el +++ b/elpa/ein-20200319.1342/ein-notebooklist.el @@ -656,14 +656,15 @@ or even this (if you want fast Emacs start-up):: (read-no-blanks-input (format "%s: " pw-prompt)))) ;;;###autoload -(defun ein:notebooklist-login (url-or-port callback &optional cookie-plist) +(defun ein:notebooklist-login (url-or-port callback &optional cookie-plist token) "Deal with security before main entry of ein:notebooklist-open*. CALLBACK takes two arguments, the buffer created by ein:notebooklist-open--success and the url-or-port argument of ein:notebooklist-open*." (interactive `(,(ein:notebooklist-ask-url-or-port) ,(lambda (buffer _url-or-port) (pop-to-buffer buffer)) - ,(if current-prefix-arg (ein:notebooklist-ask-user-pw-pair "Cookie name" "Cookie content")))) + ,(if current-prefix-arg (ein:notebooklist-ask-user-pw-pair "Cookie name" "Cookie content")) + nil)) (unless callback (setq callback (lambda (buffer url-or-port)))) (when cookie-plist (let* ((parsed-url (url-generic-parse-url (file-name-as-directory url-or-port))) @@ -672,7 +673,7 @@ and the url-or-port argument of ein:notebooklist-open*." (cl-loop for (name content) on cookie-plist by (function cddr) for line = (mapconcat #'identity (list domain "FALSE" (car (url-path-and-query parsed-url)) (if securep "TRUE" "FALSE") "0" (symbol-name name) (concat content "\n")) "\t") do (write-region line nil (request--curl-cookie-jar) 'append)))) - (let ((token (ein:notebooklist-token-or-password url-or-port))) + (let ((token (or token (ein:notebooklist-token-or-password url-or-port)))) (cond ((null token) ;; don't know (ein:notebooklist-login--iteration url-or-port callback nil nil -1 nil)) ((string= token "") ;; all authentication disabled diff --git a/elpa/ein-20200314.443/ein-notebooklist.elc b/elpa/ein-20200319.1342/ein-notebooklist.elc similarity index 83% rename from elpa/ein-20200314.443/ein-notebooklist.elc rename to elpa/ein-20200319.1342/ein-notebooklist.elc index 664307d2296ba8418f7bbddc4a94f507f0bdf0f3..47e3a0c643612e9a7cb53922616aac83ecaab2e2 100644 GIT binary patch delta 757 zcmX|7O-PhM7r7yRxldgoh}~ zjg)XG#STJUB7%g0P6ZpDJS0U}r-x|VxiRE&TJq~^+5MYy)eArgomGjH#0BKoem))b!oQI zGz4+SQ3+{!M|P^46pY2TR4^7>QZbzx{}NTu%yv{B5Y2ip{U)lw&Q?@Xw`5kL3gX!$ z$~Wtox!R~o{FC&FIh(sxjeH5gN9z6Ze5{!-DpjTmpPPN~-JPXh9;@x@b2Bge%pC&yP*#^XY6MK9x^rCTHRo z^Aq~*qnO_8tJBNlJ%HQwpZf>);EwF%mCg%T{BM|?&xeta=G9^{>`0=_@1-55O#FO2 b+n#bJcka>Qc`i`rF&$a@` zr@-Gn=K*Sy#^b1W;ynF|=gS-xkDXQLp4O_L)8%SuFsk})J8F#X(R1C)77!Zil2%%J0pO_?s37tK)US@;fYGpj4t`Brofk0%FELhS0GVuN& z_(&1oh7%qFc}9bJdwR{{DpB2|rn)OtvVWicG5CxS>FFnDPFjV~Z$k;&4uI><;Vq{g z1U6|p5!j@uL`cKCIANQ+c~WikKU{GBQ5lMpb9FRxQq!>xJolVpH(+ zuWYNO+h+D#2SUdDaI`6;0FCV-^>|1bRYSR^8oH~hJ!ITN1DD4_Dm-;JcgUi8Id_Nb z6(0RBK`l(j>)q%`+PyHD$)rXnI<96?>5*$4=QEdz9L=gB-{{0*|A_VF{CEigsXyI6 oQeyie(9MswYzy0(s?lwaQ#SFbx;LLB5a`YMkL3jMmS42|0Wl2e*8l(j diff --git a/elpa/ein-20200314.443/ein-notification.el b/elpa/ein-20200319.1342/ein-notification.el similarity index 100% rename from elpa/ein-20200314.443/ein-notification.el rename to elpa/ein-20200319.1342/ein-notification.el diff --git a/elpa/ein-20200314.443/ein-notification.elc b/elpa/ein-20200319.1342/ein-notification.elc similarity index 100% rename from elpa/ein-20200314.443/ein-notification.elc rename to elpa/ein-20200319.1342/ein-notification.elc diff --git a/elpa/ein-20200314.443/ein-output-area.el b/elpa/ein-20200319.1342/ein-output-area.el similarity index 100% rename from elpa/ein-20200314.443/ein-output-area.el rename to elpa/ein-20200319.1342/ein-output-area.el diff --git a/elpa/ein-20200314.443/ein-output-area.elc b/elpa/ein-20200319.1342/ein-output-area.elc similarity index 100% rename from elpa/ein-20200314.443/ein-output-area.elc rename to elpa/ein-20200319.1342/ein-output-area.elc diff --git a/elpa/ein-20200314.443/ein-pager.el b/elpa/ein-20200319.1342/ein-pager.el similarity index 100% rename from elpa/ein-20200314.443/ein-pager.el rename to elpa/ein-20200319.1342/ein-pager.el diff --git a/elpa/ein-20200314.443/ein-pager.elc b/elpa/ein-20200319.1342/ein-pager.elc similarity index 100% rename from elpa/ein-20200314.443/ein-pager.elc rename to elpa/ein-20200319.1342/ein-pager.elc diff --git a/elpa/ein-20200314.443/ein-pkg.el b/elpa/ein-20200319.1342/ein-pkg.el similarity index 77% rename from elpa/ein-20200314.443/ein-pkg.el rename to elpa/ein-20200319.1342/ein-pkg.el index cee8dbe2..3d8f8bb1 100644 --- a/elpa/ein-20200314.443/ein-pkg.el +++ b/elpa/ein-20200319.1342/ein-pkg.el @@ -1,4 +1,4 @@ -(define-package "ein" "20200314.443" "Emacs IPython Notebook" +(define-package "ein" "20200319.1342" "Emacs IPython Notebook" '((emacs "25") (websocket "20190620.338") (anaphora "20180618") diff --git a/elpa/ein-20200314.443/ein-process.el b/elpa/ein-20200319.1342/ein-process.el similarity index 100% rename from elpa/ein-20200314.443/ein-process.el rename to elpa/ein-20200319.1342/ein-process.el diff --git a/elpa/ein-20200314.443/ein-process.elc b/elpa/ein-20200319.1342/ein-process.elc similarity index 100% rename from elpa/ein-20200314.443/ein-process.elc rename to elpa/ein-20200319.1342/ein-process.elc diff --git a/elpa/ein-20200314.443/ein-pytools.el b/elpa/ein-20200319.1342/ein-pytools.el similarity index 100% rename from elpa/ein-20200314.443/ein-pytools.el rename to elpa/ein-20200319.1342/ein-pytools.el diff --git a/elpa/ein-20200314.443/ein-pytools.elc b/elpa/ein-20200319.1342/ein-pytools.elc similarity index 100% rename from elpa/ein-20200314.443/ein-pytools.elc rename to elpa/ein-20200319.1342/ein-pytools.elc diff --git a/elpa/ein-20200314.443/ein-query.el b/elpa/ein-20200319.1342/ein-query.el similarity index 100% rename from elpa/ein-20200314.443/ein-query.el rename to elpa/ein-20200319.1342/ein-query.el diff --git a/elpa/ein-20200314.443/ein-query.elc b/elpa/ein-20200319.1342/ein-query.elc similarity index 100% rename from elpa/ein-20200314.443/ein-query.elc rename to elpa/ein-20200319.1342/ein-query.elc diff --git a/elpa/ein-20200314.443/ein-scratchsheet.el b/elpa/ein-20200319.1342/ein-scratchsheet.el similarity index 100% rename from elpa/ein-20200314.443/ein-scratchsheet.el rename to elpa/ein-20200319.1342/ein-scratchsheet.el diff --git a/elpa/ein-20200314.443/ein-scratchsheet.elc b/elpa/ein-20200319.1342/ein-scratchsheet.elc similarity index 100% rename from elpa/ein-20200314.443/ein-scratchsheet.elc rename to elpa/ein-20200319.1342/ein-scratchsheet.elc diff --git a/elpa/ein-20200314.443/ein-shared-output.el b/elpa/ein-20200319.1342/ein-shared-output.el similarity index 100% rename from elpa/ein-20200314.443/ein-shared-output.el rename to elpa/ein-20200319.1342/ein-shared-output.el diff --git a/elpa/ein-20200314.443/ein-shared-output.elc b/elpa/ein-20200319.1342/ein-shared-output.elc similarity index 100% rename from elpa/ein-20200314.443/ein-shared-output.elc rename to elpa/ein-20200319.1342/ein-shared-output.elc diff --git a/elpa/ein-20200314.443/ein-traceback.el b/elpa/ein-20200319.1342/ein-traceback.el similarity index 100% rename from elpa/ein-20200314.443/ein-traceback.el rename to elpa/ein-20200319.1342/ein-traceback.el diff --git a/elpa/ein-20200314.443/ein-traceback.elc b/elpa/ein-20200319.1342/ein-traceback.elc similarity index 100% rename from elpa/ein-20200314.443/ein-traceback.elc rename to elpa/ein-20200319.1342/ein-traceback.elc diff --git a/elpa/ein-20200314.443/ein-utils.el b/elpa/ein-20200319.1342/ein-utils.el similarity index 100% rename from elpa/ein-20200314.443/ein-utils.el rename to elpa/ein-20200319.1342/ein-utils.el diff --git a/elpa/ein-20200314.443/ein-utils.elc b/elpa/ein-20200319.1342/ein-utils.elc similarity index 93% rename from elpa/ein-20200314.443/ein-utils.elc rename to elpa/ein-20200319.1342/ein-utils.elc index 4d5351663c957447aa69e3636f142e500da9c519..85bd17ffb59d65d3c37d18e9f37b4feb5a1dc0a3 100644 GIT binary patch delta 227 zcmZ2;lX3n{#tjkSVwMI9%4W98R_=zDh6>8&5SG#8!tjX_7Ul}dh6Z2}3kx9A5W=*a zEF1Aw!qONhVggZa0%V#(n5LUmBN>^P42?ExL?<#b8JKSFj+w*AY-VXVxzJO1vu&Ih z3$vxU=H!dP3B78$!uu}5qg^3%VcS>xilq*iOJY-^5eAgOva{@x1>K{ zGBKGvE#nE3xxwa|OktqGhKna=F-e=7YsPAFX%rOYmu04;DyXMs=ING}WaboWasdDY CVnX}? delta 230 zcmbP#lX1;W#tjkSl7<$h3d&}-%2w`%h8AWD%H~j}`Q*ItiPDA^MheP?22e3$Alnei zHkm9Q@fIj=0TeTVidh2LrVzHJ!Dg9AMkXdB!_D&1iHuB!CYzgL<}fmw8yIX>jMHRc zHncRF?31(+NE=T6pR^N5n*jOdlRqYx0@=o!Gg5Mxm`qG2UrRgBWMVOSdHMq;Q}fB4 w8Bdrjj5p_J3WJPX+>*s4ZE2txtI4HNP?TSmnUboYo|>7bTUwHtQ>@7a0O3JF-2eap diff --git a/elpa/ein-20200314.443/ein-websocket.el b/elpa/ein-20200319.1342/ein-websocket.el similarity index 100% rename from elpa/ein-20200314.443/ein-websocket.el rename to elpa/ein-20200319.1342/ein-websocket.el diff --git a/elpa/ein-20200314.443/ein-websocket.elc b/elpa/ein-20200319.1342/ein-websocket.elc similarity index 89% rename from elpa/ein-20200314.443/ein-websocket.elc rename to elpa/ein-20200319.1342/ein-websocket.elc index 09e029b3b3b4874cced55dd9f14cfb0b1f987c64..8de2008e8588676ba2f3ba165fb941c069fbac7a 100644 GIT binary patch delta 36 ncmdmMw99Bi29LOrfq{aunXR&wyODvRg0eY;Wwg18XEzT3xRnWw delta 39 ocmdmGwAW}u29K1Xp{1#UvYD;2l{=7Wrl4#NWtwlU=h@8z0M-@?M*si- diff --git a/elpa/ein-20200314.443/ein-worksheet.el b/elpa/ein-20200319.1342/ein-worksheet.el similarity index 95% rename from elpa/ein-20200314.443/ein-worksheet.el rename to elpa/ein-20200319.1342/ein-worksheet.el index 5c376cc3..29f428b7 100644 --- a/elpa/ein-20200314.443/ein-worksheet.el +++ b/elpa/ein-20200319.1342/ein-worksheet.el @@ -57,10 +57,10 @@ (ein:deflocal buffer-local-enable-undo t "Buffer local variable activating undo accounting. Should not modify.") -(ein:deflocal ein:%cell-lengths% '() +(ein:deflocal ein:%cell-lengths% nil "Buffer local variable with buffer-undo-list's current knowledge of cell lengths.") -(ein:deflocal ein:%which-cell% '() +(ein:deflocal ein:%which-cell% nil "Buffer local variable one-to-one buffer-undo-list item to cell id.") (defsubst ein:worksheet--unique-enough-cell-id (cell) @@ -173,35 +173,52 @@ Normalize `buffer-undo-list' by removing extraneous details, and update the ein: (defun ein:worksheet--jigger-undo-list (&optional change-cell-id) (cl-assert (listp buffer-undo-list)) - (when (/= (length buffer-undo-list) (length ein:%which-cell%)) - (ein:log 'debug "jig %s to %s: %S %S" - (length ein:%which-cell%) (length buffer-undo-list) - buffer-undo-list ein:%which-cell%)) - (-when-let* ((old-cell-id (car change-cell-id)) - (new-cell-id (cdr change-cell-id)) - (changed-p (not (eq old-cell-id new-cell-id)))) - (setq ein:%which-cell% (-replace old-cell-id new-cell-id ein:%which-cell%))) - (let ((fill (- (length buffer-undo-list) (length ein:%which-cell%)))) - (cond ((> (abs fill) 1) - (let ((msg (format "Undo failure diagnostic %s %s | %s" - buffer-undo-list ein:%which-cell% fill)) - (pm-allow-post-command-hook nil)) - (setq ein:worksheet-enable-undo nil) - (ein:worksheet-undo-setup ein:%worksheet%) - (when pm/polymode - (dolist (b (eieio-oref pm/polymode '-buffers)) - (when (buffer-live-p b) - (poly-ein-copy-state (ein:worksheet--get-buffer ein:%worksheet%) b)))) - (ein:display-warning msg :error) - (error "ein:worksheet--jigger-undo-list: aborting"))) - ((< fill 0) - (setq ein:%which-cell% (nthcdr (- fill) ein:%which-cell%))) - ((> fill 0) - (setq ein:%which-cell% (nconc (make-list fill (car ein:%which-cell%)) - ein:%which-cell%))))) - (cl-assert (= (length buffer-undo-list) (length ein:%which-cell%)) t - "ein:worksheet--jigger-undo-list %d != %d" - (length buffer-undo-list) (length ein:%which-cell%))) + (let ((len-buffer-undo-list (length buffer-undo-list)) + (len-which-cell (length ein:%which-cell%))) + (when (/= len-buffer-undo-list len-which-cell) + (ein:log 'debug "jig %s to %s: %S %S" + len-which-cell len-buffer-undo-list + buffer-undo-list ein:%which-cell%)) + (-when-let* ((old-cell-id (car change-cell-id)) + (new-cell-id (cdr change-cell-id)) + (changed-p (not (eq old-cell-id new-cell-id)))) + (setq ein:%which-cell% (-replace old-cell-id new-cell-id ein:%which-cell%))) + (let (multiple-cursors-p + (fill (- len-buffer-undo-list len-which-cell))) + (cond ((and + (> (abs fill) 1) + (not (setq multiple-cursors-p + (cl-some + (lambda (entry) + (cl-flet ((check + (entry bogey) + (and (listp entry) + (not (atom (cdr entry))) + (eq (nth 1 entry) bogey)))) + (or (check entry 'activate-cursor-for-undo) + (check entry 'deactivate-cursor-after-undo)))) + (cl-subseq buffer-undo-list 0 (min len-buffer-undo-list 30)))))) + (let ((msg (format "Undo failure diagnostic %s %s | %s" + buffer-undo-list ein:%which-cell% fill)) + (pm-allow-post-command-hook nil)) + (setq ein:worksheet-enable-undo nil) + (ein:worksheet-undo-setup ein:%worksheet%) + (when pm/polymode + (dolist (b (eieio-oref pm/polymode '-buffers)) + (when (buffer-live-p b) + (poly-ein-copy-state (ein:worksheet--get-buffer ein:%worksheet%) b)))) + (ein:display-warning msg :error) + (error "ein:worksheet--jigger-undo-list: aborting"))) + ((< fill 0) + (setq ein:%which-cell% (nthcdr (- fill) ein:%which-cell%))) + ((> fill 0) + (when (and (> fill 1) multiple-cursors-p) + (ein:log 'debug "multiple-cursors-mode exception fill %s" fill)) + (setq ein:%which-cell% (nconc (make-list fill (car ein:%which-cell%)) + ein:%which-cell%))))) + (cl-assert (= (length buffer-undo-list) (length ein:%which-cell%)) t + "ein:worksheet--jigger-undo-list %d != %d" + (length buffer-undo-list) (length ein:%which-cell%)))) (defun ein:worksheet--unshift-undo-list (cell &optional exogenous-input old-cell) "Adjust `buffer-undo-list' for adding CELL. diff --git a/elpa/ein-20200314.443/ein-worksheet.elc b/elpa/ein-20200319.1342/ein-worksheet.elc similarity index 92% rename from elpa/ein-20200314.443/ein-worksheet.elc rename to elpa/ein-20200319.1342/ein-worksheet.elc index a751af1286b533fe600ece061241a0ce929325f1..9658fd5b45d353a7d5d32fe2e3ee4275da93f552 100644 GIT binary patch delta 1535 zcma)5U1%It6yDi8X?Ghsnh;}1n$2W4f17sFJNM3So6r=*TEP|twMk~h&F*Zobbqqh zU1OxWkOv`_65&3mRD#q}V(df61)(aI3L*$np9_WhP*9}mi@w%#XLl9!#fLjP=iKjn z=R4oo`DO#{T}Hd{!A8GFbbY`pz335a^oKmEV>mh-;>F<(d%0Nw8H9T}6Y_E=MHCwm z;dJPrGBR@_NQ{caaZyhp8BKI0lSv4SPOmf{8;gy@yQz!~!;kfnfO^EDfNtovM+vkf zdITP%6CU)HM9^CA9S5Y*LJ|Y6%t%xj8xg#*iCDnjI|*q^IXo=1Do2{sh6&WfhLBPW zTmr8JGN)PqBcx2t_G(^(QeDxYSSX@G5hZXa5Gq>J0A(r|xmT2e7;J^0B{dXiPtBG` zlv)tkfrv@K0EYoB#y|ymIUuK)Lc9V~Cl= zYN(+rW6@bJ4zz~RH5oY-Jryj{qqYGB7*rWT3l%p{1rOMqj$r~_%wn_dYdvhUvnx^X zOWNvEKC`4{{6aw$;bJ|P^H;QbDO=VG`D%^bjU8flrg~X?$gyA>7`EY+I>qMgxVrE^ z7*zIFXM(*ulx&pp1vR}`RdqE}(5mI4uO=2I{8DXYEvdr3z(Dwy^+n;0idnIBFa*sg zEFhk2^-Jh8iDQ}u^_e96)))>MPaqik5>TOi;7_zpv7{TFar7YNUc$>WfvsqGFX|_SKNa zejEDig~WmwSBwSU6(*5jB4JrB4^{(xF#P3j8GpH!FPGE+ zJX(#XRGMPf)sj~7SA%6~`K+2*N|(<2S#7xq`w!PL>l@BX4qqQ0eN1+-?XpktL*!aI zzoOra%J2#5?A-BfWSf+|FR$`9rhh@mv;lwt(`v;;@VyLl5dUHy-CZm2DJu47R-YEZ?gCDj`cZS!HjAeYAFn z|Fr5$vaY)>e|~KcA=kjXa&ZnJ+qL=k4HBpm#IzU~_<{E>DM%% z=pd$^VE1pxeCVbG`W&~N`1tJSlI-X%Z6|o+i*X4VVA&^MVkEnU+SoJ->Ha1g-Dt?%nYllU#Qfk-@TKIz21dX=nX6Y&!PXR;AkqG77s9dO%j!h~=lLAggq@90QIYJ<_vE*&RyEFyuh1?J4= z`g}fLbId$eOr|g=tyBgtXF#I@F1QA|c)S|ZO0@)nvt&An5Y8HdEMB(NoIzP;wFG=h zQ*4P8&M_8TgbBh;{s-`U>R%>@-4(rm&Az8DSZp0ltE(%&XBx=#taD_(AlpjXg zu7M9UY%CaT!ss8@+qARIXR)U)Gc-Zqe8Sac9S%RZvdys0P}a+)PeCS?Wv9mm%V$Q~Pmh#J?c>AgiPG@) zyF60aepg|`?H|GA)VsAD8wjmw*1&WX-1QtmMyj&#lw?lSdv=MW{#Ex^i50?ghw)yKW( zD6wr9VoryMrSd{_DHw9udW@hCW zBQrCgpb-e`f+Wlt9UYislwjgXKy3yw#)bw8PzKOghzQVVLt~~GrDQPQ$jpdQ6KKff ztHN3;R!OPpnRyE7sU^B4sTC!<1x5J,")) :maintainer '("Nikolaj Schumacher ,") :url "http://github.com/gonewest818/elisp-lint/") diff --git a/elpa/elisp-lint-20200217.38/elisp-lint-autoloads.el b/elpa/elisp-lint-20200322.2355/elisp-lint-autoloads.el similarity index 100% rename from elpa/elisp-lint-20200217.38/elisp-lint-autoloads.el rename to elpa/elisp-lint-20200322.2355/elisp-lint-autoloads.el diff --git a/elpa/elisp-lint-20200322.2355/elisp-lint-pkg.el b/elpa/elisp-lint-20200322.2355/elisp-lint-pkg.el new file mode 100644 index 00000000..e3ceab94 --- /dev/null +++ b/elpa/elisp-lint-20200322.2355/elisp-lint-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "elisp-lint" "20200322.2355" "Basic linting for Emacs Lisp" '((emacs "24.4") (dash "2.15.0") (package-lint "0.11")) :commit "e45a7f0ce0877d4e66968707b1e3310d1505af74" :keywords '("lisp" "maint" "tools") :authors '(("Nikolaj Schumacher ,")) :maintainer '("Neil Okamoto" . "neil.okamoto+melpa@gmail.com") :url "http://github.com/gonewest818/elisp-lint/") diff --git a/elpa/elisp-lint-20200217.38/elisp-lint.el b/elpa/elisp-lint-20200322.2355/elisp-lint.el similarity index 83% rename from elpa/elisp-lint-20200217.38/elisp-lint.el rename to elpa/elisp-lint-20200322.2355/elisp-lint.el index af70e593..cc40afec 100644 --- a/elpa/elisp-lint-20200217.38/elisp-lint.el +++ b/elpa/elisp-lint-20200322.2355/elisp-lint.el @@ -4,9 +4,9 @@ ;; Copyright (C) 2018-2020 Neil Okamoto ;; ;; Author: Nikolaj Schumacher , -;; Author: Neil Okamoto +;; Maintainer: Neil Okamoto ;; Version: 0.4.0-SNAPSHOT -;; Package-Version: 20200217.38 +;; Package-Version: 20200322.2355 ;; Keywords: lisp, maint, tools ;; Package-Requires: ((emacs "24.4") (dash "2.15.0") (package-lint "0.11")) ;; URL: http://github.com/gonewest818/elisp-lint/ @@ -43,28 +43,30 @@ ;; ;; ((emacs-lisp-mode . ((elisp-lint-ignored-validators . ("fill-column"))))) ;; -;; For a full list of validators, see `elisp-lint-file-validators' and -;; `elisp-lint-buffer-validators'. +;; For a full list of validators, see 'elisp-lint-file-validators' and +;; 'elisp-lint-buffer-validators'. ;; ;;; Change Log: ;; ;; * Version 0.4-SNAPSHOT (available in MELPA) ;; - Provide a summary report of all tests [#20] -;; - Integrate `package-lint' [#19] -;; - Remove `package-format', as `package-lint' covers the same -;; - Add dependency on `dash.el' +;; - Integrate 'package-lint' [#19] +;; - Remove 'package-format', as 'package-lint' covers the same territory +;; - Make byte-compile errors and warnings more robust +;; - Make 'fill-column' checker ignore the package summary line [#25] +;; - Add dependency on 'dash.el' ;; - Colorized output ;; * Version 0.3 (MELPA Stable, as of December 2019) ;; - Emacs 23 support is deprecated [#13] ;; - Adopt CircleCI and drop Travis CI [#9] [#14] -;; - Add `check-declare' validator [#16] +;; - Add 'check-declare' validator [#16] ;; - Generate autoloads before byte-compile [#8] ;; * Version 0.2 (Feb 2018) ;; - Project transferred to new maintainer ;; - Whitespace check permits page-delimiter (^L) ;; - Indentation check prints the diff to console ;; - User can specify indent specs to tell the checker about macros -;; - Added `checkdoc' (available only Emacs 25 and newer) +;; - Added 'checkdoc' (available only Emacs 25 and newer) ;; - Cleared up the console output for easier reading in CI ;; - Expand Travis CI test matrix to include Emacs 25 and 26 ;; * Version 0.1 (2015) @@ -142,8 +144,8 @@ Push results to `elisp-lint-ignored-validators' and `elisp-lint-batch-files'." "The autoloads file for this package.") (defun elisp-lint--generate-autoloads () - "Generate autoloads and set `elisp-lint--autoloads-filename`. -Assume `default-directory` name is also the package name, + "Generate autoloads and set `elisp-lint--autoloads-filename'. +Assume `default-directory' name is also the package name, e.g. for this package it will be \"elisp-lint-autoloads.el\"." (let* ((dir (directory-file-name default-directory)) (prefix (file-name-nondirectory dir)) @@ -152,45 +154,49 @@ e.g. for this package it will be \"elisp-lint-autoloads.el\"." (package-generate-autoloads pkg dir) (setq elisp-lint--autoloads-filename (format "%s-autoloads.el" prefix)))) -(defun elisp-lint--byte-compile (file) - "Byte-compile FILE with warnings enabled. -Return nil if errors were found." +(defun elisp-lint--byte-compile (path-to-file) + "Byte-compile PATH-TO-FILE with warnings enabled. +Return a list of errors, or nil if none found." (let ((comp-log "*Compile-Log*") (lines nil) - (byte-compile-warnings t)) + (byte-compile-warnings t) + (file (file-name-nondirectory path-to-file))) (unless elisp-lint--autoloads-filename (elisp-lint--generate-autoloads)) (load-file elisp-lint--autoloads-filename) (when (get-buffer comp-log) (kill-buffer comp-log)) - (byte-compile-file file) + (byte-compile-file path-to-file) (with-current-buffer comp-log (goto-char (point-min)) - (beginning-of-line 3) ; skip header lines (while (not (eobp)) - (let ((item (split-string - (buffer-substring-no-properties - (line-beginning-position) - (line-end-position)) - ":"))) - (push (list (string-to-number (nth 1 item)) ; LINE - (string-to-number (nth 2 item)) ; COL - 'byte-compile ; TYPE - (string-trim ; MSG - (mapconcat #'identity (cdddr item) ":"))) - lines) - (beginning-of-line 2)))) + (if (looking-at file) + (let* ((end-pos (save-excursion ; continuation on next line? + (beginning-of-line 2) + (if (looking-at " ") 2 1))) + (item (split-string + (buffer-substring-no-properties + (line-beginning-position) + (line-end-position end-pos)) + ":"))) + (push (list (string-to-number (nth 1 item)) ; LINE + (string-to-number (nth 2 item)) ; COL + 'byte-compile ; TYPE + (string-trim ; MSG + (mapconcat #'identity (cdddr item) ":"))) + lines))) + (beginning-of-line 2))) lines)) (defun elisp-lint--check-declare (file) - "Validate `declare-function` statements in FILE." + "Validate `declare-function' statements in FILE." (let ((errlist (check-declare-file file))) (mapcar (lambda (item) ;; check-declare-file returns a list of items containing, from - ;; left to right, the name of the library where `declare-function' + ;; left to right, the name of the library where 'declare-function' ;; said to find the definition, followed by a list of the filename ;; we are currently linting, the function name being looked up, - ;; and the error returned by `check-declare-file': + ;; and the error returned by 'check-declare-file': ;; ;; ((".../path/to/library1.el.gz" ("foo.el" "func1" "err message")) ;; (".../path/to/library2.el.gz" ("foo.el" "func2" "err message")) @@ -198,7 +204,7 @@ Return nil if errors were found." ;; (".../path/to/libraryN.el.gz" ("foo.el" "funcN" "err message"))) ;; ;; For now we don't get line numbers for warnings, but the - ;; `declare-function' lines are easy for the user to find. + ;; 'declare-function' lines are easy for the user to find. (list 0 0 'check-declare (format "(declare-function) %s: \"%s\" in file \"%s\"" (car (cddadr item)) @@ -236,7 +242,13 @@ Parse warnings and return in a list, or nil if no errors found." "Run package-lint on buffer and return results. Result is a list of one item per line having an error, and each entry contains: (LINE COLUMN TYPE MESSAGE)" - (package-lint-buffer)) + (-map + (lambda (item) + (-update-at 2 (lambda (s) + (make-symbol (concat "package-lint-" + (symbol-name s)))) + item)) + (package-lint-buffer))) (defun elisp-lint--next-diff () "Search via regexp for the next diff in the current buffer. @@ -306,7 +318,7 @@ and each entry contains: (LINE COLUMN TYPE MESSAGE)" errlist)) (defun elisp-lint--indent-character () - "Verify buffer indentation is consistent with `indent-tabs-mode`. + "Verify buffer indentation is consistent with `indent-tabs-mode'. Use a file variable or \".dir-locals.el\" to override the default value." (let ((lines nil) (re (if indent-tabs-mode @@ -323,16 +335,35 @@ Use a file variable or \".dir-locals.el\" to override the default value." lines)) (defun elisp-lint--not-tab-regular-expression () - "Regex to match a string of spaces with a length of `tab-width`." + "Regex to match a string of spaces with a length of `tab-width'." (concat "^" (make-string tab-width ? ))) +(defvar elisp-lint--package-summary-regexp + "^;;; \\([^ ]*\\)\\.el ---[ \t]*\\(.*?\\)[ \t]*\\(-\\*-.*-\\*-[ \t]*\\)?$" + "This regexp must match the definition in package.el.") + (defun elisp-lint--fill-column () - "Confirm buffer has no lines exceeding `fill-column` in length. -Use a file variable or \".dir-locals.el\" to override the default value." + "Confirm buffer has no lines exceeding `fill-column' in length. + +Use a file variable or \".dir-locals.el\" to override the default +value. + +When the first line in the buffer is a valid package summary +line, skip over that line and don't enforce the line length at +all. This enables that first line to include a 60 character +summary and \"-*- lexical-binding:t -*-\" regardless if the +resulting line length exceeds `fill-column'." (save-excursion (let ((line-number 1) (too-long-lines nil)) (goto-char (point-min)) + (if (re-search-forward elisp-lint--package-summary-regexp nil t) + ;; Skip package summary and don't enforce fill-column. + (progn + (forward-line 1) + (setq line-number (line-number-at-pos))) + ;; if no package summary then fill-column still applies + (goto-char (point-min))) (while (not (eobp)) (goto-char (point-at-eol)) (when (> (current-column) fill-column) @@ -345,7 +376,7 @@ Use a file variable or \".dir-locals.el\" to override the default value." (defun elisp-lint--trailing-whitespace () "Confirm buffer has no line with trailing whitespace. -Allow `page-delimiter` if it is alone on a line." +Allow `page-delimiter' if it is alone on a line." (save-excursion (let ((lines nil)) (goto-char (point-min)) diff --git a/elpa/elisp-lint-20200217.38/elisp-lint.elc b/elpa/elisp-lint-20200322.2355/elisp-lint.elc similarity index 78% rename from elpa/elisp-lint-20200217.38/elisp-lint.elc rename to elpa/elisp-lint-20200322.2355/elisp-lint.elc index d3c245b19ef6da8e8d46c26e35e5989138dab1b5..cd0ff4d4af3dc7b49a558575c723384de278ec71 100644 GIT binary patch delta 1716 zcmZ`(O>7%Q6!zMVM69GuptLE0^1L>+9kOO;W`AOWl(-U6i&W^31&6GwuI;hC%I>UL zucPFEe1a1fw1=L!axU_rS2)0pBjU`RQ>9)wAl|HPks?@WX5YMd^S$@Yy!XC({LSF$ z;hIuOnrquiW!7H%Qn^lu1-H&)u64s;e7$74;Ctg3!andQ3ZwBZ zgb@hO2d@tz6dd~DMD*%~LbWgcIr;tOjpV^4m^w^1^F?KA)uFm^IfF|J97=Q)?A792 zB6=ProxO$Igh*NL6S|U0QSNi8;2k*!62_q>lcr2bk2%yZGPp@mW#BNE0L)=iVx=}s zX>a0TdP_=n&0!RMP=bR3P7K|u_&3toRGNoHT$%DzZcmC94%=Z&Uuia*(y)XS7`i1{ z1=R?|Xciq%pOBTZLoG|jvlx0tS!%LqDB55#VgNql1K~yufY%Tfq@`I~=e1A>20ZyUl zc@gi%VRW9{+;~{=!|=ot1I>-0!v~%aauN15-@_!JpaOm>kmTzPKlyXRU#B`$OJ%47 zGtIqZyjjA0d$M^|$yvmnJ$?0qyi5)xs^bGlR<;VqTHubLbWBYf@HKRqCaFcPv^1EE zdM>6a20{PRuy{{CxWo$F6RwTVgHGs!I&!-w?tsf+V@-ureb-N!w!uVa!VxloAJ)|N zONu+K5AUK5UIOS$`h6a?fh`!CdwOH``n4DNyhSOSU3&B9e9mZC$!~BQNkj2lC1+ET z{Gc9XEA>RVaXl%P+S3Nr8?|<=P&zaXXbrtFM0~){Mi5M}-~u=94j~?L=<&WMyx0o` zcw!kyo%{8-3su}ZbtB+dqoX-FZ5io!5(I8^t}Q^-NBjHx;5gOeN6_AJoZ217K@iY1 z?HE?2rdr=QK>c#1InIt&-${Q9UG1Q(E+{t)oz-OQ1~rqv%G=3zrLFaf4AAFd5D)8x zq*y$h7EWD%!m&GiHsm5@)Au4|mnIDwOMdg)1my1mntQz^M_5oONb6k~pLin(PkDr= z@cmN=SM;D4ib@Pz^uwsjQ^a&j#xaeD;Kl{l_vy_1#E;Qt z9_;*PfS+|a?~UOx7MqVv*PjHUl5CXe6kC|i=A8~D;}yBYVan`hTUhZrJ(mpu1=&We zwByk2%!TH7AgyfZNHcHsQ+W{k09O2>mI&4pp{tI1q@*1|QCf2##NM2PV?)@+hH6oz zmi)MTrL-uWf92DK;IZgGzIpA+{7E!12|7H&3e`s8IC)my&zTL9yePM@6h3!=~*gQ~^(p3Af*NMcVsYHbYhZYJ#!jY1+o7BQ_jGKUZ z%86b$!5%o#1HS;t2Yvzk0*?F$E}Xb9>!v--dUnR&w=>_&$KGk{+g1j(R3o#BT5&V; z9%X9+Z=Vch^yBrJ<%${mA8t^4WD2T%g)Ie|*V2%Ow;u&yrsD{(MG_XOH zQb(W&&ehrVesM0{`Qu33ShXu4Nn``~rECpE*c+8K4bGHPNv0oy{<;)l7v zrfJt{J-&bAr diff --git a/elpa/elpy-20200202.2031/elpy/__init__.py b/elpa/elpy-20200202.2031/elpy/__init__.py deleted file mode 100644 index c0da0629..00000000 --- a/elpa/elpy-20200202.2031/elpy/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# Elpy, the Emacs Lisp Python Environment - -# Copyright (C) 2013-2019 Jorgen Schaefer - -# Author: Jorgen Schaefer -# URL: http://github.com/jorgenschaefer/elpy - -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 3 -# of the License, or (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -"""The Emacs Lisp Python Environment. - -Elpy is a mode for Emacs to support writing Python code. This package -provides the backend within Python to support auto-completion, -documentation extraction, and navigation. - -Emacs will start the protocol by running the module itself, like so: - - python -m elpy - -This will emit a greeting string on a single line, and then wait for -the protocol to start. Details of the protocol can be found in -elpy.rpc. - -This package is unlikely to be useful on its own. - -""" - -__author__ = "Jorgen Schaefer" -__version__ = "1.32.0" -__license__ = "GPL" diff --git a/elpa/elpy-20200202.2031/elpy/__main__.py b/elpa/elpy-20200202.2031/elpy/__main__.py deleted file mode 100644 index 5683fdd5..00000000 --- a/elpa/elpy-20200202.2031/elpy/__main__.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Main interface to the RPC server. - -You should be able to just run the following to use this module: - -python -m elpy - -The first line should be "elpy-rpc ready". If it isn't, something -broke. - -""" - -import os -import sys - -import elpy -from elpy.server import ElpyRPCServer - -if __name__ == '__main__': - stdin = sys.stdin - stdout = sys.stdout - sys.stdout = sys.stderr = open(os.devnull, "w") - stdout.write('elpy-rpc ready ({0})\n' - .format(elpy.__version__)) - stdout.flush() - ElpyRPCServer(stdin, stdout).serve_forever() diff --git a/elpa/elpy-20200202.2031/elpy/auto_pep8.py b/elpa/elpy-20200202.2031/elpy/auto_pep8.py deleted file mode 100644 index 310a04b9..00000000 --- a/elpa/elpy-20200202.2031/elpy/auto_pep8.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Glue for the "autopep8" library. - -""" - -from elpy.rpc import Fault -import os - - -try: - import autopep8 -except ImportError: # pragma: no cover - autopep8 = None - - -def fix_code(code, directory): - """Formats Python code to conform to the PEP 8 style guide. - - """ - if not autopep8: - raise Fault('autopep8 not installed, cannot fix code.', - code=400) - old_dir = os.getcwd() - try: - os.chdir(directory) - return autopep8.fix_code(code, apply_config=True) - finally: - os.chdir(old_dir) diff --git a/elpa/elpy-20200202.2031/elpy/blackutil.py b/elpa/elpy-20200202.2031/elpy/blackutil.py deleted file mode 100644 index 56df761d..00000000 --- a/elpa/elpy-20200202.2031/elpy/blackutil.py +++ /dev/null @@ -1,69 +0,0 @@ -"""Glue for the "black" library. - -""" - -import sys - -# in case pkg_resources is not properly installed -# (see https://github.com/jorgenschaefer/elpy/issues/1674). -try: - from pkg_resources import parse_version -except ImportError: - parse_version = None - -import os - -try: - import toml -except ImportError: - toml = None - -from elpy.rpc import Fault - -BLACK_NOT_SUPPORTED = sys.version_info < (3, 6) - -try: - if BLACK_NOT_SUPPORTED: - black = None - else: - import black -except ImportError: # pragma: no cover - black = None - - -def fix_code(code, directory): - """Formats Python code to conform to the PEP 8 style guide. - - """ - if not black: - raise Fault("black not installed", code=400) - if not parse_version: - raise Fault("`pkg_resources` could not be imported, " - "please reinstall Elpy RPC virtualenv with" - " `M-x elpy-rpc-reinstall-virtualenv`", code=400) - # Get black config from pyproject.toml - line_length = black.DEFAULT_LINE_LENGTH - string_normalization = True - pyproject_path = os.path.join(directory, "pyproject.toml") - if toml is not None and os.path.exists(pyproject_path): - pyproject_config = toml.load(pyproject_path) - black_config = pyproject_config.get("tool", {}).get("black", {}) - if "line-length" in black_config: - line_length = black_config["line-length"] - if "skip-string-normalization" in black_config: - string_normalization = not black_config["skip-string-normalization"] - try: - if parse_version(black.__version__) < parse_version("19.0"): - reformatted_source = black.format_file_contents( - src_contents=code, line_length=line_length, fast=False) - else: - fm = black.FileMode( - line_length=line_length, - string_normalization=string_normalization) - reformatted_source = black.format_file_contents( - src_contents=code, fast=False, mode=fm) - return reformatted_source - except black.NothingChanged: - return code - except Exception as e: - raise Fault("Error during formatting: {}".format(e), code=400) diff --git a/elpa/elpy-20200202.2031/elpy/compat.py b/elpa/elpy-20200202.2031/elpy/compat.py deleted file mode 100644 index ebe91a23..00000000 --- a/elpa/elpy-20200202.2031/elpy/compat.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Python 2/3 compatibility definitions. - -These are used by the rest of Elpy to keep compatibility definitions -in one place. - -""" - -import sys - - -if sys.version_info >= (3, 0): - PYTHON3 = True - - from io import StringIO - - def ensure_not_unicode(obj): - return obj -else: - PYTHON3 = False - - from StringIO import StringIO # noqa - - def ensure_not_unicode(obj): - """Return obj. If it's a unicode string, convert it to str first. - - Pydoc functions simply don't find anything for unicode - strings. No idea why. - - """ - if isinstance(obj, unicode): - return obj.encode("utf-8") - else: - return obj diff --git a/elpa/elpy-20200202.2031/elpy/jedibackend.py b/elpa/elpy-20200202.2031/elpy/jedibackend.py deleted file mode 100644 index a252cc87..00000000 --- a/elpa/elpy-20200202.2031/elpy/jedibackend.py +++ /dev/null @@ -1,382 +0,0 @@ -"""Elpy backend using the Jedi library. - -This backend uses the Jedi library: - -https://github.com/davidhalter/jedi - -""" - -import sys -import traceback -import re - -import jedi - -from elpy import rpc - - -class JediBackend(object): - """The Jedi backend class. - - Implements the RPC calls we can pass on to Jedi. - - Documentation: http://jedi.jedidjah.ch/en/latest/docs/plugin-api.html - - """ - name = "jedi" - - def __init__(self, project_root, environment_binaries_path): - self.project_root = project_root - self.environment = None - if environment_binaries_path is not None: - self.environment = jedi.create_environment(environment_binaries_path, - safe=False) - self.completions = {} - sys.path.append(project_root) - - def rpc_get_completions(self, filename, source, offset): - line, column = pos_to_linecol(source, offset) - proposals = run_with_debug(jedi, 'completions', - source=source, line=line, column=column, - path=filename, encoding='utf-8', - environment=self.environment) - if proposals is None: - return [] - self.completions = dict((proposal.name, proposal) - for proposal in proposals) - return [{'name': proposal.name.rstrip("="), - 'suffix': proposal.complete.rstrip("="), - 'annotation': proposal.type, - 'meta': proposal.description} - for proposal in proposals] - - def rpc_get_completion_docstring(self, completion): - proposal = self.completions.get(completion) - if proposal is None: - return None - else: - return proposal.docstring(fast=False) - - def rpc_get_completion_location(self, completion): - proposal = self.completions.get(completion) - if proposal is None: - return None - else: - return (proposal.module_path, proposal.line) - - def rpc_get_docstring(self, filename, source, offset): - line, column = pos_to_linecol(source, offset) - locations = run_with_debug(jedi, 'goto_definitions', - source=source, line=line, column=column, - path=filename, encoding='utf-8', - environment=self.environment) - if locations and locations[-1].docstring(): - return ('Documentation for {0}:\n\n'.format( - locations[-1].full_name) + locations[-1].docstring()) - else: - return None - - def rpc_get_definition(self, filename, source, offset): - line, column = pos_to_linecol(source, offset) - locations = run_with_debug(jedi, 'goto_definitions', - source=source, line=line, column=column, - path=filename, encoding='utf-8', - environment=self.environment) - # goto_definitions() can return silly stuff like __builtin__ - # for int variables, so we fall back on goto() in those - # cases. See issue #76. - if ( - locations and - (locations[0].module_path is None - or locations[0].module_name == 'builtins' - or locations[0].module_name == '__builtin__') - ): - locations = run_with_debug(jedi, 'goto_assignments', - source=source, line=line, - column=column, - path=filename, encoding='utf-8', - environment=self.environment) - if not locations: - return None - else: - loc = locations[-1] - try: - if loc.module_path: - if loc.module_path == filename: - offset = linecol_to_pos(source, - loc.line, - loc.column) - else: - with open(loc.module_path) as f: - offset = linecol_to_pos(f.read(), - loc.line, - loc.column) - else: - return None - except IOError: - return None - return (loc.module_path, offset) - - def rpc_get_assignment(self, filename, source, offset): - line, column = pos_to_linecol(source, offset) - locations = run_with_debug(jedi, 'goto_assignments', - source=source, line=line, column=column, - path=filename, encoding='utf-8', - environment=self.environment) - - if not locations: - return None - else: - loc = locations[-1] - try: - if loc.module_path: - if loc.module_path == filename: - offset = linecol_to_pos(source, - loc.line, - loc.column) - else: - with open(loc.module_path) as f: - offset = linecol_to_pos(f.read(), - loc.line, - loc.column) - else: - return None - except IOError: - return None - return (loc.module_path, offset) - - def rpc_get_calltip(self, filename, source, offset): - line, column = pos_to_linecol(source, offset) - calls = run_with_debug(jedi, 'call_signatures', - source=source, line=line, column=column, - path=filename, encoding='utf-8', - environment=self.environment) - if calls: - call = calls[0] - else: - call = None - if not call: - return None - # Strip 'param' added by jedi at the beginning of - # parameter names. Should be unecessary for jedi > 0.13.0 - params = [re.sub("^param ", '', param.description) - for param in call.params] - return {"name": call.name, - "index": call.index, - "params": params} - - def rpc_get_oneline_docstring(self, filename, source, offset): - """Return a oneline docstring for the symbol at offset""" - line, column = pos_to_linecol(source, offset) - definitions = run_with_debug(jedi, 'goto_definitions', - source=source, line=line, column=column, - path=filename, encoding='utf-8', - environment=self.environment) - assignments = run_with_debug(jedi, 'goto_assignments', - source=source, line=line, column=column, - path=filename, encoding='utf-8', - environment=self.environment) - - if definitions: - definition = definitions[0] - else: - definition = None - if assignments: - assignment = assignments[0] - else: - assignment = None - if definition: - # Get name - if definition.type in ['function', 'class']: - raw_name = definition.name - name = '{}()'.format(raw_name) - doc = definition.docstring().split('\n') - elif definition.type in ['module']: - raw_name = definition.name - name = '{} {}'.format(raw_name, definition.type) - doc = definition.docstring().split('\n') - elif (definition.type in ['instance'] - and hasattr(assignment, "name")): - raw_name = assignment.name - name = raw_name - doc = assignment.docstring().split('\n') - else: - return None - # Keep only the first paragraph that is not a function declaration - lines = [] - call = "{}(".format(raw_name) - # last line - doc.append('') - for i in range(len(doc)): - if doc[i] == '' and len(lines) != 0: - paragraph = " ".join(lines) - lines = [] - if call != paragraph[0:len(call)]: - break - paragraph = "" - continue - lines.append(doc[i]) - # Keep only the first sentence - onelinedoc = paragraph.split('. ', 1) - if len(onelinedoc) == 2: - onelinedoc = onelinedoc[0] + '.' - else: - onelinedoc = onelinedoc[0] - if onelinedoc == '': - onelinedoc = "No documentation" - return {"name": name, - "doc": onelinedoc} - return None - - def rpc_get_usages(self, filename, source, offset): - """Return the uses of the symbol at offset. - - Returns a list of occurrences of the symbol, as dicts with the - fields name, filename, and offset. - - """ - line, column = pos_to_linecol(source, offset) - uses = run_with_debug(jedi, 'usages', - source=source, line=line, column=column, - path=filename, encoding='utf-8', - environment=self.environment) - if uses is None: - return None - result = [] - for use in uses: - if use.module_path == filename: - offset = linecol_to_pos(source, use.line, use.column) - elif use.module_path is not None: - with open(use.module_path) as f: - text = f.read() - offset = linecol_to_pos(text, use.line, use.column) - - result.append({"name": use.name, - "filename": use.module_path, - "offset": offset}) - - return result - - def rpc_get_names(self, filename, source, offset): - """Return the list of possible names""" - names = jedi.api.names(source=source, - path=filename, encoding='utf-8', - all_scopes=True, - definitions=True, - references=True) - - result = [] - for name in names: - if name.module_path == filename: - offset = linecol_to_pos(source, name.line, name.column) - elif name.module_path is not None: - with open(name.module_path) as f: - text = f.read() - offset = linecol_to_pos(text, name.line, name.column) - result.append({"name": name.name, - "filename": name.module_path, - "offset": offset}) - return result - - -# From the Jedi documentation: -# -# line is the current line you want to perform actions on (starting -# with line #1 as the first line). column represents the current -# column/indent of the cursor (starting with zero). source_path -# should be the path of your file in the file system. - -def pos_to_linecol(text, pos): - """Return a tuple of line and column for offset pos in text. - - Lines are one-based, columns zero-based. - - This is how Jedi wants it. Don't ask me why. - - """ - line_start = text.rfind("\n", 0, pos) + 1 - line = text.count("\n", 0, line_start) + 1 - col = pos - line_start - return line, col - - -def linecol_to_pos(text, line, col): - """Return the offset of this line and column in text. - - Lines are one-based, columns zero-based. - - This is how Jedi wants it. Don't ask me why. - - """ - nth_newline_offset = 0 - for i in range(line - 1): - new_offset = text.find("\n", nth_newline_offset) - if new_offset < 0: - raise ValueError("Text does not have {0} lines." - .format(line)) - nth_newline_offset = new_offset + 1 - offset = nth_newline_offset + col - if offset > len(text): - raise ValueError("Line {0} column {1} is not within the text" - .format(line, col)) - return offset - - -def run_with_debug(jedi, name, *args, **kwargs): - re_raise = kwargs.pop('re_raise', ()) - try: - script = jedi.Script(*args, **kwargs) - return getattr(script, name)() - except Exception as e: - if isinstance(e, re_raise): - raise - # Bug jedi#485 - if ( - isinstance(e, ValueError) and - "invalid \\x escape" in str(e) - ): - return None - # Bug jedi#485 in Python 3 - if ( - isinstance(e, SyntaxError) and - "truncated \\xXX escape" in str(e) - ): - return None - - from jedi import debug - - debug_info = [] - - def _debug(level, str_out): - if level == debug.NOTICE: - prefix = "[N]" - elif level == debug.WARNING: - prefix = "[W]" - else: - prefix = "[?]" - debug_info.append(u"{0} {1}".format(prefix, str_out)) - - jedi.set_debug_function(_debug, speed=False) - try: - script = jedi.Script(*args, **kwargs) - return getattr(script, name)() - except Exception as e: - source = kwargs.get('source') - sc_args = [] - sc_args.extend(repr(arg) for arg in args) - sc_args.extend("{0}={1}".format(k, "source" if k == "source" - else repr(v)) - for (k, v) in kwargs.items()) - - data = { - "traceback": traceback.format_exc(), - "jedi_debug_info": {'script_args': ", ".join(sc_args), - 'source': source, - 'method': name, - 'debug_info': debug_info} - } - raise rpc.Fault(message=str(e), - code=500, - data=data) - finally: - jedi.set_debug_function(None) diff --git a/elpa/elpy-20200202.2031/elpy/pydocutils.py b/elpa/elpy-20200202.2031/elpy/pydocutils.py deleted file mode 100644 index 259bd1c2..00000000 --- a/elpa/elpy-20200202.2031/elpy/pydocutils.py +++ /dev/null @@ -1,91 +0,0 @@ -import sys -import types - -from pydoc import safeimport, resolve, ErrorDuringImport -from pkgutil import iter_modules - -from elpy import compat - -# Types we want to recurse into (nodes). -CONTAINER_TYPES = (type, types.ModuleType) -# Types of attributes we can get documentation for (leaves). -PYDOC_TYPES = (type, - types.FunctionType, - types.BuiltinFunctionType, - types.BuiltinMethodType, - types.MethodType, - types.ModuleType) -if not compat.PYTHON3: # pragma: nocover - # Python 2 old style classes - CONTAINER_TYPES = tuple(list(CONTAINER_TYPES) + [types.ClassType]) - PYDOC_TYPES = tuple(list(PYDOC_TYPES) + [types.ClassType]) - - -def get_pydoc_completions(modulename): - """Get possible completions for modulename for pydoc. - - Returns a list of possible values to be passed to pydoc. - - """ - modulename = compat.ensure_not_unicode(modulename) - modulename = modulename.rstrip(".") - if modulename == "": - return sorted(get_modules()) - candidates = get_completions(modulename) - if candidates: - return sorted(candidates) - needle = modulename - if "." in needle: - modulename, part = needle.rsplit(".", 1) - candidates = get_completions(modulename) - else: - candidates = get_modules() - return sorted(candidate for candidate in candidates - if candidate.startswith(needle)) - - -def get_completions(modulename): - modules = set("{0}.{1}".format(modulename, module) - for module in get_modules(modulename)) - - try: - module, name = resolve(modulename) - except ImportError: - return modules - if isinstance(module, CONTAINER_TYPES): - modules.update("{0}.{1}".format(modulename, name) - for name in dir(module) - if not name.startswith("_") and - isinstance(getattr(module, name), - PYDOC_TYPES)) - return modules - - -def get_modules(modulename=None): - """Return a list of modules and packages under modulename. - - If modulename is not given, return a list of all top level modules - and packages. - - """ - modulename = compat.ensure_not_unicode(modulename) - if not modulename: - try: - return ([modname for (importer, modname, ispkg) - in iter_modules() - if not modname.startswith("_")] + - list(sys.builtin_module_names)) - except OSError: - # Bug in Python 2.6, see #275 - return list(sys.builtin_module_names) - try: - module = safeimport(modulename) - except ErrorDuringImport: - return [] - if module is None: - return [] - if hasattr(module, "__path__"): - return [modname for (importer, modname, ispkg) - in iter_modules(module.__path__) - if not modname.startswith("_")] - return [] diff --git a/elpa/elpy-20200202.2031/elpy/refactor.py b/elpa/elpy-20200202.2031/elpy/refactor.py deleted file mode 100644 index 68ce93bd..00000000 --- a/elpa/elpy-20200202.2031/elpy/refactor.py +++ /dev/null @@ -1,381 +0,0 @@ -"""Refactoring methods for elpy. - -This interfaces directly with rope, regardless of the backend used, -because the other backends don't really offer refactoring choices. -Once Jedi is similarly featureful as Rope we can try and offer both. - - -# Too complex: - -- Restructure: Interesting, but too complex, and needs deep Rope - knowledge to do well. - -- ChangeSignature: Slightly less complex interface, but still to - complex, requiring a large effort for the benefit. - - -# Too useless: - -I could not get these to work in any useful fashion. I might be doing -something wrong. - -- ExtractVariable does not replace the code extracted with the - variable, making it a glorified copy&paste function. Emacs can do - better than this interface by itself. - -- EncapsulateField: Getter/setter methods are outdated, this should be - using properties. - -- IntroduceFactory: Inserts a trivial method to the current class. - Cute. - -- IntroduceParameter: Introduces a parameter correctly, but does not - replace the old code with the parameter. So it just edits the - argument list and adds a shiny default. - -- LocalToField: Seems to just add "self." in front of all occurrences - of a variable in the local scope. - -- MethodObject: This turns the current method into a callable - class/object. Not sure what that would be good for. - - -# Can't even get to work: - -- ImportOrganizer expand_star_imports, handle_long_imports, - relatives_to_absolutes: Seem not to do anything. - -- create_move: I was not able to figure out what it would like to see - as its attrib argument. - -""" - -import os - -from elpy.rpc import Fault - -try: - from rope.base.exceptions import RefactoringError - from rope.base.project import Project - from rope.base.libutils import path_to_resource - from rope.base import change as rope_change - from rope.base import worder - from rope.refactor.importutils import ImportOrganizer - from rope.refactor.topackage import ModuleToPackage - from rope.refactor.rename import Rename - from rope.refactor.move import create_move - from rope.refactor.inline import create_inline - from rope.refactor.extract import ExtractMethod - from rope.refactor.usefunction import UseFunction - ROPE_AVAILABLE = True -except ImportError: - ROPE_AVAILABLE = False - - -def options(description, **kwargs): - """Decorator to set some options on a method.""" - def set_notes(function): - function.refactor_notes = {'name': function.__name__, - 'category': "Miscellaneous", - 'description': description, - 'doc': getattr(function, '__doc__', - ''), - 'args': []} - function.refactor_notes.update(kwargs) - return function - return set_notes - - -class Refactor(object): - """The main refactoring interface. - - Once initialized, the first call should be to get_refactor_options - to get a list of refactoring options at a given position. The - returned value will also list any additional options required. - - Once you picked one, you can call get_changes to get the actual - refactoring changes. - - """ - def __init__(self, project_root, filename): - self.project_root = project_root - if not ROPE_AVAILABLE: - raise Fault('rope not installed, cannot refactor code.', - code=400) - if not os.path.exists(project_root): - raise Fault( - "cannot do refactoring without a local project root", - code=400 - ) - self.project = Project(project_root, ropefolder=None) - self.resource = path_to_resource(self.project, filename) - - def get_refactor_options(self, start, end=None): - """Return a list of options for refactoring at the given position. - - If `end` is also given, refactoring on a region is assumed. - - Each option is a dictionary of key/value pairs. The value of - the key 'name' is the one to be used for get_changes. - - The key 'args' contains a list of additional arguments - required for get_changes. - - """ - result = [] - for symbol in dir(self): - if not symbol.startswith("refactor_"): - continue - method = getattr(self, symbol) - if not method.refactor_notes.get('available', True): - continue - category = method.refactor_notes['category'] - if end is not None and category != 'Region': - continue - if end is None and category == 'Region': - continue - is_on_symbol = self._is_on_symbol(start) - if not is_on_symbol and category in ('Symbol', 'Method'): - continue - requires_import = method.refactor_notes.get('only_on_imports', - False) - if requires_import and not self._is_on_import_statement(start): - continue - result.append(method.refactor_notes) - return result - - def _is_on_import_statement(self, offset): - "Does this offset point to an import statement?" - data = self.resource.read() - bol = data.rfind("\n", 0, offset) + 1 - eol = data.find("\n", 0, bol) - if eol == -1: - eol = len(data) - line = data[bol:eol] - line = line.strip() - if line.startswith("import ") or line.startswith("from "): - return True - else: - return False - - def _is_on_symbol(self, offset): - "Is this offset on a symbol?" - if not ROPE_AVAILABLE: - return False - data = self.resource.read() - if offset >= len(data): - return False - if data[offset] != '_' and not data[offset].isalnum(): - return False - word = worder.get_name_at(self.resource, offset) - if word: - return True - else: - return False - - def get_changes(self, name, *args): - """Return a list of changes for the named refactoring action. - - Changes are dictionaries describing a single action to be - taken for the refactoring to be successful. - - A change has an action and possibly a type. In the description - below, the action is before the slash and the type after it. - - change: Change file contents - - file: The path to the file to change - - contents: The new contents for the file - - Diff: A unified diff showing the changes introduced - - create/file: Create a new file - - file: The file to create - - create/directory: Create a new directory - - path: The directory to create - - move/file: Rename a file - - source: The path to the source file - - destination: The path to the destination file name - - move/directory: Rename a directory - - source: The path to the source directory - - destination: The path to the destination directory name - - delete/file: Delete a file - - file: The file to delete - - delete/directory: Delete a directory - - path: The directory to delete - - """ - if not name.startswith("refactor_"): - raise ValueError("Bad refactoring name {0}".format(name)) - method = getattr(self, name) - if not method.refactor_notes.get('available', True): - raise RuntimeError("Method not available") - return method(*args) - - @options("Convert from x import y to import x.y as y", category="Imports", - args=[("offset", "offset", None)], - only_on_imports=True, - available=ROPE_AVAILABLE) - def refactor_froms_to_imports(self, offset): - """Converting imports of the form "from ..." to "import ...".""" - refactor = ImportOrganizer(self.project) - changes = refactor.froms_to_imports(self.resource, offset) - return translate_changes(changes) - - @options("Reorganize and clean up", category="Imports", - available=ROPE_AVAILABLE) - def refactor_organize_imports(self): - """Clean up and organize imports.""" - refactor = ImportOrganizer(self.project) - changes = refactor.organize_imports(self.resource) - return translate_changes(changes) - - @options("Convert the current module into a package", category="Module", - available=ROPE_AVAILABLE) - def refactor_module_to_package(self): - """Convert the current module into a package.""" - refactor = ModuleToPackage(self.project, self.resource) - return self._get_changes(refactor) - - @options("Rename symbol at point", category="Symbol", - args=[("offset", "offset", None), - ("new_name", "string", "Rename to: "), - ("in_hierarchy", "boolean", - "Rename in super-/subclasses as well? "), - ("docs", "boolean", - "Replace occurences in docs and strings? ") - ], - available=ROPE_AVAILABLE) - def refactor_rename_at_point(self, offset, new_name, in_hierarchy, docs): - """Rename the symbol at point.""" - try: - refactor = Rename(self.project, self.resource, offset) - except RefactoringError as e: - raise Fault(str(e), code=400) - return self._get_changes(refactor, new_name, - in_hierarchy=in_hierarchy, docs=docs) - - @options("Rename current module", category="Module", - args=[("new_name", "string", "Rename to: ")], - available=ROPE_AVAILABLE) - def refactor_rename_current_module(self, new_name): - """Rename the current module.""" - refactor = Rename(self.project, self.resource, None) - return self._get_changes(refactor, new_name) - - @options("Move the current module to a different package", - category="Module", - args=[("new_name", "directory", "Destination package: ")], - available=ROPE_AVAILABLE) - def refactor_move_module(self, new_name): - """Move the current module.""" - refactor = create_move(self.project, self.resource) - resource = path_to_resource(self.project, new_name) - return self._get_changes(refactor, resource) - - @options("Inline function call at point", category="Symbol", - args=[("offset", "offset", None), - ("only_this", "boolean", "Only this occurrence? ")], - available=ROPE_AVAILABLE) - def refactor_create_inline(self, offset, only_this): - """Inline the function call at point.""" - refactor = create_inline(self.project, self.resource, offset) - if only_this: - return self._get_changes(refactor, remove=False, only_current=True) - else: - return self._get_changes(refactor, remove=True, only_current=False) - - @options("Extract current region as a method", category="Region", - args=[("start", "start_offset", None), - ("end", "end_offset", None), - ("name", "string", "Method name: "), - ("make_global", "boolean", "Create global method? ")], - available=ROPE_AVAILABLE) - def refactor_extract_method(self, start, end, name, - make_global): - """Extract region as a method.""" - refactor = ExtractMethod(self.project, self.resource, start, end) - return self._get_changes( - refactor, name, similar=True, global_=make_global - ) - - @options("Use the function at point wherever possible", category="Method", - args=[("offset", "offset", None)], - available=ROPE_AVAILABLE) - def refactor_use_function(self, offset): - """Use the function at point wherever possible.""" - try: - refactor = UseFunction(self.project, self.resource, offset) - except RefactoringError as e: - raise Fault( - 'Refactoring error: {}'.format(e), - code=400 - ) - return self._get_changes(refactor) - - def _get_changes(self, refactor, *args, **kwargs): - try: - changes = refactor.get_changes(*args, **kwargs) - except Exception as e: - raise Fault("Error during refactoring: {}".format(e), - code=400) - return translate_changes(changes) - - -def translate_changes(initial_change): - """Translate rope.base.change.Change instances to dictionaries. - - See Refactor.get_changes for an explanation of the resulting - dictionary. - - """ - agenda = [initial_change] - result = [] - while agenda: - change = agenda.pop(0) - if isinstance(change, rope_change.ChangeSet): - agenda.extend(change.changes) - elif isinstance(change, rope_change.ChangeContents): - result.append({'action': 'change', - 'file': change.resource.real_path, - 'contents': change.new_contents, - 'diff': change.get_description()}) - elif isinstance(change, rope_change.CreateFile): - result.append({'action': 'create', - 'type': 'file', - 'file': change.resource.real_path}) - elif isinstance(change, rope_change.CreateFolder): - result.append({'action': 'create', - 'type': 'directory', - 'path': change.resource.real_path}) - elif isinstance(change, rope_change.MoveResource): - result.append({'action': 'move', - 'type': ('directory' - if change.new_resource.is_folder() - else 'file'), - 'source': change.resource.real_path, - 'destination': change.new_resource.real_path}) - elif isinstance(change, rope_change.RemoveResource): - if change.resource.is_folder(): - result.append({'action': 'delete', - 'type': 'directory', - 'path': change.resource.real_path}) - else: - result.append({'action': 'delete', - 'type': 'file', - 'file': change.resource.real_path}) - return result - - -class FakeResource(object): - """A fake resource in case Rope is absence.""" - - def __init__(self, filename): - self.real_path = filename - - def read(self): - with open(self.real_path) as f: - return f.read() diff --git a/elpa/elpy-20200202.2031/elpy/rpc.py b/elpa/elpy-20200202.2031/elpy/rpc.py deleted file mode 100644 index 07b2ce97..00000000 --- a/elpa/elpy-20200202.2031/elpy/rpc.py +++ /dev/null @@ -1,151 +0,0 @@ -"""A simple JSON-RPC-like server. - -The server will read and write lines of JSON-encoded method calls and -responses. - -See the documentation of the JSONRPCServer class for further details. - -""" - -import json -import sys -import traceback - - -class JSONRPCServer(object): - """Simple JSON-RPC-like server. - - This class will read single-line JSON expressions from stdin, - decode them, and pass them to a handler. Return values from the - handler will be JSON-encoded and written to stdout. - - To implement a handler, you need to subclass this class and add - methods starting with "rpc_". Methods then will be found. - - Method calls should be encoded like this: - - {"id": 23, "method": "method_name", "params": ["foo", "bar"]} - - This will call self.rpc_method("foo", "bar"). - - Responses will be encoded like this: - - {"id": 23, "result": "foo"} - - Errors will be encoded like this: - - {"id": 23, "error": "Simple error message"} - - See http://www.jsonrpc.org/ for the inspiration of the protocol. - - """ - - def __init__(self, stdin=None, stdout=None): - """Return a new JSON-RPC server object. - - It will read lines of JSON data from stdin, and write the - responses to stdout. - - """ - if stdin is None: - self.stdin = sys.stdin - else: - self.stdin = stdin - if stdout is None: - self.stdout = sys.stdout - else: - self.stdout = stdout - - def read_json(self): - """Read a single line and decode it as JSON. - - Can raise an EOFError() when the input source was closed. - - """ - line = self.stdin.readline() - if line == '': - raise EOFError() - return json.loads(line) - - def write_json(self, **kwargs): - """Write an JSON object on a single line. - - The keyword arguments are interpreted as a single JSON object. - It's not possible with this method to write non-objects. - - """ - self.stdout.write(json.dumps(kwargs) + "\n") - self.stdout.flush() - - def handle_request(self): - """Handle a single JSON-RPC request. - - Read a request, call the appropriate handler method, and - return the encoded result. Errors in the handler method are - caught and encoded as error objects. Errors in the decoding - phase are not caught, as we can not respond with an error - response to them. - - """ - request = self.read_json() - if 'method' not in request: - raise ValueError("Received a bad request: {0}" - .format(request)) - method_name = request['method'] - request_id = request.get('id', None) - params = request.get('params') or [] - try: - method = getattr(self, "rpc_" + method_name, None) - if method is not None: - result = method(*params) - else: - result = self.handle(method_name, params) - if request_id is not None: - self.write_json(result=result, - id=request_id) - except Fault as fault: - error = {"message": fault.message, - "code": fault.code} - if fault.data is not None: - error["data"] = fault.data - self.write_json(error=error, id=request_id) - except Exception as e: - error = {"message": str(e), - "code": 500, - "data": {"traceback": traceback.format_exc()}} - self.write_json(error=error, id=request_id) - - def handle(self, method_name, args): - """Handle the call to method_name. - - You should overwrite this method in a subclass. - """ - raise Fault("Unknown method {0}".format(method_name)) - - def serve_forever(self): - """Serve requests forever. - - Errors are not caught, so this is a slight misnomer. - - """ - while True: - try: - self.handle_request() - except (KeyboardInterrupt, EOFError, SystemExit): - break - - -class Fault(Exception): - """RPC Fault instances. - - code defines the severity of the warning. - - 2xx: Normal behavior lead to end of operation, i.e. a warning - 4xx: An expected error occurred - 5xx: An unexpected error occurred (usually includes a traceback) - """ - def __init__(self, message, code=500, data=None): - super(Fault, self).__init__(message) - self.message = message - self.code = code - self.data = data diff --git a/elpa/elpy-20200202.2031/elpy/server.py b/elpa/elpy-20200202.2031/elpy/server.py deleted file mode 100644 index d0d838ab..00000000 --- a/elpa/elpy-20200202.2031/elpy/server.py +++ /dev/null @@ -1,271 +0,0 @@ -"""Method implementations for the Elpy JSON-RPC server. - -This file implements the methods exported by the JSON-RPC server. It -handles backend selection and passes methods on to the selected -backend. - -""" -import io -import os -import pydoc - -from elpy.pydocutils import get_pydoc_completions -from elpy.rpc import JSONRPCServer, Fault -from elpy.auto_pep8 import fix_code -from elpy.yapfutil import fix_code as fix_code_with_yapf -from elpy.blackutil import fix_code as fix_code_with_black - - -try: - from elpy import jedibackend -except ImportError: # pragma: no cover - jedibackend = None - - -class ElpyRPCServer(JSONRPCServer): - """The RPC server for elpy. - - See the rpc_* methods for exported method documentation. - - """ - def __init__(self, *args, **kwargs): - super(ElpyRPCServer, self).__init__(*args, **kwargs) - self.backend = None - self.project_root = None - - def _call_backend(self, method, default, *args, **kwargs): - """Call the backend method with args. - - If there is currently no backend, return default.""" - meth = getattr(self.backend, method, None) - if meth is None: - return default - else: - return meth(*args, **kwargs) - - def rpc_echo(self, *args): - """Return the arguments. - - This is a simple test method to see if the protocol is - working. - - """ - return args - - def rpc_init(self, options): - self.project_root = options["project_root"] - self.env = options["environment"] - - if jedibackend: - self.backend = jedibackend.JediBackend(self.project_root, self.env) - else: - self.backend = None - - return { - 'jedi_available': (self.backend is not None) - } - - def rpc_get_calltip(self, filename, source, offset): - """Get the calltip for the function at the offset. - - """ - return self._call_backend("rpc_get_calltip", None, filename, - get_source(source), offset) - - def rpc_get_oneline_docstring(self, filename, source, offset): - """Get a oneline docstring for the symbol at the offset. - - """ - return self._call_backend("rpc_get_oneline_docstring", None, filename, - get_source(source), offset) - - def rpc_get_completions(self, filename, source, offset): - """Get a list of completion candidates for the symbol at offset. - - """ - results = self._call_backend("rpc_get_completions", [], filename, - get_source(source), offset) - # Uniquify by name - results = list(dict((res['name'], res) for res in results) - .values()) - results.sort(key=lambda cand: _pysymbol_key(cand["name"])) - return results - - def rpc_get_completion_docstring(self, completion): - """Return documentation for a previously returned completion. - - """ - return self._call_backend("rpc_get_completion_docstring", - None, completion) - - def rpc_get_completion_location(self, completion): - """Return the location for a previously returned completion. - - This returns a list of [file name, line number]. - - """ - return self._call_backend("rpc_get_completion_location", None, - completion) - - def rpc_get_definition(self, filename, source, offset): - """Get the location of the definition for the symbol at the offset. - - """ - return self._call_backend("rpc_get_definition", None, filename, - get_source(source), offset) - - def rpc_get_assignment(self, filename, source, offset): - """Get the location of the assignment for the symbol at the offset. - - """ - return self._call_backend("rpc_get_assignment", None, filename, - get_source(source), offset) - - def rpc_get_docstring(self, filename, source, offset): - """Get the docstring for the symbol at the offset. - - """ - return self._call_backend("rpc_get_docstring", None, filename, - get_source(source), offset) - - def rpc_get_pydoc_completions(self, name=None): - """Return a list of possible strings to pass to pydoc. - - If name is given, the strings are under name. If not, top - level modules are returned. - - """ - return get_pydoc_completions(name) - - def rpc_get_pydoc_documentation(self, symbol): - """Get the Pydoc documentation for the given symbol. - - Uses pydoc and can return a string with backspace characters - for bold highlighting. - - """ - try: - docstring = pydoc.render_doc(str(symbol), - "Elpy Pydoc Documentation for %s", - False) - except (ImportError, pydoc.ErrorDuringImport): - return None - else: - if isinstance(docstring, bytes): - docstring = docstring.decode("utf-8", "replace") - return docstring - - def rpc_get_refactor_options(self, filename, start, end=None): - """Return a list of possible refactoring options. - - This list will be filtered depending on whether it's - applicable at the point START and possibly the region between - START and END. - - """ - try: - from elpy import refactor - except: - raise ImportError("Rope not installed, refactorings unavailable") - ref = refactor.Refactor(self.project_root, filename) - return ref.get_refactor_options(start, end) - - def rpc_refactor(self, filename, method, args): - """Return a list of changes from the refactoring action. - - A change is a dictionary describing the change. See - elpy.refactor.translate_changes for a description. - - """ - try: - from elpy import refactor - except: - raise ImportError("Rope not installed, refactorings unavailable") - if args is None: - args = () - ref = refactor.Refactor(self.project_root, filename) - return ref.get_changes(method, *args) - - def rpc_get_usages(self, filename, source, offset): - """Get usages for the symbol at point. - - """ - source = get_source(source) - if hasattr(self.backend, "rpc_get_usages"): - return self.backend.rpc_get_usages(filename, source, offset) - else: - raise Fault("get_usages not implemented by current backend", - code=400) - - def rpc_get_names(self, filename, source, offset): - """Get all possible names - - """ - source = get_source(source) - if hasattr(self.backend, "rpc_get_names"): - return self.backend.rpc_get_names(filename, source, offset) - else: - raise Fault("get_names not implemented by current backend", - code=400) - - def rpc_fix_code(self, source, directory): - """Formats Python code to conform to the PEP 8 style guide. - - """ - source = get_source(source) - return fix_code(source, directory) - - def rpc_fix_code_with_yapf(self, source, directory): - """Formats Python code to conform to the PEP 8 style guide. - - """ - source = get_source(source) - return fix_code_with_yapf(source, directory) - - def rpc_fix_code_with_black(self, source, directory): - """Formats Python code to conform to the PEP 8 style guide. - - """ - source = get_source(source) - return fix_code_with_black(source, directory) - - -def get_source(fileobj): - """Translate fileobj into file contents. - - fileobj is either a string or a dict. If it's a string, that's the - file contents. If it's a string, then the filename key contains - the name of the file whose contents we are to use. - - If the dict contains a true value for the key delete_after_use, - the file should be deleted once read. - - """ - if not isinstance(fileobj, dict): - return fileobj - else: - try: - with io.open(fileobj["filename"], encoding="utf-8", - errors="ignore") as f: - return f.read() - finally: - if fileobj.get('delete_after_use'): - try: - os.remove(fileobj["filename"]) - except: # pragma: no cover - pass - - -def _pysymbol_key(name): - """Return a sortable key index for name. - - Sorting is case-insensitive, with the first underscore counting as - worse than any character, but subsequent underscores do not. This - means that dunder symbols (like __init__) are sorted after symbols - that start with an alphabetic character, but before those that - start with only a single underscore. - - """ - if name.startswith("_"): - name = "~" + name[1:] - return name.lower() diff --git a/elpa/elpy-20200202.2031/elpy/tests/__init__.py b/elpa/elpy-20200202.2031/elpy/tests/__init__.py deleted file mode 100644 index 9c9b5671..00000000 --- a/elpa/elpy-20200202.2031/elpy/tests/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Unit tests for elpy.""" - -try: - import unittest2 - import sys - sys.modules['unittest'] = unittest2 -except: - pass diff --git a/elpa/elpy-20200202.2031/elpy/tests/compat.py b/elpa/elpy-20200202.2031/elpy/tests/compat.py deleted file mode 100644 index 16595f66..00000000 --- a/elpa/elpy-20200202.2031/elpy/tests/compat.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Python 2/3 compatibility definitions. - -These are used by the rest of Elpy to keep compatibility definitions -in one place. - -""" - -import sys - - -if sys.version_info >= (3, 0): - PYTHON3 = True - import builtins - from io import StringIO -else: - PYTHON3 = False - import __builtin__ as builtins # noqa - from StringIO import StringIO # noqa diff --git a/elpa/elpy-20200202.2031/elpy/tests/support.py b/elpa/elpy-20200202.2031/elpy/tests/support.py deleted file mode 100644 index 1153c423..00000000 --- a/elpa/elpy-20200202.2031/elpy/tests/support.py +++ /dev/null @@ -1,986 +0,0 @@ -# coding: utf-8 - -"""Support classes and functions for the elpy test code. - -Elpy uses a bit of a peculiar test setup to avoid redundancy. For the -tests of the two backends, we provide generic test cases for generic -tests and for specific callback tests. - -These mixins can be included in the actual test classes. We can't add -these tests to a BackendTestCase subclass directly because the test -discovery would find them there and try to run them, which would fail. - -""" - -import os -import shutil -import sys -import tempfile -import unittest - -from elpy.tests import compat - - -class BackendTestCase(unittest.TestCase): - """Base class for backend tests. - - This class sets up a project root directory and provides an easy - way to create files within the project root. - - """ - - def setUp(self): - """Create the project root and make sure it gets cleaned up.""" - super(BackendTestCase, self).setUp() - self.project_root = tempfile.mkdtemp(prefix="elpy-test") - self.addCleanup(shutil.rmtree, self.project_root, True) - - def project_file(self, relname, contents): - """Create a file named relname within the project root. - - Write contents into that file. - - """ - full_name = os.path.join(self.project_root, relname) - try: - os.makedirs(os.path.dirname(full_name)) - except OSError: - pass - if compat.PYTHON3: - fobj = open(full_name, "w", encoding="utf-8") - else: - fobj = open(full_name, "w") - with fobj as f: - f.write(contents) - return full_name - - -class GenericRPCTests(object): - """Generic RPC test methods. - - This is a mixin to add tests that should be run for all RPC - methods that follow the generic (filename, source, offset) calling - conventions. - - """ - METHOD = None - - def rpc(self, filename, source, offset): - method = getattr(self.backend, self.METHOD) - return method(filename, source, offset) - - def test_should_not_fail_on_inexisting_file(self): - filename = self.project_root + "/doesnotexist.py" - self.rpc(filename, "", 0) - - def test_should_not_fail_on_empty_file(self): - filename = self.project_file("test.py", "") - self.rpc(filename, "", 0) - - def test_should_not_fail_if_file_is_none(self): - self.rpc(None, "", 0) - - def test_should_not_fail_for_module_syntax_errors(self): - source, offset = source_and_offset( - "class Foo(object):\n" - " def bar(self):\n" - " foo(_|_" - " bar(" - "\n" - " def a(self):\n" - " pass\n" - "\n" - " def b(self):\n" - " pass\n" - "\n" - " def b(self):\n" - " pass\n" - "\n" - " def b(self):\n" - " pass\n" - "\n" - " def b(self):\n" - " pass\n" - "\n" - " def b(self):\n" - " pass\n" - ) - filename = self.project_file("test.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_for_bad_indentation(self): - source, offset = source_and_offset( - "def foo():\n" - " print(23)_|_\n" - " print(17)\n") - filename = self.project_file("test.py", source) - - self.rpc(filename, source, offset) - - # @unittest.skipIf((3, 3) <= sys.version_info < (3, 4), - # "Bug in jedi for Python 3.3") - def test_should_not_fail_for_relative_import(self): - source, offset = source_and_offset( - "from .. import foo_|_" - ) - filename = self.project_file("test.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_on_keyword(self): - source, offset = source_and_offset( - "_|_try:\n" - " pass\n" - "except:\n" - " pass\n") - filename = self.project_file("test.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_with_bad_encoding(self): - source, offset = source_and_offset( - u'# coding: utf-8X_|_\n' - ) - filename = self.project_file("test.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_with_form_feed_characters(self): - # Bug in Jedi: jedi#424 - source, offset = source_and_offset( - "\f\n" - "class Test(object):_|_\n" - " pass" - ) - filename = self.project_file("test.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_for_dictionaries_in_weird_places(self): - # Bug in Jedi: jedi#417 - source, offset = source_and_offset( - "import json\n" - "\n" - "def foo():\n" - " json.loads(_|_\n" - "\n" - " json.load.return_value = {'foo': [],\n" - " 'bar': True}\n" - "\n" - " c = Foo()\n" - ) - filename = self.project_file("test.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_break_with_binary_characters_in_docstring(self): - # Bug in Jedi: jedi#427 - template = '''\ -class Foo(object): - def __init__(self): - """ - COMMUNITY instance that this conversion belongs to. - DISPERSY_VERSION is the dispersy conversion identifier (on the wire version; must be one byte). - COMMUNIY_VERSION is the community conversion identifier (on the wire version; must be one byte). - - COMMUNIY_VERSION may not be '\\x00' or '\\xff'. '\\x00' is used by the DefaultConversion until - a proper conversion instance can be made for the Community. '\\xff' is reserved for when - more than one byte is needed as a version indicator. - """ - pass - - -x = Foo() -x._|_ -''' - source, offset = source_and_offset(template) - filename = self.project_file("test.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_for_def_without_name(self): - # Bug jedi#429 - source, offset = source_and_offset( - "def_|_():\n" - " if True:\n" - " return True\n" - " else:\n" - " return False\n" - ) - filename = self.project_file("project.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_on_lambda(self): - # Bug #272 / jedi#431, jedi#572 - source, offset = source_and_offset( - "map(lambda_|_" - ) - filename = self.project_file("project.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_on_literals(self): - # Bug #314, #344 / jedi#466 - source = u'lit = u"""\\\n# -*- coding: utf-8 -*-\n"""\n' - offset = 0 - filename = self.project_file("project.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_with_args_as_args(self): - # Bug #347 in rope_py3k - source, offset = source_and_offset( - "def my_function(*args):\n" - " ret_|_" - ) - filename = self.project_file("project.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_for_unicode_chars_in_string(self): - # Bug #358 / jedi#482 - source = '''\ -# coding: utf-8 - -logging.info(u"Saving «{}»...".format(title)) -requests.get(u"https://web.archive.org/save/{}".format(url)) -''' - offset = 57 - filename = self.project_file("project.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_for_bad_escape_sequence(self): - # Bug #360 / jedi#485 - source = r"v = '\x'" - offset = 8 - filename = self.project_file("project.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_for_coding_declarations_in_strings(self): - # Bug #314 / jedi#465 / python#22221 - source = u'lit = """\\\n# -*- coding: utf-8 -*-\n"""' - offset = 8 - filename = self.project_file("project.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_if_root_vanishes(self): - # Bug #353 - source, offset = source_and_offset( - "import foo\n" - "foo._|_" - ) - filename = self.project_file("project.py", source) - shutil.rmtree(self.project_root) - - self.rpc(filename, source, offset) - - # For some reason, this breaks a lot of other tests. Couldn't - # figure out why. - # - # def test_should_not_fail_for_sys_path(self): - # # Bug #365 / jedi#486 - # source, offset = source_and_offset( - # "import sys\n" - # "\n" - # "sys.path.index(_|_\n" - # ) - # filename = self.project_file("project.py", source) - # - # self.rpc(filename, source, offset) - - def test_should_not_fail_for_key_error(self): - # Bug #561, #564, #570, #588, #593, #599 / jedi#572, jedi#579, - # jedi#590 - source, offset = source_and_offset( - "map(lambda_|_" - ) - filename = self.project_file("project.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_for_badly_defined_global_variable(self): - # Bug #519 / jedi#610 - source, offset = source_and_offset( - """\ -def funct1(): - global global_dict_var - global_dict_var = dict() - -def funct2(): - global global_dict_var - q = global_dict_var.copy_|_() - print(q)""") - filename = self.project_file("project.py", source) - - self.rpc(filename, source, offset) - - def test_should_not_fail_with_mergednamesdict(self): - # Bug #563 / jedi#589 - source, offset = source_and_offset( - u'from email import message_|_' - ) - filename = self.project_file("project.py", source) - - self.rpc(filename, source, offset) - - -class RPCGetCompletionsTests(GenericRPCTests): - METHOD = "rpc_get_completions" - - def test_should_complete_builtin(self): - source, offset = source_and_offset("o_|_") - - expected = self.BUILTINS - actual = [cand['name'] for cand in - self.backend.rpc_get_completions("test.py", - source, offset)] - - for candidate in expected: - self.assertIn(candidate, actual) - - if sys.version_info >= (3, 5) or sys.version_info < (3, 0): - JSON_COMPLETIONS = ["SONDecoder", "SONEncoder", "SONDecodeError"] - else: - JSON_COMPLETIONS = ["SONDecoder", "SONEncoder"] - - def test_should_complete_imports(self): - source, offset = source_and_offset("import json\n" - "json.J_|_") - filename = self.project_file("test.py", source) - completions = self.backend.rpc_get_completions(filename, - source, - offset) - self.assertEqual( - sorted([cand['suffix'] for cand in completions]), - sorted(self.JSON_COMPLETIONS)) - - def test_should_complete_top_level_modules_for_import(self): - source, offset = source_and_offset("import multi_|_") - filename = self.project_file("test.py", source) - completions = self.backend.rpc_get_completions(filename, - source, - offset) - if compat.PYTHON3: - expected = ["processing"] - else: - expected = ["file", "processing"] - self.assertEqual(sorted([cand['suffix'] for cand in completions]), - sorted(expected)) - - def test_should_complete_packages_for_import(self): - source, offset = source_and_offset("import email.mi_|_") - filename = self.project_file("test.py", source) - completions = self.backend.rpc_get_completions(filename, - source, - offset) - if sys.version_info < (3, 0): - compl = [u'me', u'METext'] - else: - compl = ['me'] - self.assertEqual([cand['suffix'] for cand in completions], - compl) - - def test_should_not_complete_for_import(self): - source, offset = source_and_offset("import foo.Conf_|_") - filename = self.project_file("test.py", source) - completions = self.backend.rpc_get_completions(filename, - source, - offset) - self.assertEqual([cand['suffix'] for cand in completions], - []) - - # @unittest.skipIf((3, 3) <= sys.version_info < (3, 4), - # "Bug in jedi for Python 3.3") - def test_should_not_fail_for_short_module(self): - source, offset = source_and_offset("from .. import foo_|_") - filename = self.project_file("test.py", source) - completions = self.backend.rpc_get_completions(filename, - source, - offset) - self.assertIsNotNone(completions) - - def test_should_complete_sys(self): - source, offset = source_and_offset("import sys\nsys._|_") - filename = self.project_file("test.py", source) - completions = self.backend.rpc_get_completions(filename, - source, - offset) - self.assertIn('path', [cand['suffix'] for cand in completions]) - - def test_should_find_with_trailing_text(self): - source, offset = source_and_offset( - "import threading\nthreading.T_|_mumble mumble") - - expected = ["Thread", "ThreadError", "Timer"] - actual = [cand['name'] for cand in - self.backend.rpc_get_completions("test.py", source, offset)] - - for candidate in expected: - self.assertIn(candidate, actual) - - def test_should_find_completion_different_package(self): - # See issue #74 - self.project_file("project/__init__.py", "") - source1 = ("class Add:\n" - " def add(self, a, b):\n" - " return a + b\n") - self.project_file("project/add.py", source1) - source2, offset = source_and_offset( - "from project.add import Add\n" - "class Calculator:\n" - " def add(self, a, b):\n" - " c = Add()\n" - " c.ad_|_\n") - file2 = self.project_file("project/calculator.py", source2) - proposals = self.backend.rpc_get_completions(file2, - source2, - offset) - self.assertEqual(["add"], - [proposal["name"] for proposal in proposals]) - - -class RPCGetCompletionDocstringTests(object): - def test_should_return_docstring(self): - source, offset = source_and_offset("import json\n" - "json.JSONEnc_|_") - filename = self.project_file("test.py", source) - completions = self.backend.rpc_get_completions(filename, - source, - offset) - completions.sort(key=lambda p: p["name"]) - prop = completions[0] - self.assertEqual(prop["name"], "JSONEncoder") - - docs = self.backend.rpc_get_completion_docstring("JSONEncoder") - - self.assertIn("Extensible JSON", docs) - - def test_should_return_none_if_unknown(self): - docs = self.backend.rpc_get_completion_docstring("Foo") - - self.assertIsNone(docs) - - -class RPCGetCompletionLocationTests(object): - def test_should_return_location(self): - source, offset = source_and_offset("donaudampfschiff = 1\n" - "donau_|_") - filename = self.project_file("test.py", source) - completions = self.backend.rpc_get_completions(filename, - source, - offset) - prop = completions[0] - self.assertEqual(prop["name"], "donaudampfschiff") - - loc = self.backend.rpc_get_completion_location("donaudampfschiff") - - self.assertEqual((filename, 1), loc) - - def test_should_return_none_if_unknown(self): - docs = self.backend.rpc_get_completion_location("Foo") - - self.assertIsNone(docs) - - -class RPCGetDefinitionTests(GenericRPCTests): - METHOD = "rpc_get_definition" - - def test_should_return_definition_location_same_file(self): - source, offset = source_and_offset("import threading\n" - "def test_function(a, b):\n" - " return a + b\n" - "\n" - "test_func_|_tion(\n") - filename = self.project_file("test.py", source) - - location = self.backend.rpc_get_definition(filename, - source, - offset) - - self.assertEqual(location[0], filename) - # On def or on the function name - self.assertIn(location[1], (17, 21)) - - def test_should_return_location_in_same_file_if_not_saved(self): - source, offset = source_and_offset( - "import threading\n" - "\n" - "\n" - "def other_function():\n" - " test_f_|_unction(1, 2)\n" - "\n" - "\n" - "def test_function(a, b):\n" - " return a + b\n") - filename = self.project_file("test.py", "") - - location = self.backend.rpc_get_definition(filename, - source, - offset) - - self.assertEqual(location[0], filename) - # def or function name - self.assertIn(location[1], (67, 71)) - - def test_should_return_location_in_different_file(self): - source1 = ("def test_function(a, b):\n" - " return a + b\n") - file1 = self.project_file("test1.py", source1) - source2, offset = source_and_offset("from test1 import test_function\n" - "test_funct_|_ion(1, 2)\n") - file2 = self.project_file("test2.py", source2) - - definition = self.backend.rpc_get_definition(file2, - source2, - offset) - - self.assertEqual(definition[0], file1) - # Either on the def or on the function name - self.assertIn(definition[1], (0, 4)) - - def test_should_return_none_if_location_not_found(self): - source, offset = source_and_offset("test_f_|_unction()\n") - filename = self.project_file("test.py", source) - - definition = self.backend.rpc_get_definition(filename, - source, - offset) - - self.assertIsNone(definition) - - def test_should_return_none_if_outside_of_symbol(self): - source, offset = source_and_offset("test_function(_|_)\n") - filename = self.project_file("test.py", source) - - definition = self.backend.rpc_get_definition(filename, - source, - offset) - - self.assertIsNone(definition) - - def test_should_return_definition_location_different_package(self): - # See issue #74 - self.project_file("project/__init__.py", "") - source1 = ("class Add:\n" - " def add(self, a, b):\n" - " return a + b\n") - file1 = self.project_file("project/add.py", source1) - source2, offset = source_and_offset( - "from project.add import Add\n" - "class Calculator:\n" - " def add(self, a, b):\n" - " return Add_|_().add(a, b)\n") - file2 = self.project_file("project/calculator.py", source2) - - location = self.backend.rpc_get_definition(file2, - source2, - offset) - - self.assertEqual(location[0], file1) - # class or class name - self.assertIn(location[1], (0, 6)) - - def test_should_find_variable_definition(self): - source, offset = source_and_offset("SOME_VALUE = 1\n" - "\n" - "variable = _|_SOME_VALUE\n") - filename = self.project_file("test.py", source) - self.assertEqual(self.backend.rpc_get_definition(filename, - source, - offset), - (filename, 0)) - - -class RPCGetAssignmentTests(GenericRPCTests): - METHOD = "rpc_get_assignment" - - def test_should_return_assignment_location_same_file(self): - source, offset = source_and_offset("import threading\n" - "class TestClass(object):\n" - " def __init__(self, a, b):\n" - " self.a = a\n" - " self.b = b\n" - "\n" - "testclass = TestClass(2, 4)" - "\n" - "testcl_|_ass(\n") - filename = self.project_file("test.py", source) - - location = self.backend.rpc_get_assignment(filename, - source, - offset) - - self.assertEqual(location[0], filename) - # On def or on the function name - self.assertEqual(location[1], 111) - - def test_should_return_location_in_same_file_if_not_saved(self): - source, offset = source_and_offset("import threading\n" - "class TestClass(object):\n" - " def __init__(self, a, b):\n" - " self.a = a\n" - " self.b = b\n" - "\n" - "testclass = TestClass(2, 4)" - "\n" - "testcl_|_ass(\n") - filename = self.project_file("test.py", "") - - location = self.backend.rpc_get_assignment(filename, - source, - offset) - - self.assertEqual(location[0], filename) - # def or function name - self.assertEqual(location[1], 111) - - def test_should_return_location_in_different_file(self): - source1 = ("class TestClass(object):\n" - " def __init__(self, a, b):\n" - " self.a = a\n" - " self.b = b\n" - "testclass = TestClass(3, 5)\n") - file1 = self.project_file("test1.py", source1) - source2, offset = source_and_offset("from test1 import testclass\n" - "testcl_|_ass.a\n") - file2 = self.project_file("test2.py", source2) - # First jump goes to import statement - assignment = self.backend.rpc_get_assignment(file2, - source2, - offset) - # Second jump goes to test1 file - self.assertEqual(assignment[0], file2) - assignment = self.backend.rpc_get_assignment(file2, - source2, - assignment[1]) - - self.assertEqual(assignment[0], file1) - self.assertEqual(assignment[1], 93) - - def test_should_return_none_if_location_not_found(self): - source, offset = source_and_offset("test_f_|_unction()\n") - filename = self.project_file("test.py", source) - - assignment = self.backend.rpc_get_assignment(filename, - source, - offset) - - self.assertIsNone(assignment) - - def test_should_return_none_if_outside_of_symbol(self): - source, offset = source_and_offset("testcl(_|_)ass\n") - filename = self.project_file("test.py", source) - - assignment = self.backend.rpc_get_assignment(filename, - source, - offset) - - self.assertIsNone(assignment) - - def test_should_find_variable_assignment(self): - source, offset = source_and_offset("SOME_VALUE = 1\n" - "\n" - "variable = _|_SOME_VALUE\n") - filename = self.project_file("test.py", source) - self.assertEqual(self.backend.rpc_get_assignment(filename, - source, - offset), - (filename, 0)) - - -class RPCGetCalltipTests(GenericRPCTests): - METHOD = "rpc_get_calltip" - - def test_should_get_calltip(self): - source, offset = source_and_offset( - "import threading\nthreading.Thread(_|_") - filename = self.project_file("test.py", source) - calltip = self.backend.rpc_get_calltip(filename, - source, - offset) - - expected = self.THREAD_CALLTIP - - self.assertEqual(calltip, expected) - - def test_should_get_calltip_even_after_parens(self): - source, offset = source_and_offset( - "import threading\nthreading.Thread(foo()_|_") - filename = self.project_file("test.py", source) - - actual = self.backend.rpc_get_calltip(filename, - source, - offset) - - self.assertEqual(self.THREAD_CALLTIP, actual) - - def test_should_get_calltip_at_closing_paren(self): - source, offset = source_and_offset( - "import threading\nthreading.Thread(_|_)") - filename = self.project_file("test.py", source) - - actual = self.backend.rpc_get_calltip(filename, - source, - offset) - - self.assertEqual(self.THREAD_CALLTIP, actual) - - def test_should_not_missing_attribute_get_definition(self): - # Bug #627 / jedi#573 - source, offset = source_and_offset( - "import threading\nthreading.Thread(_|_)") - filename = self.project_file("test.py", source) - - self.backend.rpc_get_calltip(filename, source, offset) - - def test_should_return_none_for_bad_identifier(self): - source, offset = source_and_offset( - "froblgoo(_|_") - filename = self.project_file("test.py", source) - calltip = self.backend.rpc_get_calltip(filename, - source, - offset) - self.assertIsNone(calltip) - - def test_should_remove_self_argument(self): - source, offset = source_and_offset( - "d = dict()\n" - "d.keys(_|_") - filename = self.project_file("test.py", source) - - actual = self.backend.rpc_get_calltip(filename, - source, - offset) - - self.assertEqual(self.KEYS_CALLTIP, actual) - - def test_should_remove_package_prefix(self): - source, offset = source_and_offset( - "import decimal\n" - "d = decimal.Decimal('1.5')\n" - "d.radix(_|_") - filename = self.project_file("test.py", source) - - actual = self.backend.rpc_get_calltip(filename, - source, - offset) - - self.assertEqual(self.RADIX_CALLTIP, actual) - - def test_should_return_none_outside_of_all(self): - filename = self.project_file("test.py", "") - source, offset = source_and_offset("import thr_|_eading\n") - calltip = self.backend.rpc_get_calltip(filename, - source, offset) - self.assertIsNone(calltip) - - def test_should_find_calltip_different_package(self): - # See issue #74 - self.project_file("project/__init__.py", "") - source1 = ("class Add:\n" - " def add(self, a, b):\n" - " return a + b\n") - self.project_file("project/add.py", source1) - source2, offset = source_and_offset( - "from project.add import Add\n" - "class Calculator:\n" - " def add(self, a, b):\n" - " c = Add()\n" - " c.add(_|_\n") - file2 = self.project_file("project/calculator.py", source2) - - actual = self.backend.rpc_get_calltip(file2, - source2, - offset) - - self.assertEqual(self.ADD_CALLTIP, actual) - - -class RPCGetDocstringTests(GenericRPCTests): - METHOD = "rpc_get_docstring" - - def check_docstring(self, docstring): - - def first_line(s): - return s[:s.index("\n")] - - self.assertEqual(first_line(docstring), - self.JSON_LOADS_DOCSTRING) - - def test_should_get_docstring(self): - source, offset = source_and_offset( - "import json\njson.loads_|_(") - filename = self.project_file("test.py", source) - docstring = self.backend.rpc_get_docstring(filename, - source, - offset) - self.check_docstring(docstring) - - def test_should_return_none_for_bad_identifier(self): - source, offset = source_and_offset( - "froblgoo_|_(\n") - filename = self.project_file("test.py", source) - docstring = self.backend.rpc_get_docstring(filename, - source, - offset) - self.assertIsNone(docstring) - - -class RPCGetOnelineDocstringTests(GenericRPCTests): - METHOD = "rpc_get_oneline_docstring" - - def check_docstring(self, docstring): - - self.assertEqual(docstring['doc'], - self.JSON_LOADS_DOCSTRING) - - def check_module_docstring(self, docstring): - - self.assertEqual(docstring['doc'], - self.JSON_DOCSTRING) - - def test_should_get_oneline_docstring(self): - source, offset = source_and_offset( - "import json\njson.loads_|_(") - filename = self.project_file("test.py", source) - docstring = self.backend.rpc_get_oneline_docstring(filename, - source, - offset) - self.check_docstring(docstring) - - def test_should_get_oneline_docstring_for_modules(self): - source, offset = source_and_offset( - "import json_|_\njson.loads(") - filename = self.project_file("test.py", source) - docstring = self.backend.rpc_get_oneline_docstring(filename, - source, - offset) - self.check_module_docstring(docstring) - - def test_should_return_none_for_bad_identifier(self): - source, offset = source_and_offset( - "froblgoo_|_(\n") - filename = self.project_file("test.py", source) - docstring = self.backend.rpc_get_oneline_docstring(filename, - source, - offset) - self.assertIsNone(docstring) - - -class RPCGetNamesTests(GenericRPCTests): - METHOD = "rpc_get_names" - - def test_shouldreturn_names_in_same_file(self): - filename = self.project_file("test.py", "") - source, offset = source_and_offset( - "def foo(x, y):\n" - " return x + y\n" - "c = _|_foo(5, 2)\n") - - names = self.backend.rpc_get_names(filename, - source, - offset) - - self.assertEqual(names, - [{'name': 'foo', - 'filename': filename, - 'offset': 4}, - {'name': 'x', - 'filename': filename, - 'offset': 8}, - {'name': 'y', - 'filename': filename, - 'offset': 11}, - {'name': 'x', - 'filename': filename, - 'offset': 26}, - {'name': 'y', - 'filename': filename, - 'offset': 30}, - {'name': 'c', - 'filename': filename, - 'offset': 32}, - {'name': 'foo', - 'filename': filename, - 'offset': 36}]) - - def test_should_not_fail_without_symbol(self): - filename = self.project_file("test.py", "") - - names = self.backend.rpc_get_names(filename, - "", - 0) - - self.assertEqual(names, []) - - -class RPCGetUsagesTests(GenericRPCTests): - METHOD = "rpc_get_usages" - - def test_should_return_uses_in_same_file(self): - filename = self.project_file("test.py", "") - source, offset = source_and_offset( - "def foo(x):\n" - " return _|_x + x\n") - - usages = self.backend.rpc_get_usages(filename, - source, - offset) - - self.assertEqual(usages, - [{'name': 'x', - 'offset': 8, - 'filename': filename}, - {'name': 'x', - 'filename': filename, - 'offset': 23}, - {'name': u'x', - 'filename': filename, - 'offset': 27}]) - - def test_should_return_uses_in_other_file(self): - file1 = self.project_file("file1.py", "") - file2 = self.project_file("file2.py", "\n\n\n\n\nx = 5") - source, offset = source_and_offset( - "import file2\n" - "file2._|_x\n") - - usages = self.backend.rpc_get_usages(file1, - source, - offset) - - self.assertEqual(usages, - [{'name': 'x', - 'filename': file1, - 'offset': 19}, - {'name': 'x', - 'filename': file2, - 'offset': 5}]) - - def test_should_not_fail_without_symbol(self): - filename = self.project_file("file.py", "") - - usages = self.backend.rpc_get_usages(filename, - "", - 0) - - self.assertEqual(usages, []) - - -def source_and_offset(source): - """Return a source and offset from a source description. - - >>> source_and_offset("hello, _|_world") - ("hello, world", 7) - >>> source_and_offset("_|_hello, world") - ("hello, world", 0) - >>> source_and_offset("hello, world_|_") - ("hello, world", 12) - """ - offset = source.index("_|_") - return source[:offset] + source[offset + 3:], offset diff --git a/elpa/elpy-20200202.2031/elpy/tests/test_auto_pep8.py b/elpa/elpy-20200202.2031/elpy/tests/test_auto_pep8.py deleted file mode 100644 index 38d32f21..00000000 --- a/elpa/elpy-20200202.2031/elpy/tests/test_auto_pep8.py +++ /dev/null @@ -1,21 +0,0 @@ -# coding: utf-8 - -"""Tests for the elpy.autopep8 module""" - -import unittest -import os - -from elpy import auto_pep8 -from elpy.tests.support import BackendTestCase - - -class Autopep8TestCase(BackendTestCase): - - def setUp(self): - if not auto_pep8.autopep8: - raise unittest.SkipTest - - def test_fix_code(self): - code_block = 'x= 123\n' - new_block = auto_pep8.fix_code(code_block, os.getcwd()) - self.assertEqual(new_block, 'x = 123\n') diff --git a/elpa/elpy-20200202.2031/elpy/tests/test_black.py b/elpa/elpy-20200202.2031/elpy/tests/test_black.py deleted file mode 100644 index 636b4661..00000000 --- a/elpa/elpy-20200202.2031/elpy/tests/test_black.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 -"""Tests for the elpy.black module""" - -import unittest -import os - -from elpy import blackutil -from elpy.rpc import Fault -from elpy.tests.support import BackendTestCase - - -@unittest.skipIf(blackutil.BLACK_NOT_SUPPORTED, - 'black not supported for current python version') -class BLACKTestCase(BackendTestCase): - def setUp(self): - if blackutil.BLACK_NOT_SUPPORTED: - raise unittest.SkipTest - - def test_fix_code_should_throw_error_for_invalid_code(self): - src = 'x = ' - self.assertRaises(Fault, blackutil.fix_code, src, os.getcwd()) - - def test_fix_code(self): - testdata = [ - ('x= 123\n', 'x = 123\n'), - ('x=1; \ny=2 \n', 'x = 1\ny = 2\n'), - ] - for src, expected in testdata: - self._assert_format(src, expected) - - def test_perfect_code(self): - testdata = [ - ('x = 123\n', 'x = 123\n'), - ('x = 1\ny = 2\n', 'x = 1\ny = 2\n'), - ] - for src, expected in testdata: - self._assert_format(src, expected) - - def _assert_format(self, src, expected): - new_block = blackutil.fix_code(src, os.getcwd()) - self.assertEqual(new_block, expected) - - def test_should_read_options_from_pyproject_toml(self): - with open('pyproject.toml', 'w') as f: - f.write('[tool.black]\nline-length = 10') - - self.addCleanup(os.remove, 'pyproject.toml') - - testdata = [('x= 123\n', 'x = 123\n'), - ('x=1; \ny=2 \n', 'x = 1\ny = 2\n'), - ('x, y, z, a, b, c = 123, 124, 125, 126, 127, 128', - 'x, y, z, a, b, c = (\n 123,\n 124,\n 125,' - '\n 126,\n 127,\n 128,\n)\n')] - for src, expected in testdata: - self._assert_format(src, expected) diff --git a/elpa/elpy-20200202.2031/elpy/tests/test_jedibackend.py b/elpa/elpy-20200202.2031/elpy/tests/test_jedibackend.py deleted file mode 100644 index de36a46b..00000000 --- a/elpa/elpy-20200202.2031/elpy/tests/test_jedibackend.py +++ /dev/null @@ -1,395 +0,0 @@ -"""Tests for the elpy.jedibackend module.""" - -import sys -import unittest - -import jedi -import mock - -from elpy import jedibackend -from elpy import rpc -from elpy.tests import compat -from elpy.tests.support import BackendTestCase -from elpy.tests.support import RPCGetCompletionsTests -from elpy.tests.support import RPCGetCompletionDocstringTests -from elpy.tests.support import RPCGetCompletionLocationTests -from elpy.tests.support import RPCGetDocstringTests -from elpy.tests.support import RPCGetOnelineDocstringTests -from elpy.tests.support import RPCGetDefinitionTests -from elpy.tests.support import RPCGetAssignmentTests -from elpy.tests.support import RPCGetCalltipTests -from elpy.tests.support import RPCGetUsagesTests -from elpy.tests.support import RPCGetNamesTests - - -class JediBackendTestCase(BackendTestCase): - def setUp(self): - super(JediBackendTestCase, self).setUp() - env = jedi.get_default_environment().path - self.backend = jedibackend.JediBackend(self.project_root, env) - - -class TestInit(JediBackendTestCase): - def test_should_have_jedi_as_name(self): - self.assertEqual(self.backend.name, "jedi") - - -class TestRPCGetCompletions(RPCGetCompletionsTests, - JediBackendTestCase): - BUILTINS = ['object', 'oct', 'open', 'ord', 'OSError', 'OverflowError'] - - -class TestRPCGetCompletionDocstring(RPCGetCompletionDocstringTests, - JediBackendTestCase): - pass - - -class TestRPCGetCompletionLocation(RPCGetCompletionLocationTests, - JediBackendTestCase): - pass - - -class TestRPCGetDocstring(RPCGetDocstringTests, - JediBackendTestCase): - - def __init__(self, *args, **kwargs): - super(TestRPCGetDocstring, self).__init__(*args, **kwargs) - if sys.version_info >= (3, 6): - self.JSON_LOADS_DOCSTRING = ( - 'loads(s, *, encoding=None, cls=None, object_hook=None, ' - 'parse_float=None, parse_int=None, parse_constant=None, ' - 'object_pairs_hook=None, object_hook: ' - 'Optional[Callable[[Dict[str, Any]], Any]]=..., ' - 'parse_float: Optional[Callable[[str], Any]]=..., ' - 'parse_int: Optional[Callable[[str], Any]]=..., ' - 'parse_constant: Optional[Callable[[str], Any]]=..., ' - 'strict: bool=..., ' - 'object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], ' - 'Any]]=...)' - ) - elif sys.version_info >= (3, 5): - self.JSON_LOADS_DOCSTRING = ( - 'loads(s, encoding=None, cls=None, object_hook=None, ' - 'parse_float=None, parse_int=None, parse_constant=None, ' - 'object_pairs_hook=None, *, object_hook: ' - 'Optional[Callable[[Dict[str, Any]], Any]]=..., ' - 'parse_float: Optional[Callable[[str], Any]]=..., ' - 'parse_int: Optional[Callable[[str], Any]]=..., ' - 'parse_constant: Optional[Callable[[str], Any]]=..., ' - 'strict: bool=..., ' - 'object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], ' - 'Any]]=...)' - ) - else: - self.JSON_LOADS_DOCSTRING = ( - 'loads(s, encoding=None, cls=None, object_hook=None, ' - 'parse_float=None, parse_int=None, parse_constant=None, ' - 'object_pairs_hook=None, **kw)' - ) - - def check_docstring(self, docstring): - lines = docstring.splitlines() - self.assertEqual(lines[0], 'Documentation for json.loads:') - self.assertEqual(lines[2], self.JSON_LOADS_DOCSTRING) - - @mock.patch("elpy.jedibackend.run_with_debug") - def test_should_not_return_empty_docstring(self, run_with_debug): - location = mock.MagicMock() - location.full_name = "testthing" - location.docstring.return_value = "" - run_with_debug.return_value = [location] - filename = self.project_file("test.py", "print") - docstring = self.backend.rpc_get_docstring(filename, "print", 0) - self.assertIsNone(docstring) - - -class TestRPCGetOnelineDocstring(RPCGetOnelineDocstringTests, - JediBackendTestCase): - - def __init__(self, *args, **kwargs): - super(TestRPCGetOnelineDocstring, self).__init__(*args, **kwargs) - if sys.version_info >= (3, 6): - self.JSON_LOADS_DOCSTRING = ( - 'Deserialize ``s`` (a ``str``, ``bytes`` or' - ' ``bytearray`` instance containing a JSON' - ' document) to a Python object.' - ) - self.JSON_DOCSTRING = ( - "JSON (JavaScript Object Notation) " - " is a subset of JavaScript syntax (ECMA-262" - " 3rd edition) used as a lightweight data interchange format.") - elif sys.version_info >= (3, 0): - self.JSON_LOADS_DOCSTRING = ( - 'Deserialize ``s`` (a ``str`` instance ' - 'containing a JSON document) to a Python object.' - ) - self.JSON_DOCSTRING = ( - "JSON (JavaScript Object Notation) " - " is a subset of JavaScript syntax (ECMA-262" - " 3rd edition) used as a lightweight data interchange format.") - else: - self.JSON_LOADS_DOCSTRING = ( - 'Deserialize ``s`` (a ``str`` or ``unicode`` ' - 'instance containing a JSON document) to a Python object.' - ) - self.JSON_DOCSTRING = ( - "JSON (JavaScript Object Notation) " - " is a subset of JavaScript syntax (ECMA-262" - " 3rd edition) used as a lightweight data interchange format.") - - @mock.patch("elpy.jedibackend.run_with_debug") - def test_should_not_return_empty_docstring(self, run_with_debug): - location = mock.MagicMock() - location.full_name = "testthing" - location.docstring.return_value = "" - run_with_debug.return_value = [location] - filename = self.project_file("test.py", "print") - docstring = self.backend.rpc_get_oneline_docstring(filename, "print", 0) - self.assertIsNone(docstring) - - -class TestRPCGetDefinition(RPCGetDefinitionTests, - JediBackendTestCase): - @mock.patch("jedi.Script") - def test_should_not_fail_if_module_path_is_none(self, Script): - """Do not fail if loc.module_path is None. - - This can happen under some circumstances I am unsure about. - See #537 for the issue that reported this. - - """ - locations = [ - mock.Mock(module_path=None) - ] - script = Script.return_value - script.goto_definitions.return_value = locations - script.goto_assignments.return_value = locations - - location = self.rpc("", "", 0) - - self.assertIsNone(location) - - -class TestRPCGetAssignment(RPCGetAssignmentTests, - JediBackendTestCase): - @mock.patch("jedi.Script") - def test_should_not_fail_if_module_path_is_none(self, Script): - """Do not fail if loc.module_path is None. - - """ - locations = [ - mock.Mock(module_path=None) - ] - script = Script.return_value - script.goto_assignments.return_value = locations - script.goto_assignments.return_value = locations - - location = self.rpc("", "", 0) - - self.assertIsNone(location) - - -class TestRPCGetCalltip(RPCGetCalltipTests, - JediBackendTestCase): - KEYS_CALLTIP = {'index': None, - 'params': [], - 'name': u'keys'} - RADIX_CALLTIP = {'index': None, - 'params': [], - 'name': u'radix'} - ADD_CALLTIP = {'index': 0, - 'params': [u'a', u'b'], - 'name': u'add'} - if compat.PYTHON3: - THREAD_CALLTIP = {'name': 'Thread', - 'index': 0, - 'params': ['group: None=...', - 'target: Optional[Callable[..., Any]]=...', - 'name: Optional[str]=...', - 'args: Iterable=...', - 'kwargs: Mapping[str, Any]=...', - 'daemon: Optional[bool]=...']} - - else: - THREAD_CALLTIP = {'index': 0, - 'name': u'Thread', - 'params': [u'group: None=...', - u'target: Optional[Callable[..., Any]]=...', - u'name: Optional[str]=...', - u'args: Iterable=...', - u'kwargs: Mapping[str, Any]=...']} - - def test_should_not_fail_with_get_subscope_by_name(self): - # Bug #677 / jedi#628 - source = ( - u"my_lambda = lambda x: x+1\n" - u"my_lambda(1)" - ) - filename = self.project_file("project.py", source) - offset = 37 - - sigs = self.backend.rpc_get_calltip(filename, source, offset) - sigs["index"] - - -class TestRPCGetUsages(RPCGetUsagesTests, - JediBackendTestCase): - def test_should_not_fail_for_missing_module(self): - # This causes use.module_path to be None - source = "import sys\n\nsys.path.\n" # insert()" - offset = 21 - filename = self.project_file("project.py", source) - - self.rpc(filename, source, offset) - - -class TestRPCGetNames(RPCGetNamesTests, - JediBackendTestCase): - pass - - -class TestPosToLinecol(unittest.TestCase): - def test_should_handle_beginning_of_string(self): - self.assertEqual(jedibackend.pos_to_linecol("foo", 0), - (1, 0)) - - def test_should_handle_end_of_line(self): - self.assertEqual(jedibackend.pos_to_linecol("foo\nbar\nbaz\nqux", 9), - (3, 1)) - - def test_should_handle_end_of_string(self): - self.assertEqual(jedibackend.pos_to_linecol("foo\nbar\nbaz\nqux", 14), - (4, 2)) - - -class TestLinecolToPos(unittest.TestCase): - def test_should_handle_beginning_of_string(self): - self.assertEqual(jedibackend.linecol_to_pos("foo", 1, 0), - 0) - - def test_should_handle_end_of_string(self): - self.assertEqual(jedibackend.linecol_to_pos("foo\nbar\nbaz\nqux", - 3, 1), - 9) - - def test_should_return_offset(self): - self.assertEqual(jedibackend.linecol_to_pos("foo\nbar\nbaz\nqux", - 4, 2), - 14) - - def test_should_fail_for_line_past_text(self): - self.assertRaises(ValueError, - jedibackend.linecol_to_pos, "foo\n", 3, 1) - - def test_should_fail_for_column_past_text(self): - self.assertRaises(ValueError, - jedibackend.linecol_to_pos, "foo\n", 1, 10) - - -class TestRunWithDebug(unittest.TestCase): - @mock.patch('jedi.Script') - def test_should_call_method(self, Script): - Script.return_value.test_method.return_value = "test-result" - - result = jedibackend.run_with_debug(jedi, 'test_method', 1, 2, arg=3) - - Script.assert_called_with(1, 2, arg=3) - self.assertEqual(result, 'test-result') - - @mock.patch('jedi.Script') - def test_should_re_raise(self, Script): - Script.side_effect = RuntimeError - - with self.assertRaises(RuntimeError): - jedibackend.run_with_debug(jedi, 'test_method', 1, 2, arg=3, - re_raise=(RuntimeError,)) - - @mock.patch('jedi.Script') - @mock.patch('jedi.set_debug_function') - def test_should_keep_debug_info(self, set_debug_function, Script): - Script.side_effect = RuntimeError - - try: - jedibackend.run_with_debug(jedi, 'test_method', 1, 2, arg=3) - except rpc.Fault as e: - self.assertGreaterEqual(e.code, 400) - self.assertIsNotNone(e.data) - self.assertIn("traceback", e.data) - jedi_debug_info = e.data["jedi_debug_info"] - self.assertIsNotNone(jedi_debug_info) - self.assertEqual(jedi_debug_info["script_args"], - "1, 2, arg=3") - self.assertEqual(jedi_debug_info["source"], None) - self.assertEqual(jedi_debug_info["method"], "test_method") - self.assertEqual(jedi_debug_info["debug_info"], []) - else: - self.fail("Fault not thrown") - - @mock.patch('jedi.Script') - @mock.patch('jedi.set_debug_function') - def test_should_keep_error_text(self, set_debug_function, Script): - Script.side_effect = RuntimeError - - try: - jedibackend.run_with_debug(jedi, 'test_method', 1, 2, arg=3) - except rpc.Fault as e: - self.assertEqual(str(e), str(RuntimeError())) - self.assertEqual(e.message, str(RuntimeError())) - else: - self.fail("Fault not thrown") - - @mock.patch('jedi.Script') - @mock.patch('jedi.set_debug_function') - def test_should_handle_source_special(self, set_debug_function, Script): - Script.side_effect = RuntimeError - - try: - jedibackend.run_with_debug(jedi, 'test_method', source="foo") - except rpc.Fault as e: - self.assertEqual(e.data["jedi_debug_info"]["script_args"], - "source=source") - self.assertEqual(e.data["jedi_debug_info"]["source"], "foo") - else: - self.fail("Fault not thrown") - - @mock.patch('jedi.Script') - @mock.patch('jedi.set_debug_function') - def test_should_set_debug_info(self, set_debug_function, Script): - the_debug_function = [None] - - def my_set_debug_function(debug_function, **kwargs): - the_debug_function[0] = debug_function - - def my_script(*args, **kwargs): - the_debug_function[0](jedi.debug.NOTICE, "Notice") - the_debug_function[0](jedi.debug.WARNING, "Warning") - the_debug_function[0]("other", "Other") - raise RuntimeError - - set_debug_function.side_effect = my_set_debug_function - Script.return_value.test_method = my_script - - try: - jedibackend.run_with_debug(jedi, 'test_method', source="foo") - except rpc.Fault as e: - self.assertEqual(e.data["jedi_debug_info"]["debug_info"], - ["[N] Notice", - "[W] Warning", - "[?] Other"]) - else: - self.fail("Fault not thrown") - - @mock.patch('jedi.set_debug_function') - @mock.patch('jedi.Script') - def test_should_not_fail_with_bad_data(self, Script, set_debug_function): - import jedi.debug - - def set_debug(function, speed=True): - if function is not None: - function(jedi.debug.NOTICE, u"\xab") - - set_debug_function.side_effect = set_debug - Script.return_value.test_method.side_effect = Exception - - with self.assertRaises(rpc.Fault): - jedibackend.run_with_debug(jedi, 'test_method', 1, 2, arg=3) diff --git a/elpa/elpy-20200202.2031/elpy/tests/test_pydocutils.py b/elpa/elpy-20200202.2031/elpy/tests/test_pydocutils.py deleted file mode 100644 index 6e4eeb2d..00000000 --- a/elpa/elpy-20200202.2031/elpy/tests/test_pydocutils.py +++ /dev/null @@ -1,88 +0,0 @@ -import os -import unittest -import shutil -import sys -import tempfile - -import mock - -import elpy.pydocutils - - -class TestGetPydocCompletions(unittest.TestCase): - def test_should_return_top_level_modules(self): - modules = elpy.pydocutils.get_pydoc_completions("") - self.assertIn('sys', modules) - self.assertIn('json', modules) - - def test_should_return_submodules(self): - modules = elpy.pydocutils.get_pydoc_completions("elpy") - self.assertIn("elpy.rpc", modules) - self.assertIn("elpy.server", modules) - modules = elpy.pydocutils.get_pydoc_completions("os") - self.assertIn("os.path", modules) - - def test_should_find_objects_in_module(self): - self.assertIn("elpy.tests.test_pydocutils.TestGetPydocCompletions", - elpy.pydocutils.get_pydoc_completions - ("elpy.tests.test_pydocutils")) - - def test_should_find_attributes_of_objects(self): - attribs = elpy.pydocutils.get_pydoc_completions( - "elpy.tests.test_pydocutils.TestGetPydocCompletions") - self.assertIn("elpy.tests.test_pydocutils.TestGetPydocCompletions." - "test_should_find_attributes_of_objects", - attribs) - - def test_should_return_none_for_inexisting_module(self): - self.assertEqual([], - elpy.pydocutils.get_pydoc_completions - ("does_not_exist")) - - def test_should_work_for_unicode_strings(self): - self.assertIsNotNone(elpy.pydocutils.get_pydoc_completions - (u"sys")) - - def test_should_find_partial_completions(self): - self.assertIn("multiprocessing", - elpy.pydocutils.get_pydoc_completions - ("multiprocess")) - self.assertIn("multiprocessing.util", - elpy.pydocutils.get_pydoc_completions - ("multiprocessing.ut")) - - def test_should_ignore_trailing_dot(self): - self.assertIn("elpy.pydocutils", - elpy.pydocutils.get_pydoc_completions - ("elpy.")) - - -class TestGetModules(unittest.TestCase): - def test_should_return_top_level_modules(self): - modules = elpy.pydocutils.get_modules() - self.assertIn('sys', modules) - self.assertIn('json', modules) - - def test_should_return_submodules(self): - modules = elpy.pydocutils.get_modules("elpy") - self.assertIn("rpc", modules) - self.assertIn("server", modules) - - @mock.patch.object(elpy.pydocutils, 'safeimport') - def test_should_catch_import_errors(self, safeimport): - def raise_function(message): - raise elpy.pydocutils.ErrorDuringImport(message, - (None, None, None)) - safeimport.side_effect = raise_function - self.assertEqual([], elpy.pydocutils.get_modules("foo.bar")) - - def test_should_not_fail_for_permission_denied(self): - tmpdir = tempfile.mkdtemp(prefix="test-elpy-get-modules-") - sys.path.append(tmpdir) - os.chmod(tmpdir, 0o000) - try: - elpy.pydocutils.get_modules() - finally: - os.chmod(tmpdir, 0o755) - shutil.rmtree(tmpdir) - sys.path.remove(tmpdir) diff --git a/elpa/elpy-20200202.2031/elpy/tests/test_refactor.py b/elpa/elpy-20200202.2031/elpy/tests/test_refactor.py deleted file mode 100644 index 94270ebb..00000000 --- a/elpa/elpy-20200202.2031/elpy/tests/test_refactor.py +++ /dev/null @@ -1,545 +0,0 @@ -import unittest -import tempfile -import shutil -import os -import mock -import sys - -from elpy import refactor -from textwrap import dedent - - -class RefactorTestCase(unittest.TestCase): - def setUp(self): - self.project_root = tempfile.mkdtemp(prefix="test-refactor-root") - self.addCleanup(shutil.rmtree, self.project_root, - ignore_errors=True) - - def create_file(self, name, contents=""): - filename = os.path.join(self.project_root, name) - contents = dedent(contents) - offset = contents.find("_|_") - if offset > -1: - contents = contents[:offset] + contents[offset + 3:] - with open(filename, "w") as f: - f.write(contents) - return filename, offset - - def assertSourceEqual(self, first, second, msg=None): - """Fail if the two objects are unequal, ignoring indentation.""" - self.assertEqual(dedent(first), dedent(second), msg=msg) - - -class TestGetRefactorOptions(RefactorTestCase): - def test_should_only_return_importsmodule_if_not_on_symbol(self): - filename, offset = self.create_file("foo.py", - """\ - import foo - _|_""") - ref = refactor.Refactor(self.project_root, filename) - options = ref.get_refactor_options(offset) - self.assertTrue(all(opt['category'] in ('Imports', - 'Module') - for opt in options)) - filename, offset = self.create_file("foo.py", - """\ - _|_ - import foo""") - ref = refactor.Refactor(self.project_root, filename) - options = ref.get_refactor_options(offset) - self.assertTrue(all(opt['category'] in ('Imports', - 'Module') - for opt in options)) - - def test_should_return_all_if_on_symbol(self): - filename, offset = self.create_file("foo.py", - "import _|_foo") - ref = refactor.Refactor(self.project_root, filename) - options = ref.get_refactor_options(offset) - self.assertTrue(all(opt['category'] in ('Imports', - 'Method', - 'Module', - 'Symbol') - for opt in options)) - - def test_should_return_only_region_if_endoffset(self): - filename, offset = self.create_file("foo.py", - "import foo") - ref = refactor.Refactor(self.project_root, filename) - options = ref.get_refactor_options(offset, 5) - self.assertTrue(all(opt['category'] == 'Region' - for opt in options)) - - @unittest.skipIf(not refactor.ROPE_AVAILABLE, "Requires Rope") - def test_should_treat_from_import_special(self): - filename, offset = self.create_file("foo.py", - """\ - import foo - _|_""") - ref = refactor.Refactor(self.project_root, filename) - options = ref.get_refactor_options(offset) - self.assertFalse(any(opt['name'] == "refactor_froms_to_imports" - for opt in options)) - filename, offset = self.create_file("foo.py", - "imp_|_ort foo") - ref = refactor.Refactor(self.project_root, filename) - options = ref.get_refactor_options(offset) - self.assertTrue(any(opt['name'] == "refactor_froms_to_imports" - for opt in options)) - - -class TestGetChanges(RefactorTestCase): - def test_should_fail_if_method_is_not_refactoring(self): - filename, offset = self.create_file("foo.py") - ref = refactor.Refactor(self.project_root, filename) - self.assertRaises(ValueError, ref.get_changes, "bad_name") - - def test_should_return_method_results(self): - filename, offset = self.create_file("foo.py") - ref = refactor.Refactor(self.project_root, filename) - with mock.patch.object(ref, 'refactor_extract_method') as test: - test.return_value = "Meep!" - self.assertEqual(ref.get_changes("refactor_extract_method", - 1, 2), - "Meep!") - test.assert_called_with(1, 2) - - -@unittest.skipIf(not refactor.ROPE_AVAILABLE, "Requires Rope") -class TestIsOnSymbol(RefactorTestCase): - def test_should_find_symbol(self): - filename, offset = self.create_file("test.py", "__B_|_AR = 100") - r = refactor.Refactor(self.project_root, filename) - self.assertTrue(r._is_on_symbol(offset)) - - # Issue #111 - def test_should_find_symbol_with_underscores(self): - filename, offset = self.create_file("test.py", "_|___BAR = 100") - r = refactor.Refactor(self.project_root, filename) - self.assertTrue(r._is_on_symbol(offset)) - - def test_should_not_find_weird_places(self): - filename, offset = self.create_file("test.py", "hello = _|_ 1 + 1") - r = refactor.Refactor(self.project_root, filename) - self.assertFalse(r._is_on_symbol(offset)) - - -@unittest.skipIf(not refactor.ROPE_AVAILABLE, "Requires Rope") -class TestFromsToImports(RefactorTestCase): - def test_should_refactor(self): - filename, offset = self.create_file( - "foo.py", - """\ - _|_from datetime import datetime - - d = datetime(2013, 4, 7) - """) - ref = refactor.Refactor(self.project_root, filename) - (change,) = ref.get_changes("refactor_froms_to_imports", offset) - self.assertEqual(change['action'], 'change') - self.assertEqual(change['file'], filename) - self.assertSourceEqual(change['contents'], - """\ - import datetime - - d = datetime.datetime(2013, 4, 7) - """) - - -@unittest.skipIf(not refactor.ROPE_AVAILABLE, "Requires Rope") -class TestOrganizeImports(RefactorTestCase): - def test_should_refactor(self): - filename, offset = self.create_file( - "foo.py", - """\ - import unittest, base64 - import datetime, json - - obj = json.dumps(23) - unittest.TestCase() - """) - ref = refactor.Refactor(self.project_root, filename) - (change,) = ref.get_changes("refactor_organize_imports") - self.assertEqual(change['action'], 'change') - self.assertEqual(change['file'], filename) - self.assertSourceEqual(change['contents'], - """\ - import json - import unittest - - - obj = json.dumps(23) - unittest.TestCase() - """) - - -@unittest.skipIf(not refactor.ROPE_AVAILABLE, "Requires Rope") -class TestModuleToPackage(RefactorTestCase): - def test_should_refactor(self): - filename, offset = self.create_file( - "foo.py", - "_|_import os\n") - ref = refactor.Refactor(self.project_root, filename) - changes = ref.refactor_module_to_package() - a, b, c = changes - # Not sure why the a change is there. It's a CHANGE that - # changes nothing... - self.assertEqual(a['diff'], '') - - self.assertEqual(b['action'], 'create') - self.assertEqual(b['type'], 'directory') - self.assertEqual(b['path'], os.path.join(self.project_root, "foo")) - - self.assertEqual(c['action'], 'move') - self.assertEqual(c['type'], 'file') - self.assertEqual(c['source'], os.path.join(self.project_root, - "foo.py")) - self.assertEqual(c['destination'], os.path.join(self.project_root, - "foo/__init__.py")) - - -@unittest.skipIf(not refactor.ROPE_AVAILABLE, "Requires Rope") -class TestRenameAtPoint(RefactorTestCase): - def test_should_refactor(self): - filename, offset = self.create_file( - "foo.py", - """\ - class Foo(object): - def _|_foo(self): - return 5 - - def bar(self): - return self.foo() - """) - file2, offset2 = self.create_file( - "bar.py", - """\ - import foo - - - x = foo.Foo() - x.foo()""") - ref = refactor.Refactor(self.project_root, filename) - first, second = ref.refactor_rename_at_point(offset, "frob", - in_hierarchy=False, - docs=False) - if first['file'] == filename: - a, b = first, second - else: - a, b = second, first - self.assertEqual(a['action'], 'change') - self.assertEqual(a['file'], filename) - self.assertSourceEqual(a['contents'], - """\ - class Foo(object): - def frob(self): - return 5 - - def bar(self): - return self.frob() - """) - self.assertEqual(b['action'], 'change') - self.assertEqual(b['file'], file2) - self.assertSourceEqual(b['contents'], - """\ - import foo - - - x = foo.Foo() - x.frob()""") - - def test_should_refactor_in_hierarchy(self): - filename, offset = self.create_file( - "foo.py", - """\ - class Foo(object): - def _|_foo(self): - return 5 - - def bar(self): - return self.foo() - - class Bar(Foo): - def foo(self): - return 42 - - class Baz(object): - def foo(self): - return 42 - """) - file2, offset2 = self.create_file( - "bar.py", - """\ - import foo - - - x, y, z = foo.Foo(), foo.Bar(), foo.Baz() - x.foo() - y.foo() - z.foo()""") - ref = refactor.Refactor(self.project_root, filename) - first, second = ref.refactor_rename_at_point(offset, "frob", - in_hierarchy=True, - docs=False) - if first['file'] == filename: - a, b = first, second - else: - a, b = second, first - self.assertEqual(a['action'], 'change') - self.assertEqual(a['file'], filename) - self.assertSourceEqual(a['contents'], - """\ - class Foo(object): - def frob(self): - return 5 - - def bar(self): - return self.frob() - - class Bar(Foo): - def frob(self): - return 42 - - class Baz(object): - def foo(self): - return 42 - """) - self.assertEqual(b['action'], 'change') - self.assertEqual(b['file'], file2) - self.assertSourceEqual(b['contents'], - """\ - import foo - - - x, y, z = foo.Foo(), foo.Bar(), foo.Baz() - x.frob() - y.frob() - z.foo()""") - - def test_should_refactor_in_docstrings(self): - filename, offset = self.create_file( - "foo.py", - """\ - class Foo(object): - "Frobnicate the foo" - def _|_foo(self): - return 5 - - print("I'm an unrelated foo") - """) - ref = refactor.Refactor(self.project_root, filename) - (change,) = ref.refactor_rename_at_point(offset, "frob", - in_hierarchy=False, - docs=True) - self.assertEqual(change['action'], 'change') - self.assertEqual(change['file'], filename) - self.assertSourceEqual(change['contents'], - """\ - class Foo(object): - "Frobnicate the frob" - def frob(self): - return 5 - - print("I'm an unrelated foo") - """) - - -@unittest.skipIf(not refactor.ROPE_AVAILABLE, "Requires Rope") -class TestRenameCurrentModule(RefactorTestCase): - def test_should_refactor(self): - filename, offset = self.create_file( - "foo.py", - "_|_import os\n") - file2, offset = self.create_file( - "bar.py", - """\ - _|_import foo - foo.os - """) - dest = os.path.join(self.project_root, "frob.py") - ref = refactor.Refactor(self.project_root, filename) - a, b = ref.refactor_rename_current_module("frob") - - self.assertEqual(a['action'], 'change') - self.assertEqual(a['file'], file2) - self.assertEqual(a['contents'], - "import frob\n" - "frob.os\n") - - self.assertEqual(b['action'], 'move') - self.assertEqual(b['type'], 'file') - self.assertEqual(b['source'], filename) - self.assertEqual(b['destination'], dest) - - -@unittest.skipIf(not refactor.ROPE_AVAILABLE, "Requires Rope") -class TestMoveModule(RefactorTestCase): - def test_should_refactor(self): - filename, offset = self.create_file( - "foo.py", - "_|_import os\n") - file2, offset = self.create_file( - "bar.py", - """\ - _|_import foo - foo.os - """) - dest = os.path.join(self.project_root, "frob") - os.mkdir(dest) - with open(os.path.join(dest, "__init__.py"), "w") as f: - f.write("") - ref = refactor.Refactor(self.project_root, filename) - a, b = ref.refactor_move_module(dest) - - self.assertEqual(a['action'], 'change') - self.assertEqual(a['file'], file2) - self.assertSourceEqual(a['contents'], - """\ - import frob.foo - frob.foo.os - """) - - self.assertEqual(b['action'], 'move') - self.assertEqual(b['type'], 'file') - self.assertEqual(b['source'], filename) - self.assertEqual(b['destination'], - os.path.join(dest, "foo.py")) - - -@unittest.skipIf(not refactor.ROPE_AVAILABLE, "Requires Rope") -class TestCreateInline(RefactorTestCase): - def setUp(self): - super(TestCreateInline, self).setUp() - self.filename, self.offset = self.create_file( - "foo.py", - """\ - def add(a, b): - return a + b - - x = _|_add(2, 3) - y = add(17, 4) - """) - - def test_should_refactor_single_occurrenc(self): - ref = refactor.Refactor(self.project_root, self.filename) - (change,) = ref.refactor_create_inline(self.offset, True) - - self.assertEqual(change['action'], 'change') - self.assertEqual(change['file'], self.filename) - self.assertSourceEqual(change['contents'], - """\ - def add(a, b): - return a + b - - x = 2 + 3 - y = add(17, 4) - """) - - def test_should_refactor_all_occurrencs(self): - ref = refactor.Refactor(self.project_root, self.filename) - (change,) = ref.refactor_create_inline(self.offset, False) - - self.assertEqual(change['action'], 'change') - self.assertEqual(change['file'], self.filename) - self.assertSourceEqual(change['contents'], - """\ - x = 2 + 3 - y = 17 + 4 - """) - - -@unittest.skipIf(not refactor.ROPE_AVAILABLE, "Requires Rope") -class TestExtractMethod(RefactorTestCase): - def setUp(self): - super(TestExtractMethod, self).setUp() - self.filename, self.offset = self.create_file( - "foo.py", - """\ - class Foo(object): - def spaghetti(self, a, b): - _|_x = a + 5 - y = b + 23 - return y - """) - - @unittest.skipIf(sys.version_info >= (3, 5), "Python 3.5 not supported") - def test_should_refactor_local(self): - ref = refactor.Refactor(self.project_root, self.filename) - (change,) = ref.refactor_extract_method(self.offset, 104, - "calc", False) - self.assertEqual(change['action'], 'change') - self.assertEqual(change['file'], self.filename) - expected = """\ - class Foo(object): - def spaghetti(self, a, b): - return self.calc(a, b) - - def calc(self, a, b): - x = a + 5 - y = b + 23 - return y - """ - expected2 = expected.replace("return self.calc(a, b)", - "return self.calc(b, a)") - expected2 = expected2.replace("def calc(self, a, b)", - "def calc(self, b, a)") - # This is silly, but it's what we got. - if change['contents'] == dedent(expected2): - self.assertSourceEqual(change['contents'], expected2) - else: - self.assertSourceEqual(change['contents'], expected) - - @unittest.skipIf(sys.version_info >= (3, 5), "Python 3.5 not supported") - def test_should_refactor_global(self): - ref = refactor.Refactor(self.project_root, self.filename) - (change,) = ref.refactor_extract_method(self.offset, 104, - "calc", True) - self.assertEqual(change['action'], 'change') - self.assertEqual(change['file'], self.filename) - expected = """\ - class Foo(object): - def spaghetti(self, a, b): - return calc(a, b) - - def calc(a, b): - x = a + 5 - y = b + 23 - return y - """ - expected2 = expected.replace("return calc(a, b)", - "return calc(b, a)") - expected2 = expected2.replace("def calc(a, b)", - "def calc(b, a)") - if change['contents'] == dedent(expected2): - self.assertSourceEqual(change['contents'], expected2) - else: - self.assertSourceEqual(change['contents'], expected) - - -@unittest.skipIf(not refactor.ROPE_AVAILABLE, "Requires Rope") -class TestUseFunction(RefactorTestCase): - def test_should_refactor(self): - filename, offset = self.create_file( - "foo.py", - """\ - def _|_add_and_multiply(a, b, c): - temp = a + b - return temp * c - - f = 1 + 2 - g = f * 3 - """) - - ref = refactor.Refactor(self.project_root, filename) - (change,) = ref.refactor_use_function(offset) - - self.assertEqual(change['action'], 'change') - self.assertEqual(change['file'], filename) - self.assertSourceEqual(change['contents'], - """\ - def add_and_multiply(a, b, c): - temp = a + b - return temp * c - - g = add_and_multiply(1, 2, 3) - """) diff --git a/elpa/elpy-20200202.2031/elpy/tests/test_rpc.py b/elpa/elpy-20200202.2031/elpy/tests/test_rpc.py deleted file mode 100644 index 0d35196c..00000000 --- a/elpa/elpy-20200202.2031/elpy/tests/test_rpc.py +++ /dev/null @@ -1,209 +0,0 @@ -"""Tests for elpy.rpc.""" - -import json -import unittest -import sys - -from elpy import rpc -from elpy.tests.compat import StringIO - - -class TestFault(unittest.TestCase): - def test_should_have_code_and_data(self): - fault = rpc.Fault("Hello", code=250, data="Fnord") - self.assertEqual(str(fault), "Hello") - self.assertEqual(fault.code, 250) - self.assertEqual(fault.data, "Fnord") - - def test_should_have_defaults_for_code_and_data(self): - fault = rpc.Fault("Hello") - self.assertEqual(str(fault), "Hello") - self.assertEqual(fault.code, 500) - self.assertIsNone(fault.data) - - -class TestJSONRPCServer(unittest.TestCase): - def setUp(self): - self.stdin = StringIO() - self.stdout = StringIO() - self.rpc = rpc.JSONRPCServer(self.stdin, self.stdout) - - def write(self, s): - self.stdin.seek(0) - self.stdin.truncate() - self.stdout.seek(0) - self.stdout.truncate() - self.stdin.write(s) - self.stdin.seek(0) - - def read(self): - value = self.stdout.getvalue() - self.stdin.seek(0) - self.stdin.truncate() - self.stdout.seek(0) - self.stdout.truncate() - return value - - -class TestInit(TestJSONRPCServer): - def test_should_use_arguments(self): - self.assertEqual(self.rpc.stdin, self.stdin) - self.assertEqual(self.rpc.stdout, self.stdout) - - def test_should_default_to_sys(self): - testrpc = rpc.JSONRPCServer() - self.assertEqual(sys.stdin, testrpc.stdin) - self.assertEqual(sys.stdout, testrpc.stdout) - - -class TestReadJson(TestJSONRPCServer): - def test_should_read_json(self): - objlist = [{'foo': 'bar'}, - {'baz': 'qux', 'fnord': 'argl\nbargl'}, - "beep\r\nbeep\r\nbeep"] - self.write("".join([(json.dumps(obj) + "\n") - for obj in objlist])) - for obj in objlist: - self.assertEqual(self.rpc.read_json(), - obj) - - def test_should_raise_eof_on_eof(self): - self.assertRaises(EOFError, self.rpc.read_json) - - def test_should_fail_on_malformed_json(self): - self.write("malformed json\n") - self.assertRaises(ValueError, - self.rpc.read_json) - - -class TestWriteJson(TestJSONRPCServer): - def test_should_write_json_line(self): - objlist = [{'foo': 'bar'}, - {'baz': 'qux', 'fnord': 'argl\nbargl'}, - ] - for obj in objlist: - self.rpc.write_json(**obj) - self.assertEqual(json.loads(self.read()), - obj) - - -class TestHandleRequest(TestJSONRPCServer): - def test_should_fail_if_json_does_not_contain_a_method(self): - self.write(json.dumps(dict(params=[], - id=23))) - self.assertRaises(ValueError, - self.rpc.handle_request) - - def test_should_call_right_method(self): - self.write(json.dumps(dict(method='foo', - params=[1, 2, 3], - id=23))) - self.rpc.rpc_foo = lambda *params: params - self.rpc.handle_request() - self.assertEqual(json.loads(self.read()), - dict(id=23, - result=[1, 2, 3])) - - def test_should_pass_defaults_for_missing_parameters(self): - def test_method(*params): - self.args = params - - self.write(json.dumps(dict(method='foo'))) - self.rpc.rpc_foo = test_method - self.rpc.handle_request() - self.assertEqual(self.args, ()) - self.assertEqual(self.read(), "") - - def test_should_return_error_for_missing_method(self): - self.write(json.dumps(dict(method='foo', - id=23))) - self.rpc.handle_request() - result = json.loads(self.read()) - - self.assertEqual(result["id"], 23) - self.assertEqual(result["error"]["message"], - "Unknown method foo") - - def test_should_return_error_for_exception_in_method(self): - def test_method(): - raise ValueError("An error was raised") - - self.write(json.dumps(dict(method='foo', - id=23))) - self.rpc.rpc_foo = test_method - - self.rpc.handle_request() - result = json.loads(self.read()) - - self.assertEqual(result["id"], 23) - self.assertEqual(result["error"]["message"], "An error was raised") - self.assertIn("traceback", result["error"]["data"]) - - def test_should_not_include_traceback_for_faults(self): - def test_method(): - raise rpc.Fault("This is a fault") - - self.write(json.dumps(dict(method="foo", - id=23))) - self.rpc.rpc_foo = test_method - - self.rpc.handle_request() - result = json.loads(self.read()) - - self.assertEqual(result["id"], 23) - self.assertEqual(result["error"]["message"], "This is a fault") - self.assertNotIn("traceback", result["error"]) - - def test_should_add_data_for_faults(self): - def test_method(): - raise rpc.Fault("St. Andreas' Fault", - code=12345, data="Yippieh") - - self.write(json.dumps(dict(method="foo", id=23))) - self.rpc.rpc_foo = test_method - - self.rpc.handle_request() - result = json.loads(self.read()) - - self.assertEqual(result["error"]["data"], "Yippieh") - - def test_should_call_handle_for_unknown_method(self): - def test_handle(method_name, args): - return "It works" - self.write(json.dumps(dict(method="doesnotexist", - id=23))) - self.rpc.handle = test_handle - self.rpc.handle_request() - self.assertEqual(json.loads(self.read()), - dict(id=23, - result="It works")) - - -class TestServeForever(TestJSONRPCServer): - def handle_request(self): - self.hr_called += 1 - if self.hr_called > 10: - raise self.error() - - def setUp(self): - super(TestServeForever, self).setUp() - self.hr_called = 0 - self.error = KeyboardInterrupt - self.rpc.handle_request = self.handle_request - - def test_should_call_handle_request_repeatedly(self): - self.rpc.serve_forever() - self.assertEqual(self.hr_called, 11) - - def test_should_return_on_some_errors(self): - self.error = KeyboardInterrupt - self.rpc.serve_forever() - self.error = EOFError - self.rpc.serve_forever() - self.error = SystemExit - self.rpc.serve_forever() - - def test_should_fail_on_most_errors(self): - self.error = RuntimeError - self.assertRaises(RuntimeError, - self.rpc.serve_forever) diff --git a/elpa/elpy-20200202.2031/elpy/tests/test_server.py b/elpa/elpy-20200202.2031/elpy/tests/test_server.py deleted file mode 100644 index fea56131..00000000 --- a/elpa/elpy-20200202.2031/elpy/tests/test_server.py +++ /dev/null @@ -1,389 +0,0 @@ -# coding: utf-8 - -"""Tests for the elpy.server module""" - -import os -import tempfile -import unittest - -import mock - -from elpy import rpc -from elpy import server -from elpy.tests import compat -from elpy.tests.support import BackendTestCase -import elpy.refactor - - -class ServerTestCase(unittest.TestCase): - def setUp(self): - self.srv = server.ElpyRPCServer() - - -class BackendCallTestCase(ServerTestCase): - def assert_calls_backend(self, method): - with mock.patch("elpy.server.get_source") as get_source: - with mock.patch.object(self.srv, "backend") as backend: - get_source.return_value = "transformed source" - - getattr(self.srv, method)("filename", "source", "offset") - - get_source.assert_called_with("source") - getattr(backend, method).assert_called_with( - "filename", "transformed source", "offset" - ) - - -class TestInit(ServerTestCase): - def test_should_not_select_a_backend_by_default(self): - self.assertIsNone(self.srv.backend) - - -class TestRPCEcho(ServerTestCase): - def test_should_return_arguments(self): - self.assertEqual(("hello", "world"), - self.srv.rpc_echo("hello", "world")) - - -class TestRPCInit(ServerTestCase): - @mock.patch("elpy.jedibackend.JediBackend") - def test_should_set_project_root(self, JediBackend): - self.srv.rpc_init({"project_root": "/project/root", - "environment": "/project/env"}) - - self.assertEqual("/project/root", self.srv.project_root) - - @mock.patch("jedi.create_environment") - def test_should_set_project_env(self, create_environment): - self.srv.rpc_init({"project_root": "/project/root", - "environment": "/project/env"}) - - create_environment.assert_called_with("/project/env", safe=False) - - @mock.patch("elpy.jedibackend.JediBackend") - def test_should_initialize_jedi(self, JediBackend): - self.srv.rpc_init({"project_root": "/project/root", - "environment": "/project/env"}) - - JediBackend.assert_called_with("/project/root", "/project/env") - - - @mock.patch("elpy.jedibackend.JediBackend") - def test_should_use_jedi_if_available(self, JediBackend): - JediBackend.return_value.name = "jedi" - - self.srv.rpc_init({"project_root": "/project/root", - "environment": "/project/env"}) - - self.assertEqual("jedi", self.srv.backend.name) - - - @mock.patch("elpy.jedibackend.JediBackend") - def test_should_use_none_if_nothing_available( - self, JediBackend): - JediBackend.return_value.name = "jedi" - old_jedi = server.jedibackend - server.jedibackend = None - - try: - self.srv.rpc_init({"project_root": "/project/root", - "environment": "/project/env"}) - finally: - server.jedibackend = old_jedi - - self.assertIsNone(self.srv.backend) - - -class TestRPCGetCalltip(BackendCallTestCase): - def test_should_call_backend(self): - self.assert_calls_backend("rpc_get_calltip") - - def test_should_handle_no_backend(self): - self.srv.backend = None - self.assertIsNone(self.srv.rpc_get_calltip("filname", "source", - "offset")) - - -class TestRPCGetCompletions(BackendCallTestCase): - def test_should_call_backend(self): - self.assert_calls_backend("rpc_get_completions") - - def test_should_handle_no_backend(self): - self.srv.backend = None - self.assertEqual([], - self.srv.rpc_get_completions("filname", "source", - "offset")) - - def test_should_sort_results(self): - with mock.patch.object(self.srv, 'backend') as backend: - backend.rpc_get_completions.return_value = [ - {'name': '_e'}, - {'name': '__d'}, - {'name': 'c'}, - {'name': 'B'}, - {'name': 'a'}, - ] - expected = list(reversed(backend.rpc_get_completions.return_value)) - - actual = self.srv.rpc_get_completions("filename", "source", - "offset") - - self.assertEqual(expected, actual) - - def test_should_uniquify_results(self): - with mock.patch.object(self.srv, 'backend') as backend: - backend.rpc_get_completions.return_value = [ - {'name': 'a'}, - {'name': 'a'}, - ] - expected = [{'name': 'a'}] - - actual = self.srv.rpc_get_completions("filename", "source", - "offset") - - self.assertEqual(expected, actual) - - -class TestRPCGetCompletionDocs(ServerTestCase): - def test_should_call_backend(self): - with mock.patch.object(self.srv, "backend") as backend: - self.srv.rpc_get_completion_docstring("completion") - - (backend.rpc_get_completion_docstring - .assert_called_with("completion")) - - def test_should_handle_no_backend(self): - self.srv.backend = None - self.assertIsNone(self.srv.rpc_get_completion_docstring("foo")) - - -class TestRPCGetCompletionLocation(ServerTestCase): - def test_should_call_backend(self): - with mock.patch.object(self.srv, "backend") as backend: - self.srv.rpc_get_completion_location("completion") - - (backend.rpc_get_completion_location - .assert_called_with("completion")) - - def test_should_handle_no_backend(self): - self.srv.backend = None - self.assertIsNone(self.srv.rpc_get_completion_location("foo")) - - -class TestRPCGetDefinition(BackendCallTestCase): - def test_should_call_backend(self): - self.assert_calls_backend("rpc_get_definition") - - def test_should_handle_no_backend(self): - self.srv.backend = None - self.assertIsNone(self.srv.rpc_get_definition("filname", "source", - "offset")) - - -class TestRPCGetAssignment(BackendCallTestCase): - def test_should_call_backend(self): - self.assert_calls_backend("rpc_get_assignment") - - def test_should_handle_no_backend(self): - self.srv.backend = None - self.assertIsNone(self.srv.rpc_get_assignment("filname", "source", - "offset")) - - -class TestRPCGetDocstring(BackendCallTestCase): - def test_should_call_backend(self): - self.assert_calls_backend("rpc_get_docstring") - - def test_should_handle_no_backend(self): - self.srv.backend = None - self.assertIsNone(self.srv.rpc_get_docstring("filname", "source", - "offset")) - - -class TestRPCGetOnelineDocstring(BackendCallTestCase): - def test_should_call_backend(self): - self.assert_calls_backend("rpc_get_oneline_docstring") - - def test_should_handle_no_backend(self): - self.srv.backend = None - self.assertIsNone(self.srv.rpc_get_oneline_docstring("filname", - "source", - "offset")) - - -class TestRPCGetPydocCompletions(ServerTestCase): - @mock.patch.object(server, 'get_pydoc_completions') - def test_should_call_pydoc_completions(self, get_pydoc_completions): - srv = server.ElpyRPCServer() - srv.rpc_get_pydoc_completions() - get_pydoc_completions.assert_called_with(None) - srv.rpc_get_pydoc_completions("foo") - get_pydoc_completions.assert_called_with("foo") - - -class TestGetPydocDocumentation(ServerTestCase): - @mock.patch("pydoc.render_doc") - def test_should_find_documentation(self, render_doc): - render_doc.return_value = "expected" - - actual = self.srv.rpc_get_pydoc_documentation("open") - - render_doc.assert_called_with("open", - "Elpy Pydoc Documentation for %s", - False) - self.assertEqual("expected", actual) - - def test_should_return_none_for_unknown_module(self): - actual = self.srv.rpc_get_pydoc_documentation("frob.open") - - self.assertIsNone(actual) - - def test_should_return_valid_unicode(self): - import json - - docstring = self.srv.rpc_get_pydoc_documentation("tarfile") - - json.dumps(docstring) - - -class TestRPCGetRefactorOptions(BackendTestCase): - @mock.patch.object(compat.builtins, '__import__') - def test_should_fail_if_rope_is_not_available(self, import_): - import_.side_effect = ImportError - filename = self.project_file("foo.py", "") - srv = server.ElpyRPCServer() - self.assertRaises(ImportError, srv.rpc_get_refactor_options, - filename, 0) - - @mock.patch.object(elpy.refactor, 'Refactor') - def test_should_initialize_and_call_refactor_object(self, Refactor): - filename = self.project_file("foo.py", "import foo") - srv = server.ElpyRPCServer() - srv.project_root = self.project_root - - srv.rpc_get_refactor_options(filename, 5) - - Refactor.assert_called_with(self.project_root, filename) - Refactor.return_value.get_refactor_options.assert_called_with(5, None) - - -class TestRPCRefactor(BackendTestCase): - @mock.patch.object(compat.builtins, '__import__') - def test_should_fail_if_rope_is_not_available(self, import_): - import_.side_effect = ImportError - filename = self.project_file("foo.py", "") - srv = server.ElpyRPCServer() - self.assertRaises(ImportError, srv.rpc_refactor, - filename, 'foo', ()) - - @mock.patch.object(elpy.refactor, 'Refactor') - def test_should_initialize_and_call_refactor_object_with_args( - self, Refactor): - filename = self.project_file("foo.py", "import foo") - srv = server.ElpyRPCServer() - srv.project_root = self.project_root - - srv.rpc_refactor(filename, 'foo', (1, 2, 3)) - - Refactor.assert_called_with(self.project_root, filename) - Refactor.return_value.get_changes.assert_called_with('foo', 1, 2, 3) - - @mock.patch.object(elpy.refactor, 'Refactor') - def test_should_initialize_and_call_refactor_object_without_args( - self, Refactor): - filename = self.project_file("foo.py", "import foo") - srv = server.ElpyRPCServer() - srv.project_root = self.project_root - - srv.rpc_refactor(filename, 'foo', None) - - Refactor.assert_called_with(self.project_root, filename) - Refactor.return_value.get_changes.assert_called_with('foo') - - -class TestRPCGetUsages(BackendCallTestCase): - def test_should_call_backend(self): - self.assert_calls_backend("rpc_get_usages") - - def test_should_handle_no_backend(self): - self.srv.backend = None - with self.assertRaises(rpc.Fault): - self.assertIsNone(self.srv.rpc_get_usages("filname", "source", - "offset")) - - -class TestRPCGetNames(BackendCallTestCase): - def test_should_call_backend(self): - self.assert_calls_backend("rpc_get_names") - - def test_should_handle_no_backend(self): - self.srv.backend = None - with self.assertRaises(rpc.Fault): - self.assertIsNone(self.srv.rpc_get_names("filname", "source", 0)) - - -class TestGetSource(unittest.TestCase): - def test_should_return_string_by_default(self): - self.assertEqual(server.get_source("foo"), - "foo") - - def test_should_return_file_contents(self): - fd, filename = tempfile.mkstemp(prefix="elpy-test-") - self.addCleanup(os.remove, filename) - with open(filename, "w") as f: - f.write("file contents") - - fileobj = {'filename': filename} - - self.assertEqual(server.get_source(fileobj), - "file contents") - - def test_should_clean_up_tempfile(self): - fd, filename = tempfile.mkstemp(prefix="elpy-test-") - with open(filename, "w") as f: - f.write("file contents") - - fileobj = {'filename': filename, - 'delete_after_use': True} - - self.assertEqual(server.get_source(fileobj), - "file contents") - self.assertFalse(os.path.exists(filename)) - - def test_should_support_utf8(self): - fd, filename = tempfile.mkstemp(prefix="elpy-test-") - self.addCleanup(os.remove, filename) - with open(filename, "wb") as f: - f.write(u"möp".encode("utf-8")) - - source = server.get_source({'filename': filename}) - - self.assertEqual(source, u"möp") - - -class TestPysymbolKey(BackendTestCase): - def keyLess(self, a, b): - self.assertLess(b, a) - self.assertLess(server._pysymbol_key(a), - server._pysymbol_key(b)) - - def test_should_be_case_insensitive(self): - self.keyLess("bar", "Foo") - - def test_should_sort_private_symbols_after_public_symbols(self): - self.keyLess("foo", "_bar") - - def test_should_sort_private_symbols_after_dunder_symbols(self): - self.assertLess(server._pysymbol_key("__foo__"), - server._pysymbol_key("_bar")) - - def test_should_sort_dunder_symbols_after_public_symbols(self): - self.keyLess("bar", "__foo") - - -class Autopep8TestCase(ServerTestCase): - - def test_rpc_fix_code_should_return_formatted_string(self): - code_block = 'x= 123\n' - new_block = self.srv.rpc_fix_code(code_block, os.getcwd()) - self.assertEqual(new_block, 'x = 123\n') diff --git a/elpa/elpy-20200202.2031/elpy/tests/test_support.py b/elpa/elpy-20200202.2031/elpy/tests/test_support.py deleted file mode 100644 index 0ed1d6d6..00000000 --- a/elpa/elpy-20200202.2031/elpy/tests/test_support.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Tests for elpy.tests.support. Yep, we test test code.""" - -import unittest - -from elpy.tests.support import source_and_offset - - -class TestSourceAndOffset(unittest.TestCase): - def test_should_return_source_and_offset(self): - self.assertEqual(source_and_offset("hello, _|_world"), - ("hello, world", 7)) - - def test_should_handle_beginning_of_string(self): - self.assertEqual(source_and_offset("_|_hello, world"), - ("hello, world", 0)) - - def test_should_handle_end_of_string(self): - self.assertEqual(source_and_offset("hello, world_|_"), - ("hello, world", 12)) diff --git a/elpa/elpy-20200202.2031/elpy/tests/test_yapf.py b/elpa/elpy-20200202.2031/elpy/tests/test_yapf.py deleted file mode 100644 index 712f119b..00000000 --- a/elpa/elpy-20200202.2031/elpy/tests/test_yapf.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 -"""Tests for the elpy.yapf module""" - -import unittest -import os - -from elpy import yapfutil -from elpy.rpc import Fault -from elpy.tests.support import BackendTestCase - - -@unittest.skipIf(yapfutil.YAPF_NOT_SUPPORTED, - 'yapf not supported for current python version') -class YAPFTestCase(BackendTestCase): - def setUp(self): - if yapfutil.YAPF_NOT_SUPPORTED: - raise unittest.SkipTest - - def test_fix_code_should_throw_error_for_invalid_code(self): - src = 'x = ' - self.assertRaises(Fault, yapfutil.fix_code, src, os.getcwd()) - - def test_fix_code(self): - testdata = [ - ('x= 123\n', 'x = 123\n'), - ('x=1; \ny=2 \n', 'x = 1\ny = 2\n'), - ] - for src, expected in testdata: - self._assert_format(src, expected) - - def _assert_format(self, src, expected): - new_block = yapfutil.fix_code(src, os.getcwd()) - self.assertEqual(new_block, expected) diff --git a/elpa/elpy-20200202.2031/elpy/yapfutil.py b/elpa/elpy-20200202.2031/elpy/yapfutil.py deleted file mode 100644 index a6e00608..00000000 --- a/elpa/elpy-20200202.2031/elpy/yapfutil.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Glue for the "yapf" library. - -""" - -import os -import sys - -from elpy.rpc import Fault - -YAPF_NOT_SUPPORTED = sys.version_info < (2, 7) or ( - sys.version_info >= (3, 0) and sys.version_info < (3, 4)) - -try: - if YAPF_NOT_SUPPORTED: - yapf_api = None - else: - from yapf.yapflib import yapf_api - from yapf.yapflib import file_resources -except ImportError: # pragma: no cover - yapf_api = None - - -def fix_code(code, directory): - """Formats Python code to conform to the PEP 8 style guide. - - """ - if not yapf_api: - raise Fault('yapf not installed', code=400) - style_config = file_resources.GetDefaultStyleForDir(directory or os.getcwd()) - try: - reformatted_source, _ = yapf_api.FormatCode(code, - filename='', - style_config=style_config, - verify=False) - return reformatted_source - except Exception as e: - raise Fault("Error during formatting: {}".format(e), - code=400) diff --git a/elpa/elpy-20200202.2031/elpy-autoloads.el b/elpa/elpy-20200323.1647/elpy-autoloads.el similarity index 100% rename from elpa/elpy-20200202.2031/elpy-autoloads.el rename to elpa/elpy-20200323.1647/elpy-autoloads.el diff --git a/elpa/elpy-20200202.2031/elpy-django.el b/elpa/elpy-20200323.1647/elpy-django.el similarity index 100% rename from elpa/elpy-20200202.2031/elpy-django.el rename to elpa/elpy-20200323.1647/elpy-django.el diff --git a/elpa/elpy-20200202.2031/elpy-django.elc b/elpa/elpy-20200323.1647/elpy-django.elc similarity index 100% rename from elpa/elpy-20200202.2031/elpy-django.elc rename to elpa/elpy-20200323.1647/elpy-django.elc diff --git a/elpa/elpy-20200202.2031/elpy-pkg.el b/elpa/elpy-20200323.1647/elpy-pkg.el similarity index 76% rename from elpa/elpy-20200202.2031/elpy-pkg.el rename to elpa/elpy-20200323.1647/elpy-pkg.el index 74844934..49b194db 100644 --- a/elpa/elpy-20200202.2031/elpy-pkg.el +++ b/elpa/elpy-20200323.1647/elpy-pkg.el @@ -1,4 +1,4 @@ -(define-package "elpy" "20200202.2031" "Emacs Python Development Environment" +(define-package "elpy" "20200323.1647" "Emacs Python Development Environment" '((company "0.9.2") (emacs "24.4") (highlight-indentation "0.5.0") diff --git a/elpa/elpy-20200202.2031/elpy-profile.el b/elpa/elpy-20200323.1647/elpy-profile.el similarity index 100% rename from elpa/elpy-20200202.2031/elpy-profile.el rename to elpa/elpy-20200323.1647/elpy-profile.el diff --git a/elpa/elpy-20200202.2031/elpy-profile.elc b/elpa/elpy-20200323.1647/elpy-profile.elc similarity index 100% rename from elpa/elpy-20200202.2031/elpy-profile.elc rename to elpa/elpy-20200323.1647/elpy-profile.elc diff --git a/elpa/elpy-20200202.2031/elpy-refactor.el b/elpa/elpy-20200323.1647/elpy-refactor.el similarity index 100% rename from elpa/elpy-20200202.2031/elpy-refactor.el rename to elpa/elpy-20200323.1647/elpy-refactor.el diff --git a/elpa/elpy-20200202.2031/elpy-refactor.elc b/elpa/elpy-20200323.1647/elpy-refactor.elc similarity index 100% rename from elpa/elpy-20200202.2031/elpy-refactor.elc rename to elpa/elpy-20200323.1647/elpy-refactor.elc diff --git a/elpa/elpy-20200202.2031/elpy-rpc.el b/elpa/elpy-20200323.1647/elpy-rpc.el similarity index 98% rename from elpa/elpy-20200202.2031/elpy-rpc.el rename to elpa/elpy-20200323.1647/elpy-rpc.el index 236a6d0b..ba259f82 100644 --- a/elpa/elpy-20200202.2031/elpy-rpc.el +++ b/elpa/elpy-20200323.1647/elpy-rpc.el @@ -369,8 +369,11 @@ binaries used to create the virtualenv." (kill-buffer elpy-venv-buffname-visible)) (with-elpy-rpc-virtualenv-activated (cond - ((= 0 (call-process elpy-rpc-python-command nil nil nil - "-m" "venv" "-h")) + ((and (= 0 (call-process elpy-rpc-python-command nil nil nil + "-m" "venv" "-h")) + ;; see https://github.com/jorgenschaefer/elpy/issues/1756 + (= 0 (call-process elpy-rpc-python-command nil nil nil + "-m" "ensurepip" "-h"))) (with-current-buffer (get-buffer-create elpy-venv-buffname) (insert (concat "Running '" elpy-rpc-python-command " -m venv " rpc-venv-path "':\n\n")) @@ -384,7 +387,7 @@ binaries used to create the virtualenv." (setq success (call-process "virtualenv" nil t t "-p" elpy-rpc-python-command rpc-venv-path)))) (t - (error "Elpy necessitates the 'virtualenv' python package, please install it with `pip install virtualenv`")))) + (error "Elpy needs the 'virtualenv' or 'venv' python packages to create its virtualenv. Please install one of them or disable the dedicated virtualenv with `(setq elpy-rpc-virtualenv-path 'current)`")))) ;; warn us if something wrong happened (unless (= 0 success) (with-current-buffer elpy-venv-buffname diff --git a/elpa/elpy-20200202.2031/elpy-rpc.elc b/elpa/elpy-20200323.1647/elpy-rpc.elc similarity index 90% rename from elpa/elpy-20200202.2031/elpy-rpc.elc rename to elpa/elpy-20200323.1647/elpy-rpc.elc index bd646e871a28c2301e86a0edff88d92bf638d2c6..dce4b737ad213f53b6ba33088cffe2a965ece0f4 100644 GIT binary patch delta 1062 zcmZWnU27C)6wb`MyD^QaUlaoheK&$JDDL|`Gd8Iko7SRH{6=KOPIgCk?PfRGowevi zQ@;?~nxwu8qKJZ)f=a2rSAJXxq8Hxy0~AG&dQm7s>xCkonQ7@oFXk}koacGYbI#1m zEB33a_HWB`)?A&-9h)g-TY+;zqoD8RmJSOM6=+9+6IEc8#t-KViV7aFxE-S0T4011 z7=Rm)I++>SaR8D67X+AsX1X9UJ(D;SjDR5Jkn?QJ;#B^RC4faq!YVLD(#1rMgE0YI z@WNT*hYQ(}nFBUrbBcBLfhyQb<_N$mm=hUS%qC<}(p995MAc6c3xc&Jn20I#`5g=M zfJk;$%z_?4fD~yflZhC%1p`E;JyHf8!qQL>4vtbl6W(R%bri42S&c~dpJPa3$Ar>I zOyiQqYxTjd;8VhA$x{%-rfi?Sy&!8I(5F^sPf%;N8o^j)tVjRC%M(GViNkV$d-qiu zVau-uwSB#~-he!Q8`~e2>oq*)7r*xR1OTn$Vk7Xw09V2${*SX9Z>R=-6Uwz_=vS+_ zUJG!2cO*R;$(1Tif2113qe?-kQUr+-@IU%@DE_7rmho3hnn5^@_4S3_AK>0%tI-H* zVV|jp9qE)HRGItUkc~X6Z+y% zw|&Jt$w72RKq9V!vUiA>cFBtb$e%`L1e|8H=hnR~)H!M)6X6qMk zEJP(Wo4@?QMoKaBY|S|faj-Noe85HyC+6+?X&Z6nn5m5wD@6%Y=Iy3I0C~jZw=e)v zX)|~zR6j<_les%J-z+ZUn!R|rZ=AMeh=?% BG*bWo delta 1006 zcmZ8fU1(HC7~Om4W}`77#DYdFc((!df^p}6?iiJ<#v<1ETSVlFU6VCgUDtK@nxZe! zR{MiBl}x~g7W&#Mh&cG5557eR^g%&UhzLcH`rt2!f*^i(H!AotcjkO^&iT%F=j8?W z@p<>s@~neQHv4lclc|U?Od>{zd6r#Zrn7SwQIVOLIm0({^i)Le{58&ytHI6-^rEilSbjXMdGLNqAldOy&-gzJ1H*6kYz!3bb5kusG| zH?$;ZG0M};i7l8Ul2C?5q#w~%f)gdk53x;|_$z#;ni$Otj4QX!8{AuGGlA>T1DFTc z2*@j_2MgPl2~1m0V4f~)zf7kbbB7J>8Yt9i#W)`qYJNOi@Ry7ftMQS1sZbtS;#ZEw z!-vX#B|mT=KU7%eS4xF^t>72SwK!iY`Ni1(z8DYt-&Km0kKiZ1eaUwaqs!@XA#liGCW#*h%oT+dA-6*BnFH~ZGKn@72< zd9fx&7&oxdwf`cbwb|5n4{?@Yo#uI8tL|YQ`>V6qJr6}Zz*V~(7xL- z2^yT)8#@;_BcVh4Y|jG+Iw1CDKJR*56K2KWUnp@jcZZ%daUp`;=FfSH?Ek~LCdex6 zvhr6R!b;k$)#ISXl)YWsFb5diW=2oCh?CI%ec~~+FNK--@gfXFnsp~{A;p+oaEdt| z(_GjsKRt);B(ZCM+2|l8q#ghDAdoaMSI%T?*XappOlWiMx7VHswYFEzw1J(#c5>_s zC{b#se}|2NAM@gDm*YvTLen|^5K+a, Gaby Launay ;; URL: https://github.com/jorgenschaefer/elpy -;; Version: 1.32.0 +;; Version: 1.33.0 ;; Keywords: Python, IDE, Languages, Tools ;; Package-Requires: ((company "0.9.10") (emacs "24.4") (highlight-indentation "0.7.0") (pyvenv "1.20") (yasnippet "0.13.0") (s "1.12.0")) @@ -53,7 +53,7 @@ (require 'elpy-rpc) (require 'pyvenv) -(defconst elpy-version "1.32.0" +(defconst elpy-version "1.33.0" "The version of the Elpy Lisp code.") ;;;;;;;;;;;;;;;;;;;;;; @@ -598,8 +598,8 @@ virtualenv. (defvar elpy-config--get-config "import json import sys +from distutils.version import LooseVersion import warnings - warnings.filterwarnings('ignore', category=FutureWarning) try: @@ -607,12 +607,21 @@ try: except ImportError: import urllib.request as urllib -from distutils.version import LooseVersion + +# Check if we can connect to pypi quickly enough +try: + response = urllib.urlopen('https://pypi.org/pypi', timeout=1) + CAN_CONNECT_TO_PYPI = True +except: + CAN_CONNECT_TO_PYPI = False def latest(package, version=None): + if not CAN_CONNECT_TO_PYPI: + return None try: - response = urllib.urlopen('https://pypi.org/pypi/{package}/json'.format(package=package)).read() + response = urllib.urlopen('https://pypi.org/pypi/{package}/json'.format(package=package), + timeout=2).read() latest = json.loads(response)['info']['version'] if version is None or LooseVersion(version) < LooseVersion(latest): return latest @@ -623,6 +632,7 @@ def latest(package, version=None): config = {} +config['can_connect_to_pypi'] = CAN_CONNECT_TO_PYPI config['rpc_python_version'] = ('{major}.{minor}.{micro}' .format(major=sys.version_info[0], minor=sys.version_info[1], @@ -859,6 +869,20 @@ item in another window.\n\n") :package python-shell-interpreter :norpc t) (insert "\n\n")) + ;; Couldn't connect to pypi to check package versions + (when (not (gethash "can_connect_to_pypi" config)) + (elpy-insert--para + "Elpy could not connect to Pypi (or at least not quickly enough) " + "and check if the python packages were up-to-date. " + "You can still try to update all of them:" + "\n") + (insert "\n") + (widget-create 'elpy-insert--generic-button + :button-name "[Update python packages]" + :function (lambda () (with-elpy-rpc-virtualenv-activated + (elpy-rpc--install-dependencies)))) + (insert "\n\n")) + ;; Pip not available in the rpc virtualenv (when (and (elpy-rpc--pip-missing) (not (gethash "jedi_version" config))) @@ -1034,7 +1058,9 @@ virtual_env_short" (let ((venv (getenv "VIRTUAL_ENV"))) (puthash "virtual_env" venv config) (if venv - (puthash "virtual_env_short" (file-name-nondirectory venv) config) + (puthash "virtual_env_short" (file-name-nondirectory + (directory-file-name venv)) + config) (puthash "virtual_env_short" nil config))) (with-elpy-rpc-virtualenv-activated (let ((return-value (ignore-errors @@ -2250,10 +2276,13 @@ prefix argument is given, prompt for a symbol from the user." (interactive) (cond ((elpy-config--package-available-p "yapf") + (when (interactive-p) (message "Autoformatting code with yapf.")) (elpy-yapf-fix-code)) ((elpy-config--package-available-p "autopep8") + ((when (interactive-p) message "Autoformatting code with autopep8.")) (elpy-autopep8-fix-code)) ((elpy-config--package-available-p "black") + ((when (interactive-p) message "Autoformatting code with black.")) (elpy-black-fix-code)) (t (message "Install yapf/autopep8 to format code.")))) diff --git a/elpa/elpy-20200202.2031/elpy.elc b/elpa/elpy-20200323.1647/elpy.elc similarity index 79% rename from elpa/elpy-20200202.2031/elpy.elc rename to elpa/elpy-20200323.1647/elpy.elc index 7803a4758fa5bf48bd4c29c21fb66fcc81b21e3d..49c0a2603ee2aa0c72940b5413eb755f8dd0c984 100644 GIT binary patch delta 7580 zcmbVR3v^WFozH*fCLkf<9p33p5KPd}``z!phE{ z@A3cs@Bi<6@cFGH-h5!h!4+|m;ra0wSNbolK4nb0H<#_p>)YDe#BMyYy`-y`w#&cVsh}R7YOVXZ75UTw1?yAlVWb zQn@@9|KEh)Ztv+&-MnU=0ev#r{FkvSu4f*7sr*1+MqirEr2M8eJ=0H#So2izUr9YP z+_h#5oecZhiuSeTvu$kONv+WDOSBI6to`vw%@(E=p1Wy%JZ>Ade}C$pxO9zhW!H8L z$VB+B>GAPF!%a%p)RK)!)37v3O5tEY;?KgLos^b!V$u`_H#(w*!!u0fVvSf>!QVyd z`>l%E5s51zTFfl2&_N(gu!bxQoL*6s#zQHH!`KqF{M+h#hFT!bRGqWb_iXh&M}5z& zfMhY}gh&vpFYJh+T>IBDct|)wu7xJ~-^1NL@k`34QEyz*liLBb80hI#r8*2Z zmNRZNW&8B@yxx;)@6Ri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^h6#Ihw*IJ||%_bZ#Uw)!&sN;QJ7t~rCRkqI`v-DcYohcsoW0Z8gBK6*`g zjp9p%-OC@sbu^$!_|b>}{ujCj^Xw-ntukPHYpR*iG$NCtxwi2h+HD$DW>vP;eSXsz zMiu`R*+^B!L<0jCt6VN_YAHfgG$Qf$!v|~upHNI;(VTS object 0)) 1 0) + (or n 0))) + +(defvar pos-tip-saved-frame-coordinates '(0 . 0) + "The latest result of `pos-tip-frame-top-left-coordinates'.") + +(defvar pos-tip-frame-offset nil + "The latest result of `pos-tip-calibrate-frame-offset'. This value +is used for non-X graphical environment.") + +(defvar pos-tip-frame-offset-array [nil nil nil nil] + "Array of the results of `pos-tip-calibrate-frame-offset'. They are +recorded only when `pos-tip-frame-top-left-coordinates' is called for a +non-X but graphical frame. + +The 2nd and 4th elements are the values for frames having a menu bar. +The 3rd and 4th elements are the values for frames having a tool bar.") + +(defun pos-tip-frame-top-left-coordinates (&optional frame) + "Return the pixel coordinates of FRAME as a cons cell (LEFT . TOP), +which are relative to top left corner of screen. + +Return nil if failing to acquire the coordinates. + +If FRAME is omitted, use selected-frame. + +Users can also get the frame coordinates by referring the variable +`pos-tip-saved-frame-coordinates' just after calling this function." + (let ((winsys (pos-tip-window-system frame))) + (cond + ((null winsys) + (error "text-only frame: %S" frame)) + ((eq winsys 'x) + (condition-case nil + (with-current-buffer (get-buffer-create " *xwininfo*") + (let ((case-fold-search nil)) + (buffer-disable-undo) + (erase-buffer) + (call-process shell-file-name nil t nil shell-command-switch + (format "xwininfo -display %s -id %s" + (frame-parameter frame 'display) + (frame-parameter frame 'window-id))) + (goto-char (point-min)) + (search-forward "\n Absolute") + (setq pos-tip-saved-frame-coordinates + (cons (string-to-number (buffer-substring-no-properties + (search-forward "X: ") + (line-end-position))) + (string-to-number (buffer-substring-no-properties + (search-forward "Y: ") + (line-end-position))))))) + (error nil))) + (t + (let* ((index (+ (pos-tip-normalize-natnum + (frame-parameter frame 'menu-bar-lines) 0) + (pos-tip-normalize-natnum + (frame-parameter frame 'tool-bar-lines) 1))) + (offset (or (aref pos-tip-frame-offset-array index) + (aset pos-tip-frame-offset-array index + (pos-tip-calibrate-frame-offset frame))))) + (if offset + (setq pos-tip-saved-frame-coordinates + (cons (+ (eval (frame-parameter frame 'left)) + (car offset)) + (+ (eval (frame-parameter frame 'top)) + (cdr offset)))))))))) + +(defun pos-tip-frame-relative-position + (frame1 frame2 &optional w32-frame frame-coord1 frame-coord2) + "Return the pixel coordinates of FRAME1 relative to FRAME2 +as a cons cell (LEFT . TOP). + +W32-FRAME non-nil means both of frames are under `w32' window system. + +FRAME-COORD1 and FRAME-COORD2, if given, specify the absolute +coordinates of FRAME1 and FRAME2, respectively, which make the +calculations faster if the frames have different heights of menu bars +and tool bars." + (if (and (eq (pos-tip-normalize-natnum + (frame-parameter frame1 'menu-bar-lines)) + (pos-tip-normalize-natnum + (frame-parameter frame2 'menu-bar-lines))) + (or w32-frame + (eq (pos-tip-normalize-natnum + (frame-parameter frame1 'tool-bar-lines)) + (pos-tip-normalize-natnum + (frame-parameter frame2 'tool-bar-lines))))) + (cons (- (eval (frame-parameter frame1 'left)) + (eval (frame-parameter frame2 'left))) + (- (eval (frame-parameter frame1 'top)) + (eval (frame-parameter frame2 'top)))) + (unless frame-coord1 + (setq frame-coord1 (let (pos-tip-saved-frame-coordinates) + (pos-tip-frame-top-left-coordinates frame1)))) + (unless frame-coord2 + (setq frame-coord2 (let (pos-tip-saved-frame-coordinates) + (pos-tip-frame-top-left-coordinates frame2)))) + (cons (- (car frame-coord1) (car frame-coord2)) + (- (cdr frame-coord1) (cdr frame-coord2))))) + +(defvar pos-tip-upperside-p nil + "Non-nil indicates the latest result of `pos-tip-compute-pixel-position' +was upper than the location specified by the arguments.") + +(defvar pos-tip-w32-saved-max-width-height nil + "Display pixel size effective for showing tooltip in MS-Windows desktop. +This doesn't include the taskbar area, so isn't same as actual display size.") + +(defun pos-tip-compute-pixel-position + (&optional pos window pixel-width pixel-height frame-coordinates dx dy) + "Return pixel position of POS in WINDOW like (X . Y), which indicates +the absolute or relative coordinates of bottom left corner of the object. + +Omitting POS and WINDOW means use current position and selected window, +respectively. + +If PIXEL-WIDTH and PIXEL-HEIGHT are given, this function assumes these +values as the size of small window like tooltip which is located around the +object at POS. These values are used to adjust the location in order that +the tooltip won't disappear by sticking out of the display. By referring +the variable `pos-tip-upperside-p' after calling this function, user can +examine whether the tooltip will be located above the specified position. + +If FRAME-COORDINATES is omitted or nil, automatically obtain the absolute +coordinates of the top left corner of frame which WINDOW is on. Here, +`top left corner of frame' represents the origin of `window-pixel-edges' +and its coordinates are essential for calculating the return value as +absolute coordinates. If a cons cell like (LEFT . TOP), specifies the +frame absolute location and makes the calculation slightly faster, but can +be used only when it's clear that frame is in the specified position. Users +can get the latest values of frame coordinates for using in the next call +by referring the variable `pos-tip-saved-frame-coordinates' just after +calling this function. Otherwise, FRAME-COORDINATES `relative' means return +pixel coordinates of the object relative to the top left corner of the frame. +This is the same effect as `pos-tip-use-relative-coordinates' is non-nil. + +DX specifies horizontal offset in pixel. + +DY specifies vertical offset in pixel. This makes the calculations done +without considering the height of object at POS, so the object might be +hidden by the tooltip." + (let* ((frame (window-frame (or window (selected-window)))) + (w32-frame (eq (pos-tip-window-system frame) 'w32)) + (relative (or pos-tip-use-relative-coordinates + (eq frame-coordinates 'relative) + (and w32-frame + (null pos-tip-w32-saved-max-width-height)))) + (frame-coord (or (and relative '(0 . 0)) + frame-coordinates + (pos-tip-frame-top-left-coordinates frame) + (progn + (setq relative t + pos-tip-use-relative-coordinates t) + '(0 . 0)))) + (posn (posn-at-point (or pos (window-point window)) window)) + (line (cdr (posn-actual-col-row posn))) + (line-height (and line + (or (window-line-height line window) + (and (redisplay t) + (window-line-height line window))))) + (x-y (or (posn-x-y posn) + (let ((geom (pos-visible-in-window-p + (or pos (window-point window)) window t))) + (and geom (cons (car geom) (cadr geom)))) + '(0 . 0))) + (x (+ (car frame-coord) + (car (window-inside-pixel-edges window)) + (car x-y) + (or dx 0))) + (y0 (+ (cdr frame-coord) + (cadr (window-pixel-edges window)) + (or (nth 2 line-height) (cdr x-y)))) + (y (+ y0 + (or dy + (car line-height) + (with-current-buffer (window-buffer window) + (cond + ;; `posn-object-width-height' returns an incorrect value + ;; when the header line is displayed (Emacs bug #4426). + ((and posn + (null header-line-format)) + (cdr (posn-object-width-height posn))) + ((and (bound-and-true-p text-scale-mode) + (not (zerop (with-no-warnings + text-scale-mode-amount)))) + (round (* (frame-char-height frame) + (with-no-warnings + (expt text-scale-mode-step + text-scale-mode-amount))))) + (t + (frame-char-height frame))))))) + xmax ymax) + (cond + (relative + (setq xmax (frame-pixel-width frame) + ymax (frame-pixel-height frame))) + (w32-frame + (setq xmax (car pos-tip-w32-saved-max-width-height) + ymax (cdr pos-tip-w32-saved-max-width-height))) + (t + (setq xmax (x-display-pixel-width frame) + ymax (x-display-pixel-height frame)))) + (setq pos-tip-upperside-p (> (+ y (or pixel-height 0)) + ymax)) + (cons (max 0 (min x (- xmax (or pixel-width 0)))) + (max 0 (if pos-tip-upperside-p + (- (if dy ymax y0) (or pixel-height 0)) + y))))) + +(defun pos-tip-cancel-timer () + "Cancel timeout of tooltip." + (mapc (lambda (timer) + (if (eq (aref timer 5) 'x-hide-tip) + (cancel-timer timer))) + timer-list)) + +(defun pos-tip-avoid-mouse (left right top bottom &optional frame) + "Move out mouse pointer if it is inside region (LEFT RIGHT TOP BOTTOM) +in FRAME. Return new mouse position like (FRAME . (X . Y))." + (unless frame + (setq frame (selected-frame))) + (let* ((mpos (with-selected-window (frame-selected-window frame) + (mouse-pixel-position))) + (mframe (pop mpos)) + (mx (car mpos)) + (my (cdr mpos))) + (when (and (eq mframe frame) + (numberp mx)) + (let* ((large-number (+ (frame-pixel-width frame) (frame-pixel-height frame))) + (dl (if (> left 2) + (1+ (- mx left)) + large-number)) + (dr (if (< (1+ right) (frame-pixel-width frame)) + (- right mx) + large-number)) + (dt (if (> top 2) + (1+ (- my top)) + large-number)) + (db (if (< (1+ bottom) (frame-pixel-height frame)) + (- bottom my) + large-number)) + (d (min dl dr dt db))) + (when (> d -2) + (cond + ((= d dl) + (setq mx (- left 2))) + ((= d dr) + (setq mx (1+ right))) + ((= d dt) + (setq my (- top 2))) + (t + (setq my (1+ bottom)))) + (set-mouse-pixel-position frame mx my) + (sit-for 0.0001)))) + (cons mframe (and mpos (cons mx my))))) + +(defun pos-tip-compute-foreground-color (tip-color) + "Compute the foreground color to use for tooltip. + +TIP-COLOR is a face or a cons cell like (FOREGROUND-COLOR . BACKGROUND-COLOR). +If it is nil, use `pos-tip-foreground-color' or the foreground color of the +`tooltip' face." + (or (and (facep tip-color) + (face-attribute tip-color :foreground)) + (car-safe tip-color) + pos-tip-foreground-color + (face-foreground 'tooltip))) + +(defun pos-tip-compute-background-color (tip-color) + "Compute the background color to use for tooltip. + +TIP-COLOR is a face or a cons cell like (FOREGROUND-COLOR . BACKGROUND-COLOR). +If it is nil, use `pos-tip-background-color' or the background color of the +`tooltip' face." + (or (and (facep tip-color) + (face-attribute tip-color :background)) + (cdr-safe tip-color) + pos-tip-background-color + (face-background 'tooltip))) + +(defun pos-tip-show-no-propertize + (string &optional tip-color pos window timeout pixel-width pixel-height frame-coordinates dx dy) + "Show STRING in a tooltip at POS in WINDOW. +Analogous to `pos-tip-show' except don't propertize STRING by `pos-tip' face. + +PIXEL-WIDTH and PIXEL-HEIGHT specify the size of tooltip, if given. These +are used to adjust the tooltip position in order that it doesn't disappear by +sticking out of the display, and also used to prevent it from vanishing by +overlapping with mouse pointer. + +Note that this function itself doesn't calculate tooltip size because the +character width and height specified by faces are unknown. So users should +calculate PIXEL-WIDTH and PIXEL-HEIGHT by using `pos-tip-tooltip-width' and +`pos-tip-tooltip-height', or use `pos-tip-show' instead, which can +automatically calculate tooltip size. + +See `pos-tip-show' for details. + +Example: + +\(defface my-tooltip + '((t + :background \"gray85\" + :foreground \"black\" + :inherit variable-pitch)) + \"Face for my tooltip.\") + +\(defface my-tooltip-highlight + '((t + :background \"blue\" + :foreground \"white\" + :inherit my-tooltip)) + \"Face for my tooltip highlighted.\") + +\(let ((str (propertize \" foo \\n bar \\n baz \" 'face 'my-tooltip))) + (put-text-property 6 11 'face 'my-tooltip-highlight str) + (pos-tip-show-no-propertize str 'my-tooltip))" + (unless window + (setq window (selected-window))) + (let* ((frame (window-frame window)) + (winsys (pos-tip-window-system frame)) + (x-frame (eq winsys 'x)) + (w32-frame (eq winsys 'w32)) + (relative (or pos-tip-use-relative-coordinates + (eq frame-coordinates 'relative) + (and w32-frame + (null pos-tip-w32-saved-max-width-height)))) + (x-y (prog1 + (pos-tip-compute-pixel-position pos window + pixel-width pixel-height + frame-coordinates dx dy) + (if pos-tip-use-relative-coordinates + (setq relative t)))) + (ax (car x-y)) + (ay (cdr x-y)) + (rx (if relative ax (- ax (car pos-tip-saved-frame-coordinates)))) + (ry (if relative ay (- ay (cdr pos-tip-saved-frame-coordinates)))) + (retval (cons rx ry)) + (fg (pos-tip-compute-foreground-color tip-color)) + (bg (pos-tip-compute-background-color tip-color)) + (use-dxdy (or relative + (not x-frame))) + (spacing (frame-parameter frame 'line-spacing)) + (border (ash (+ pos-tip-border-width + pos-tip-internal-border-width) + 1)) + (x-max-tooltip-size + (cons (+ (if x-frame 1 0) + (/ (- (or pixel-width + (cond + (relative + (frame-pixel-width frame)) + (w32-frame + (car pos-tip-w32-saved-max-width-height)) + (t + (x-display-pixel-width frame)))) + border) + (frame-char-width frame))) + (/ (- (or pixel-height + (x-display-pixel-height frame)) + border) + (frame-char-height frame)))) + (x-gtk-use-system-tooltips nil) ; Don't use Gtk+ tooltip in Emacs 24 + (mpos (with-selected-window window (mouse-pixel-position))) + (mframe (car mpos)) + default-frame-alist) + (if (or relative + (and use-dxdy + (null (cadr mpos)))) + (unless (and (cadr mpos) + (eq mframe frame)) + (let* ((edges (window-inside-pixel-edges (cadr (window-list frame)))) + (mx (ash (+ (pop edges) (cadr edges)) -1)) + (my (ash (+ (pop edges) (cadr edges)) -1))) + (setq mframe frame) + (set-mouse-pixel-position mframe mx my) + (sit-for 0.0001))) + (when (and (cadr mpos) + (not (eq mframe frame))) + (let ((rel-coord (pos-tip-frame-relative-position frame mframe w32-frame + frame-coordinates))) + (setq rx (+ rx (car rel-coord)) + ry (+ ry (cdr rel-coord)))))) + (and pixel-width pixel-height + (setq mpos (pos-tip-avoid-mouse rx (+ rx pixel-width + (if w32-frame 3 0)) + ry (+ ry pixel-height) + mframe))) + (x-show-tip string mframe + `((border-width . ,pos-tip-border-width) + (internal-border-width . ,pos-tip-internal-border-width) + ,@(and (not use-dxdy) `((left . ,ax) + (top . ,ay))) + (font . ,(frame-parameter frame 'font)) + ,@(and spacing `((line-spacing . ,spacing))) + ,@(and (stringp fg) `((foreground-color . ,fg))) + ,@(and (stringp bg) `((background-color . ,bg)))) + (and timeout (> timeout 0) timeout) + (and use-dxdy (- rx (cadr mpos))) + (and use-dxdy (- ry (cddr mpos)))) + (if (and timeout (<= timeout 0)) + (pos-tip-cancel-timer)) + retval)) + +(defun pos-tip-split-string (string &optional width margin justify squeeze max-rows) + "Split STRING into fixed width strings. Return a list of these strings. + +WIDTH specifies the width of filling each paragraph. WIDTH nil means use +the width of currently selected frame. Note that this function doesn't add any +padding characters at the end of each row. + +MARGIN, if non-nil, specifies left margin width which is the number of spece +characters to add at the beginning of each row. + +The optional fourth argument JUSTIFY specifies which kind of justification +to do: `full', `left', `right', `center', or `none'. A value of t means handle +each paragraph as specified by its text properties. Omitting JUSTIFY means +don't perform justification, word wrap and kinsoku shori (禁則処理). + +SQUEEZE nil means leave whitespaces other than line breaks untouched. + +MAX-ROWS, if given, specifies maximum number of elements of return value. +The elements exceeding this number are discarded." + (with-temp-buffer + (let* ((tab-width (or pos-tip-tab-width tab-width)) + (fill-column (or width (frame-width))) + (left-margin (or margin 0)) + (kinsoku-limit 1) + indent-tabs-mode + row rows) + (insert string) + (untabify (point-min) (point-max)) + (if justify + (fill-region (point-min) (point-max) justify (not squeeze)) + (setq margin (make-string left-margin ?\s))) + (goto-char (point-min)) + (while (prog2 + (let ((line (buffer-substring + (point) (progn (end-of-line) (point))))) + (if justify + (push line rows) + (while (progn + (setq line (concat margin line) + row (truncate-string-to-width line fill-column)) + (push row rows) + (if (not (= (length row) (length line))) + (setq line (substring line (length row)))))))) + (< (point) (point-max)) + (beginning-of-line 2))) + (nreverse (if max-rows + (last rows max-rows) + rows))))) + +(defun pos-tip-fill-string (string &optional width margin justify squeeze max-rows) + "Fill each of the paragraphs in STRING. + +WIDTH specifies the width of filling each paragraph. WIDTH nil means use +the width of currently selected frame. Note that this function doesn't add any +padding characters at the end of each row. + +MARGIN, if non-nil, specifies left margin width which is the number of spece +characters to add at the beginning of each row. + +The optional fourth argument JUSTIFY specifies which kind of justification +to do: `full', `left', `right', `center', or `none'. A value of t means handle +each paragraph as specified by its text properties. Omitting JUSTIFY means +don't perform justification, word wrap and kinsoku shori (禁則処理). + +SQUEEZE nil means leave whitespaces other than line breaks untouched. + +MAX-ROWS, if given, specifies maximum number of rows. The rows exceeding +this number are discarded." + (if justify + (with-temp-buffer + (let* ((tab-width (or pos-tip-tab-width tab-width)) + (fill-column (or width (frame-width))) + (left-margin (or margin 0)) + (kinsoku-limit 1) + indent-tabs-mode) + (insert string) + (untabify (point-min) (point-max)) + (fill-region (point-min) (point-max) justify (not squeeze)) + (if max-rows + (buffer-substring (goto-char (point-min)) + (line-end-position max-rows)) + (buffer-string)))) + (mapconcat 'identity + (pos-tip-split-string string width margin nil nil max-rows) + "\n"))) + +(defun pos-tip-truncate-string (string width height) + "Truncate each line of STRING to WIDTH and discard lines exceeding HEIGHT." + (with-temp-buffer + (insert string) + (goto-char (point-min)) + (let ((nrow 0) + rows) + (while (and (< nrow height) + (prog2 + (push (truncate-string-to-width + (buffer-substring (point) (progn (end-of-line) (point))) + width) + rows) + (< (point) (point-max)) + (beginning-of-line 2) + (setq nrow (1+ nrow))))) + (mapconcat 'identity (nreverse rows) "\n")))) + +(defun pos-tip-string-width-height (string) + "Count columns and rows of STRING. Return a cons cell like (WIDTH . HEIGHT). +The last empty line of STRING is ignored. + +Example: + +\(pos-tip-string-width-height \"abc\\nあいう\\n123\") +;; => (6 . 3)" + (with-temp-buffer + (insert string) + (goto-char (point-min)) + (end-of-line) + (let ((width (current-column)) + (height (if (eq (char-before (point-max)) ?\n) 0 1))) + (while (< (point) (point-max)) + (end-of-line 2) + (setq width (max (current-column) width) + height (1+ height))) + (cons width height)))) + +(defun pos-tip-x-display-width (&optional frame) + "Return maximum column number in tooltip which occupies the full width +of display. Omitting FRAME means use display that selected frame is in." + (1+ (/ (x-display-pixel-width frame) (frame-char-width frame)))) + +(defun pos-tip-x-display-height (&optional frame) + "Return maximum row number in tooltip which occupies the full height +of display. Omitting FRAME means use display that selected frame is in." + (1+ (/ (x-display-pixel-height frame) (frame-char-height frame)))) + +(defun pos-tip-tooltip-width (width char-width) + "Calculate tooltip pixel width." + (+ (* width char-width) + (ash (+ pos-tip-border-width + pos-tip-internal-border-width) + 1))) + +(defun pos-tip-tooltip-height (height char-height &optional frame) + "Calculate tooltip pixel height." + (let ((spacing (or (default-value 'line-spacing) + (frame-parameter frame 'line-spacing)))) + (+ (* height (+ char-height + (cond + ((integerp spacing) + spacing) + ((floatp spacing) + (truncate (* (frame-char-height frame) + spacing))) + (t 0)))) + (ash (+ pos-tip-border-width + pos-tip-internal-border-width) + 1)))) + +(defun pos-tip-show + (string &optional tip-color pos window timeout width frame-coordinates dx dy) + "Show STRING in a tooltip, which is a small X window, at POS in WINDOW +using frame's default font with TIP-COLOR. + +Return pixel position of tooltip relative to top left corner of frame as +a cons cell like (X . Y). + +TIP-COLOR is a face or a cons cell like (FOREGROUND-COLOR . BACKGROUND-COLOR) +used to specify *only* foreground-color and background-color of tooltip. If +omitted, use `pos-tip-foreground-color' and `pos-tip-background-color' or the +foreground and background color of the `tooltip' face instead. + +Omitting POS and WINDOW means use current position and selected window, +respectively. + +Automatically hide the tooltip after TIMEOUT seconds. Omitting TIMEOUT means +use the default timeout of 5 seconds. Non-positive TIMEOUT means don't hide +tooltip automatically. + +WIDTH, if non-nil, specifies the width of filling each paragraph. + +If FRAME-COORDINATES is omitted or nil, automatically obtain the absolute +coordinates of the top left corner of frame which WINDOW is on. Here, +`top left corner of frame' represents the origin of `window-pixel-edges' +and its coordinates are essential for calculating the absolute coordinates +of the tooltip. If a cons cell like (LEFT . TOP), specifies the frame +absolute location and makes the calculation slightly faster, but can be +used only when it's clear that frame is in the specified position. Users +can get the latest values of frame coordinates for using in the next call +by referring the variable `pos-tip-saved-frame-coordinates' just after +calling this function. Otherwise, FRAME-COORDINATES `relative' means use +the pixel coordinates relative to the top left corner of the frame for +displaying the tooltip. This is the same effect as +`pos-tip-use-relative-coordinates' is non-nil. + +DX specifies horizontal offset in pixel. + +DY specifies vertical offset in pixel. This makes the calculations done +without considering the height of object at POS, so the object might be +hidden by the tooltip. + +See also `pos-tip-show-no-propertize'." + (unless window + (setq window (selected-window))) + (let* ((frame (window-frame window)) + (max-width (pos-tip-x-display-width frame)) + (max-height (pos-tip-x-display-height frame)) + (w-h (pos-tip-string-width-height string)) + (fg (pos-tip-compute-foreground-color tip-color)) + (bg (pos-tip-compute-background-color tip-color)) + (frame-font (find-font (font-spec :name (frame-parameter frame 'font)))) + (tip-face-attrs (list :font frame-font :foreground fg :background bg))) + (cond + ((and width + (> (car w-h) width)) + (setq string (pos-tip-fill-string string width nil 'none nil max-height) + w-h (pos-tip-string-width-height string))) + ((or (> (car w-h) max-width) + (> (cdr w-h) max-height)) + (setq string (pos-tip-truncate-string string max-width max-height) + w-h (pos-tip-string-width-height string)))) + (pos-tip-show-no-propertize + (propertize string 'face tip-face-attrs) + tip-color pos window timeout + (pos-tip-tooltip-width (car w-h) (frame-char-width frame)) + (pos-tip-tooltip-height (cdr w-h) (frame-char-height frame) frame) + frame-coordinates dx dy))) + +(defalias 'pos-tip-hide 'x-hide-tip + "Hide pos-tip's tooltip.") + +(defun pos-tip-calibrate-frame-offset (&optional frame) + "Return coordinates of FRAME origin relative to the top left corner of +the FRAME extent, like (LEFT . TOP). The return value is recorded to +`pos-tip-frame-offset'. + +Note that this function doesn't correctly work for X frame and Emacs 22." + (setq pos-tip-frame-offset nil) + (let* ((window (frame-first-window frame)) + (delete-frame-functions + '((lambda (frame) + (if (equal (frame-parameter frame 'name) "tooltip") + (setq pos-tip-frame-offset + (cons (eval (frame-parameter frame 'left)) + (eval (frame-parameter frame 'top)))))))) + (pos-tip-border-width 0) + (pos-tip-internal-border-width 1) + (rpos (pos-tip-show "" + `(nil . ,(frame-parameter frame 'background-color)) + (window-start window) window + nil nil 'relative nil 0))) + (sit-for 0) + (pos-tip-hide) + (and pos-tip-frame-offset + (setq pos-tip-frame-offset + (cons (- (car pos-tip-frame-offset) + (car rpos) + (eval (frame-parameter frame 'left))) + (- (cdr pos-tip-frame-offset) + (cdr rpos) + (eval (frame-parameter frame 'top)))))))) + +(defun pos-tip-w32-max-width-height (&optional keep-maximize) + "Maximize the currently selected frame temporarily and set +`pos-tip-w32-saved-max-width-height' the effective display size in order +to become possible to calculate the absolute location of tooltip. + +KEEP-MAXIMIZE non-nil means leave the frame maximized. + +Note that this function is usable only in Emacs 23 for MS-Windows." + (interactive) + (unless (eq window-system 'w32) + (error "`pos-tip-w32-max-width-height' can be used only in w32 frame.")) + ;; Maximize frame + (with-no-warnings (w32-send-sys-command 61488)) + (sit-for 0) + (let ((offset (pos-tip-calibrate-frame-offset))) + (prog1 + (setq pos-tip-w32-saved-max-width-height + (cons (frame-pixel-width) + (+ (frame-pixel-height) + (- (cdr offset) (car offset))))) + (if (called-interactively-p 'interactive) + (message "%S" pos-tip-w32-saved-max-width-height)) + (unless keep-maximize + ;; Restore frame + (with-no-warnings (w32-send-sys-command 61728)))))) + + +(provide 'pos-tip) + +;;; +;;; pos-tip.el ends here diff --git a/elpa/pos-tip-20191227.1356/pos-tip.elc b/elpa/pos-tip-20191227.1356/pos-tip.elc new file mode 100644 index 0000000000000000000000000000000000000000..6c052bf8222bf228eaf73de9829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xFT042|{30wd50OdsoC^0>tZQ z9%1hB%_f0{*648zy=4thxO)<%Qw9DX{|k*xw7iLFDEsg!AiqzP8}p5o(lg6N;EEi@Z&d7 zIol>m7YLhH4j__$)pozSq;Z{sMG zTb#X^ds*6fN;!a(6ibyVfYwqP{PKUE)-KLK#be{IJty}CNO2DSeYQ>9P1WV7EGnBVvLwoH+ z7V_CIIkRY>h31eUGKp=<@dGjvxGxws(Tvf`g;9Uw3kz9Bn%!D%_r?%eF{SfeE)9SwR_`()!L3vJDBcHy+4^(x{Lz zP8ZcjWFObMzd93)W!(MF{{*vhQzuHXa{i*X+-b5>(F$aoup98EQ(TF`YhT?dGFP4O zs6TO?+5oBG@v7r-gpb;|B~rvgMrQC*BicI`g$W@n1*iH3xQ!f)K*JU@mh;rb5oe21 zYkpmlwYl{A9Cu8FQ8qYY(Z_X1=&2l~rk7nffqSUELQpmz zZZec*?0Pm0XUUB}fkQE3BH0(QKg7qeT;!*ho}#PSJ^K^^`Tb7Q8J{zfsa&US$JqWw zk{mIM%ssI%@NG?Fo{11Kv{p`^F-Ans!dfQQ{S)^R8J<7IZIIw!Gq*Ok`pn*~_!_>* zE(xO_BA?ujnjj8R+A-Kop&i0#a@pkzr9KBBIa<>@qAe#l61#Y@&DfYEl-B(}7ZeLm z&dVatJM)t5-1Wh9qZ#FQ+-faNayt&ueqe_~Ui)YoLG9M9i~*_{`(7Y(Rd#3uZ_%dI zFIKstEUv4?Iex@+;TizBK@Vs73-5^M8V=)qTmZ=%A{#+7yp") (point)))) - (unless (or (eq beg (point-max)) - (member (char-syntax (char-after beg)) '(?\" ?\( ?\)))) - (condition-case nil - (save-excursion - (goto-char beg) - (forward-sexp 1) - (let ((end (point))) - (and - (<= (+ beg 2) end) ;prefix at least 2 chars - (list beg - end - (completion-table-dynamic - #'racket--completion-candidates-for-prefix) - :predicate #'identity - ;; racket--get-type is too slow for :company-docsig - :company-doc-buffer #'racket--do-describe - :company-location #'racket--get-def-file+line)))) - (scan-error nil))))) - -(defun racket--get-def-file+line (sym) - "Return a value suitable for use as :company-location." - (pcase (racket--cmd/await `(def ,sym)) - (`(,path ,line ,_) (cons path line)) - (_ nil))) - -;;; "types" (i.e. TR types, contracts, and/or function signatures) - -(defvar-local racket--type-cache (make-hash-table :test #'eq) - "Memoize \",type\" commands in Racket REPL. - -This var is local to each buffer, including the REPL buffer. - -`racket-run' should call `racket-invalidate-type-cache'.") - -(defun racket--invalidate-type-cache () - "Both current `racket-mode' buffer and `racket-repl-mode' buffer (if any)." - (setq racket--type-cache (make-hash-table :test #'eq)) - (with-racket-repl-buffer - (setq racket--type-cache (make-hash-table :test #'eq)))) - -(add-hook 'racket--repl-before-run-hook #'racket--invalidate-type-cache) - -(defun racket--get-type (str) - (let* ((sym (intern str)) - (v (gethash sym racket--type-cache))) - (or v - (and (racket--in-repl-or-its-file-p) - (let ((v (racket--cmd/await `(type ,str)))) - (puthash sym v racket--type-cache) v))))) - -;;; at-point - -(defun racket--symbol-at-point-or-prompt (force-prompt-p prompt) - "Helper for functions that want symbol-at-point, or, to prompt -when there is no symbol-at-point or FORCE-PROMPT-P is true. The -prompt uses `read-from-minibuffer'. Returns `stringp' not -`symbolp' to simplify using the result in a sexpr that can be -passed to Racket backend. Likewise text properties are stripped." - (let ((sap (racket--thing-at-point 'symbol t))) - (if (or force-prompt-p (not sap)) - (let ((s (read-from-minibuffer prompt sap))) - (if (equal "" (racket--trim s)) - nil - s)) - sap))) - -;;; eldoc - -(defun racket-eldoc-function () - "A value suitable for the variable `eldoc-documentation-function'. - -By default Racket Mode sets `eldoc-documentation-function' to nil --- no `eldoc-mode' support. You may set it to this function in a -`racket-mode-hook' if you really want to use `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: - -- Many Racket functions are defined in #%kernel. There's no easy - way to determine their argument lists. Most are not provided - with a contract. - -- Many of the interesting Racket forms are syntax (macros) not - functions. There's no easy way to determine their \"argument - lists\". - -A more satisfying experience is to use `racket-describe' or -`racket-doc'." - (and (racket--repl-live-p) - (> (point) (point-min)) - (save-excursion - (condition-case nil - ;; The char-before and looking-at checks below are to - ;; avoid calling `racket--get-type' when the sexp is - ;; quoted or when its first elem couldn't be a Racket - ;; function name. - (let* ((beg (progn - (backward-up-list) - (and (not (memq (char-before) '(?` ?' ?,))) - (progn (forward-char 1) (point))))) - (beg (and beg (looking-at "[^0-9#'`,\"]") beg)) - (end (and beg (progn (forward-sexp) (point)))) - (end (and end - (char-after (point)) - (eq ?\s (char-syntax (char-after (point)))) - end)) - (sym (and beg end (buffer-substring-no-properties beg end))) - (str (and sym (racket--get-type sym)))) - str) - (scan-error nil))))) - -;;; describe - -(defun racket-describe (&optional prefix) -"Describe the identifier at point in a `*Racket Describe*` buffer. - -The intent is to give a quick reminder or introduction to -something, regardless of whether it has installed documentation --- and to do so within Emacs, without switching to a web browser. - -This buffer is also displayed when you use `company-mode' and -press F1 or C-h in its pop up completion list. - -- If the identifier has installed Racket documentation, then a - simplified version of the HTML is presented in the buffer, - including the \"blue box\", documentation prose, and examples. - -- Otherwise, if the identifier is a function, then its signature - is displayed, for example `(name arg-1-name arg-2-name)`. If it - has a contract or a Typed Racket type, that is also displayed. - -You can quit the buffer by pressing q. Also, at the bottom of the -buffer are Emacs buttons -- which you may navigate among using -TAB, and activate using RET -- for `racket-visit-definition' and -`racket-doc'." - (interactive "P") - (pcase (racket--symbol-at-point-or-prompt prefix "Describe: ") - (`nil nil) - (str (racket--do-describe str t)))) - -(defun racket--do-describe (str &optional display-and-pop-to-p) - "A helper used by both `racket-describe' and `company-mode'. - -DISPLAY-AND-POP-TO-P should be t for use by `racket-describe' -- -in which case some buttons are added and the buffer is displayed --- and nil for use by `company-mode'. - -Returns the buffer in which the description was written." - ;; Work around what seems to be a bug with `shr-insert-document' -- - ;; elements are out of order when an existing Racket Describe buffer - ;; hasn't had a `quit-window' -- by re-creating the buffer. - (with-current-buffer (racket--get-buffer-recreate "*Racket Describe*") - (let* ((html (racket--cmd/await `(describe ,str))) - ;; Because shr removes leading   from elements -- - ;; which messes up the indentation of s-expressions - ;; including contracts -- replace   with `spc' in the - ;; source HTML. Below we'll replace `spc' with " " in the - ;; result of `shr-insert-document'. - (spc (string #x2020)) ;unlikely character (hopefully) - (dom (with-temp-buffer - (insert html) - (goto-char (point-min)) - (while (re-search-forward " " nil t) - (replace-match spc t t)) - (libxml-parse-html-region (point-min) (point-max))))) - (racket-describe-mode) - (read-only-mode -1) - (let ((shr-use-fonts nil)) - (shr-insert-document dom)) - (goto-char (point-min)) - (while (re-search-forward spc nil t) - (replace-match " " t t)) - (when display-and-pop-to-p - (goto-char (point-max)) - (insert "\n") - (insert-text-button "Definition" - 'follow-link t - 'action - (lambda (_btn) - (racket--do-visit-def-or-mod 'def str))) - (insert " ") - (insert-text-button "Documentation in Browser" - 'follow-link t - 'action - (lambda (_btn) - (racket--cmd/await `(doc ,str)))) - (insert " [q]uit")) - (read-only-mode 1) - (goto-char (point-min)) - (when display-and-pop-to-p - (display-buffer (current-buffer) t) - (pop-to-buffer (current-buffer)) - (message "Type TAB to move to links, 'q' to restore previous window")) - (current-buffer)))) - -(defvar racket-describe-mode-map - (let ((m (make-sparse-keymap))) - (set-keymap-parent m special-mode-map) - (mapc (lambda (x) - (define-key m (kbd (car x)) (cadr x))) - '(("" racket-describe--next-button) - ("S-" racket-describe--prev-button))) - m) - "Keymap for Racket Describe mode.") - -(define-derived-mode racket-describe-mode special-mode - "RacketDescribe" - "Major mode for describing Racket functions. -\\{racket-describe-mode-map}" - (setq show-trailing-whitespace nil)) - -(defun racket-describe--next-button () - (interactive) - (forward-button 1 t t)) - -(defun racket-describe--prev-button () - (interactive) - (forward-button -1 t t)) - - -(provide 'racket-complete) - -;; racket-complete.el ends here diff --git a/elpa/racket-mode-20200218.1623/racket-complete.elc b/elpa/racket-mode-20200218.1623/racket-complete.elc deleted file mode 100644 index 7bfb1b5442990b04b66c54d01045ab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vBD zZ}Y@?TSK0ZRpvITxA)5o@quf;-@p=TUwo{JUA|0!kHm)xtHS5b-0!d_NgI`#Z?yS)F$p>{(I^^@7D_}{4x8`cFlEfDu)exe>X+z(0F7bPH;AIk--X({W=_`2iC z&<+otL(3!lr4#M03@sj{`>1TlVONHR%7CsASV35f;eJ?7glBf5qgsE#VNB$8s)?`! zasoqatS!FUBw!~P4rwr^I<~O|C0rit2Bn-Kb{eI#g=*F??g_29jCD}}9Gnx(vt zcBq{=m=41LnFIGv+YiviDW)@ioCTwQm(r}vwC!%U+ZF&#?bNKGc_Mep+|?tW6>n$ z{E&uF7e#Uq<>>QgZ9aP6RA5rN@eIEd|0OXs({WMd`; z>mmhvfLuP(vc~(aX3i^vsgttGaOk6qV>Pj}Xq63h${@p4$hCAO-ue5J)Ck@GY7zuL SH)pX`kLu%7n*r7B#{U5KQWAjx diff --git a/elpa/racket-mode-20200218.1623/racket-custom.elc b/elpa/racket-mode-20200218.1623/racket-custom.elc deleted file mode 100644 index 2a8b028cc1555446920581d7a8359999886f9ab1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14607 zcmdU$+jrYWdcgfw$NSQKYJ2)J3wJ{*N6`I}C^?(Rk{r8{H?HKYn}*&JB!?s_5a0r! zBxcY4W&1zu-_+mt%>cZJiWR5(P@f|Sz|1%E-ETAg{OtVXpB_DW^yKr;KQ|}YXdEZD zr!R48&PGwUFxNIO;w&{g2OGOOaub(B6D5hs#$`N;e~e0oi;X8b_+}Uvrq3#-o26wG zr-hl6{qR$hW@&hQdGhk5=?Xt0Kt{_p`Geu^)QJQ9@=~$CwQP1{FoR*o#VQ0r= zxv^26#5Uh}(iD(pC!3_bv1wRAGxTV#Ju&jH`Gsjlx$T>ULDSq0O*66S016gH*4Ea{ zm&X-wQRZD^@~R`U!V8% znU#5W6Lg7>js^DDOy2wLqfZ!>ef=&wd(|#{+}Y;`6!hcPVPJk3=h@hVVJ}PKq6|@& zBn(Y%|1^nnYw}yu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^Xx^l}Muq2eu!Bl54>G4;eagw_K(WA%5@*o#nZr_>hckj&ZJLB2i*ZS8VmzwAD zMu$NDFmuPYy4JW1 z^iHnm)R2CZ+@O0!jFfCxTwW;1n+kU2D61^hrSFFk4_BJz5pLH?6^n}qp3!l*;zUPU z4%N3y8-1Nyn{M;{#*&zD6){VC>gJydW|iYvz|6TH>{T-w$!AD+0fnBr11m??a*^yr z2sW24)|_%TQI=)U)z%f^LQ(NPcCq14u&WyVIqa%n9?GuQQDSR;(WoKwk8#;?_X8Ow zEW|ulaOyjZ_-Ap-Cv9Pr5A=X$ky9&2;nd>AG;R*ve}k;PPRT5}DdcXt_=}G96&*}& zTP_$Ka7A`1&3rT9~`acq+fL#AtydQs{|~ME1EZfU5@Gy$Px_pI`8x zeUq6qE)W^1yotU!Gpk9;b}RMT;Tlf%F)%u5PoaW-@Yzo)_}* z(lv*EmchGx%4f8TMBN>F4_S8smI>>V(n^_m#fEz2*6nz-+6fYN>d4{Ob}@q}I!kP8 z&v&7@qB);WQhuI%{U(|ndQ zy5FPbXL>#0LrmV6Ju4}lAA1u3I?WZ$|H`-5aFRoqH~>w$++TTfpm zb>`q)#L>+jK)5XUlT^Qy2_GV6E%jE?JR5l!(X;vYQ?2z43GGAac7^CqDfp>W>pzcj zhiE6a(bXd1%LDJBdwF_A_FOW_S+}H&3u&NF-5j(FSc;2rmqN32*_2O}#AkxK ZK3^!e7WwRnkou#jkM8_ON3<3Q{|iu>AbS7+ diff --git a/elpa/racket-mode-20200218.1623/racket-edit.el b/elpa/racket-mode-20200218.1623/racket-edit.el deleted file mode 100644 index efb366b5..00000000 --- a/elpa/racket-mode-20200218.1623/racket-edit.el +++ /dev/null @@ -1,891 +0,0 @@ -;;; racket-edit.el -*- lexical-binding: t -*- - -;; Copyright (c) 2013-2018 by Greg Hendershott. -;; Portions Copyright (C) 1985-1986, 1999-2013 Free Software Foundation, Inc. - -;; Author: Greg Hendershott -;; URL: https://github.com/greghendershott/racket-mode - -;; License: -;; This is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. This is distributed in the hope that it will be -;; useful, but without any warranty; without even the implied warranty -;; of merchantability or fitness for a particular purpose. See the GNU -;; General Public License for more details. See -;; http://www.gnu.org/licenses/ for details. - -;; racket-mode per se, i.e. the .rkt file buffers - -(require 'cl-lib) -(require 'cl-macs) -(require 'racket-custom) -(require 'racket-common) -(require 'racket-complete) -(require 'racket-util) -(require 'hideshow) -(require 'tooltip) - -(defun racket-run (&optional prefix) - "Save and evaluate the buffer in REPL. - -With one C-u prefix, uses errortrace for improved stack traces. -Otherwise follows the `racket-error-context' setting. - -With two C-u prefixes, instruments code for step debugging. See -`racket-debug-mode' and the variable `racket-debuggable-files'. - -If point is within a Racket module form, the REPL \"enters\" that -submodule (uses its language info and namespace). - -When you run again, the file is evaluated from scratch --- the -custodian releases resources like threads and the evaluation -environment is reset to the contents of the file. In other words, -like DrRacket, this provides the predictability of a \"static\" -baseline, plus the ability to explore interactively using the -REPL. - -See also `racket-run-and-switch-to-repl', which is even more like -DrRacket's Run because it selects the REPL window (gives it the -focus), too. - -When `racket-retry-as-skeleton' is true, if your source file has -an error, a \"skeleton\" of your file is evaluated to get -identifiers from module languages, require forms, and -definitions. That way, things like completion and -`racket-describe' are more likely to work while you edit the file -to fix the error. If not even the \"skeleton\" evaluation -succeeds, you'll have only identifiers provided by racket/base, -until you fix the error and run again. - -Output in the Racket REPL buffer that describes a file and -position is automatically \"linkified\". Examples of such text -include: - -- Racket error messages. -- rackunit test failure location messages. -- print representation of path objects. - -To visit these locations, move point there and press RET or mouse -click. Or, use the standard `next-error' and `previous-error' -commands." - (interactive "P") - (racket--repl-run (racket--what-to-run) - (pcase prefix - (`(4) 'high) - (`(16) 'debug) - (_ racket-error-context)))) - -(defun racket-run-with-errortrace () - "Run with `racket-error-context' temporarily set to \"high\". -This is just `racket-run' with a C-u prefix. Defined as a function so -it can be a menu target." - (interactive) - (racket-run '(4))) - -(defun racket-run-with-debugging () - "Run with `racket-error-context' temporarily set to 'debug. -This is just `racket-run' with a double C-u prefix. Defined as a -function so it can be a menu target." - (interactive) - (racket-run '(16))) - -(defun racket-run-and-switch-to-repl (&optional prefix) - "This is `racket-run' followed by `racket-repl'." - (interactive "P") - (racket-run prefix) - (racket-repl)) - -(defun racket-racket () - "Do \"racket \" in a shell buffer." - (interactive) - (racket--shell (concat (shell-quote-argument racket-program) - " " - (shell-quote-argument (racket--buffer-file-name))))) - -(defun racket-test (&optional coverage) - "Run the \"test\" submodule. - -With prefix, runs with coverage instrumentation and highlights -uncovered code. - -Put your tests in a \"test\" submodule. For example: - -#+BEGIN_SRC racket - (module+ test - (require rackunit) - (check-true #t)) -#+END_SRC - -Any rackunit test failure messages show the location. You may use -`next-error' to jump to the location of each failing test. - -See also: -- `racket-fold-all-tests' -- `racket-unfold-all-tests' -" - (interactive "P") - (let ((mod-path (list 'submod (racket--buffer-file-name) 'test)) - (buf (current-buffer))) - (if (not coverage) - (racket--repl-run mod-path) - (message "Running test submodule with coverage instrumentation...") - (racket--repl-run - mod-path - 'coverage - (lambda (_n/a) - (message "Getting coverage results...") - (racket--cmd/async - `(get-uncovered) - (lambda (xs) - (pcase xs - (`() (message "Full coverage.")) - ((and xs `((,beg0 . ,_) . ,_)) - (message "Missing coverage in %s place(s)." (length xs)) - (with-current-buffer buf - (dolist (x xs) - (let ((o (make-overlay (car x) (cdr x) buf))) - (overlay-put o 'name 'racket-uncovered-overlay) - (overlay-put o 'priority 100) - (overlay-put o 'face font-lock-warning-face))) - (goto-char beg0))))))))))) - -(add-hook 'racket--repl-before-run-hook #'racket--remove-coverage-overlays) - -(defun racket--remove-coverage-overlays () - (remove-overlays (point-min) (point-max) 'name 'racket-uncovered-overlay)) - -(defun racket-raco-test () - "Do \"raco test -x \" in a shell buffer to run the \"test\" submodule." - (interactive) - (racket--shell (concat (shell-quote-argument racket-program) - " -l raco test -x " - (shell-quote-argument (racket--buffer-file-name))))) - -(defun racket--shell (cmd) - (racket--save-if-changed) - (let ((w (selected-window))) - (pcase (get-buffer-window "*shell*" t) - (`() (other-window -1)) - (win (select-window win))) - (with-temp-message cmd - (shell) - (pop-to-buffer-same-window "*shell*") - (comint-send-string "*shell*" (concat cmd "\n")) - (select-window w) - (sit-for 3)))) - -;;; visiting defs and mods - -(defun racket-visit-definition (&optional prefix) - "Visit definition of identifier at point. - -If there is no identifier at point, prompt for it. - -With a prefix, always prompt for the identifier. - -Use `racket-unvisit' to return. - -Please keep in mind the following limitations: - -- Only finds symbols defined in the current namespace. You may - need to `racket-run' the current buffer, first. - -- Only visits the definition of module-level identifiers -- - things for which Racket's \"identifier-binding\" function - returns information. This does NOT include things such as - local (nested) function definitions or \"racket/class\" member - functions. To find those in the same file, you'll need to use a - normal Emacs text search function like `isearch-forward'. - -- If the definition is found in Racket's \"#%kernel\" module, it - will tell you so but won't visit the definition site." - (interactive "P") - (pcase (racket--symbol-at-point-or-prompt prefix "Visit definition of: ") - (`nil nil) - (str (racket--visit-symbol-definition str)))) - -(defun racket-lispy-visit-symbol-definition (str) - "Function called by lispy.el's `lispy-goto-symbol' for Racket -symbol definition lookup." - (racket--visit-symbol-definition str)) - -(defun racket--visit-symbol-definition (str) - (if (and (eq major-mode 'racket-mode) - (not (equal (racket--repl-file-name+md5) - (cons (racket--buffer-file-name t) (md5 (current-buffer))))) - (y-or-n-p "Run current buffer first? ")) - (racket--repl-run nil nil - (lambda (_n/a) - (racket--do-visit-def-or-mod 'def str))) - (racket--do-visit-def-or-mod 'def str))) - -(defun racket-visit-module (&optional prefix) - "Visit definition of module at point, e.g. net/url or \"file.rkt\". - -If there is no module at point, prompt for it. - -With a prefix, always prompt for the module. - -Use `racket-unvisit' to return. - -See also: `racket-find-collection'." - (interactive "P") - (let* ((v (racket--module-at-point)) - (v (if (or prefix (not v)) - (read-from-minibuffer "Visit module: " (or v "")) - v))) - ;; If the module name is quoted e.g. "file.rkt", just do - ;; equivalent of `find-file-at-point'. Else ask back-end. - (cond ((and (equal "\"" (substring v 0 1)) - (equal "\"" (substring v -1 nil))) - (racket--push-loc) - (find-file (expand-file-name (substring v 1 -1))) - (message "Type M-, to return")) - (t (racket--do-visit-def-or-mod 'mod v))))) - -(defun racket--module-at-point () - "Treat point as a Racket module path name, possibly in a multi-in form." - ;; `thing-at-point' 'filename matches both net/url and "file.rkt". - ;; But. 1. Returns both without the quotes; use `syntax-ppss' to - ;; detect latter (string). 2. Returns nil if on the opening quote; - ;; use `forward-char' then. - (save-excursion - (when (eq ?\" (char-syntax (char-after))) ;2 - (forward-char)) - (pcase (racket--thing-at-point 'filename t) - (`() `()) - (v - (let* ((ppss (syntax-ppss)) - (relative-p (and (racket--ppss-string-p ppss) t)) ;1 - (multi-in (condition-case () - (progn - (when relative-p - (goto-char (racket--ppss-string/comment-start ppss))) - (backward-up-list 1) - (backward-sexp 2) - (when (looking-at-p "multi-in") - (forward-sexp 2) - (backward-sexp 1) - (when (eq ?\" (char-syntax (char-after))) ;2 - (forward-char)) - (unless (eq relative-p - (and (racket--ppss-string-p ppss) t)) ;1 - (user-error "multi-in mixes absolute and relative paths")) - (racket--thing-at-point 'filename t))) - (scan-error nil)))) - (concat (if relative-p "\"" "") ;1 - (if multi-in - (concat multi-in "/") - "") - v - (if relative-p "\"" ""))))))) ;1 - -(defun racket--do-visit-def-or-mod (cmd str) - "CMD must be 'def or 'mod. STR must be stringp." - (unless (memq major-mode '(racket-mode racket-repl-mode racket-describe-mode)) - (user-error "That doesn't work in %s" major-mode)) - (pcase (racket--cmd/await (list cmd str)) - (`(,path ,line ,col) - (racket--push-loc) - (find-file (funcall racket-path-from-racket-to-emacs-function path)) - (goto-char (point-min)) - (forward-line (1- line)) - (forward-char col) - (message "Type M-, to return")) - (`kernel - (message "`%s' defined in #%%kernel -- source not available." str)) - (_ - (message "Not found.")))) - -(defvar racket--loc-stack '()) - -(defun racket--push-loc () - (push (cons (current-buffer) (point)) - racket--loc-stack)) - -(defun racket-unvisit () - "Return from previous `racket-visit-definition' or `racket-visit-module'." - (interactive) - (if racket--loc-stack - (pcase (pop racket--loc-stack) - (`(,buffer . ,pt) - (pop-to-buffer-same-window buffer) - (goto-char pt))) - (message "Stack empty."))) - -(defun racket-doc (&optional prefix) - "View documentation of the identifier or string at point. - -Uses the default external web browser. - -If point is an identifier required in the current namespace that -has help, opens the web browser directly at that help -topic. (i.e. Uses the identifier variant of racket/help.) - -Otherwise, opens the 'search for a term' page, where you can -choose among multiple possibilities. (i.e. Uses the string -variant of racket/help.) - -With a C-u prefix, prompts for the identifier or quoted string, -instead of looking at point." - (interactive "P") - (pcase (racket--symbol-at-point-or-prompt prefix "Racket help for: ") - (`nil nil) - (str (racket--cmd/async `(doc ,str))))) - -;;; code folding - -;;;###autoload -(add-to-list 'hs-special-modes-alist - '(racket-mode "(" ")" ";" nil nil)) - -(defun racket--for-all-tests (verb f) - (save-excursion - (goto-char (point-min)) - (let ((n 0)) - (while (re-search-forward "^(module[+*]? test" (point-max) t) - (funcall f) - (cl-incf n) - (goto-char (match-end 0))) - (message "%s %d test submodules" verb n)))) - -(defun racket-fold-all-tests () - "Fold (hide) all test submodules." - (interactive) - (racket--for-all-tests "Folded" 'hs-hide-block)) - -(defun racket-unfold-all-tests () - "Unfold (show) all test submodules." - (interactive) - (racket--for-all-tests "Unfolded" 'hs-show-block)) - -;;; requires - -(defun racket-tidy-requires () - "Make a single top-level \"require\" form, modules sorted, one per line. - -All top-level require forms are combined into a single form. -Within that form: - -- A single subform is used for each phase level, sorted in this - order: for-syntax, for-template, for-label, for-meta, and - plain (phase 0). - - - Within each level subform, the modules are sorted: - - - Collection path modules -- sorted alphabetically. - - - Subforms such as only-in. - - - Quoted relative requires -- sorted alphabetically. - -At most one module is listed per line. - -Note: This only works for requires at the top level of a source -file using #lang. It does NOT work for require forms inside -module forms. - -See also: `racket-trim-requires' and `racket-base-requires'." - (interactive) - (unless (eq major-mode 'racket-mode) - (user-error "Current buffer is not a racket-mode buffer")) - (pcase (racket--top-level-requires 'find) - (`nil (user-error "The file module has no requires; nothing to do")) - (reqs (pcase (racket--cmd/await `(requires/tidy ,reqs)) - ("" nil) - (new (goto-char (racket--top-level-requires 'kill)) - (insert (concat new "\n"))))))) - -(defun racket-trim-requires () - "Like `racket-tidy-requires' but also deletes unnecessary requires. - -Note: This only works when the source file can be evaluated with -no errors. - -Note: This only works for requires at the top level of a source -file using #lang. It does NOT work for require forms inside -module forms. Furthermore, it is not smart about module+ or -module* forms -- it might delete top level requires that are -actually needed by such submodules. - -See also: `racket-base-requires'." - (interactive) - (unless (eq major-mode 'racket-mode) - (user-error "Current buffer is not a racket-mode buffer")) - (when (racket--ok-with-module+*) - (racket--save-if-changed) - (pcase (racket--top-level-requires 'find) - (`nil (user-error "The file module has no requires; nothing to do")) - (reqs (pcase (racket--cmd/await `(requires/trim - ,(racket--buffer-file-name) - ,reqs)) - (`nil (user-error "Syntax error in source file")) - ("" (goto-char (racket--top-level-requires 'kill))) - (new (goto-char (racket--top-level-requires 'kill)) - (insert (concat new "\n")))))))) - -(defun racket-base-requires () - "Change from \"#lang racket\" to \"#lang racket/base\". - -Adds explicit requires for imports that are provided by -\"racket\" but not by \"racket/base\". - -This is a recommended optimization for Racket applications. -Avoiding loading all of \"racket\" can reduce load time and -memory footprint. - -Also, as does `racket-trim-requires', this removes unneeded -modules and tidies everything into a single, sorted require form. - -Note: This only works when the source file can be evaluated with -no errors. - -Note: This only works for requires at the top level of a source -file using #lang. It does NOT work for require forms inside -module forms. Furthermore, it is not smart about module+ or -module* forms -- it might delete top level requires that are -actually needed by such submodules. - -Note: Currently this only helps change \"#lang racket\" to -\"#lang racket/base\". It does not help with other similar -conversions, such as changing \"#lang typed/racket\" to \"#lang -typed/racket/base\"." - (interactive) - (unless (eq major-mode 'racket-mode) - (user-error "Current buffer is not a racket-mode buffer")) - (when (racket--buffer-start-re "^#lang.*? racket/base$") - (user-error "Already using #lang racket/base. Nothing to change.")) - (unless (racket--buffer-start-re "^#lang.*? racket$") - (user-error "File does not use use #lang racket. Cannot change.")) - (when (racket--ok-with-module+*) - (racket--save-if-changed) - (let ((reqs (racket--top-level-requires 'find))) - (pcase (racket--cmd/await `(requires/base - ,(racket--buffer-file-name) - ,reqs)) - (`nil (user-error "Syntax error in source file")) - (new (goto-char (point-min)) - (re-search-forward "^#lang.*? racket$") - (insert "/base") - (goto-char (or (racket--top-level-requires 'kill) - (progn (insert "\n\n") (point)))) - (unless (string= "" new) - (insert (concat new "\n")))))))) - -(defun racket--ok-with-module+* () - (save-excursion - (goto-char (point-min)) - (or (not (re-search-forward (rx ?\( "module" (or "+" "*")) nil t)) - (prog1 - (y-or-n-p "Analysis will be unreliable due to module+ or module* forms -- proceed anyway? ") - (message ""))))) - -(defun racket--buffer-start-re (re) - (save-excursion - (ignore-errors - (goto-char (point-min)) - (re-search-forward re) - t))) - -(defun racket--top-level-requires (what) - "Identify all top-level requires and do WHAT. - -When WHAT is 'find, returns the top-level require forms. - -When WHAT is 'kill, kill the top-level requires, returning the -location of the first one." - (save-excursion - (goto-char (point-min)) - (let ((first-beg nil) - (requires nil)) - (while (re-search-forward "^(require " nil t) - (let* ((beg (progn (up-list -1) (point))) - (end (progn (forward-sexp) (point))) - (str (buffer-substring-no-properties beg end)) - (sexpr (read str))) - (unless first-beg (setq first-beg beg)) - (setq requires (cons sexpr requires)) - (when (eq 'kill what) - (kill-sexp -1) - (delete-blank-lines)))) - (if (eq 'kill what) first-beg requires)))) - -;;; racket-check-syntax - -(defvar racket--highlight-overlays nil) - -(defun racket--highlight (beg end defp) - ;; Unless one of our highlight overlays already exists there... - (let ((os (overlays-at beg))) - (unless (cl-some (lambda (o) (member o racket--highlight-overlays)) os) - (let ((o (make-overlay beg end))) - (setq racket--highlight-overlays (cons o racket--highlight-overlays)) - (overlay-put o 'name 'racket-check-syntax-overlay) - (overlay-put o 'priority 100) - (overlay-put o 'face (if defp - racket-check-syntax-def-face - racket-check-syntax-use-face)))))) - -(defun racket--unhighlight-all () - (while racket--highlight-overlays - (delete-overlay (car racket--highlight-overlays)) - (setq racket--highlight-overlays (cdr racket--highlight-overlays)))) - -(defun racket--non-empty-string-p (v) - (and (stringp v) - (not (string-match-p "\\`[ \t\n\r]*\\'" v)))) ;`string-blank-p' - -(defun racket--point-entered (_old new) - (pcase (get-text-property new 'help-echo) - ((and s (pred racket--non-empty-string-p)) - (if (and (boundp 'tooltip-mode) - tooltip-mode - (fboundp 'window-absolute-pixel-position)) - (pcase (window-absolute-pixel-position new) - (`(,left . ,top) - (let ((tooltip-frame-parameters `((left . ,left) - (top . ,top) - ,@tooltip-frame-parameters))) - (tooltip-show s)))) - (message "%s" s)))) - (pcase (get-text-property new 'racket-check-syntax-def) - ((and uses `((,beg ,_end) . ,_)) - (pcase (get-text-property beg 'racket-check-syntax-use) - (`(,beg ,end) (racket--highlight beg end t))) - (dolist (use uses) - (pcase use (`(,beg ,end) (racket--highlight beg end nil)))))) - (pcase (get-text-property new 'racket-check-syntax-use) - (`(,beg ,end) - (racket--highlight beg end t) - (dolist (use (get-text-property beg 'racket-check-syntax-def)) - (pcase use (`(,beg ,end) (racket--highlight beg end nil))))))) - -(defun racket--point-left (_old _new) - (racket--unhighlight-all)) - -(defun racket-check-syntax-mode-quit () - (interactive) - (racket-check-syntax-mode -1)) - -(defun racket-check-syntax-mode-goto-def () - "When point is on a use, go to its definition." - (interactive) - (pcase (get-text-property (point) 'racket-check-syntax-use) - (`(,beg ,_end) (goto-char beg)))) - -(defun racket-check-syntax-mode-forward-use (amt) - "When point is on a use, go AMT uses forward. AMT may be negative. - -Moving before/after the first/last use wraps around. - -If point is instead on a definition, then go to its first use." - (pcase (get-text-property (point) 'racket-check-syntax-use) - (`(,beg ,_end) - (pcase (get-text-property beg 'racket-check-syntax-def) - (uses (let* ((pt (point)) - (ix-this (cl-loop for ix from 0 to (1- (length uses)) - for use = (nth ix uses) - when (and (<= (car use) pt) (< pt (cadr use))) - return ix)) - (ix-next (+ ix-this amt)) - (ix-next (if (> amt 0) - (if (>= ix-next (length uses)) 0 ix-next) - (if (< ix-next 0) (1- (length uses)) ix-next))) - (next (nth ix-next uses))) - (goto-char (car next)))))) - (_ (pcase (get-text-property (point) 'racket-check-syntax-def) - (`((,beg ,_end) . ,_) (goto-char beg)))))) - -(defun racket-check-syntax-mode-goto-next-use () - "When point is on a use, go to the next (sibling) use." - (interactive) - (racket-check-syntax-mode-forward-use 1)) - -(defun racket-check-syntax-mode-goto-prev-use () - "When point is on a use, go to the previous (sibling) use." - (interactive) - (racket-check-syntax-mode-forward-use -1)) - -(defun racket-check-syntax-mode-help () - (interactive) - (describe-function #'racket-check-syntax-mode)) - -(defun racket-check-syntax-mode-rename () - (interactive) - ;; If we're on a def, get its uses. If we're on a use, get its def. - (let* ((pt (point)) - (uses (get-text-property pt 'racket-check-syntax-def)) - (def (get-text-property pt 'racket-check-syntax-use))) - ;; If we got one, get the other. - (when (or uses def) - (let* ((uses (or uses (get-text-property (car def) 'racket-check-syntax-def))) - (def (or def (get-text-property (caar uses) 'racket-check-syntax-use))) - (locs (cons def uses)) - (strs (mapcar (lambda (loc) - (apply #'buffer-substring-no-properties loc)) - locs))) - ;; Proceed only if all the strings are the same. (They won't - ;; be for e.g. import bindings.) - (when (cl-every (lambda (s) (equal (car strs) s)) - (cdr strs)) - (let ((new (read-from-minibuffer (format "Rename %s to: " (car strs)))) - (marker-pairs - (mapcar (lambda (loc) - (let ((beg (make-marker)) - (end (make-marker))) - (set-marker beg (nth 0 loc) (current-buffer)) - (set-marker end (nth 1 loc) (current-buffer)) - (list beg end))) - locs)) - (point-marker (let ((m (make-marker))) - (set-marker m (point) (current-buffer))))) - (racket-check-syntax-mode -1) - (dolist (marker-pair marker-pairs) - (let ((beg (marker-position (nth 0 marker-pair))) - (end (marker-position (nth 1 marker-pair)))) - (delete-region beg end) - (goto-char beg) - (insert new))) - (goto-char (marker-position point-marker)) - (racket-check-syntax-mode 1))))))) - -(defun racket-check-syntax-mode-goto-next-def () - (interactive) - (let ((pos (next-single-property-change (point) 'racket-check-syntax-def))) - (when pos - (unless (get-text-property pos 'racket-check-syntax-def) - (setq pos (next-single-property-change pos 'racket-check-syntax-def))) - (and pos (goto-char pos))))) - -(defun racket-check-syntax-mode-goto-prev-def () - (interactive) - (let ((pos (previous-single-property-change (point) 'racket-check-syntax-def))) - (when pos - (unless (get-text-property pos 'racket-check-syntax-def) - (setq pos (previous-single-property-change pos 'racket-check-syntax-def))) - (and pos (goto-char pos))))) - -(define-minor-mode racket-check-syntax-mode - "Analyze the buffer and annotate with information. - -The buffer becomes read-only until you exit this minor mode. -However you may navigate the usual ways. When point is on a -definition or use, related items are highlighted and -information is displayed in the echo area. You may also use -special commands to navigate among the definition and its uses. - -\\{racket-check-syntax-mode-map} -" - :lighter " CheckSyntax" - :keymap (racket--easy-keymap-define - '(("q" racket-check-syntax-mode-quit) - ("h" racket-check-syntax-mode-help) - (("j" "TAB") racket-check-syntax-mode-goto-next-def) - (("k" "") racket-check-syntax-mode-goto-prev-def) - ("." racket-check-syntax-mode-goto-def) - ("n" racket-check-syntax-mode-goto-next-use) - ("p" racket-check-syntax-mode-goto-prev-use) - ("r" racket-check-syntax-mode-rename))) - (unless (eq major-mode 'racket-mode) - (setq racket-check-syntax-mode nil) - (user-error "racket-check-syntax-mode only works with Racket Mode buffers")) - (racket--check-syntax-stop) - (when racket-check-syntax-mode - (racket--check-syntax-start))) - -(defun racket--check-syntax-start () - (let ((buf (current-buffer))) - (racket--save-if-changed) - (message "Running check-syntax analysis...") - (racket--cmd/async-raw - `(check-syntax ,(racket--buffer-file-name)) - (lambda (response) - (with-current-buffer buf - (pcase response - (`(error ,m) - (racket-check-syntax-mode -1) - (error m)) - (`(ok ()) - (racket-check-syntax-mode -1) - (user-error "No bindings found")) - (`(ok ,xs) - (message "Marking up buffer...") - (racket--check-syntax-insert xs) - (message "")))))))) - -(defun racket--check-syntax-insert (xs) - (with-silent-modifications - (dolist (x xs) - (pcase x - (`(,`info ,beg ,end ,str) - (put-text-property beg end 'help-echo str)) - (`(,`def/uses ,def-beg ,def-end ,uses) - (add-text-properties def-beg - def-end - (list 'racket-check-syntax-def uses - 'point-entered #'racket--point-entered - 'point-left #'racket--point-left)) - (dolist (use uses) - (pcase-let* ((`(,use-beg ,use-end) use)) - (add-text-properties use-beg - use-end - (list 'racket-check-syntax-use (list def-beg - def-end) - 'point-entered #'racket--point-entered - 'point-left #'racket--point-left))))))) - (setq buffer-read-only t) - (setq header-line-format - "Check Syntax. Buffer is read-only. Press h for help, q to quit.") - ;; Make 'point-entered and 'point-left work in Emacs 25+. Note - ;; that this is somewhat of a hack -- I spent a lot of time trying - ;; to Do the Right Thing using the new cursor-sensor-mode, but - ;; could not get it to work satisfactorily. See: - ;; http://emacs.stackexchange.com/questions/29813/point-motion-strategy-for-emacs-25-and-older - (setq-local inhibit-point-motion-hooks nil) - ;; Go to next definition, as an affordance/hint what this does: - (racket-check-syntax-mode-goto-next-def))) - -(defun racket--check-syntax-stop () - (setq header-line-format nil) - (with-silent-modifications - (remove-text-properties (point-min) - (point-max) - '(help-echo nil - racket-check-syntax-def nil - racket-check-syntax-use nil - point-entered - point-left)) - (racket--unhighlight-all) - (setq buffer-read-only nil))) - -;;; align - -(defun racket-align () - "Align values in the same column. - -Useful for binding forms like \"let\" and \"parameterize\", -conditionals like \"cond\" and \"match\", association lists, and -any series of couples like the arguments to \"hash\". - -Before choosing this command, put point on the first of a series -of \"couples\". A couple is: - -- A list of two or more sexprs: \"[sexpr val sexpr ...]\". -- Two sexprs: \"sexpr val\". - -Each \"val\" moves to the same column and is -`prog-indent-sexp'-ed (in case it is a multi-line form). - -For example with point on the \"[\" before \"a\": - -#+BEGIN_SRC racket - Before After - - (let ([a 12] (let ([a 12] - [bar 23]) [bar 23]) - ....) ....) - - '([a . 12] '([a . 12] - [bar . 23]) [bar . 23]) - - (cond [a? #t] (cond [a? #t] - [b? (f x [b? (f x - y)] y)] - [else #f]) [else #f]) -#+END_SRC - -Or with point on the quote before \"a\": - -#+BEGIN_SRC racket - (list 'a 12 (list 'a 12 - 'bar 23) 'bar 23) -#+END_SRC - -If more than one couple is on the same line, none are aligned, -because it is unclear where the value column should be. For -example the following form will not change; `racket-align' will -display an error message: - -#+BEGIN_SRC racket - (let ([a 0][b 1] - [c 2]) error; unchanged - ....) -#+END_SRC - -When a couple's sexprs start on different lines, that couple is -ignored. Other, single-line couples in the series are aligned as -usual. For example: - -#+BEGIN_SRC racket - (let ([foo (let ([foo - 0] 0] - [bar 1] [bar 1] - [x 2]) [x 2]) - ....) ....) -#+END_SRC - -See also: `racket-unalign'." - (interactive) - (save-excursion - (let ((listp (eq ?\( (char-syntax (char-after)))) - (prev-line 0) - (max-col 0)) - (racket--for-each-couple listp - (lambda () - (setq max-col (max max-col (current-column))) - (let ((this-line (line-number-at-pos))) - (when (= prev-line this-line) - (user-error - "Can't align if any couples are on same line")) - (setq prev-line this-line)))) - (racket--for-each-couple listp - (lambda () - (indent-to max-col) - (prog-indent-sexp)))))) - -(defun racket-unalign () - "The opposite of `racket-align'. - -Effectively does M-x `just-one-space' and `prog-indent-sexp' for -each couple's value." - (interactive) - (save-excursion - (let ((listp (eq ?\( (char-syntax (char-after))))) - (racket--for-each-couple listp - (lambda () - (just-one-space) - (prog-indent-sexp)))))) - -(defun racket--for-each-couple (listp f) - "Move point to each value sexp of a couple, and `funcall' F. - -Only call F when the couple's sexprs are on the same line. - -When LISTP is true, expects couples to be `[id val]`, else `id val`." - (save-excursion - (condition-case () - (while t - (when listp - (down-list)) - (forward-sexp) - (let ((line (line-number-at-pos))) - (forward-sexp) - (backward-sexp) - (when (= line (line-number-at-pos)) - ;; Defensive: Backup over any prefix or punctuation - ;; chars just in case backward-sexp didn't (although it - ;; should have if our syntax table is correct). - (while (memq (char-syntax (char-before)) '(?\' ?\.)) - (goto-char (1- (point)))) - (funcall f))) - ;; On to the next couple... - (if listp - (up-list) - (forward-sexp))) - (scan-error nil)))) - -(provide 'racket-edit) - -;; racket-edit.el ends here diff --git a/elpa/racket-mode-20200218.1623/racket-edit.elc b/elpa/racket-mode-20200218.1623/racket-edit.elc deleted file mode 100644 index c9ce13a2e3cdf1ed5bda8d45633b2741a341e103..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29886 zcmeI5`*$11mFG#yR&4CatY;?K$s}_oCD2-uwweMO03q2)Eb8TW*OnAXeq<%h5(Jte zED(V45XJ27*?)aM-&8I}2 z=xE#@WIg-RAG$k7o$l1V%qG+RXz0?N?S?%$?#~WgXE1Q1@vMK;|4V1at#Kc&r-j>onAjPMsLIz!_mxj zN5ff%&hyzpa*dW@vis=P7hkyUVQ13m&H(X>P2U;z+;rr+ouS*$++fsMm?SJ^>axyc z(9b4rc1Xvx;pYVf|E~W8z`ysuN~N;7e=^IG?x>f!>eEK8#=rWdr)gau^e-)cX_UV- z%U@dMFFWNg?b4TejW4x!)jgSHKg|1+%ykFJpuewQw)aq4Sr)&~XZ?XY?Dw+i;po`SMx(*3KYr%Yt;+h1db@tzJ?gy7oOUXE*%{0`yg56} z-2VLFfGuH@AKrQJC0p{X=xj91+^uBp#*^%z|LTgTs%$bDO=e7=xq}g}9E~TVmr&Dm z2DHu|K#%tsb#mOFs?%UFI-c4zdjV=212hk3*{j)xn`W~a9T^2m#NJ zvf*qBHL^LHc{`eNdeVAjR({nW?Vw&j& z0DN)a#-sjl=HMjp8W`!ghqe!n;pV)~+(%bzIl`5z0u?M!6+O=?)A@erwrM=r2jW3z z_OKcxjRivW^&kl1)eRNtaK9{tIpJBS<2#!iNeA%CjhQh2?%!}C! zsI`1S({^HFPD=DjSbT zMDoOq1(69Po=n-n?qM<;C6jDC*tp`35Bp%wa0RpGs=P-orG5(c<>p3N%Yd^qbLAY4%cqLo03kpSVO zC}~8*d<9FD9?U)Ldp+VFL&Wa5b7DJ*#_$x>ML7YyG?CtjYh#PMlm5PV3{2+eWRCy{ z`gkFP!!aUmh`?}VtE})GiDFo_l|oksrfag7Y>bdyjrgiY1`xeY=iP3WL3bK+12uRk zaW)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To9+@JAHjir9!`3aZ(pZSl*QqL#ZfUR3UD50WgD&NL_pBpt5 zCSKS%yDZ|Z_HNT(qM+T05amtUof1eJekaPvk4zCq8w1K{?vQ`kNSoK_$ee;j7>=2Y>H;($6Wm_Uy?%sqPZGo^*9- zO+czSBA;qG{%+sU&r@#cZhZ^9cLK_|kJ8Hq{lP8V3DAde#vkv3&+Q%oB%+Ts#NuBI&q*51LAtaJ94K zURywwD2u#Z=|AJgMSQ+0;nVkgB8Jn=K>q8wqM?M~vj^knXd%$H{6-*q)zb)V}!MMO~^TJ4iq4A1c0JW_!86jcUP(i{*fXb@n;v z;M_iuN^jPR@VQ-BqT3a?F;QCZv{|hT+&e(#;UD~;6>cu=sGYR;nZSx zqq$uKyCR+z;a9|Z!5k3Ulsyia%j>m9y(lFlukEM<)P+X+`%zdKwnQ&xC4T%B6@JNP zfw?`Et5Bf7;qHRc`?`o)U)^1aX>UN~7zzR`YcRh|G^S*W z^vD0aWd}r5E$%%bZV6D&_PEkis&UVM-(wUV+VO+D=3<{kOy*bni1z9?i9yM)_xD6b z2LvVw+$wI#zcqcc;wNmOGybWs>^(BM(9)%PjcvY?`-jzuV*G1yL69m|YW&SAUc_Ar z&n@E;MyESpd9Xznf;z?p3-=uI2kC~0b1E|-kK!245|+&GJG4#QR53;1V ZBssm_@D~woLOMF(ou{t#r`)zG{|`mlqc{Kn diff --git a/elpa/racket-mode-20200218.1623/racket-repl.el b/elpa/racket-mode-20200218.1623/racket-repl.el deleted file mode 100644 index 103b65b5..00000000 --- a/elpa/racket-mode-20200218.1623/racket-repl.el +++ /dev/null @@ -1,815 +0,0 @@ -;;; racket-repl.el -*- lexical-binding: t; -*- - -;; Copyright (c) 2013-2019 by Greg Hendershott. -;; Portions Copyright (C) 1985-1986, 1999-2013 Free Software Foundation, Inc. -;; Image portions Copyright (C) 2012 Jose Antonio Ortega Ruiz. - -;; Author: Greg Hendershott -;; URL: https://github.com/greghendershott/racket-mode - -;; License: -;; This is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. This is distributed in the hope that it will be -;; useful, but without any warranty; without even the implied warranty -;; of merchantability or fitness for a particular purpose. See the GNU -;; General Public License for more details. See -;; http://www.gnu.org/licenses/ for details. - -(require 'racket-custom) -(require 'racket-common) -(require 'racket-util) -(require 'comint) -(require 'compile) -(require 'easymenu) -(require 'cl-lib) -(require 'rx) - -;; Don't (require 'racket-debug). Mutual dependency. Instead: -(declare-function racket--debug-send-definition "racket-debug" (beg end)) -(autoload 'racket--debug-send-definition "racket-debug") -(declare-function racket--debug-on-break "racket-debug" (response)) -(autoload 'racket--debug-on-break "racket-debug") -(declare-function racket--debuggable-files "racket-debug" (file-to-run)) -(autoload 'racket--debuggable-files "racket-debug") - -(defconst racket--repl-buffer-name/raw - "Racket REPL" - "The base buffer name, NOT surrounded in *stars*") -(defconst racket--repl-buffer-name - (concat "*" racket--repl-buffer-name/raw "*") - "The actual buffer name as created by comint-mode") - -(defmacro with-racket-repl-buffer (&rest body) - "Execute the forms in BODY with `racket-repl-mode' temporarily current. -The value returned is the value of the last form in BODY -- -unless no `racket-repl-mode' buffer exists, in which case no BODY -forms are evaluated and nil is returned. See also -`with-current-buffer'." - (declare (indent 0) (debug t)) - (let ((repl-buffer (make-symbol "repl-buffer"))) - `(let ((,repl-buffer (get-buffer racket--repl-buffer-name))) - (when ,repl-buffer - (with-current-buffer ,repl-buffer - ,@body))))) - -(defun racket-repl--input-filter (str) - "Don't save anything matching `racket-history-filter-regexp'." - (not (string-match racket-history-filter-regexp str))) - -(defalias 'racket-repl-eval-or-newline-and-indent #'racket-repl-submit) - -(defun racket-repl-submit (&optional prefix) - "Submit your input to the Racket REPL. - -If the REPL is running a Racket lang whose language-info has a -'drracket:submit-predicate, that is first called to see if the -input is valid to be submitted. - -With a prefix: After sending your input and a newline, also calls -`process-send-eof' -- because some langs require EOF to mark the -end of an interactive expression/statement." - (interactive "P") - (let* ((proc (get-buffer-process (current-buffer))) - (_ (unless proc (user-error "Current buffer has no process"))) - (text (substring-no-properties (funcall comint-get-old-input))) - (submitp - (if racket-use-repl-submit-predicate - (cl-case (racket--cmd/await `(repl-submit? ,text t)) - ((t) t) - ((nil) (user-error "Not a complete expression, according to the current lang's submit-predicate.")) - ((default) (racket--repl-complete-sexp-p proc))) - (racket--repl-complete-sexp-p proc)))) - (if (not submitp) - (newline-and-indent) - (comint-send-input) - (remove-text-properties comint-last-input-start - comint-last-input-end - '(font-lock-face comint-highlight-input)) - ;; Hack for datalog/lang - (when prefix (process-send-eof proc))))) - -(defun racket--repl-complete-sexp-p (proc) - (condition-case nil - (let* ((beg (marker-position (process-mark proc))) - (end (save-excursion - (goto-char beg) - (forward-list 1) ;scan-error unless complete sexp - (point))) - (blankp (save-excursion - (save-match-data - (goto-char beg) - (equal end - (re-search-forward (rx (1+ (or (syntax whitespace) - (syntax comment-start) - (syntax comment-end)))) - end - t)))))) - (not (or (equal beg end) blankp))) - (scan-error nil))) - -(defun racket-repl-exit (&optional quitp) - "End the Racket REPL process. - -Effectively the same as entering `(exit)` at the prompt, but -works even when the module language doesn't provide any binding -for `exit`. If there is no connection to the command server, then -this uses `comint-kill-subjob' to send a kill signal. - -With a prefix, uses `comint-quit-subjob' to send a quit signal." - (interactive "P") - (if quitp - (comint-quit-subjob) - (condition-case () - (progn (racket--cmd/async `(exit))) - (error (comint-kill-subjob))))) - -;;;###autoload -(defun racket-repl (&optional noselect) - "Show the Racket REPL buffer in some window. - -If NOSELECT is not nil, does not also select the REPL window. - -*IMPORTANT* - -The main, intended use of Racket Mode's REPL is that you -`find-file' some specific .rkt file, then `racket-run' it. The -REPL will then match that file. Also, various Racket Mode -features will work, such as completion, visiting definitions, and -so on. - -If the REPL isn't running, and you want to start it for no file -in particular? Then you could use this command. But the resulting -REPL will have a minimal \"#lang racket/base\" namespace. You -could enter \"(require racket)\" if you want the equivalent of -\"#lang racket\". You could also \"(require racket/enter)\" if -you want things like \"enter!\". But in some sense you'd be -\"using it wrong\". If you really don't want to use Racket Mode's -REPL as intended, then you might as well use a plain Emacs shell -buffer to run command-line Racket." - (interactive "P") - (if (racket--repl-live-p) - (racket--repl-show-and-move-to-end) - (racket--repl-start)) - (unless noselect - (select-window (get-buffer-window racket--repl-buffer-name t)))) - -(defconst racket--minimum-required-version "6.0" - "The minimum version of Racket required by run.rkt. - -Although some functionality may require an even newer version of -Racket, run.rkt will handle that via `dynamic-require` and -fallbacks. The version number here is a baseline for run.rkt to -be able to load at all.") - -(defvar racket--run.rkt (expand-file-name "run.rkt" racket--rkt-source-dir) - "Pathname of run.rkt.") - -(defvar racket-adjust-run-rkt #'identity - "A function used to transform the variable `racket--run.rkt'. - -You probably don't need to change this unless you are developing -Racket Mode, AND run Emacs on Windows Subsystem for Linux, AND -want to run your programs using Windows Racket.exe, AND have the -Racket Mode source code under \"/mnt\". Whew. In that case you -can set this variable to the function `racket-wsl-to-windows' so -that Racket Mode can find its own run.rkt file.") - -(defvar-local racket-user-command-line-arguments - nil - "List of command-line arguments to supply to your Racket program. - -Accessible in your Racket program in the usual way --- the -parameter `current-command-line-arguments` and friends. - -This is an Emacs buffer-local variable --- convenient to set as a -file local variable. For example at the end of your .rkt file: - -#+BEGIN_SRC elisp - ;; Local Variables: - ;; racket-user-command-line-arguments: (\"-f\" \"bar\") - ;; End: -#+END_SRC - -Set this way, the value must be an *unquoted* list of strings. -For example: - -#+BEGIN_SRC elisp - (\"-f\" \"bar\") -#+END_SRC - -The following values will /not/ work: - -#+BEGIN_SRC elisp - '(\"-f\" \"bar\") - (list \"-f\" \"bar\") -#+END_SRC -") - -(defun racket--repl-live-p () - "Does the Racket REPL buffer exist and have a live Racket process?" - (comint-check-proc racket--repl-buffer-name)) - -(defvar racket--repl-before-run-hook nil - "Thunks to do before each `racket--repl-run'.") - -(defun racket--repl-run (&optional what-to-run context-level callback) - "Do an initial or subsequent run. - -WHAT-TO-RUN should be a cons of a file name to a list of -submodule symbols. Or if nil, defaults to `racket--what-to-run'. - -CONTEXT-LEVEL should be a valid value for the variable -`racket-error-context', 'coverage, or 'profile. Or if nil, -defaults to the variable `racket-error-context'. - -CALLBACK is supplied to `racket--repl-run' and is used as the -callback for `racket--cmd/async'; it may be nil which is -equivalent to #'ignore. CALLBACK is called with a single -argument whose value should be ignored. - -- If the REPL is not live, start our backend run.rkt passing - the file to run as a command-line argument. - -- If the REPL is live, send a 'run command to the backend's TCP - server." - (run-hook-with-args 'racket--repl-before-run-hook) - (let ((cmd (racket--repl-make-run-command (or what-to-run (racket--what-to-run)) - (or context-level racket-error-context)))) - (cond ((racket--repl-live-p) - (racket--cmd/async cmd callback) - (racket--repl-show-and-move-to-end)) - (t - (racket--repl-start cmd) - (when callback - (racket--cmd/async `(no-op) callback)))))) - -(defun racket--repl-make-run-command (what-to-run &optional context-level) - "Form a `run` command sexpr for the backend. -WHAT-TO-RUN may be nil, meaning just a `racket/base` namespace." - (let ((context-level (or context-level racket-error-context))) - (list 'run - what-to-run - racket-memory-limit - racket-pretty-print - context-level - racket-user-command-line-arguments - (when (and what-to-run (eq context-level 'debug)) - (racket--debuggable-files (car what-to-run))) - racket-retry-as-skeleton))) - -(defvar racket--cmd-auth nil - "A value we give the Racket back-end when we launch it and when we connect. -See issue #327.") - -(defun racket--repl-start (&optional run-command) - "Start the Racket process, creating `racket-repl-mode' buffer if necessary. - -Arrange for attempts to connect to the TCP command server to -happen later. - -A non-nil RUN-COMMAND is supplied as the second command-line -argument to `racket--run.rkt' so the process can start by -immediately running a desired file. - -Always displays the buffer. Never changes selected window. - -Note that the value of the variable `racket--run.rkt' is applied -to the function variable `racket-adjust-run-rkt' before being -used. See the latter for more information." - (when (racket--repl-live-p) - (error "Racket REPL already running.")) - (racket--assert-version racket--minimum-required-version) - (let ((run.rkt (funcall racket-adjust-run-rkt racket--run.rkt))) - (with-current-buffer - (make-comint racket--repl-buffer-name/raw ;w/o *stars* - racket-program - nil - run.rkt - (number-to-string racket-command-port) - (setq racket--cmd-auth (format "%S" `(auth ,(random)))) - (format "%S" (or run-command - (racket--repl-make-run-command nil)))) - ;; Use a local comint output filter function to detect first - ;; output (e.g. Welcome to Racket banner). Only thereafter might - ;; our backend TCP command server be ready for connections; no - ;; point trying sooner. (I'd rather use a process sentinel, but - ;; a comint process supplies no such "open" or "ready" event.) - (add-hook 'comint-output-filter-functions - #'racket-repl--startup-output-filter - nil t) - (let ((proc (get-buffer-process racket--repl-buffer-name))) - (display-buffer (current-buffer)) ;show startup/banner sooner - (message "Starting %s to run %s ..." racket-program run.rkt) - (set-process-coding-system proc 'utf-8 'utf-8) ;for e.g. λ - (racket-repl-mode))))) - -(defun racket--version () - "Get the `racket-program' version as a string." - (with-temp-message "Checking Racket version ..." - (with-temp-buffer - (call-process racket-program nil t nil "--version") - (goto-char (point-min)) - ;; Welcome to Racket v6.12. - ;; Welcome to Racket v7.0.0.6. - (save-match-data - (re-search-forward "[0-9]+\\(?:\\.[0-9]+\\)*") - (match-string 0))))) - -(defun racket--assert-version (at-least) - "Raise a `user-error' unless Racket is version AT-LEAST." - (let ((have (racket--version))) - (unless (version<= at-least have) - (user-error "Racket Mode needs at least Racket version %s but you have %s" - at-least have)))) - -;;; Connection to command process - -(defvar racket--cmd-proc nil - "Process for talking to the command server. -Most code should use `racket--cmd-open-p' to check this.") - -(defun racket--cmd-open-p () - "Does an open process exist for the command server?" - (and racket--cmd-proc - (eq 'open (process-status racket--cmd-proc)))) - -(defun racket-repl--startup-output-filter (_txt) - "As soon as the REPL process displays its first output -- -presumably the Racket banner -- schedule an attempt to connect to -the command process. And having done our one job, remove -ourselves from the local cominit output filter functions." - (run-at-time 0.5 nil #'racket--cmd-connect-attempt 1) - (remove-hook 'comint-output-filter-functions - #'racket-repl--startup-output-filter - t)) - -(defvar racket--cmd-nonce->callback (make-hash-table :test 'eq) - "A hash from nonce to callback function.") -(defvar racket--cmd-nonce 0 - "Number that increments for each command request we send.") - -(defvar racket--cmd-connect-attempts 15 - "How many times to `racket--cmd-connect-attempt', at roughly 1 second intervals.") - -(defun racket--cmd-connect-attempt (attempt) - (unless (featurep 'make-network-process '(:nowait t)) - (error "Racket Mode needs Emacs to support the :nowait feature")) - (setq - racket--cmd-proc - (make-network-process - :name "racket-command" - :host "127.0.0.1" - :service racket-command-port - :nowait t - :sentinel - (lambda (proc event) - ;;(message "sentinel got (%S %S) [attempt %s]" proc event attempt) - (cond ((string-match-p "^open" event) - (let ((buf (generate-new-buffer (concat " *" (process-name proc) "*")))) - (set-process-buffer proc buf) - (buffer-disable-undo buf)) - (set-process-filter proc #'racket--cmd-process-filter) - (process-send-string proc (concat racket--cmd-auth "\n")) - (message "Connected to %s process on port %s after %s attempt%s" - proc racket-command-port attempt (if (= 1 attempt) "" "s"))) - - ((string-match-p "^failed" event) - (delete-process proc) ;we'll get called with "deleted" event, below - (when (<= attempt racket--cmd-connect-attempts) - (run-at-time 1.0 nil - #'racket--cmd-connect-attempt - (1+ attempt)))) - - ((or (string-match-p "^deleted" event) - (string-match-p "^connection broken by remote peer" event)) - (clrhash racket--cmd-nonce->callback) - ;; If process has a buffer -- and do check that it does, - ;; see #383 -- we can't `kill-buffer' now here in the - ;; process sentinel. Instead do soon. - (pcase (process-buffer proc) - (`() nil) - (buf (run-at-time 0.1 nil #'kill-buffer buf)))) - - (t (message "sentinel surprised by (%S %S) [attempt %s]" proc event attempt))))))) - -(defun racket--cmd-process-filter (proc string) - (let ((buffer (process-buffer proc))) - (when (buffer-live-p buffer) - (with-current-buffer buffer - (goto-char (point-max)) - (insert string) - (goto-char (point-min)) - (while - (condition-case () - (progn - (forward-sexp 1) - (let ((sexp (buffer-substring (point-min) (point)))) - (delete-region (point-min) (point)) - (ignore-errors - (racket--cmd-dispatch-response (read sexp)) - t))) - (scan-error nil))))))) - -(defun racket--cmd-dispatch-response (response) - (pcase response - (`(debug-break . ,response) - (run-at-time 0.001 nil #'racket--debug-on-break response)) - (`(,nonce . ,response) - (let ((callback (gethash nonce racket--cmd-nonce->callback))) - (when callback - (remhash nonce racket--cmd-nonce->callback) - (run-at-time 0.001 nil callback response)))) - (_ nil))) - -(defun racket--repl-ensure-command-server () - "See the variable `racket--repl-wait-for-command-server'." - (if racket-command-startup - (progn - (unless (racket--repl-live-p) - (racket--repl-start)) - (with-timeout (racket-command-startup - (error "Could not connect to racket-command process on port %s. You probably need to `racket-repl-exit' and restart the Racket REPL." - racket-command-port)) - (while (not (racket--cmd-open-p)) - (message "Waiting to connect to racket-command process on port %s ... press C-g to quit waiting ..." - racket-command-port) - (sit-for 1.0)))) - (unless (racket--repl-live-p) - (error "Racket REPL not running. You need to `racket-run' or `racket-repl'.")) - (unless (racket--cmd-open-p) - (error "Not connected to racket-command process on port %s.\nWait for the Racket REPL to start and try again, or, `racket-repl-exit' and restart the Racket REPL." - racket-command-port)))) - -(defun racket--cmd/async-raw (command-sexpr &optional callback) - "Send COMMAND-SEXPR and return. Later call CALLBACK with the response sexp. - -If CALLBACK is not supplied or nil, defaults to `ignore'. - -Otherwise CALLBACK is called after the command server returns a -response. Because command responses are obtained from the dynamic -extent of a `set-process-filter' proc -- which may have -limitations on what it can or should do -- CALLBACK is not called -immediately but instead using `run-at-time' with a very small -delay. - -Important: Do not assume that `current-buffer' is the same when -CALLBACK is called, as it was when the command was sent. If you -need to do something to do that original buffer, save the -`current-buffer' in a `let' and use it in a `with-current-buffer' -form." - (racket--repl-ensure-command-server) - (cl-incf racket--cmd-nonce) - (when (and callback - (not (equal callback #'ignore))) - (puthash racket--cmd-nonce callback racket--cmd-nonce->callback)) - (process-send-string racket--cmd-proc - (format "%S\n" (cons racket--cmd-nonce - command-sexpr)))) - -(defun racket--cmd/async (command-sexpr &optional callback) - "You probably want to use this instead of `racket--cmd/async-raw'. - -CALLBACK is only called for 'ok responses, with (ok v ...) -unwrapped to (v ...). - -'error responses are handled here. Note: We use `message' not -`error' here because: - - 1. It would show \"error running timer:\" which, although true, - is confusing or at best N/A for end users. - - 2. More simply, we don't need to escape any call stack, we only - need to ... not call the callback! - -The original value of `current-buffer' is temporarily restored -during CALLBACK, because neglecting to do so is a likely -mistake." - (let ((buf (current-buffer))) - (racket--cmd/async-raw - command-sexpr - (if callback - (lambda (response) - (pcase response - (`(ok ,v) (with-current-buffer buf (funcall callback v))) - (`(error ,m) (message "%s" m)) - (v (message "Unknown command response: %S" v)))) - #'ignore)))) - -(defun racket--cmd/await (command-sexpr) - "Send COMMAND-SEXPR. Await and return an 'ok response value, or raise `error'." - (let* ((awaiting 'RACKET-REPL-AWAITING) - (response awaiting)) - (racket--cmd/async-raw command-sexpr - (lambda (v) (setq response v))) - (with-timeout (racket-command-timeout - (error "racket-command process timeout")) - (while (eq response awaiting) - (accept-process-output nil 0.001)) - (pcase response - (`(ok ,v) v) - (`(error ,m) (error "%s" m)) - (v (error "Unknown command response: %S" v)))))) - -;;; Misc - -(defun racket--repl-file-name+md5 () - "Return the file and MD5 running in the REPL, or nil. - -The result can be nil if the REPL is not started, or if it is -running no particular file as with the `,top` command." - (when (comint-check-proc racket--repl-buffer-name) - (pcase (racket--cmd/await `(path+md5)) - (`(,(and (pred stringp) path) . ,md5) - (cons (funcall racket-path-from-racket-to-emacs-function path) - md5)) - (_ nil)))) - -(defun racket-repl-file-name () - "Return the file running in the REPL, or nil. - -The result can be nil if the REPL is not started, or if it is -running no particular file." - (when (comint-check-proc racket--repl-buffer-name) - (pcase (racket--repl-file-name+md5) - (`(,(and (pred stringp) path) . ,_md5) path) - (_ nil)))) - -(defun racket--in-repl-or-its-file-p () - "Is current-buffer `racket-repl-mode' or buffer for file active in it?" - (or (eq (current-buffer) - (get-buffer racket--repl-buffer-name)) - (let ((buf-file (racket--buffer-file-name)) - (repl-file (racket-repl-file-name))) - (and buf-file repl-file (string-equal buf-file repl-file))))) - -(defun racket-repl-switch-to-edit () - "Switch to the window for the buffer of the file running in the REPL. - -If no buffer is visting the file, `find-file' it in `other-window'. - -If the REPL is running no file -- if the prompt is `>` -- use the -most recent `racket-mode' buffer, if any." - (interactive) - (pcase (racket-repl-file-name) - (`() (let ((buffer (racket--most-recent-racket-mode-buffer))) - (unless buffer - (user-error "There are no racket-mode buffers")) - (pop-to-buffer buffer t))) - (path (let ((buffer (find-buffer-visiting path))) - (if buffer - (pop-to-buffer buffer t) - (other-window 1) - (find-file path)))))) - -(defun racket--most-recent-racket-mode-buffer () - (cl-some (lambda (b) - (with-current-buffer b - (and (eq major-mode 'racket-mode) b))) - (buffer-list))) - -;;; send to REPL - -(defun racket--send-region-to-repl (start end) - "Internal function to send the region to the Racket REPL. - -Before sending the region, calls `racket-repl' and -`racket--repl-forget-errors'. Also inserts a ?\n at the process -mark so that output goes on a fresh line, not on the same line as -the prompt. - -Afterwards call `racket--repl-show-and-move-to-end'." - (unless (and start end) - (error "start and end must not be nil")) - ;; Save the current buffer in case something changes it before we - ;; call `comint-send-region'; see e.g. issue 407. - (let ((source-buffer (current-buffer))) - (racket-repl t) - (racket--repl-forget-errors) - (let ((proc (get-buffer-process racket--repl-buffer-name))) - (with-racket-repl-buffer - (save-excursion - (goto-char (process-mark proc)) - (insert ?\n) - (set-marker (process-mark proc) (point)))) - (with-current-buffer source-buffer - (comint-send-region proc start end) - (comint-send-string proc "\n"))) - (racket--repl-show-and-move-to-end))) - -(defun racket-send-region (start end) - "Send the current region (if any) to the Racket REPL." - (interactive "r") - (unless (region-active-p) - (user-error "No region")) - (racket--send-region-to-repl start end)) - -(defun racket-send-definition (&optional prefix) - "Send the current definition to the Racket REPL." - (interactive "P") - (save-excursion - (end-of-defun) - (let ((end (point))) - (beginning-of-defun) - (if prefix - (racket--debug-send-definition (point) end) - (racket--send-region-to-repl (point) end))))) - -(defun racket-send-last-sexp () - "Send the previous sexp to the Racket REPL. - -When the previous sexp is a sexp comment the sexp itself is sent, -without the #; prefix." - (interactive) - (racket--send-region-to-repl (racket--repl-last-sexp-start) - (point))) - -(defun racket-eval-last-sexp () - "Eval the previous sexp asynchronously and `message' the result." - (interactive) - (racket--cmd/async - `(eval - ,(buffer-substring-no-properties (racket--repl-last-sexp-start) - (point))) - (lambda (v) - (message "%s" v)))) - -(defun racket--repl-last-sexp-start () - (save-excursion - (condition-case () - (progn - (backward-sexp) - (if (save-match-data (looking-at "#;")) - (+ (point) 2) - (point))) - (scan-error (user-error "There isn't a complete s-expression before point"))))) - -(defun racket--repl-forget-errors () - "Forget existing errors in the REPL. -Although they remain clickable they will be ignored by -`next-error' and `previous-error'" - (with-racket-repl-buffer - (compilation-forget-errors) - ;; `compilation-forget-errors' may have just set - ;; `compilation-messages-start' to a marker at position 1. But in - ;; that case process output (including error messages) will be - ;; inserted ABOVE the marker, in which case `next-error' won't see - ;; them. Instead use a non-marker position like 1 or use nil. - (when (and (markerp compilation-messages-start) - (equal (marker-position compilation-messages-start) 1) - (equal (marker-buffer compilation-messages-start) (current-buffer))) - (setq compilation-messages-start nil)))) - -(add-hook 'racket--repl-before-run-hook #'racket--repl-forget-errors) - -(defun racket--repl-show-and-move-to-end () - "Make the Racket REPL visible, and move point to end. -Keep original window selected." - (display-buffer racket--repl-buffer-name) - (save-selected-window - (select-window (get-buffer-window racket--repl-buffer-name t)) - (comint-show-maximum-output))) - -;;; Inline images in REPL - -(defvar racket-image-cache-dir nil) - -(defun racket-repl--list-image-cache () - "List all the images in the image cache." - (and racket-image-cache-dir - (file-directory-p racket-image-cache-dir) - (let ((files (directory-files-and-attributes - racket-image-cache-dir t "racket-image-[0-9]*.png"))) - (mapcar #'car - (sort files (lambda (a b) - (< (float-time (nth 6 a)) - (float-time (nth 6 b))))))))) - -(defun racket-repl--clean-image-cache () - "Clean all except for the last `racket-images-keep-last' -images in 'racket-image-cache-dir'." - (interactive) - (dolist (file (butlast (racket-repl--list-image-cache) - racket-images-keep-last)) - (delete-file file))) - -(defun racket-repl--replace-images () - "Replace all image patterns with actual images" - (with-silent-modifications - (save-excursion - (goto-char (point-min)) - (while (re-search-forward "\"#\"" nil t) - ;; can't pass a filename to create-image because emacs might - ;; not display it before it gets deleted (race condition) - (let* ((file (match-string 1)) - (begin (match-beginning 0)) - (end (match-end 0))) - (delete-region begin end) - (goto-char begin) - (if (and racket-images-inline (display-images-p)) - (insert-image (create-image file) "[image]") - (goto-char begin) - (insert "[image] ; use M-x racket-view-last-image to view")) - (setq racket-image-cache-dir (file-name-directory file)) - (racket-repl--clean-image-cache)))))) - -(defun racket-view-last-image (n) - "Open the last displayed image using `racket-images-system-viewer'. - -With prefix arg, open the N-th last shown image." - (interactive "p") - (let ((images (reverse (racket-repl--list-image-cache)))) - (if (>= (length images) n) - (start-process "Racket image view" - nil - racket-images-system-viewer - (nth (- n 1) images)) - (error "There aren't %d recent images" n)))) - -(defun racket-repl--normal-output-filter (_txt) - (racket-repl--replace-images)) - -;;; racket-repl-mode - -(defvar racket-repl-mode-map - (racket--easy-keymap-define - '(("C-m" racket-repl-submit) - ("C-j" newline-and-indent) - ("TAB" indent-for-tab-command) - ("C-M-u" racket-backward-up-list) - ("C-M-q" prog-indent-sexp) - ("C-a" comint-bol) - ("C-w" comint-kill-region) - ("" comint-kill-whole-line) - ("C-c C-e f" racket-expand-file) - ("C-c C-e x" racket-expand-definition) - ("C-c C-e e" racket-expand-last-sexp) - ("C-c C-e r" racket-expand-region) - ("M-C-y" racket-insert-lambda) - ("C-c C-d" racket-doc) - ("C-c C-." racket-describe) - ("M-." racket-visit-definition) - ("C-M-." racket-visit-module) - ("M-," racket-unvisit) - ("C-c C-z" racket-repl-switch-to-edit) - ("C-c C-l" racket-logger) - ("C-c C-\\" racket-repl-exit) - ((")" "]" "}") racket-insert-closing))) - "Keymap for Racket REPL mode.") - -(easy-menu-define racket-repl-mode-menu racket-repl-mode-map - "Menu for Racket REPL mode." - '("Racket" - ["Break" comint-interrupt-subjob] - ["Exit" racket-repl-exit] - "---" - ["Insert Lambda" racket-insert-lambda] ;λ in string breaks menu - ["Indent Region" indent-region] - ["Cycle Paren Shapes" racket-cycle-paren-shapes] - ("Macro Expand" - ["File" racket-expand-file] - ["Region" racket-expand-region :active (region-active-p)] - ["Definition" racket-expand-definition] - ["Last S-Expression" racket-expand-last-sexp]) - "---" - ["Visit Definition" racket-visit-definition] - ["Visit Module" racket-visit-module] - ["Return from Visit" racket-unvisit] - "---" - ["Racket Documentation" racket-doc] - ["Describe" racket-describe] - "---" - ["Switch to Edit Buffer" racket-repl-switch-to-edit])) - -(define-derived-mode racket-repl-mode comint-mode "Racket-REPL" - "Major mode for Racket REPL. -\\{racket-repl-mode-map}" - (racket--common-variables) - (setq-local comint-use-prompt-regexp nil) - (setq-local comint-prompt-read-only t) - (setq-local comint-scroll-show-maximum-output nil) ;t slow for big outputs - (setq-local mode-line-process nil) - (setq-local comint-input-filter #'racket-repl--input-filter) - (add-hook 'comint-output-filter-functions #'racket-repl--normal-output-filter nil t) - (compilation-setup t) - (setq-local - compilation-error-regexp-alist - (list - ;; Any apparent file:line:col - (list (rx (group-n 1 (+? (not (syntax whitespace)))) - (any ?\: ?\.) - (group-n 2 (+ digit)) - (any ?\: ?\.) - (group-n 3 (+ digit))) - #'racket--adjust-group-1 2 3) - ;; Any path struct - (list (rx "#)))) ?\>) - #'racket--adjust-group-1 nil nil 0)))) - -(defun racket--adjust-group-1 () - (list (funcall racket-path-from-racket-to-emacs-function (match-string 1)))) - -(provide 'racket-repl) - -;; racket-repl.el ends here diff --git a/elpa/racket-mode-20200218.1623/racket-repl.elc b/elpa/racket-mode-20200218.1623/racket-repl.elc deleted file mode 100644 index 3492a373f69d2ae2bf756a25fce13c2e99c4ad62..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31107 zcmchgiFX^>b>_9WG^?=J7*i`@tJ{`SI!3$-u4_#(MCKAjAP z`H_7YjFR2cUVoOn&Zo1%c$74|+bz5EW-vcVdc$Edp3DcQgMaPKxjoyi+0DI^!7MqZ zm1Hr?XUWmKQSWrnPmad@*?c+}y`0_P?sPU!dPhh3QBw4h-P&&6I@89{m^Mb^dD0(` z<~<%>%#YKXTp6Wzp542DKk1+JroH~0A>Od=d!wUdHctAzQF53k!*Oq^lQ5N8lJ};= zK|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!?Yj;5Ph@=K1kA>pNz!B*PLk7tfza#zG8SM=%iC_#0i~zm~+dCFjd_Mj|t|OVV#e zY47~N)Pch0S(kGK*jO8)6AFABs~^j?vz=9+5WB<*NVOxA^B_1?PBD%U&rr9`_7C}E zIrK*R>4hKuXj{+oiK|_^^`q^3q4(yFde>VNN?BixAAY(WVjng?CTsPn_Dt(jMR9bg z__@oSPk$ON#UH(FwRDP|Jr#fYl1u*>F2%i>?Z&77#Hj&HNF~8-bczlbXxNTXhSQeX zjL)jAc5J?_FDS(hPj#|i@kj4-!B4g0J2eKKosYix^!gTGXs4rBO-b1fD(7`)!%E?b zmUz95FlBXy!I#AU%-tn=4*DD?XP+dyg+X|n(PAwO#)6ZBi8v>?mE^6teIi<^tW0ZU!}EM rU#GS*9@DZ`Xod!8UcGv68DRVcWy8xcNG~+ogkS8pud06KR_*@+mY5Ll diff --git a/elpa/racket-mode-20200218.1623/racket/channel.rkt b/elpa/racket-mode-20200218.1623/racket/channel.rkt deleted file mode 100644 index 1eb4b42b..00000000 --- a/elpa/racket-mode-20200218.1623/racket/channel.rkt +++ /dev/null @@ -1,70 +0,0 @@ -#lang racket/base - -(require racket/contract - racket/match - racket/set - "mod.rkt") - -(provide message-to-main-thread-channel - (struct-out message-to-main-thread) - (struct-out load-gui) - (struct-out rerun) - rerun-default - context-level? - instrument-level? - profile/coverage-level? - debug-level?) - - -;;; Definitions for the context-level member of rerun - -(define profile/coverage-levels - ;; "sibling" levels that need instrument plus... - '(profile ;profiling-enabled - coverage)) ;execute-counts-enabled - -(define instrument-levels - `(high ;compile-context-preservation-enabled #t + instrument - ,@profile/coverage-levels)) - -(define context-levels - `(low ;compile-context-preservation-enabled #f - medium ;compile-context-preservation-enabled #t - ,@instrument-levels - debug)) - -(define-syntax-rule (memq? x xs) - (and (memq x xs) #t)) - -(define (context-level? v) (memq? v context-levels)) -(define (instrument-level? v) (memq? v instrument-levels)) -(define (profile/coverage-level? v) (memq? v profile/coverage-levels)) -(define (debug-level? v) (eq? v 'debug)) - -;;; Messages to the main thread via a channel - -(define message-to-main-thread-channel (make-channel)) - -(define-struct/contract message-to-main-thread ()) - -(define-struct/contract (load-gui message-to-main-thread) - ([in-repl? boolean?])) - -(define-struct/contract (rerun message-to-main-thread) - ([maybe-mod (or/c #f mod?)] - [memory-limit exact-nonnegative-integer?] ;0 = no limit - [pretty-print? boolean?] - [context-level context-level?] - [cmd-line-args (vectorof string?)] - [debug-files (set/c path?)] - [retry-skeletal? boolean?] - [ready-thunk (-> any/c)])) - -(define rerun-default (rerun #f - 0 - #f - 'low - #() - (set) - #t - void)) diff --git a/elpa/racket-mode-20200218.1623/racket/command-server.rkt b/elpa/racket-mode-20200218.1623/racket/command-server.rkt deleted file mode 100644 index 8bbf028a..00000000 --- a/elpa/racket-mode-20200218.1623/racket/command-server.rkt +++ /dev/null @@ -1,235 +0,0 @@ -#lang racket/base - -(require racket/contract - racket/format - racket/function - racket/lazy-require - racket/match - racket/set - racket/tcp - "channel.rkt" - "debug.rkt" - "elisp.rkt" - "interactions.rkt" - "md5.rkt" - "mod.rkt" - "util.rkt") - -(lazy-require - ["commands/check-syntax.rkt" (check-syntax)] - ["commands/coverage.rkt" (get-uncovered)] - ["commands/describe.rkt" (describe type)] - ["commands/find-module.rkt" (find-module)] - ["commands/help.rkt" (doc)] - ["commands/macro.rkt" (macro-stepper macro-stepper/next)] - ["commands/profile.rkt" (get-profile)] - ["commands/requires.rkt" (requires/tidy requires/trim requires/base)] - ["find.rkt" (find-definition)]) - -(provide start-command-server - attach-command-server - make-prompt-read) - -(define drracket:submit-predicate/c (-> input-port? boolean? boolean?)) - -(define-struct/contract context - ([ns namespace?] - [maybe-mod (or/c #f mod?)] - [md5 string?] - [submit-pred (or/c #f drracket:submit-predicate/c)])) - -(define command-server-context (context (make-base-namespace) #f "" #f)) - -(define/contract (attach-command-server ns maybe-mod) - (-> namespace? (or/c #f mod?) any) - (set-debug-repl-namespace! ns) - (set! command-server-context - (context ns - maybe-mod - (maybe-mod->md5 maybe-mod) - (get-repl-submit-predicate maybe-mod)))) - -(define (maybe-mod->md5 m) - (define-values (dir file _) (maybe-mod->dir/file/rmp m)) - (if (and dir file) - (file->md5 (build-path dir file)) - "")) - -;; -(define/contract (get-repl-submit-predicate m) - (-> (or/c #f mod?) (or/c #f drracket:submit-predicate/c)) - (define-values (dir file rmp) (maybe-mod->dir/file/rmp m)) - (define path (and dir file (build-path dir file))) - (and path rmp - (or (with-handlers ([exn:fail? (λ _ #f)]) - (match (with-input-from-file (build-path dir file) read-language) - [(? procedure? get-info) - (match (get-info 'drracket:submit-predicate #f) - [#f #f] - [v v])] - [_ #f])) - (with-handlers ([exn:fail? (λ _ #f)]) - (match (module->language-info rmp #t) - [(vector mp name val) - (define get-info ((dynamic-require mp name) val)) - (get-info 'drracket:submit-predicate #f)] - [_ #f]))))) - -;; The command server accepts a single TCP connection at a time. -;; -;; Immediately after connecting, the client must send us exactly the -;; same '(accept ,random-value) value that it gave us as a command -;; line argument when it started us. Else we exit. See issue #327. -;; -;; Normally Emacs will make only one connection to us, ever. If the -;; user exits the REPL, then our entire Racket process exits. (Just in -;; case, we have an accept-a-connection loop below. It handles any -;; exns -- like exn:network -- not handled during command processing. -;; It uses a custodian to clean up.) -;; -;; Command requests and responses "on the wire" are a subset of valid -;; Emacs Lisp s-expressions: See elisp-read and elisp-write. -;; -;; Command requests are (nonce command param ...). -;; -;; A thread is spun off to handle each request, so that a long-running -;; command won't block others. The nonce supplied with the request is -;; returned with the response, so that the client can match the -;; response with the request. The nonce needn't be random, just -;; unique; an increasing integer is fine. -;; -;; Command responses are either (nonce 'ok sexp ...+) or (nonce 'error -;; "message"). The latter normally can and should be displayed to the -;; user in Emacs via error or message. We handle exn:fail? up here; -;; generally we're fine letting Racket exceptions percolate up and be -;; shown to the user -(define (start-command-server port launch-token) - (thread - (thunk - (define listener (tcp-listen port 4 #t "127.0.0.1")) - (let accept-a-connection () - (define custodian (make-custodian)) - (parameterize ([current-custodian custodian]) - (with-handlers ([exn:fail? void]) ;just disconnect; see #327 - (define-values (in out) (tcp-accept listener)) - (unless (or (not launch-token) - (equal? launch-token (elisp-read in))) - (display-commented "Authorization failed; exiting") - (exit 1)) ;see #327 - (define response-channel (make-channel)) - (define ((do-command/put-response nonce sexp)) - (channel-put - response-channel - (cons - nonce - (with-handlers ([exn:fail? (λ (e) `(error ,(exn-message e)))]) - (parameterize ([current-namespace - (context-ns command-server-context)]) - `(ok ,(command sexp command-server-context))))))) - (define (get/write-response) - (elisp-writeln (sync response-channel - debug-notify-channel) - out) - (flush-output out) - (get/write-response)) - ;; With all the pieces defined, let's go: - (thread get/write-response) - (let read-a-command () - (match (elisp-read in) - [(cons nonce sexp) (thread (do-command/put-response nonce sexp)) - (read-a-command)] - [(? eof-object?) (void)]))) - (custodian-shutdown-all custodian)) - (accept-a-connection)))) - (void)) - -(define/contract ((make-prompt-read m)) - (-> (or/c #f mod?) (-> any)) - (begin0 (get-interaction (maybe-mod->prompt-string m)) - (next-break 'all))) ;let debug-instrumented code break again - -(define/contract (command sexpr the-context) - (-> pair? context? any/c) - (match-define (context _ns maybe-mod md5 submit-pred) the-context) - (define-values (dir file mod-path) (maybe-mod->dir/file/rmp maybe-mod)) - (define path (and dir file (build-path dir file))) - ;; Note: Intentionally no "else" match clause -- let caller handle - ;; exn and supply a consistent exn response format. - (match sexpr - [`(run ,what ,mem ,pp? ,ctx ,args ,dbg ,skel?) - (run what mem pp? ctx args dbg skel?)] - [`(no-op) #t] - [`(path+md5) (cons (or path 'top) md5)] - [`(syms) (syms)] - [`(def ,str) (find-definition str)] - [`(mod ,sym) (find-module sym maybe-mod)] - [`(describe ,str) (describe str)] - [`(doc ,str) (doc str)] - [`(type ,v) (type v)] - [`(macro-stepper ,str ,into-base?) (macro-stepper str into-base?)] - [`(macro-stepper/next) (macro-stepper/next)] - [`(requires/tidy ,reqs) (requires/tidy reqs)] - [`(requires/trim ,path-str ,reqs) (requires/trim path-str reqs)] - [`(requires/base ,path-str ,reqs) (requires/base path-str reqs)] - [`(find-collection ,str) (find-collection str)] - [`(get-profile) (get-profile)] - [`(get-uncovered) (get-uncovered path)] - [`(check-syntax ,path-str) (check-syntax path-str)] - [`(eval ,v) (eval-command v)] - [`(repl-submit? ,str ,eos?) (repl-submit? submit-pred str eos?)] - [`(debug-eval ,src ,l ,c ,p ,code) (debug-eval src l c p code)] - [`(debug-resume ,v) (debug-resume v)] - [`(debug-disable) (debug-disable)] - [`(exit) (exit)])) - -;;; A few commands defined here - -(define/contract (run what mem pp ctx args dbgs skel) - (-> list? number? elisp-bool/c context-level? list? (listof path-string?) elisp-bool/c - list?) - (define ready-channel (make-channel)) - (channel-put message-to-main-thread-channel - (rerun (->mod/existing what) - mem - (as-racket-bool pp) - ctx - (list->vector args) - (list->set (map string->path dbgs)) - (as-racket-bool skel) - (λ () (channel-put ready-channel what)))) - ;; Waiting for this allows the command response to be used as the - ;; all-clear for additional commands that need the module load to be - ;; done and entering a REPL for that module. For example, to compose - ;; run with get-profile or get-uncovered. - (sync ready-channel)) - -(define/contract (repl-submit? submit-pred text eos) - (-> (or/c #f drracket:submit-predicate/c) string? elisp-bool/c (or/c 'default #t #f)) - (if submit-pred - (submit-pred (open-input-string text) (as-racket-bool eos)) - 'default)) - -(define (syms) - (sort (map symbol->string (namespace-mapped-symbols)) - string string? string?) - (define results - (call-with-values (λ () - ((current-eval) (string->namespace-syntax str))) - list)) - (~a (map ~v results) "\n")) - -;;; find-collection - -(define/contract (find-collection str) - (-> path-string? (or/c 'find-collection-not-installed #f (listof string?))) - (define fcd (with-handlers ([exn:fail:filesystem:missing-module? - (λ _ (error 'find-collection - "For this to work, you need to `raco pkg install raco-find-collection`."))]) - (dynamic-require 'find-collection/find-collection - 'find-collection-dir))) - (map path->string (fcd str))) diff --git a/elpa/racket-mode-20200218.1623/racket/commands/check-syntax.rkt b/elpa/racket-mode-20200218.1623/racket/commands/check-syntax.rkt deleted file mode 100644 index 8ffc3ff8..00000000 --- a/elpa/racket-mode-20200218.1623/racket/commands/check-syntax.rkt +++ /dev/null @@ -1,61 +0,0 @@ -#lang racket/base - -(require racket/list - racket/match - racket/path - racket/set) - -(provide check-syntax) - -(define check-syntax - (let ([show-content - (with-handlers ([exn:fail? (λ _ 'not-supported)]) - (let ([f (dynamic-require 'drracket/check-syntax 'show-content)]) - ;; Ensure correct position info for Unicode like λ. - ;; show-content probably ought to do this itself, but - ;; work around that. - (λ (path) - (parameterize ([port-count-lines-enabled #t]) - (f path)))))]) - ;; Note: Adjust all positions to 1-based Emacs `point' values. - (λ (path-str) - (define path (string->path path-str)) - (parameterize ([current-load-relative-directory (path-only path)]) - ;; Get all the data. - (define xs (remove-duplicates (show-content path))) - ;; Extract the add-mouse-over-status items into a list. - (define infos - (remove-duplicates - (filter values - (for/list ([x (in-list xs)]) - (match x - [(vector 'syncheck:add-mouse-over-status beg end str) - (list 'info (add1 beg) (add1 end) str)] - [_ #f]))))) - ;; Consolidate the add-arrow/name-dup items into a hash table - ;; with one item per definition. The key is the definition - ;; position. The value is the set of its uses. - (define ht-defs/uses (make-hash)) - (for ([x (in-list xs)]) - (match x - [(or (vector 'syncheck:add-arrow/name-dup - def-beg def-end - use-beg use-end - _ _ _ _) - (vector 'syncheck:add-arrow/name-dup/pxpy - def-beg def-end _ _ - use-beg use-end _ _ - _ _ _ _)) - (hash-update! ht-defs/uses - (list (add1 def-beg) (add1 def-end)) - (λ (v) (set-add v (list (add1 use-beg) (add1 use-end)))) - (set))] - [_ #f])) - ;; Convert the hash table into a list, sorting the usage positions. - (define defs/uses - (for/list ([(def uses) (in-hash ht-defs/uses)]) - (match-define (list def-beg def-end) def) - (define tweaked-uses (sort (set->list uses) < #:key car)) - (list 'def/uses def-beg def-end tweaked-uses))) - ;; Append both lists and print as Elisp values. - (append infos defs/uses))))) diff --git a/elpa/racket-mode-20200218.1623/racket/commands/describe.rkt b/elpa/racket-mode-20200218.1623/racket/commands/describe.rkt deleted file mode 100644 index b7271a7e..00000000 --- a/elpa/racket-mode-20200218.1623/racket/commands/describe.rkt +++ /dev/null @@ -1,73 +0,0 @@ -#lang racket/base - -(require racket/contract - racket/format - racket/match - racket/port - (only-in xml xexpr->string) - (only-in "../find.rkt" find-signature) - "../scribble.rkt") - -(provide type - describe) - -(define (type v) - (type-or-sig v)) - -(define (type-or-sig v) - (or (type-or-contract v) - (sig v) - "")) - -(define (sig v) ;any/c -> (or/c #f string?) - (and (symbol? v) - (match (find-signature (symbol->string v)) - [#f #f] - [x (~a x)]))) - -(define (type-or-contract v) ;any/c -> (or/c #f string?) - (or - ;; 1. Try using Typed Racket's REPL simplified type. - (with-handlers ([exn:fail? (λ _ #f)]) - (match (with-output-to-string - (λ () - ((current-eval) - (cons '#%top-interaction v)))) - [(pregexp "^- : (.*) \\.\\.\\..*\n" (list _ t)) t] - [(pregexp "^- : (.*)\n$" (list _ t)) t])) - ;; 2. Try to find a contract. - (with-handlers ([exn:fail? (λ _ #f)]) - (parameterize ([error-display-handler (λ _ (void))]) - ((current-eval) - (cons '#%top-interaction - `(if (has-contract? ,v) - (~a (contract-name (value-contract ,v))) - (error "")))))))) - -(define (sig-and/or-type stx) - (define dat (syntax->datum stx)) - (define s (sig dat)) - (define t (type-or-contract stx)) - (xexpr->string - `(div () - (h1 () ,(or s (~a dat))) - ,(cond [(not (or s t)) - `(p () - (em () "(Found no documentation, signature, type, or contract.)"))] - [t `(pre () ,t)] - [else ""]) - (br ())))) - -;;; describe - -;; If a symbol has installed documentation, display it. -;; -;; Otherwise, walk the source to find the signature of its definition -;; (because the argument names have explanatory value), and also look -;; for Typed Racket type or a contract, if any. - -(define/contract (describe str) - (-> string? string?) - (define stx (namespace-symbol->identifier (string->symbol str))) - (or (scribble-doc/html stx) - (sig-and/or-type stx))) diff --git a/elpa/racket-mode-20200218.1623/racket/commands/help.rkt b/elpa/racket-mode-20200218.1623/racket/commands/help.rkt deleted file mode 100644 index 1bda5656..00000000 --- a/elpa/racket-mode-20200218.1623/racket/commands/help.rkt +++ /dev/null @@ -1,120 +0,0 @@ -#lang at-exp racket/base - -(require (only-in help/help-utils find-help) - (only-in help/search perform-search) - net/url - racket/contract - racket/match - racket/port - (only-in "../scribble.rkt" binding->path+anchor)) - -(provide doc) - -(define/contract (doc str) - (-> string? any) - (or (identifier-help (namespace-symbol->identifier (string->symbol str))) - (perform-search str))) - -;; It is 2017 therefore it is hard to activate a web browser and show -;; an anchor link within a local HTML file. -;; -;; 1. On macOS `find-help` suffers from the fact that `send-url/file` -;; doesn't supply a `browser` arg to `send-url/mac`. This causes it -;; to give an "open location" command to osascript. This causes -;; macOS to ignore #anchor fragments in the URL. Although the -;; correct page will open, it won't be scrolled to the item of -;; interest. -;; -;; 2. Furthermore, `send-url/mac` doesn't use an "activate" command to -;; show the browser window (it might be hidden behind Emacs). -;; -;; Let's pretend it's 2020. If we we're on mac and can determine the -;; default browser (from plist files^1), do the equivalent of -;; `send-url/mac` but with both desired behaviors. -;; -;; ^1: This is kludgy because the plist has "bundle IDs" like -;; "com.google.chrome" but osascript wants strings like "chrome". - -(module mac-default-browser racket/base - (require json - racket/match - racket/file - racket/system) - (provide mac-default-browser) - - (define launch-plists - '("Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist" - "Library/Preferences/com.apple.LaunchServices.plist")) - - (define (mac-default-browser) - (and (equal? (system-type) 'macosx) - (for/or ([plist launch-plists]) - (match (mac-http-handler (build-path (find-system-path 'home-dir) plist)) - [#f #f] - [(pregexp "^.+\\.(.+?)$" ;after final dot - (list _ s)) s])))) - - (define (mac-http-handler plist-path) ;; path? -> (or/c string? #f) - (for/or ([h (in-list (hash-ref (read-bplist plist-path) 'LSHandlers '()))]) - (and (equal? (hash-ref h 'LSHandlerURLScheme #f) "http") - (hash-ref h 'LSHandlerRoleAll #f)))) - - (define plutil (find-executable-path "plutil" #f)) - - (define (read-bplist plist-path) ;path? -> json? - (define out-path (make-temporary-file)) - (begin0 - (if (system* plutil - "-convert" "json" - "-o" out-path - plist-path) - (with-input-from-file out-path read-json) - (make-hash)) - (delete-file out-path)))) - -(module browse-file-url/mac racket/base - (provide browse-file-url/mac) - (require racket/format - racket/system) - - (define osascript (find-executable-path "osascript" #f)) - - (define (browse-file-url/mac file-url browser) - ;; Note: Unlike `send-url/mac`, we also do an "activate" to show - ;; the browser window. - (system* - osascript - "-e" - @~a{tell application "@browser" to open location "@file-url" activate}))) - -(require 'mac-default-browser - 'browse-file-url/mac) - - -(define/contract (identifier-help stx) - (-> identifier? boolean?) - ((if (mac-default-browser) - identifier-help/mac - identifier-help/other) - stx)) - -(define/contract (identifier-help/other stx) - (-> identifier? boolean?) - ;; Like `find-help` but returns whether help was found and shown. - ;; That way, if this returns #f caller knows it could next call - ;; `perform-search` as Plan B. - (with-handlers ([exn:fail? (λ _ #f)]) - (match (with-output-to-string (λ () (find-help stx))) - [(pregexp "Sending to web browser") #t] - [_ #f]))) - -(define/contract (identifier-help/mac stx) - (-> identifier? boolean?) - (define-values (path anchor) (binding->path+anchor stx)) - (and path - anchor - (let ([path-url (path->url (path->complete-path path))]) - (browse-file-url/mac - (url->string (struct-copy url path-url [fragment anchor])) - (mac-default-browser))) - #t)) diff --git a/elpa/racket-mode-20200218.1623/racket/commands/macro.rkt b/elpa/racket-mode-20200218.1623/racket/commands/macro.rkt deleted file mode 100644 index b37b0089..00000000 --- a/elpa/racket-mode-20200218.1623/racket/commands/macro.rkt +++ /dev/null @@ -1,125 +0,0 @@ -#lang racket/base - -(require racket/contract - racket/file - racket/format - racket/match - racket/pretty - racket/system - "../elisp.rkt" - "../syntax.rkt" - "../util.rkt") - -(provide macro-stepper - macro-stepper/next) - -(define step-thunk/c (-> (cons/c (or/c 'original string? 'final) string?))) -(define step-thunk #f) - -(define/contract (make-expr-stepper str) - (-> string? step-thunk/c) - (define step-num #f) - (define last-stx (string->namespace-syntax str)) - (define (step) - (cond [(not step-num) - (set! step-num 0) - (cons 'original (pretty-format-syntax last-stx))] - [else - (define this-stx (expand-once last-stx)) - (cond [(not (equal? (syntax->datum last-stx) - (syntax->datum this-stx))) - (begin0 - (cons (~a step-num ": expand-once") - (diff-text (pretty-format-syntax last-stx) - (pretty-format-syntax this-stx) - #:unified 3)) - (set! last-stx this-stx))] - [else - (cons 'final (pretty-format-syntax this-stx))])])) - step) - -(define/contract (make-file-stepper path into-base?) - (-> (and/c path-string? absolute-path?) boolean? step-thunk/c) - ;; If the dynamic-require fails, just let it bubble up. - (define stepper-text (dynamic-require 'macro-debugger/stepper-text 'stepper-text)) - (define stx (file->syntax path)) - (define-values (dir _name _dir) (split-path path)) - (define raw-step (parameterize ([current-load-relative-directory dir]) - (stepper-text stx - (if into-base? (λ _ #t) (not-in-base))))) - (define step-num #f) - (define step-last-after "") - (define/contract (step) step-thunk/c - (cond [(not step-num) - (set! step-num 0) - (cons 'original - (pretty-format-syntax stx))] - [else - (define out (open-output-string)) - (parameterize ([current-output-port out]) - (cond [(raw-step 'next) - (set! step-num (add1 step-num)) - (match-define (list title before after) - (step-parts (get-output-string out))) - (set! step-last-after after) - (cons (~a step-num ": " title) - (diff-text before after #:unified 3))] - [else - (cons 'final step-last-after)]))])) - step) - -(define/contract (macro-stepper what into-base?) - (-> (or/c (cons/c 'expr string?) (cons/c 'file path-string?)) elisp-bool/c - (cons/c 'original string?)) - (set! step-thunk - (match what - [(cons 'expr str) (make-expr-stepper str)] - [(cons 'file path) (make-file-stepper path (as-racket-bool into-base?))])) - (macro-stepper/next)) - -(define/contract (macro-stepper/next) - (-> (cons/c (or/c 'original 'final string?) string?)) - (unless step-thunk - (error 'macro-stepper "Nothing to expand")) - (define v (step-thunk)) - (when (eq? 'final (car v)) - (set! step-thunk #f)) - v) - -;; Borrowed from xrepl. -(define not-in-base - (λ () (let ([base-stxs #f]) - (unless base-stxs - (set! base-stxs ; all ids that are bound to a syntax in racket/base - (parameterize ([current-namespace (make-base-namespace)]) - (let-values ([(vals stxs) (module->exports 'racket/base)]) - (map (λ (s) (namespace-symbol->identifier (car s))) - (cdr (assq 0 stxs))))))) - (λ (id) (not (ormap (λ (s) (free-identifier=? id s)) base-stxs)))))) - -(define (step-parts str) - (match str - [(pregexp "^(.+?)\n(.+?)\n +==>\n(.+?)\n+$" - (list _ title before after)) - (list title before after)])) - -(define (diff-text before-text after-text #:unified [-U 3]) - (define template "racket-mode-syntax-diff-~a") - (define (make-temporary-file-with-text str) - (define file (make-temporary-file template)) - (with-output-to-file file #:mode 'text #:exists 'replace - (λ () (displayln str))) - file) - (define before-file (make-temporary-file-with-text before-text)) - (define after-file (make-temporary-file-with-text after-text)) - (define out (open-output-string)) - (begin0 (parameterize ([current-output-port out]) - (system (format "diff -U ~a ~a ~a" -U before-file after-file)) - (match (get-output-string out) - ["" " \n"] - [(pregexp "\n(@@.+@@\n.+)$" (list _ v)) v])) - (delete-file before-file) - (delete-file after-file))) - -(define (pretty-format-syntax stx) - (pretty-format #:mode 'write (syntax->datum stx))) diff --git a/elpa/racket-mode-20200218.1623/racket/find.rkt b/elpa/racket-mode-20200218.1623/racket/find.rkt deleted file mode 100644 index 280d1cd3..00000000 --- a/elpa/racket-mode-20200218.1623/racket/find.rkt +++ /dev/null @@ -1,235 +0,0 @@ -#lang racket/base - -(require racket/contract - (only-in racket/format ~a) - racket/list - racket/match - "syntax.rkt") - -(provide find-definition - find-signature) - -(define location/c (list/c path-string? natural-number/c natural-number/c)) - -;; Try to find the definition of `str`, returning a list with the file -;; name, line and column, 'kernel, or #f if not found. -(define/contract (find-definition str) - (-> string? (or/c #f 'kernel location/c)) - (match (find-definition/stx str) - [(list* stx file submods) - (list (path->string (or (syntax-source stx) file)) - (or (syntax-line stx) 1) - (or (syntax-column stx) 0))] - [v v])) - -;; Try to find the definition of `str`, returning its signature or #f. -;; When defined in 'kernel, returns a form saying so, not #f. -(define/contract (find-signature str) - (-> string? (or/c #f pair?)) - (match (find-definition/stx str) - ['kernel '("defined in #%kernel, signature unavailable")] - [(list* id-stx file submods) - (define file-stx (file->syntax file)) - (define sub-stx (submodule file submods file-stx)) - (match ($signature (syntax-e id-stx) sub-stx) - [(? syntax? stx) (syntax->datum stx)] - [_ #f])] - [v v])) - -(define/contract (find-definition/stx str) - (-> string? - (or/c #f 'kernel (cons/c syntax? (cons/c path? (listof symbol?))))) - (match (identifier-binding* str) - [(? list? xs) - (define ht (make-hash)) ;cache in case source repeated - (for/or ([x (in-list (remove-duplicates xs))]) - (match x - [(cons id 'kernel) 'kernel] - [(list* id file submods) - (define (sub-stx file->stx) - (hash-ref! ht (cons file file->stx) - (λ () (submodule file submods (file->stx file))))) - (match (or ($definition id (sub-stx file->expanded-syntax)) - (match ($renaming-provide id (sub-stx file->syntax)) - [(? syntax? s) - ($definition (syntax-e s) (sub-stx file->expanded-syntax))] - [_ #f])) - [#f #f] - [stx (list* stx file submods)])]))] - [_ #f])) - -;; Distill identifier-binding to what we need. Unfortunately it can't -;; report the definition id in the case of a contract-out and a -;; rename-out, both. For `(provide (contract-out [rename orig new -;; contract]))` it reports (1) the contract-wrapper as the id, and (2) -;; `new` as the nominal-id -- but NOT (3) `orig`. Instead the caller -;; will need try using `renaming-provide`. -(define/contract (identifier-binding* v) - (-> (or/c string? symbol? identifier?) - (or/c #f - (listof (cons/c symbol? - (or/c 'kernel - (cons/c path-string? (listof symbol?))))))) - (define sym->id namespace-symbol->identifier) - (define id (cond [(string? v) (sym->id (string->symbol v))] - [(symbol? v) (sym->id v)] - [(identifier? v) v])) - (match (identifier-binding id) - [(list source-mpi source-id - nominal-source-mpi nominal-source-id - source-phase import-phase nominal-export-phase) - (list (cons source-id (mpi->path source-mpi)) - (cons nominal-source-id (mpi->path nominal-source-mpi)))] - [_ #f])) - -(define/contract (mpi->path mpi) - (-> module-path-index? - (or/c 'kernel - (cons/c path-string? (listof symbol?)))) - (define (hash-bang-symbol? v) - (and (symbol? v) - (regexp-match? #px"^#%" (symbol->string v)))) - (match (resolved-module-path-name (module-path-index-resolve mpi)) - [(? hash-bang-symbol?) 'kernel] - [(? path-string? path) (list path)] - [(? symbol? sym) (list (build-path (current-load-relative-directory) - (~a sym ".rkt")))] - [(list (? path-string? path) (? symbol? subs) ...) - (list* path subs)])) - -;; For use with syntax-case*. When we use syntax-case for syntax-e equality. -(define (syntax-e-eq? a b) - (eq? (syntax-e a) (syntax-e b))) - -(define ((make-eq-sym? sym) stx) - (and (eq? sym (syntax-e stx)) stx)) - -(define (file-module file) - (match (path->string (last (explode-path file))) - [(pregexp "(.+?)\\.rkt$" (list _ v)) (string->symbol v)])) - -;; Return bodies (wrapped in begin) of the module indicated by -;; file and sub-mod-syms. -(define (submodule file sub-mod-syms stx) - (submodule* (cons (file-module file) sub-mod-syms) stx)) - -(define (submodule* mods stx) - (match-define (cons this more) mods) - (define (subs stxs) - (if (empty? more) - #`(begin . #,stxs) - (ormap (λ (stx) (submodule* more stx)) - (syntax->list stxs)))) - (syntax-case* stx (module #%module-begin) syntax-e-eq? - [(module name _ (#%module-begin . stxs)) - (eq? this (syntax-e #'name)) - (subs #'stxs)] - [(module name _ . stxs) - (eq? this (syntax-e #'name)) - (subs #'stxs)] - [_ #f])) - -(module+ test - (require rackunit) - (check-equal? (syntax->datum - (submodule "/path/to/file.rkt" '(a b c) - #'(module file racket - (module a racket - (module not-b racket #f) - (module b racket - (module not-c racket #f) - (module c racket "bingo") - (module not-c racket #f)) - (module not-b racket #f))))) - '(begin "bingo"))) - -;; Given a symbol and syntax, return syntax corresponding to the -;; definition. Intentionally does NOT walk into module forms, so, give -;; us the module bodies wrapped in begin. -;; -;; If `stx` is expanded we can find things defined via definer -;; macros. -;; -;; If `stx` is not expanded, we will miss some things, however the -;; syntax will be closer to what a human expects -- e.g. `(define (f -;; x) x)` instead of `(define-values (f) (lambda (x) x))`. -(define ($definition sym stx) ;;symbol? syntax? -> syntax? - (define eq-sym? (make-eq-sym? sym)) - ;; This is a hack to handle definer macros that neglect to set - ;; srcloc properly using syntax/loc or (format-id ___ #:source __): - ;; If the stx lacks srcloc and its parent stx has srcloc, return the - ;; parent stx instead. Caveats: 1. Assumes caller only cares about - ;; the srcloc. 2. We only check immediate parent. 3. We only use - ;; this for define-values and define-syntaxes, below, on the - ;; assumption that this only matters for fully-expanded syntax. - (define (loc s) - (if (and (not (syntax-line s)) - (syntax-line stx)) - stx - s)) - (syntax-case* stx - (begin define-values define-syntaxes - define define/contract - define-syntax struct define-struct) - syntax-e-eq? - [(begin . stxs) (ormap (λ (stx) ($definition sym stx)) - (syntax->list #'stxs))] - [(define (s . _) . _) (eq-sym? #'s) stx] - [(define/contract (s . _) . _) (eq-sym? #'s) stx] - [(define s . _) (eq-sym? #'s) stx] - [(define-values (ss ...) . _) (ormap eq-sym? (syntax->list #'(ss ...))) - (loc (ormap eq-sym? (syntax->list #'(ss ...))))] - [(define-syntax (s . _) . _) (eq-sym? #'s) stx] - [(define-syntax s . _) (eq-sym? #'s) stx] - [(define-syntaxes (ss ...) . _) (ormap eq-sym? (syntax->list #'(ss ...))) - (loc (ormap eq-sym? (syntax->list #'(ss ...))))] - [(define-struct s . _) (eq-sym? #'s) stx] - [(define-struct (s _) . _) (eq-sym? #'s) stx] - [(struct s . _) (eq-sym? #'s) stx] - [(struct (s _) . _) (eq-sym? #'s) stx] - [_ #f])) - -;; Given a symbol and syntax, return syntax corresponding to the -;; function definition signature. The input syntax should NOT be -;; `expand`ed. This intentionally does NOT walk into module forms, so, -;; give us the module bodies wrapped in begin. -(define ($signature sym stx) ;;symbol? syntax? -> (or/c #f list?) - (define eq-sym? (make-eq-sym? sym)) - (syntax-case* stx (begin define define/contract case-lambda) syntax-e-eq? - [(begin . stxs) (ormap (λ (stx) ($signature sym stx)) - (syntax->list #'stxs))] - [(define (s . as) . _) (eq-sym? #'s) #'(s . as)] - [(define/contract (s . as) . _) (eq-sym? #'s) #'(s . as)] - [(define s (case-lambda [(ass ...) . _] ...)) (eq-sym? #'s) #'((s ass ...) ...)] - [_ #f])) - -;; Find sym in a contracting and/or renaming provide, and return the -;; syntax for the ORIGINAL identifier (before being contracted and/or -;; renamed). The input syntax should NOT be expanded. -(define ($renaming-provide sym stx) ;;symbol? syntax? -> syntax? - (define eq-sym? (make-eq-sym? sym)) - (syntax-case* stx (begin provide provide/contract) syntax-e-eq? - [(begin . stxs) - (ormap (λ (stx) ($renaming-provide sym stx)) - (syntax->list #'stxs))] - [(provide/contract . stxs) - (for/or ([stx (syntax->list #'stxs)]) - (syntax-case stx () - [(s _) (eq-sym? #'s)] - [_ #f]))] - [(provide . stxs) - (for/or ([stx (syntax->list #'stxs)]) - (syntax-case* stx (contract-out rename-out) syntax-e-eq? - [(contract-out . stxs) - (for/or ([stx (syntax->list #'stxs)]) - (syntax-case* stx (rename) syntax-e-eq? - [(rename orig s _) (eq-sym? #'s) #'orig] - [(s _) (eq-sym? #'s) #'s] - [_ #f]))] - [(rename-out . stxs) - (for/or ([stx (syntax->list #'stxs)]) - (syntax-case* stx () syntax-e-eq? - [(orig s) (eq-sym? #'s) #'orig] - [_ #f]))] - [_ #f]))] - [_ #f])) diff --git a/elpa/racket-mode-20200218.1623/racket/fresh-line.rkt b/elpa/racket-mode-20200218.1623/racket/fresh-line.rkt deleted file mode 100644 index f0ce1a85..00000000 --- a/elpa/racket-mode-20200218.1623/racket/fresh-line.rkt +++ /dev/null @@ -1,37 +0,0 @@ -#lang racket/base - -(provide fresh-line - zero-column!) - -;; Borrowed from xrepl - -(define last-output-port #f) -(define last-error-port #f) - -(define (maybe-new-output-ports) - (define-syntax-rule (maybe last cur) - (unless (eq? last cur) - (when (and last - (not (port-closed? last))) - (flush-output last)) ;just in case - (set! last cur) - (flush-output last) - (port-count-lines! last))) - (maybe last-output-port (current-output-port)) - (maybe last-error-port (current-error-port))) - -(define (fresh-line [stderr? #f]) - (maybe-new-output-ports) - (define port (if stderr? last-error-port last-output-port)) - (flush-output port) - (define-values [line col pos] (port-next-location port)) - (unless (eq? col 0) (newline))) - -(define (zero-column!) - ;; there's a problem whenever there's some printout followed by a - ;; read: the cursor will be at column zero, but the port counting - ;; will think that it's still right after the printout; call this - ;; function in such cases to adjust the column to 0. - (maybe-new-output-ports) - (define-values [line col pos] (port-next-location last-output-port)) - (set-port-next-location! last-output-port line 0 pos)) diff --git a/elpa/racket-mode-20200218.1623/racket/interactions.rkt b/elpa/racket-mode-20200218.1623/racket/interactions.rkt deleted file mode 100644 index 9363936b..00000000 --- a/elpa/racket-mode-20200218.1623/racket/interactions.rkt +++ /dev/null @@ -1,84 +0,0 @@ -#lang racket/base - -(require racket/match - "fresh-line.rkt") - -(provide current-sync/yield - get-interaction) - -;; A channel to which a thread puts interactions that it reads using -;; the current-read-interaction handler (which can be set by a lang -;; from its configure-runtime, so, this should be compatible with -;; any lang, even non-sexpr langs). -;; -;; This is its own thread and channel for a couple reasons: -;; -;; - Issue #311. A consumer can use sync/timeout to avoid displaying a -;; prompt when multiple interactions are waiting. -;; -;; - Debugging. We can switch from the normal REPL to a debugger REPL, -;; without input being stuck inside a read call for the former. -;; -;; One wrinkle is we need to be careful about calling yield instead of -;; sync when the gui is active. See issue #326. - -;; FIXME??: This used to be under the REPL custodian. Is it OK for it -;; _not_ to be, now? For instance what if user runs another file, but -;; this is still using the previous current-read-interaction value? -(define chan (make-channel)) - -(define (read-interaction/put-channel) - (define in ((current-get-interaction-input-port))) - (define (read-interaction) - (with-handlers ([exn:fail? values]) - ((current-read-interaction) (object-name in) in))) ;[^1] - (match (read-interaction) - [(? eof-object?) (sync in)] ;[^2] - [(? exn:fail? e) (channel-put chan e)] ;raise in other thread - [v (channel-put chan v)]) - (read-interaction/put-channel)) - -(void (thread read-interaction/put-channel)) - -(define current-sync/yield (make-parameter sync)) ;see issue #326 - -(define (get-interaction prompt) - (match (or (sync/timeout 0.01 chan) ;see issue #311 - (begin (display-prompt prompt) - ((current-sync/yield) chan))) - [(? exn:fail? exn) (raise exn)] - [v v])) - -(define (display-prompt str) - (flush-output (current-error-port)) - (fresh-line) - (display str) - (display "> ") - (flush-output) - (zero-column!)) - -;; "Footnote" comments about make-prompt-read and many attempts to fix -;; issue #305. -;; -;; [^1]: datalog/lang expects each interaction to be EOF terminated. -;; This seems to be a DrRacket convention (?). We could make -;; that work here if we composed open-input-string with -;; read-line. But that would fail for valid multi-line -;; expressions in langs like racket/base e.g. "(+ 1\n2)". We -;; could have Emacs racket-repl-submit append some marker that -;; lets us know to combine multiple lines here -- but we'd have -;; to be careful to eat the marker and avoid combining lines -;; when the user is entering input for their own program that -;; uses `read-line` etc. Trying to be clever here is maybe not -;; smart. I _think_ the safest thing is for each lang like -;; datalog to implement current-read-interaction like it says on -;; the tin -- it can parse just one expression/statement from a -;; normal, "infinite" input port; if that means the lang parser -;; has to be tweaked for a single-expression/statement mode of -;; usage, so be it. -;; -;; [^2]: The eof-object? clause is here only for datalog/lang -;; configure-runtime.rkt. Its `the-read` returns eof if -;; char-ready? is false. WAT. Why doesn't it just block like a -;; normal read-interaction handler? Catch this and wait for more -;; input to be available before calling it again. diff --git a/elpa/racket-mode-20200218.1623/racket/md5.rkt b/elpa/racket-mode-20200218.1623/racket/md5.rkt deleted file mode 100644 index 29e09e67..00000000 --- a/elpa/racket-mode-20200218.1623/racket/md5.rkt +++ /dev/null @@ -1,8 +0,0 @@ -#lang racket/base - -(require file/md5) - -(provide file->md5) - -(define (file->md5 file) - (call-with-input-file* file (compose bytes->string/utf-8 md5))) diff --git a/elpa/racket-mode-20200218.1623/racket/namespace.rkt b/elpa/racket-mode-20200218.1623/racket/namespace.rkt deleted file mode 100644 index 4f445049..00000000 --- a/elpa/racket-mode-20200218.1623/racket/namespace.rkt +++ /dev/null @@ -1,270 +0,0 @@ -#lang at-exp racket/base - -(require racket/contract - racket/file - racket/format - racket/function - racket/list - racket/match - syntax/modread - racket/path - syntax/parse - syntax/strip-context - syntax/stx - (only-in "error.rkt" display-exn) - "mod.rkt" - (only-in "util.rkt" display-commented)) - -(provide dynamic-require/some-namespace) - -;; A composition of dynamic-require and module->namespace that tries -;; to tolerate syntax errors. It tries to return a namespace with at -;; least some identifiers from the file -- such as from module -;; languages, requires, and definitions. -;; -;; Motivation: -;; -;; https://github.com/greghendershott/racket-mode/issues/272 -;; -;; You're working in #lang racket/base. You're partway through writing -;; a some expression, and realize you need to add (say) -;; with-module-reading-parameterization. You add syntax/modread to -;; your require. -;; -;; Now, you want to type with-m and hit TAB to complete. Plus after -;; that, you might want to C-. a.k.a. M-x racket-describe to read -;; docs. -;; -;; But you need to re-run, first, for the new require to take effect -;; and make the syntax/modread exports available. -;; -;; But if you re-run, your half-written expression results in a syntax -;; or runtime error. Now your REPL is just an empty racket/base. -;; -;; Annoying! -;; -;; Strategy: When dynamic-require fails, try again using a custom load -;; handler that rewrites the file -- "distill" it to a skeleton of -;; module forms, requires, and define-values. Try again using that. -;; -;; Note that it's important for the skeleton to include submodules, -;; because racket-mode lets you "enter" a submodule and work with -;; identifiers inside it (and only inside it). - -(define is-skeleton - "[Due to errors, REPL is just module language, requires, and stub definitions]") -(define is-base - "[Due to errors, REPL is just racket/base]") - -;; A composition of dynamic-require and module->namespace, but which -;; tries to tolerate errors in the source file and return _some_ -;; namespace more useful than racket/base (if possible). -(define/contract (dynamic-require/some-namespace mod retry-as-skeletal?) - (-> mod? boolean? namespace?) - (parameterize ([current-load-relative-directory (mod-dir mod)] - [current-directory (mod-dir mod)]) - (cond [(normal mod) => values] - [(and retry-as-skeletal? - (skeletal mod)) => (λ (ns) - (display-commented is-skeleton) - ns)] - [else (display-commented is-base) - (make-base-namespace)]))) - -(define/contract (normal mod) - (-> mod? (or/c #f namespace?)) - (with-handlers ([exn:fail? (λ (e) (display-exn e) #f)]) - (dynamic-require (mod-rmp mod) #f) - (module->namespace (mod-rmp mod)))) - -(define/contract (skeletal mod) - (-> mod? (or/c #f namespace?)) - (with-handlers ([exn:fail? (const #f)]) ;don't show errors again - (parameterize ([current-load (make-load mod)] - ;; Module is cached in old namespace, so for `load` - ;; to be called, we need a fresh namespace. - [current-namespace (make-base-namespace)]) - (dynamic-require (mod-rmp mod) #f) - (module->namespace (mod-rmp mod))))) - -(define/contract (make-load mod) - (-> mod? any) - (define original-load (current-load)) - (define special-path (build-path (mod-dir mod) (mod-file mod))) - (λ (path module-name) - (if (equal? path special-path) - (eval (skeleton (read-module-file path))) - (original-load path module-name)))) - -(define (read-module-file file) ;Path-String -> Syntax - (with-module-reading-parameterization - (λ () - (parameterize ([read-accept-compiled #f]) - (with-input-from-file file read-syntax))))) - -(define no-op-expr #'(void)) -(define no-op-def-val #''|Due to errors in source file, this value is from a "stub" define-values|) - -(define (skeleton stx) ;Syntax -> Syntax - ;; We got here because `stx` has either a syntax error or a runtime - ;; error. If it has a syntax error, we can't `expand` it as whole. - ;; Let's try to distill it to a skeleton of things that create - ;; runtime, module-level bidings: requires and defines. - ;; - ;; To get #%require and define-values, we want to work with - ;; fully-expanded syntax as much as possible. But we have to catch - ;; syntax errors and replace each with #'(void). Also we want to - ;; walk submodule forms for their bindings, but we can't expand a - ;; submodule forms in isolation (that's a syntax error). - ;; - ;; So, the idea is to preserve the nested modules skeleton, and only - ;; try to expand each of their module-level expressions to discover - ;; bindings. - ;; - ;; Our final result should, as a whole, work with (eval (expand)). - (strip-context - ;; Unlike expand-syntax-to-top-form, expand-to-top-form does - ;; namespace-syntax-introduce before expanding to top form. - (let recur ([stx (expand-to-top-form stx)]) - (syntax-parse stx - #:literal-sets (kernel-literals) - #:datum-literals (#%module-begin module+) - ;; Note: A #lang file has #%module-begin even on initial read - ;; and without calling `expand`. However, a (module) expression - ;; file -- even when using with-module-reading-parameterization - ;; -- doesn't. That only gets added by `expand`. But we can't - ;; use `expand`. Anyway, it hardly matters as we're going to - ;; remove everything interesting that a #%module-begin might - ;; transform (IIUC). Just treat #%module-begin as begin. - [((~and mod (~or module module*)) name:id lang:expr . es) - #`(mod name lang . #,(stx-map recur #'es))] - [(#%module-begin . es) - #`(begin . #,(stx-map recur #'es))] - [(module+ name:id . es) - #`(module+ name . #,(stx-map recur #'es))] - [_ - (let ([stx (with-handlers ([exn:fail:syntax? (const no-op-expr)]) - (expand stx))]) - (syntax-parse stx - #:literal-sets (kernel-literals) - [(begin . es) #`(begin . #,(stx-map recur #'es))] - [(#%require . _) stx] - [(define-values (id ...) . _) #`(define-values (id ...) - (values - #,@(stx-map (const no-op-def-val) - #'(id ...))))] - [_ no-op-expr]))])))) - -(module+ test - (require rackunit - racket/set - version/utils) - - ;; A example of the transformation we do. - ;; - ;; Note: Prior to Racket 6.3, expansion of `require` with - ;; non-existent modules seems to be a syntax error. So in this test, - ;; use modules that actually exist in minimal Racket. - (check-equal? (syntax->datum - (skeleton - #'(module m racket/base - (#%module-begin - (require racket/pretty - racket/list) - (if) ;stx err - (/ 1 0) ;runtime err - (define foo 42) - (define-values (bar baz) (values 43 44)) - (define (f x) (+ x 1)) - (module* m #f - (require net/url) - (if) ;stx err - (/ 1 0)) ;runtime err - (module+ test - (require rackunit) - (if)) ;stx err - (module m typed/racket/base - (#%module-begin - (require racket/function) - (define id 42) - (if))))))) ;stx err - (let ([no-op-expr (syntax->datum no-op-expr)] - [no-op-def-val (syntax->datum no-op-def-val)]) - `(module m racket/base - (begin - (begin (#%require racket/pretty) (#%require racket/list)) - ,no-op-expr - ,no-op-expr - (define-values (foo) (values ,no-op-def-val)) - (define-values (bar baz) (values ,no-op-def-val ,no-op-def-val)) - (define-values (f) (values ,no-op-def-val)) - (module* m #f - (#%require net/url) - (void) - (void)) - (module+ test - (#%require rackunit) - ,no-op-expr) - (module m typed/racket/base - (begin - (#%require racket/function) - (define-values (id) (values ,no-op-def-val)) - ,no-op-expr)))))) - - ;; Helpers to write text or sexpr to a tempory .rkt file, then run - ;; through dynamic-require/some-namespace and get the - ;; namespace-mapped-symbols. - - (define/contract (call-with-temporary-file v proc) - (-> any/c (-> mod? any/c) any/c) - (define file #f) - (dynamic-wind - (λ () - (set! file (make-temporary-file "call-with-temporary-file-~a.rkt")) - (call-with-output-file file #:exists 'replace - (λ (out) - (cond [(string? v) (display v out)] - [else (write v out)])))) - (λ () (proc (->mod/existing file))) - (λ () (delete-file file)))) - - (define/contract (syms mod) - (-> mod? (listof symbol?)) - (namespace-mapped-symbols - (parameterize ([current-namespace (make-base-empty-namespace)]) - (dynamic-require/some-namespace mod #t)))) - - (define (do v) - (define op (open-output-string)) - (define result (parameterize ([current-error-port op]) - (call-with-temporary-file v syms))) - (check-match (get-output-string op) - (regexp (string-append (regexp-quote is-skeleton) "\n$"))) - result) - - ;; Despite a syntax error and a runtime error, a binding provided by - ;; a require is available in the namespace in both: - - ;; (a) A #lang file: - (check-not-false - (memq 'pretty-print (do @~a{#lang racket/base - (if) - (require racket/pretty)}))) - - ;; (b) A module expression file: - (check-not-false - (memq 'pretty-print (do `(module m racket/base - (if) - (require racket/pretty))))) - - ;; Requiring exactly 1 binding adds exactly that symbol to the - ;; namespace: - (check-equal? (set-subtract - (list->set - (do `(module m racket/base - (/ 1 0) - (require (only-in racket/pretty pretty-print))))) - (list->set - (do `(module n racket/base - (/ 1 0))))) - (set 'pretty-print))) diff --git a/elpa/racket-mode-20200218.1623/racket/run.rkt b/elpa/racket-mode-20200218.1623/racket/run.rkt deleted file mode 100644 index 5354a930..00000000 --- a/elpa/racket-mode-20200218.1623/racket/run.rkt +++ /dev/null @@ -1,255 +0,0 @@ -#lang racket/base -;; Do NOT use `at-exp` in this file! See issue #290. - -(require racket/cmdline - racket/contract/base - racket/contract/region - racket/format - racket/match - racket/set - racket/string - "channel.rkt" - "command-server.rkt" - (only-in "debug.rkt" make-debug-eval-handler) - "elisp.rkt" - "error.rkt" - "gui.rkt" - "instrument.rkt" - "interactions.rkt" - "logger.rkt" - "mod.rkt" - "namespace.rkt" - "print.rkt" - (only-in "syntax.rkt" with-expanded-syntax-caching-evaluator) - "util.rkt" - "welcome.rkt") - -;; Main moving parts: -;; -;; 1. This main thread, which receives a couple messages on a channel -;; (see channel.rkt). One message is a `rerun` struct with info -;; about a new file/module to run. The main thread loops forever -;; (the `run` function tail calls itself forever). The special case -;; of racket/gui/base is handled with a custom module names -;; resolver and another message. -;; -;; 2. A thread created for each run; loads a module and goes into -;; a read-eval-print-loop. -;; -;; 3. A thread for a command server that listens on a TCP port (see -;; command-server.rkt). One of the commands is a `run` command. - -(module+ main - (define-values (command-port launch-token run-info) - (match (current-command-line-arguments) - [(vector port) - (values (string->number port) - #f - rerun-default)] - [(vector port launch-token run-command) - (values (string->number port) - (elisp-read (open-input-string launch-token)) - (match (elisp-read (open-input-string run-command)) - [(list 'run what mem pp ctx args dbgs skel) - (rerun (->mod/existing what) - mem - (as-racket-bool pp) - ctx - (list->vector args) - (list->set (map string->path dbgs)) - (as-racket-bool skel) - void)] - [v (eprintf "Bad command-line arguments: ~v => ~v\n" run-command v) - (exit)]))] - [v - (eprintf "Bad command-line arguments: ~v\n" v) - (exit)])) - (start-command-server command-port launch-token) - (start-logger-server (add1 command-port) launch-token) - ;; Emacs on Windows comint-mode needs buffering disabled. - (when (eq? (system-type 'os) 'windows) - (file-stream-buffer-mode (current-output-port) 'none)) - (welcome (and (rerun-maybe-mod run-info) #t)) - (flush-output) - (parameterize ([error-display-handler our-error-display-handler]) - (run run-info))) - -(define (run rr) ;rerun? -> void? - (match-define (rerun maybe-mod - mem-limit - pretty-print? - context-level - cmd-line-args - debug-files - retry-as-skeleton? - ready-thunk) rr) - (define-values (dir file mod-path) (maybe-mod->dir/file/rmp maybe-mod)) - ;; Always set current-directory and current-load-relative-directory - ;; to match the source file. - (current-directory dir) - (current-load-relative-directory dir) - ;; Make src-loc->string provide full pathnames - (show-full-path-in-errors) - ;; Custodian for the REPL. - (define repl-cust (make-custodian)) - (when (< 0 mem-limit) - (custodian-limit-memory repl-cust - (inexact->exact (round (* 1024 1024 mem-limit))) - repl-cust)) - ;; If racket/gui/base isn't loaded, the current-eventspace parameter - ;; doesn't exist, so make a "dummy" parameter of that name. - (define current-eventspace (txt/gui (make-parameter #f) current-eventspace)) - - ;; Create REPL thread - (define repl-thread - (parameterize* ;; Use `parameterize*` because the order matters. - (;; FIRST: current-custodian and current-namespace, so in - ;; effect for later parameterizations. - [current-custodian repl-cust] - [current-namespace (if mod-path - ((txt/gui make-base-empty-namespace - make-gui-empty-namespace)) - ((txt/gui make-base-namespace - make-gui-namespace)))] - ;; OTHERS: - [compile-enforce-module-constants #f] - [compile-context-preservation-enabled (not (eq? context-level 'low))] - [current-eval - (cond [(debug-level? context-level) (make-debug-eval-handler debug-files)] - [(instrument-level? context-level)(make-instrumented-eval-handler)] - [else (current-eval)])] - [instrumenting-enabled (instrument-level? context-level)] - [profiling-enabled (eq? context-level 'profile)] - [test-coverage-enabled (eq? context-level 'coverage)] - [current-sync/yield (txt/gui sync yield)] - ;; LAST: `current-eventspace` because `make-eventspace` - ;; creates an event handler thread -- now. We want that - ;; thread to inherit the parameterizations above. (Otherwise - ;; in the non-gui case, we call `thread` below in the body of - ;; the parameterize* form, so that's fine.) - [current-eventspace ((txt/gui void make-eventspace))]) - ;; repl-thunk will be called from another thread -- either a plain - ;; thread when racket/gui/base is not (yet) instantiated, or, from - ;; (eventspace-handler-thread (current-eventspace)). - (define (repl-thunk) - ;; 0. Command line arguments - (current-command-line-arguments cmd-line-args) - ;; 1. Set print hooks and output handlers - (set-print-parameters pretty-print?) - (set-output-handlers) - ;; 2. If module, require and enter its namespace, etc. - (with-expanded-syntax-caching-evaluator maybe-mod - (when (and maybe-mod mod-path) - (parameterize ([current-module-name-resolver module-name-resolver-for-run]) - ;; When exn:fail? during module load, re-run with "empty" - ;; module. Note: Unlikely now that we're using - ;; dynamic-require/some-namespace. - (define (load-exn-handler exn) - (display-exn exn) - (channel-put message-to-main-thread-channel - (struct-copy rerun rr [maybe-mod #f])) - (sync never-evt)) - (with-handlers ([exn? load-exn-handler]) - (maybe-configure-runtime mod-path) ;FIRST: see #281 - (current-namespace - (dynamic-require/some-namespace maybe-mod retry-as-skeleton?)) - (maybe-warn-about-submodules mod-path context-level) - (check-top-interaction))))) - ;; 3. Tell command server to use our namespace and module. - (attach-command-server (current-namespace) maybe-mod) - ;; 3b. And call the ready-thunk command-server gave us from a - ;; run command, so that it can send a response for the run - ;; command. Because the command server runs on a different - ;; thread, it is probably waiting with (sync some-channel) and - ;; the thunk will simply channel-put. - (ready-thunk) - ;; 4. read-eval-print-loop - (parameterize ([current-prompt-read (make-prompt-read maybe-mod)] - [current-module-name-resolver module-name-resolver-for-repl]) - ;; Note that read-eval-print-loop catches all non-break - ;; exceptions. - (read-eval-print-loop))) - - ;; Main thread: Run repl-thunk on a plain thread, or, on the - ;; eventspace thread via queue-callback. Return the thread. - (define t/v ((txt/gui thread queue-callback ) repl-thunk)) - (define thd ((txt/gui (λ _ t/v) eventspace-handler-thread) (current-eventspace))) - thd)) - - ;; Main thread: Wait for message from REPL thread on channel. Also - ;; catch breaks, in which case we (a) break the REPL thread so - ;; display-exn runs there, and (b) continue from the break instead - ;; of re-running so that the REPL environment is maintained. - (define message - (call-with-exception-handler - (match-lambda - [(and (or (? exn:break:terminate?) (? exn:break:hang-up?)) e) e] - [(exn:break msg marks continue) (break-thread repl-thread) (continue)] - [e e]) - (λ () (sync message-to-main-thread-channel)))) - (match context-level - ['profile (clear-profile-info!)] - ['coverage (clear-test-coverage-info!)] - [_ (void)]) - (custodian-shutdown-all repl-cust) - (newline) ;; FIXME: Move this to racket-mode.el instead? - (match message - [(? rerun? new-rr) (run new-rr)] - [(load-gui repl?) (require-gui repl?) (run rr)])) - -(define (maybe-configure-runtime mod-path) - ;; Do configure-runtime when available. - ;; Important for langs like Typed Racket. - (with-handlers ([exn:fail? void]) - (match (module->language-info mod-path #t) - [(vector mp name val) - (define get-info ((dynamic-require mp name) val)) - (define configs (get-info 'configure-runtime '())) - (for ([config (in-list configs)]) - (match-let ([(vector mp name val) config]) - ((dynamic-require mp name) val)))] - [_ (void)]) - (define cr-submod `(submod - ,@(match mod-path - [(list 'submod sub-paths ...) sub-paths] - [_ (list mod-path)]) - configure-runtime)) - (when (module-declared? cr-submod) - (dynamic-require cr-submod #f)))) - -(define (check-top-interaction) - ;; Check that the lang defines #%top-interaction - (unless (memq '#%top-interaction (namespace-mapped-symbols)) - (display-commented - "Because the language used by this module provides no #%top-interaction\n you will be unable to evaluate expressions here in the REPL."))) - -;; Catch attempt to load racket/gui/base for the first time. -(define (make-module-name-resolver repl?) - (let ([orig-resolver (current-module-name-resolver)]) - (define (resolve mp rmp stx load?) - (when (and load? (memq mp '(racket/gui/base - racket/gui/dynamic - scheme/gui/base))) - (unless (gui-required?) - (channel-put message-to-main-thread-channel - (load-gui repl?)) - (sync never-evt))) - (orig-resolver mp rmp stx load?)) - (case-lambda - [(rmp ns) (orig-resolver rmp ns)] - [(mp rmp stx) (resolve mp rmp stx #t)] - [(mp rmp stx load?) (resolve mp rmp stx load?)]))) -(define module-name-resolver-for-run (make-module-name-resolver #f)) -(define module-name-resolver-for-repl (make-module-name-resolver #t)) - -;;; Output handlers; see issues #381 #397 - -(define the-default-output-handlers - (for/hash ([get/set (in-list (list port-write-handler - port-display-handler - port-print-handler))]) - (values get/set (get/set (current-output-port))))) - -(define (set-output-handlers) - (for ([(get/set v) (in-hash the-default-output-handlers)]) - (get/set (current-output-port) v))) diff --git a/elpa/racket-mode-20200218.1623/racket/syntax.rkt b/elpa/racket-mode-20200218.1623/racket/syntax.rkt deleted file mode 100644 index 5f909a6f..00000000 --- a/elpa/racket-mode-20200218.1623/racket/syntax.rkt +++ /dev/null @@ -1,110 +0,0 @@ -#lang racket/base - -(require (only-in compiler/cm [get-file-sha1 file->digest]) - racket/contract - racket/match - racket/promise - syntax/modread - syntax/parse/define - "mod.rkt") - -(provide with-expanded-syntax-caching-evaluator - file->syntax - file->expanded-syntax) - -;; Return a syntax object or #f for the contents of `file`. The -;; resulting syntax is applied to `k` while the parameters -;; current-load-relative-directory and current-namespace are still set -;; appropriately. -(define/contract (file->syntax file [k values]) - (->* (path-string?) - ((-> syntax? syntax?)) - (or/c #f syntax?)) - (define-values (base _ __) (split-path file)) - (parameterize ([current-load-relative-directory base] - [current-namespace (make-base-namespace)]) - (with-handlers ([exn:fail? (λ _ #f)]) - (k - (with-module-reading-parameterization - (λ () - (with-input-from-file file read-syntax/count-lines))))))) - -(define (read-syntax/count-lines) - (port-count-lines! (current-input-port)) - (read-syntax)) - -;;; expanded syntax caching - -(define/contract (call-with-expanded-syntax-caching-evaluator maybe-mod thk) - (-> (or/c mod? #f) (-> any) any) - (before-run maybe-mod) - (begin0 - (parameterize ([current-eval (make-eval-handler maybe-mod)]) - (thk)) - (after-run maybe-mod))) - -(define-simple-macro (with-expanded-syntax-caching-evaluator mm:expr e:expr ...+) - (call-with-expanded-syntax-caching-evaluator mm (λ () e ...))) - -;; cache : (hash/c file (cons/c digest-string? (or/c promise? syntax?))) -(define cache (make-hash)) -(define last-mod #f) - -;; Call this early in a file run, _before_ any evaluation. If it's not -;; the same file as before, we empty the cache -- to free up memory. -;; If it's the same file, we keep the cache. -(define (before-run maybe-mod) - (unless (equal? last-mod maybe-mod) - (hash-clear! cache) - (set! last-mod maybe-mod))) - -(define ((make-eval-handler maybe-mod [orig-eval (current-eval)]) e) - (cond [(and (syntax? e) - (syntax-source e) - (path-string? (syntax-source e)) - (not (compiled-expression? (syntax-e e)))) - (define expanded-stx (expand e)) - (cache-set! (syntax-source e) (λ () expanded-stx)) - (orig-eval expanded-stx)] - [else (orig-eval e)])) - -(define (after-run maybe-mod) - ;; When the rkt file being run has a compiled zo that was used, then - ;; our eval-hander above won't expand and cache any syntax. That - ;; means when the user does a command that needs expanded syntax - ;; (e.g. find-completion), they will need to wait for expansion. But - ;; if you call this _after_ the file was run, it will cache-set! the - ;; expansion using `delay/thread` -- i.e. the work will happen "in - ;; the background". (Furthermore, when we already have a cache entry - ;; for the file and digest, from a previous run, we'll just use - ;; that.) As a result, it's likely to be mostly or entirely ready - ;; when the user does a command. - (define-values (dir base _) (maybe-mod->dir/file/rmp maybe-mod)) - (when (and dir base) - (define path (build-path dir base)) - (cache-set! path (λ () (delay/thread (file->syntax path expand)))))) - -;; cache-set! takes a thunk so that, if the cache already has an entry -;; for the file and digest, it can avoid doing any work. Furthermore, -;; if you already have a digest for file, supply it to avoid redoing -;; that work, too. -(define/contract (cache-set! file thk [digest #f]) - (->* (path-string? (-> (or/c promise? syntax?))) - ((or/c #f string?)) - any) - (let ([digest (or digest (file->digest file))]) - (match (hash-ref cache file #f) - [(cons (== digest) _) - (void)] - [_ - (hash-set! cache file (cons digest (thk)))]))) - -(define (file->expanded-syntax file) - (define digest (file->digest file)) - (match (hash-ref cache file #f) - [(cons (== digest) promise) - (force promise)] - [_ - (define stx (file->syntax file expand)) - (cache-set! file (λ () stx) digest) - stx])) diff --git a/elpa/racket-mode-20200218.1623/racket/util.rkt b/elpa/racket-mode-20200218.1623/racket/util.rkt deleted file mode 100644 index b97614b5..00000000 --- a/elpa/racket-mode-20200218.1623/racket/util.rkt +++ /dev/null @@ -1,39 +0,0 @@ -#lang racket/base - -(require (for-syntax racket/base - syntax/parse)) - -(provide display-commented - with-dynamic-requires - string->namespace-syntax - syntax-or-sexpr->syntax - syntax-or-sexpr->sexpr - nat/c - pos/c) - -(define (display-commented str) - (eprintf "; ~a\n" - (regexp-replace* "\n" str "\n; "))) - -(define-syntax (with-dynamic-requires stx) - (syntax-parse stx - [(_ ([lib:id id:id] ...+) body:expr ...+) - #'(let ([id (dynamic-require 'lib 'id)] ...) - body ...)])) - -(define (string->namespace-syntax str) - (namespace-syntax-introduce - (read-syntax #f (open-input-string str)))) - -(define (syntax-or-sexpr->syntax v) - (if (syntax? v) - v - (namespace-syntax-introduce (datum->syntax #f v)))) - -(define (syntax-or-sexpr->sexpr v) - (if (syntax? v) - (syntax-e v) - v)) - -(define nat/c exact-nonnegative-integer?) -(define pos/c exact-positive-integer?) diff --git a/elpa/racket-mode-20200218.1623/racket/welcome.rkt b/elpa/racket-mode-20200218.1623/racket/welcome.rkt deleted file mode 100644 index 4ab6f791..00000000 --- a/elpa/racket-mode-20200218.1623/racket/welcome.rkt +++ /dev/null @@ -1,19 +0,0 @@ -#lang at-exp racket/base - -(require racket/format - "util.rkt") - -(provide welcome) - -(define (welcome specific-file?) - (display (banner)) - (unless specific-file? - (display-commented - @~a{You started Racket Mode's REPL for no specific file. The namespace - is just #lang racket/base. If you were expecting more things to be - defined, try entering (require racket). - - Instead of using the racket-repl command, consider using - Racket Mode's REPL as intended: - 1. Visit a .rkt file. - 2. Use the racket-run command.}))) diff --git a/elpa/racket-mode-20200218.1623/dir b/elpa/racket-mode-20200323.1739/dir similarity index 100% rename from elpa/racket-mode-20200218.1623/dir rename to elpa/racket-mode-20200323.1739/dir diff --git a/elpa/racket-mode-20200218.1623/racket-bug-report.el b/elpa/racket-mode-20200323.1739/racket-bug-report.el similarity index 97% rename from elpa/racket-mode-20200218.1623/racket-bug-report.el rename to elpa/racket-mode-20200323.1739/racket-bug-report.el index 5b9e5723..25b6dd2d 100644 --- a/elpa/racket-mode-20200218.1623/racket-bug-report.el +++ b/elpa/racket-mode-20200323.1739/racket-bug-report.el @@ -47,11 +47,9 @@ racket--rkt-source-dir racket-program racket-command-port - racket-command-startup racket-command-timeout racket-memory-limit racket-error-context - racket-retry-as-skeleton racket-error-context racket-history-filter-regexp racket-images-inline diff --git a/elpa/racket-mode-20200218.1623/racket-bug-report.elc b/elpa/racket-mode-20200323.1739/racket-bug-report.elc similarity index 65% rename from elpa/racket-mode-20200218.1623/racket-bug-report.elc rename to elpa/racket-mode-20200323.1739/racket-bug-report.elc index da3dfc270b4689fa6fd5d2423f21f3b58a1203f4..381664dd42cf9502b7ec161472ff0352269e0767 100644 GIT binary patch delta 20 ccmcaAvQ%Wl1-8l0*(@e=v5Ri@W#?c909I%QtN;K2 delta 41 xcmZ1~a#du*1vd8LlEk8t(t^nc*gOP_QcH>|brXwqi?dU6QcLplHnFQR0{~j=51#-4 diff --git a/elpa/racket-mode-20200323.1739/racket-cmd.el b/elpa/racket-mode-20200323.1739/racket-cmd.el new file mode 100644 index 00000000..a2efdbc4 --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket-cmd.el @@ -0,0 +1,224 @@ +;;; racket-cmd.el -*- lexical-binding: t; -*- + +;; Copyright (c) 2013-2020 by Greg Hendershott. +;; Portions Copyright (C) 1985-1986, 1999-2013 Free Software Foundation, Inc. +;; Image portions Copyright (C) 2012 Jose Antonio Ortega Ruiz. + +;; Author: Greg Hendershott +;; URL: https://github.com/greghendershott/racket-mode + +;; License: +;; This is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. This is distributed in the hope that it will be +;; useful, but without any warranty; without even the implied warranty +;; of merchantability or fitness for a particular purpose. See the GNU +;; General Public License for more details. See +;; http://www.gnu.org/licenses/ for details. + +;;; TCP connection to back end command server + +(require 'racket-custom) +(require 'racket-util) + +(declare-function racket--debug-on-break "racket-debug" (response)) +(autoload 'racket--debug-on-break "racket-debug") + +(defun racket-start-back-end () + "Start the back end process used by Racket Mode. + +If the process is already started, this command will stop and restart it." + (interactive) + (racket--cmd-open)) + +(defun racket-stop-back-end () + "Stop the back end process used by Racket Mode. + +If the process is not already started, this does nothing." + (interactive) + (racket--cmd-close)) + +(defvar racket--cmd-name "racket-process" + "Name for both the process and its associated buffer") + +(defun racket--cmd-open-p () + "Does a running process exist for the command server?" + (pcase (get-process racket--cmd-name) + ((and (pred (processp)) proc) + (eq 'run (process-status proc))))) + +(defvar racket--run.rkt (expand-file-name "main.rkt" racket--rkt-source-dir) + "Pathname of run.rkt.") + +(defvar racket-adjust-run-rkt #'identity + "A function used to transform the variable `racket--run.rkt'. + +You probably don't need to change this unless you are developing +Racket Mode, AND run Emacs on Windows Subsystem for Linux, AND +want to run your programs using Windows Racket.exe, AND have the +Racket Mode source code under \"/mnt\". Whew. In that case you +can set this variable to the function `racket-wsl-to-windows' so +that Racket Mode can find its own run.rkt file.") + +(defvar racket--cmd-auth nil + "A value we give the Racket back-end when we launch it and when we connect. +See issue #327.") + +(defun racket--cmd-open () + ;; Never create more "racket-process<1>" etc processes. + (racket--cmd-close) + (make-process + :name racket--cmd-name + :connection-type 'pipe + :noquery t + :buffer (get-buffer-create racket--cmd-name) + :stderr (get-buffer-create "racket-process-stderr") + :command (list racket-program + (funcall racket-adjust-run-rkt racket--run.rkt) + (number-to-string racket-command-port) + (setq racket--cmd-auth (format "%S" `(auth ,(random))))) + :filter #'racket--cmd-process-filter)) + +(defun racket--cmd-close () + (pcase (get-process racket--cmd-name) + ((and (pred (processp)) proc) (delete-process proc)))) + +(defun racket--call-when-connected-to-command-server (func) + "Call FUNC, starting the back end process if necessary." + (unless (racket--cmd-open-p) + (racket--cmd-open)) + (funcall func (get-process racket--cmd-name))) + +(defun racket--cmd-process-filter (proc string) + "Parse complete sexprs from the process output and give them to +`racket--cmd-dispatch-response'." + (let ((buffer (process-buffer proc))) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (goto-char (point-max)) + (insert string) + (goto-char (point-min)) + (while + (condition-case () + (progn + (forward-sexp 1) + (let ((sexp (buffer-substring (point-min) (point)))) + (delete-region (point-min) (point)) + (ignore-errors + (racket--cmd-dispatch-response (read sexp)) + t))) + (scan-error nil))))))) + +(defvar racket--cmd-nonce->callback (make-hash-table :test 'eq) + "A hash from nonce to callback function.") +(defvar racket--cmd-nonce 0 + "Number that increments for each command request we send.") + +(defun racket--cmd-dispatch-response (response) + "Do something with a sexpr sent to us from the command server. +Mostly these are responses to command requests. Strictly speaking +'debug-break is a \"notification\", i.e. /not/ one direct response +to one command request." + (pcase response + (`(debug-break . ,response) + (run-at-time 0.001 nil #'racket--debug-on-break response)) + (`(,nonce . ,response) + (let ((callback (gethash nonce racket--cmd-nonce->callback))) + (when callback + (remhash nonce racket--cmd-nonce->callback) + (run-at-time 0.001 nil callback response)))) + (_ nil))) + +(defun racket--cmd/async-raw (repl-session-id command-sexpr &optional callback) + "Send COMMAND-SEXPR and return. Later call CALLBACK with the response sexp. + +REPL-SESSION-ID may be nil for commands that do not need to run +in a specific namespace. + +If CALLBACK is not supplied or nil, defaults to `ignore'. + +Otherwise CALLBACK is called after the command server returns a +response. Because command responses are obtained from the dynamic +extent of a `set-process-filter' proc -- which may have +limitations on what it can or should do -- CALLBACK is not called +immediately but instead using `run-at-time' with a very small +delay. + +Important: Do not assume that `current-buffer' is the same when +CALLBACK is called, as it was when the command was sent. If you +need to do something to do that original buffer, save the +`current-buffer' in a `let' and use it in a `with-current-buffer' +form. See `racket--restoring-current-buffer'." + (racket--call-when-connected-to-command-server + (lambda (process) + (cl-incf racket--cmd-nonce) + (when (and callback + (not (equal callback #'ignore))) + (puthash racket--cmd-nonce callback racket--cmd-nonce->callback)) + (process-send-string + process + (format "%S\n" (cons racket--cmd-nonce + (cons repl-session-id + command-sexpr))))))) + +(defun racket--cmd/async (repl-session-id command-sexpr &optional callback) + "You probably want to use this instead of `racket--cmd/async-raw'. + +REPL-SESSION-ID may be nil for commands that do not need to run +in a specific namespace. + +CALLBACK is only called for 'ok responses, with (ok v ...) +unwrapped to (v ...). + +'error responses are handled here. Note: We use `message' not +`error' here because: + + 1. It would show \"error running timer:\" which, although true, + is confusing or at best N/A for end users. + + 2. More simply, we don't need to escape any call stack, we only + need to ... not call the callback! + +'break responses are handled here, too. This is used when a +command is somehow canceled, with no useful response except the +indication we should clean up the pending callback as usual. + +The original value of `current-buffer' is temporarily restored +during CALLBACK, because neglecting to do so is a likely +mistake." + (let ((buf (current-buffer))) + (racket--cmd/async-raw + repl-session-id + command-sexpr + (if callback + (lambda (response) + (pcase response + (`(ok ,v) (with-current-buffer buf (funcall callback v))) + (`(error ,m) (message "%s" m)) + (`(break) nil) + (v (message "Unknown command response: %S" v)))) + #'ignore)))) + +(defun racket--cmd/await (repl-session-id command-sexpr) + "Send COMMAND-SEXPR. Await and return an 'ok response value, or raise `error'. + +REPL-SESSION-ID may be nil for commands that do not need to run +in a specific namespace." + (let* ((awaiting 'RACKET-REPL-AWAITING) + (response awaiting)) + (racket--cmd/async-raw repl-session-id + command-sexpr + (lambda (v) (setq response v))) + (with-timeout (racket-command-timeout + (error "racket-command process timeout")) + (while (eq response awaiting) + (accept-process-output nil 0.001)) + (pcase response + (`(ok ,v) v) + (`(error ,m) (error "%s" m)) + (v (error "Unknown command response: %S" v)))))) + +(provide 'racket-cmd) + +;; racket-cmd.el ends here diff --git a/elpa/racket-mode-20200323.1739/racket-cmd.elc b/elpa/racket-mode-20200323.1739/racket-cmd.elc new file mode 100644 index 0000000000000000000000000000000000000000..8a592bfa130ae55234d21c42664fc412ad45572b GIT binary patch literal 8274 zcmcIp3vb)V5w>%=AmITmibGqpMbV9XIoStOA*omFH0?Q#?`kx00z22VI2rJYTv@Co zQsKk0`uOktW_Fi)I8IWeb)pBC%iWpTnQy)sJwAB8|I4+tHRti;$6`MnPvVh^_##fk z!B~d5xKvplr-=wUjV9lj#>G&`(MY6|A|A*8kOgk%4To>O9>%#CU=>m3Di_f#k>fZN zQ5xn&7ANQVHtuG5A!HP(NL0J{JB?uH+8R-cHIlRtVVV>Ylgnb@KEg=i?w#x(9*S@% zGZ_{Tahtc7NhI=AgfbC*B}S=S+Qg`m3njBrtTIsyF)?WBePM!6`Xd28_0Msf&Hk)V zZkR?&)OtGB47xy()`% zBxG5nWEDH;Myg+)yRc_JQ}RO8%%eP9I~C0>XX9HxXo-_TW(Dk}L?4R_1v^i&G*o#` z2OWw2OdRvB;sqp!K@SH!+fIU4$Pu=PW+JDhRJ4uz7!A|$m`-gP!=oVYM9@{Hc$SEZ z#_ycXNDbsDmbs`K@%W}olDH(v#*d!1m9U1;25`f1sc46Ib(Mq_} zqg!HAT}@zJm*CFWZ48j2d$r1@xN!5d%tGZxakgc*4R%^=%2v}8dty)~A)%;_r6LtY zCX*ay9J3veK>J%-l7@Xum;q;#dLa^pL&hpV$K+gL3B*~Mj3`)V zm@NSjk-Ai)bb_;U7UFhW>>WKL)eZJTqBn68rPExTl>K~`7i!F>`#es{E1vC4WddMG z`6;ZPkuc|(91}2*YuE+!HVt*9^e#hrNusI6{ej(NDL4+$uS_C9bnW3dDQXSzW~inO zahTu{iF_b)MY=eI^tmErf{vA)$b#^{%BsXNs=)v=w!%Pp9IbH@M^IB3#o zVm*Pgnu+2CcaYKF0kd=>5)eDBWT<0i4Eo+fCB9rOIZa5W5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el similarity index 87% rename from elpa/racket-mode-20200218.1623/racket-collection.el rename to elpa/racket-mode-20200323.1739/racket-collection.el index 2bcfcc57..d1ad563b 100644 --- a/elpa/racket-mode-20200218.1623/racket-collection.el +++ b/elpa/racket-mode-20200323.1739/racket-collection.el @@ -50,23 +50,27 @@ See also: `racket-visit-module' and `racket-open-require-path'." (pcase (racket--symbol-at-point-or-prompt prefix "Collection name: ") (`() nil) (coll - (pcase (racket--cmd/await `(find-collection ,coll)) - (`() - (user-error (format "Collection `%s' not found" coll))) - (`(,path) - (racket--find-file-in-dir path)) - (paths - (let ((done nil)) - (while (not done) - ;; `(ido-find-file-in-dir (ido-completing-read paths))` - ;; -- except we want to let the user press C-g inside - ;; ido-find-file-in-dir to back up and pick a different - ;; module path. - (let ((dir (ido-completing-read "Directory: " paths))) - (condition-case () - (progn (racket--find-file-in-dir dir) - (setq done t)) - (quit nil)))))))))) + (racket--cmd/async + nil + `(find-collection ,coll) + (lambda (result) + (pcase result + (`() + (user-error (format "Collection `%s' not found" coll))) + (`(,path) + (racket--find-file-in-dir path)) + (paths + (let ((done nil)) + (while (not done) + ;; `(ido-find-file-in-dir (ido-completing-read paths))` + ;; -- except we want to let the user press C-g inside + ;; ido-find-file-in-dir to back up and pick a different + ;; module path. + (let ((dir (ido-completing-read "Directory: " paths))) + (condition-case () + (progn (racket--find-file-in-dir dir) + (setq done t)) + (quit nil)))))))))))) (defun racket--find-file-in-dir (dir) "Like `ido-find-file-in-dir', but allows C-d to `dired' as does `ido-find-file'." @@ -130,26 +134,18 @@ See also: `racket-visit-module' and `racket-open-require-path'." racket--orp/nop)))) (defun racket--orp/process () - "Start process to run find-module-path-completions.rkt. - -To do so, prefer `make-process' when available (Emacs 25.1+) -because we can filter stderr. This helps e.g. when Racket core -developers insert an eprintf in racket/base.rkt or similar -- see -issue #345." + "Start process to run find-module-path-completions.rkt." (let ((name "racket-find-module-path-completions-process") (buffer " *racket-find-module-path-completions*") (stderr " *racket-find-module-path-completions-stderr*") (rkt (funcall racket-adjust-run-rkt (expand-file-name "find-module-path-completions.rkt" racket--rkt-source-dir)))) - (if (fboundp 'make-process) - (make-process :name name - :buffer buffer - :command (list racket-program rkt) - :connection-type 'pipe - :stderr stderr) - (let ((process-connection-type nil)) ;use pipe not tty - (start-process name buffer racket-program rkt))))) + (make-process :name name + :buffer buffer + :command (list racket-program rkt) + :connection-type 'pipe + :stderr stderr))) (defun racket--orp/begin () (setq racket--orp/tq (tq-create (racket--orp/process)))) @@ -189,10 +185,7 @@ at the top, marked with \"->\". - C-n and C-p move among the choices. - RET on a directory adds its contents to the choices. - RET on a file exits doing `find-file'. -- C-g aborts. - -Note: This requires Racket 6.1.1.6 or newer. Otherwise it won't -error, it will just never return any matches." +- C-g aborts." (interactive) (racket--orp/begin) (setq racket--orp/active t) diff --git a/elpa/racket-mode-20200218.1623/racket-collection.elc b/elpa/racket-mode-20200323.1739/racket-collection.elc similarity index 71% rename from elpa/racket-mode-20200218.1623/racket-collection.elc rename to elpa/racket-mode-20200323.1739/racket-collection.elc index 229de3d78e5a2cf46c2e7e509dab96d49cd8ff30..076568e7c90329b1a2678928d81add934eef334f 100644 GIT binary patch delta 556 zcmXX@&uF7d6e)8d^5v@&!A(S7@QC|wT=^v!*1q&l4Hk#wz(F)$)xp!aN&K{15zx) zyX_QwzQ9pV#T9a>RySW*K9?sMRoA5?dqW0ME0@;cPQHU?z5c^NSf9=&4`#hbT|@}l zvv*JfF-)k_bzoX9MgQ{mbi)-m>RfuN8%$;Uk>7;H>Rp3l7U9AxJtD;~dWQL~6Mw_G ztg!x5Hw5MI_sZ9_@PxPYE5nENY_ur7&{r@$$4b%jjkTnKxd*SWeK)wrV6^=!>A6h` U`)HB$ntl`P%FrOn?q%irfAbBK0{{R3 delta 901 zcmXw%&u`pB6vx-`hHSjuG=-*wmMkyb^v9C!;_>edDk`*v3M3*`y&$<&9q)72#A}u#gHM{oOs zM*G%Q`~A98_iU|yx6$dYlhj*V-|pAS_Znf+-hTV^qdMJHA1`lpd)Cd~-f@&c&!(h| zBY^`GdJYv&Tt_9#ch1kFR6>&G<3U_x8OAa#^6KF$%i0?B+=b4CGLjROto*45fv@&k z-jZpnuUg|JH&B1KGMXinM2V+IkEqA1TYWpXK z@t}Zl0iw78CC3CgJf22JI4F4$qY&3%KEWKK<0#FdgAC#N-DwmHu-qZr?HdOeM>Byi zM~I`G=FTK_5OR#158=Ti6)?f96oA9S;c2V;QGA3F;)0_w{sfOPD@x=7(p(^yKwYrp zX)Y7m0lpBwb3jH7`H_Tznx|75g~MO~0?|l?m?8P;xa!&3MfKVl=U&aqzFH$(;Oo?2 z!h}|TZG%9EwnfY>Mq#zD5?tcNNNw5O3$!|&FsXGr{p#?{infv*6tjF>s%hu;M|qmj z&qZARZ_mpC>++CCQ?hX38nMgsQ+5OSw8V$N7+mk|z!0oaV5%3Jm#V)y_ceXQSatL4 zms-t;wWdF$mUOB8p(Kqf(+cKetY#BP4`^CIywK3 zrUxTW$qPR>J!Xv-Q$KqBnWo#LQT1ZeZ0ZghshzD~^?=;}ckB0NVA3uArTe@YSiY&g NeJjx&YOo1c{sR^qsipDc(_+V% z&5aB;PZ2L;WHGfgH`&Z58Np#n8+|bF!kG*yi)HHyN4D4U9Igmfz0A xVs2?^GC56YFN>L_5mnT-t0H)pCH2Wl`fm~5<}2mp{1DYpOs delta 259 zcmccVep}kVvsYQDSm-YKbmXQ7T-C zLTXM*ezGnQm*%GCl_Y}o!?Y<(t`k+BTq}Bk+1$`") (point)))) + (unless (or (eq beg (point-max)) + (member (char-syntax (char-after beg)) '(?\" ?\( ?\)))) + (condition-case nil + (save-excursion + (goto-char beg) + (forward-sexp 1) + (let ((end (point))) + (and + (<= (+ beg 2) end) ;prefix at least 2 chars + (funcall proc beg end)))) + (scan-error nil))))) + +(defun racket--in-require-form-p () + (save-excursion + (save-match-data + (racket--escape-string-or-comment) + (let ((done nil) + (result nil)) + (condition-case () + (while (not done) + (backward-up-list) + (when (looking-at (rx ?\( (or "require" "#%require"))) + (setq done t) + (setq result t))) + (scan-error nil)) + result)))) + +(provide 'racket-complete) + +;; racket-complete.el ends here diff --git a/elpa/racket-mode-20200323.1739/racket-complete.elc b/elpa/racket-mode-20200323.1739/racket-complete.elc new file mode 100644 index 0000000000000000000000000000000000000000..48242e34d2710b7932a9e3673f7dc560db04577e GIT binary patch literal 1185 zcmbu8-*3|}5XaL>yyTG=_QtIpB9Z1Uj@xuw1p`%kn1loZ9*~wI+{B?)lQ`IJ_v5eU zoOHhgZ;NWzzO(OqpRYYT|1^K)d7eL;&0wyoMwTLPC$fg~if0D4LK~@Sh?5a(Jy+7M zfR`nx#>z_Ga*J*=@>}Qkl{8Rb6xbMHAit@3B{RrXW~`R=Z*z!VZ7lFS7dhN#p(msG zB#%ov#C>4K_WLJs- z!F4Hx2D`$AG3)Xof@gj10MGq=-w(9-vyocBTdZs?EXh<=sXFwBA1DL#7d3qO`gtC{ z_Jdp$yp-JBuO%4@L!3fxTT=?B4QaF}o7yCF$ zum~1S5Ag6w%4h^#6_nyX?w~PcUaw_zgp5$BogX7m2PR^B&Yn0D{kuWW0on6fF4K<7 z1ECgK2X05I;x=26oLdeRUkkFlu>y6@1-KHrlRGhD2i&pU;=9SX#W$Q;r4cn=r$<4= zmN!asD;B_DciV_S%#9%3b0tc*_fOQ;5q_${omgbkkW%8CE|ps28z-1?5Tt2vcKXl_ g-=t}HwquV&{0+b^VCr;gwAxB6X`gk75Jd;_!a)Vz<0YiPTClwNgl}*UmyV20#NC6PUry z36#>4KvwD)%QpFa5HtAF6Uhu`q=iwB%9 zpAY0SAmdpl2#8Nkxb`10`QT>{KE){ab-U~x_+9XF?-0L0L0;}02j=@}mQGC=_S12k z7a`PT9EK*dKg{CHn(W5(#^E^bntT-Iy)2#xrbQ1P$Zw&E($tEE?Laz_fI=f0LWmI8LribCz*ed}p-b3A=0JIOc8|lIqi|<0@UXFC8u|@_-=;H@SQuZLj29*c zS3AonH4Kch#!q`=d$WQVm}yjul4t_fzBQk1JZdU=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OtuZqf6c zFE6#V{6PkKEfc;v@E*EXr+cz%$)uDh>*cGfHDC!Yrq*N7QqsAsQz7vQ z@%;3UZmFMds=-;;ymGU%GTiyBY&KudZ z?9<(fV#=IzUWUv+hC66>zq~u^sw;`K3@p8mig?klcbnkAUXDTFO_I15dIfJVUa-q literal 0 HcmV?d00001 diff --git a/elpa/racket-mode-20200218.1623/racket-debug.el b/elpa/racket-mode-20200323.1739/racket-debug.el similarity index 98% rename from elpa/racket-mode-20200218.1623/racket-debug.el rename to elpa/racket-mode-20200323.1739/racket-debug.el index f39c92fe..1474430b 100644 --- a/elpa/racket-mode-20200218.1623/racket-debug.el +++ b/elpa/racket-mode-20200323.1739/racket-debug.el @@ -86,6 +86,7 @@ file-local variable.") ;;;###autoload (defun racket--debug-send-definition (beg end) (racket--cmd/async + (racket--repl-session-id) (save-excursion (goto-char beg) (list 'debug-eval @@ -120,7 +121,8 @@ file-local variable.") (let ((info (if value-prompt-p (racket--debug-prompt-for-new-values) racket--debug-break-info))) - (racket--cmd/async `(debug-resume (,next-break ,info)))) + (racket--cmd/async (racket--repl-session-id) + `(debug-resume (,next-break ,info)))) (racket-debug-mode -1) (setq racket--debug-break-positions nil) (setq racket--debug-break-locals nil) @@ -184,7 +186,7 @@ file-local variable.") (defun racket-debug-disable () (interactive) - (racket--cmd/async `(debug-disable)) + (racket--cmd/async (racket--repl-session-id) `(debug-disable)) (racket-debug-mode -1) (setq racket--debug-break-positions nil) (setq racket--debug-break-locals nil) diff --git a/elpa/racket-mode-20200218.1623/racket-debug.elc b/elpa/racket-mode-20200323.1739/racket-debug.elc similarity index 88% rename from elpa/racket-mode-20200218.1623/racket-debug.elc rename to elpa/racket-mode-20200323.1739/racket-debug.elc index 5617c4969e0c765449235531883f3934cd96b9dc..9f82c36615f2312a5166ab0a59c0710c368018f7 100644 GIT binary patch delta 402 zcmaEwxHoA-J-3mufuTZ-k)aWD5|A{AF*Yy)Vq*m$VWNGxPIwGgBrXd8Ttgr>QiRxNXbhwc1%-e@#*+gD*5fq!zkmk6rGkdCih`bkiGhi! zW~}DqjXYAD0|a+4v6vbdm``pL6`m|FvX0rvz`3;=Spegbo6m4ZAO#LpQVx+fvz&z94QmR&un5~ym^Cm88fq) Tx%p;I{dtT`78a9F8pr?u#&vST delta 324 zcmXwzF-rqM5QVwj5JN7QyTeOzmlT(%s6pb+?%pM5BSNsTv9R1C#>zinsR&kSrxApZ z*2;u!1hEK+zrx}W{0nx1n-Ghc_q|ulytm=^#q`$haNuO9I4~s`nBkFGBDxwFk%N3e zwG@xL`8{J})xwz_;FtYjfqp6lln8L2-~aorm|qkzv(WzIIfA7 diff --git a/elpa/racket-mode-20200323.1739/racket-describe.el b/elpa/racket-mode-20200323.1739/racket-describe.el new file mode 100644 index 00000000..9b2f00fc --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket-describe.el @@ -0,0 +1,122 @@ +;;; racket-describe.el -*- lexical-binding: t -*- + +;; Copyright (c) 2013-2020 by Greg Hendershott. +;; Portions Copyright (C) 1985-1986, 1999-2013 Free Software Foundation, Inc. + +;; Author: Greg Hendershott +;; URL: https://github.com/greghendershott/racket-mode + +;; License: +;; This is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. This is distributed in the hope that it will be +;; useful, but without any warranty; without even the implied warranty +;; of merchantability or fitness for a particular purpose. See the GNU +;; General Public License for more details. See +;; http://www.gnu.org/licenses/ for details. + +(require 'racket-cmd) +(require 'racket-util) +(require 'racket-visit) +(require 'shr) + +(defun racket--do-describe (how + repl-session-id + str + &optional + display-and-pop-to-p + visit-thunk + doc-thunk) + "Create a `racket-describe-mode' buffer. + +HOW is supplied as the first argument to the back-end +\"describe\" command. See it for details that we don't need to +know or care about in this function. + +STR is the string form of an identifier that is to be described. + +DISPLAY-AND-POP-TO-P should be t for use by direct user commands +like `racket-xp-describe' and `racket-repl-describe' -- in which +the buffer is displayed -- and nil for use as +a :company-doc-buffer function. + +VISIT-THUNK and DOC-THUNK are, when not nil, used to insert +\"Visit Definition\" and \"Documentation in Browser\" buttons. + +Returns the buffer in which the description was written." + ;; Work around what seems to be a bug with `shr-insert-document' -- + ;; elements are out of order when an existing Racket Describe buffer + ;; hasn't had a `quit-window' -- by re-creating the buffer. + (with-current-buffer (racket--get-buffer-recreate "*Racket Describe*") + (let* ((html (racket--cmd/await repl-session-id + `(describe ,how ,str))) + ;; Because shr removes leading   from elements -- + ;; which messes up the indentation of s-expressions + ;; including contracts -- replace   with `spc' in the + ;; source HTML. Below we'll replace `spc' with " " in the + ;; result of `shr-insert-document'. + (spc (string #x2020)) ;unlikely character (hopefully) + (dom (with-temp-buffer + (insert html) + (goto-char (point-min)) + (while (re-search-forward " " nil t) + (replace-match spc t t)) + (libxml-parse-html-region (point-min) (point-max))))) + (racket-describe-mode) + (read-only-mode -1) + (let ((shr-use-fonts nil)) + (shr-insert-document dom)) + (goto-char (point-min)) + (while (re-search-forward spc nil t) + (replace-match " " t t)) + (when display-and-pop-to-p + (goto-char (point-max)) + (insert "\n") + (when visit-thunk + (insert-text-button "Visit Definition" + 'follow-link t + 'action + (lambda (_btn) (funcall visit-thunk))) + (insert " ")) + (when doc-thunk + (insert-text-button "Documentation in Browser" + 'follow-link t + 'action + (lambda (_btn) (funcall doc-thunk)))) + (insert " [q]uit")) + (read-only-mode 1) + (goto-char (point-min)) + (when display-and-pop-to-p + (display-buffer (current-buffer) t) + (pop-to-buffer (current-buffer)) + (message "Type TAB to move to links, 'q' to restore previous window")) + (current-buffer)))) + +(defvar racket-describe-mode-map + (let ((m (make-sparse-keymap))) + (set-keymap-parent m special-mode-map) + (mapc (lambda (x) + (define-key m (kbd (car x)) (cadr x))) + '(("" racket-describe--next-button) + ("S-" racket-describe--prev-button))) + m) + "Keymap for Racket Describe mode.") + +(define-derived-mode racket-describe-mode special-mode + "RacketDescribe" + "Major mode for describing Racket functions. +\\{racket-describe-mode-map}" + (setq show-trailing-whitespace nil)) + +(defun racket-describe--next-button () + (interactive) + (forward-button 1 t t)) + +(defun racket-describe--prev-button () + (interactive) + (forward-button -1 t t)) + +(provide 'racket-describe) + +;; racket-describe.el ends here diff --git a/elpa/racket-mode-20200323.1739/racket-describe.elc b/elpa/racket-mode-20200323.1739/racket-describe.elc new file mode 100644 index 0000000000000000000000000000000000000000..81d7dc05fee6cdce6c0a60441fbf1cea5d897564 GIT binary patch literal 5447 zcmbtY|8LvI6?d8?%Ty%5_Cr@-8Tw2&wUzli@r$G+ZihIwff!94!}i(^k%64Zlf{`L z8S-RB8}`5N^X^D}N#vzNZP4bCcklcAy!W_!_-g-;Yinzb-Q8W<&qjHisK_khlnzHS zEa_SmWt^qtb#{F7W)kZm$t0mH*YPO+m(+M&?ljEH^I=@l090sPs*<8b7~N|ln7ERt9iq=(q(`IawC@T-1UfM5I5Xf(F^Q>{dpMT(rB z-)iA<*L$AJH+*@E3x9DDVA1M2^rlen#&MwtrnypDgrlgw9qTx$@2}%B)>ICQ3-X$c zjptpzMf-)4T9Kr;)!9guVG;M07(t*->W>ElRlr^^U;jk#bUDs*STZ76!kDV|ZE-ms zsZ^8B%+o&P5GsutPEF2%M@J)gYlqI1BFHhw3W^k*oG>M+X`&D{>87SsfxgZfS7|mO z>)@Cw{!(oGkx0YrJqqxiyIfW6hhbg4+A)AY3kYz*CGqBEOIu%GW zQ5_u2P4eT>+0nT;fBE<0@6Gvx*ZcLVP}|_CQj=t$yUj$|+7Jdh>4x*8iIM{~h|`!& z>=+WxK^7Vpo8)K7UliE{CmaZ_wZ(%|rN>2TeNn4Zsc8IT?E(-1x=av2lOonyu@koj zDRG3I9-h1sXNPBJN3V~?(E+h@zhT(PQkl?7M=dHlQ?&V2V=GbvnZ#hTS%o&NHM2i$ zym8z9Q*sJUHV%KclWo4Jx<6ruFg9CbbG$rS}(B8t@gS&>3X<)Tmi23 z9c*+ve9rBDjh&s(LME&Fmbiz6_Hf9h*cs1&drjQ)2YzyN_~4S+lU(IYE!5EzQLD^@kd;L{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bc --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket-edit.el @@ -0,0 +1,405 @@ +;;; racket-edit.el -*- lexical-binding: t -*- + +;; Copyright (c) 2013-2020 by Greg Hendershott. +;; Portions Copyright (C) 1985-1986, 1999-2013 Free Software Foundation, Inc. + +;; Author: Greg Hendershott +;; URL: https://github.com/greghendershott/racket-mode + +;; License: +;; This is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. This is distributed in the hope that it will be +;; useful, but without any warranty; without even the implied warranty +;; of merchantability or fitness for a particular purpose. See the GNU +;; General Public License for more details. See +;; http://www.gnu.org/licenses/ for details. + +;; racket-mode per se, i.e. the mode for .rkt file buffers + +(require 'cl-lib) +(require 'cl-macs) +(require 'comint) +(require 'racket-custom) +(require 'racket-cmd) +(require 'racket-common) +(require 'racket-complete) +(require 'racket-repl) +(require 'racket-util) +(require 'hideshow) + +(defun racket-racket () + "Do \"racket \" in a shell buffer." + (interactive) + (racket--shell (concat (shell-quote-argument racket-program) + " " + (shell-quote-argument (racket--buffer-file-name))))) + +(defun racket-raco-test () + "Do \"raco test -x \" in a shell buffer to run the \"test\" submodule." + (interactive) + (racket--shell (concat (shell-quote-argument racket-program) + " -l raco test -x " + (shell-quote-argument (racket--buffer-file-name))))) + +(defun racket--shell (cmd) + (racket--save-if-changed) + (let ((w (selected-window))) + (pcase (get-buffer-window "*shell*" t) + (`() (other-window -1)) + (win (select-window win))) + (with-temp-message cmd + (shell) + (pop-to-buffer-same-window "*shell*") + (comint-send-string "*shell*" (concat cmd "\n")) + (select-window w) + (sit-for 3)))) + +;;; code folding + +;;;###autoload +(add-to-list 'hs-special-modes-alist + '(racket-mode "(" ")" ";" nil nil)) + +(defun racket--for-all-tests (verb f) + (save-excursion + (goto-char (point-min)) + (let ((n 0)) + (while (re-search-forward "^(module[+*]? test" (point-max) t) + (funcall f) + (cl-incf n) + (goto-char (match-end 0))) + (message "%s %d test submodules" verb n)))) + +(defun racket-fold-all-tests () + "Fold (hide) all test submodules." + (interactive) + (racket--for-all-tests "Folded" 'hs-hide-block)) + +(defun racket-unfold-all-tests () + "Unfold (show) all test submodules." + (interactive) + (racket--for-all-tests "Unfolded" 'hs-show-block)) + +;;; requires + +(defun racket-tidy-requires () + "Make a single top-level \"require\" form, modules sorted, one per line. + +All top-level require forms are combined into a single form. +Within that form: + +- A single subform is used for each phase level, sorted in this + order: for-syntax, for-template, for-label, for-meta, and + plain (phase 0). + + - Within each level subform, the modules are sorted: + + - Collection path modules -- sorted alphabetically. + + - Subforms such as only-in. + + - Quoted relative requires -- sorted alphabetically. + +At most one module is listed per line. + +Note: This only works for requires at the top level of a source +file using #lang. It does NOT work for require forms inside +module forms. + +See also: `racket-trim-requires' and `racket-base-requires'." + (interactive) + (unless (eq major-mode 'racket-mode) + (user-error "Current buffer is not a racket-mode buffer")) + (pcase (racket--top-level-requires 'find) + (`nil (user-error "The file module has no requires; nothing to do")) + (reqs (racket--cmd/async + nil + `(requires/tidy ,reqs) + (lambda (result) + (pcase result + ("" nil) + (new (goto-char (racket--top-level-requires 'kill)) + (insert (concat new "\n"))))))))) + +(defun racket-trim-requires () + "Like `racket-tidy-requires' but also deletes unnecessary requires. + +Note: This only works when the source file can be fully expanded +with no errors. + +Note: This only works for requires at the top level of a source +file using #lang. It does NOT work for require forms inside +module forms. Furthermore, it is not smart about module+ or +module* forms -- it might delete top level requires that are +actually needed by such submodules. + +See also: `racket-base-requires'." + (interactive) + (unless (eq major-mode 'racket-mode) + (user-error "Current buffer is not a racket-mode buffer")) + (when (racket--ok-with-module+*) + (racket--save-if-changed) + (pcase (racket--top-level-requires 'find) + (`nil (user-error "The file module has no requires; nothing to do")) + (reqs (racket--cmd/async + nil + `(requires/trim + ,(racket--buffer-file-name) + ,reqs) + (lambda (result) + (pcase result + (`nil (user-error "Syntax error in source file")) + ("" (goto-char (racket--top-level-requires 'kill))) + (new (goto-char (racket--top-level-requires 'kill)) + (insert (concat new "\n")))))))))) + +(defun racket-base-requires () + "Change from \"#lang racket\" to \"#lang racket/base\". + +Adds explicit requires for imports that are provided by +\"racket\" but not by \"racket/base\". + +This is a recommended optimization for Racket applications. +Avoiding loading all of \"racket\" can reduce load time and +memory footprint. + +Also, as does `racket-trim-requires', this removes unneeded +modules and tidies everything into a single, sorted require form. + +Note: This only works when the source file can be fully expanded +with no errors. + +Note: This only works for requires at the top level of a source +file using #lang. It does NOT work for require forms inside +module forms. Furthermore, it is not smart about module+ or +module* forms -- it might delete top level requires that are +actually needed by such submodules. + +Note: Currently this only helps change \"#lang racket\" to +\"#lang racket/base\". It does not help with other similar +conversions, such as changing \"#lang typed/racket\" to \"#lang +typed/racket/base\"." + (interactive) + (unless (eq major-mode 'racket-mode) + (user-error "Current buffer is not a racket-mode buffer")) + (when (racket--buffer-start-re "^#lang.*? racket/base$") + (user-error "Already using #lang racket/base. Nothing to change.")) + (unless (racket--buffer-start-re "^#lang.*? racket$") + (user-error "File does not use use #lang racket. Cannot change.")) + (when (racket--ok-with-module+*) + (racket--save-if-changed) + (let ((reqs (racket--top-level-requires 'find))) + (racket--cmd/async + nil + `(requires/base + ,(racket--buffer-file-name) + ,reqs) + (lambda (result) + (pcase result + (`nil (user-error "Syntax error in source file")) + (new (goto-char (point-min)) + (re-search-forward "^#lang.*? racket$") + (insert "/base") + (goto-char (or (racket--top-level-requires 'kill) + (progn (insert "\n\n") (point)))) + (unless (string= "" new) + (insert (concat new "\n")))))))))) + +(defun racket--ok-with-module+* () + (save-excursion + (goto-char (point-min)) + (or (not (re-search-forward (rx ?\( "module" (or "+" "*")) nil t)) + (prog1 + (y-or-n-p "Analysis will be unreliable due to module+ or module* forms -- proceed anyway? ") + (message ""))))) + +(defun racket--buffer-start-re (re) + (save-excursion + (ignore-errors + (goto-char (point-min)) + (re-search-forward re) + t))) + +(defun racket--top-level-requires (what) + "Identify all top-level requires and do WHAT. + +When WHAT is 'find, returns the top-level require forms. + +When WHAT is 'kill, kill the top-level requires, returning the +location of the first one." + (save-excursion + (goto-char (point-min)) + (let ((first-beg nil) + (requires nil)) + (while (re-search-forward "^(require " nil t) + (let* ((beg (progn (up-list -1) (point))) + (end (progn (forward-sexp) (point))) + (str (buffer-substring-no-properties beg end)) + (sexpr (read str))) + (unless first-beg (setq first-beg beg)) + (setq requires (cons sexpr requires)) + (when (eq 'kill what) + (kill-sexp -1) + (delete-blank-lines)))) + (if (eq 'kill what) first-beg requires)))) + +;;; align + +(defun racket-align () + "Align values in the same column. + +Useful for binding forms like \"let\" and \"parameterize\", +conditionals like \"cond\" and \"match\", association lists, and +any series of couples like the arguments to \"hash\". + +Before choosing this command, put point on the first of a series +of \"couples\". A couple is: + +- A list of two or more sexprs: \"[sexpr val sexpr ...]\". +- Two sexprs: \"sexpr val\". + +Each \"val\" moves to the same column and is +`prog-indent-sexp'-ed (in case it is a multi-line form). + +For example with point on the \"[\" before \"a\": + +#+BEGIN_SRC racket + Before After + + (let ([a 12] (let ([a 12] + [bar 23]) [bar 23]) + ....) ....) + + '([a . 12] '([a . 12] + [bar . 23]) [bar . 23]) + + (cond [a? #t] (cond [a? #t] + [b? (f x [b? (f x + y)] y)] + [else #f]) [else #f]) +#+END_SRC + +Or with point on the quote before \"a\": + +#+BEGIN_SRC racket + (list 'a 12 (list 'a 12 + 'bar 23) 'bar 23) +#+END_SRC + +If more than one couple is on the same line, none are aligned, +because it is unclear where the value column should be. For +example the following form will not change; `racket-align' will +display an error message: + +#+BEGIN_SRC racket + (let ([a 0][b 1] + [c 2]) error; unchanged + ....) +#+END_SRC + +When a couple's sexprs start on different lines, that couple is +ignored. Other, single-line couples in the series are aligned as +usual. For example: + +#+BEGIN_SRC racket + (let ([foo (let ([foo + 0] 0] + [bar 1] [bar 1] + [x 2]) [x 2]) + ....) ....) +#+END_SRC + +See also: `racket-unalign'." + (interactive) + (save-excursion + (let ((listp (eq ?\( (char-syntax (char-after)))) + (prev-line 0) + (max-col 0)) + (racket--for-each-couple listp + (lambda () + (setq max-col (max max-col (current-column))) + (let ((this-line (line-number-at-pos))) + (when (= prev-line this-line) + (user-error + "Can't align if any couples are on same line")) + (setq prev-line this-line)))) + (racket--for-each-couple listp + (lambda () + (indent-to max-col) + (prog-indent-sexp)))))) + +(defun racket-unalign () + "The opposite of `racket-align'. + +Effectively does M-x `just-one-space' and `prog-indent-sexp' for +each couple's value." + (interactive) + (save-excursion + (let ((listp (eq ?\( (char-syntax (char-after))))) + (racket--for-each-couple listp + (lambda () + (just-one-space) + (prog-indent-sexp)))))) + +(defun racket--for-each-couple (listp f) + "Move point to each value sexp of a couple, and `funcall' F. + +Only call F when the couple's sexprs are on the same line. + +When LISTP is true, expects couples to be `[id val]`, else `id val`." + (save-excursion + (condition-case () + (while t + (when listp + (down-list)) + (forward-sexp) + (let ((line (line-number-at-pos))) + (forward-sexp) + (backward-sexp) + (when (= line (line-number-at-pos)) + ;; Defensive: Backup over any prefix or punctuation + ;; chars just in case backward-sexp didn't (although it + ;; should have if our syntax table is correct). + (while (memq (char-syntax (char-before)) '(?\' ?\.)) + (goto-char (1- (point)))) + (funcall f))) + ;; On to the next couple... + (if listp + (up-list) + (forward-sexp))) + (scan-error nil)))) + +;;; Completion + +(defvar racket--completion-candidates (list racket-type-list + racket-keywords + racket-builtins-1-of-2 + racket-builtins-2-of-2)) + +(defun racket--completion-candidates-for-prefix (prefix) + (cl-reduce (lambda (results strs) + (append results (all-completions prefix strs))) + racket--completion-candidates + :initial-value ())) + +(defun racket-complete-at-point () + "A value for the variable `completion-at-point-functions'. + +Completion candidates are drawn from the same symbols used for +font-lock. This is a static list. If you want dynamic, smarter +completion candidates, enable the minor mode `racket-xp-mode'." + (racket--call-with-completion-prefix-positions + (lambda (beg end) + (list beg + end + (completion-table-dynamic + #'racket--completion-candidates-for-prefix) + :predicate #'identity + :exclusive 'no)))) + + +(provide 'racket-edit) + +;; racket-edit.el ends here diff --git a/elpa/racket-mode-20200323.1739/racket-edit.elc b/elpa/racket-mode-20200323.1739/racket-edit.el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$!zdkfSh z&yf%?Bs2sj%HlfA2sPdLX&h48XXj|a#CUG*&(RC32GhweoTF%ZN#i61Ezf(Y_`LUa z0#NT#sHQxtE`aRe*VSF$T$mc8C+a=k#`&>Eh21~WnYy^OM1br6Zh0PqF6H+Az)?)y zfm?GJ!}e}&G5j`~fOJ>ds8fK;HM@-4u-WU>lmaluWgW1_Ax8)i%LW}Bd+UP_uL=p6 z+VVu1=XwJ@qQM&f3X!<7K;UDZtpiSXFo!S>vGrac#IqE!ZOG7>3E2nlq6M~^!J6Cq z(L4s~Obf?zvWes0dF<=s)k87gzd3sK`ajlJfotc)!zw6zqDg#HGdm1@CLU{C!?jX2 z4BD3x~8+;=jCnoL02N`mHlh=6DWa(wdU7)OYn$0{(u*6z*iAURX}AF*-axRW^si z;)Ey`r91KGR!=uG-I-sXzip2=Wyw6n3a<{M(308RY8)M6AT#@S%c)qyVw%&MwLXe< zk3pQ&4Z68)Y1nK3jWwr6PbJskR7aS9(axGC{T!wpa`OkMSXrKOAPW=(yZ&{Wl9L`xgKJ literal 0 HcmV?d00001 diff --git a/elpa/racket-mode-20200323.1739/racket-eldoc.el b/elpa/racket-mode-20200323.1739/racket-eldoc.el new file mode 100644 index 00000000..be70f92c --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket-eldoc.el @@ -0,0 +1,47 @@ +;;; racket-eldoc.el -*- lexical-binding: t -*- + +;; Copyright (c) 2013-2020 by Greg Hendershott. +;; Portions Copyright (C) 1985-1986, 1999-2013 Free Software Foundation, Inc. + +;; Author: Greg Hendershott +;; URL: https://github.com/greghendershott/racket-mode + +;; License: +;; This is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. This is distributed in the hope that it will be +;; useful, but without any warranty; without even the implied warranty +;; of merchantability or fitness for a particular purpose. See the GNU +;; General Public License for more details. See +;; http://www.gnu.org/licenses/ for details. + +(require 'racket-cmd) + +(defun racket--do-eldoc (how repl-session-id) + (and (racket--cmd-open-p) + (> (point) (point-min)) + (save-excursion + (condition-case nil + ;; The char-before and looking-at checks below are to + ;; skip when the sexp is quoted or when its first elem + ;; couldn't be a Racket function name. + (let* ((beg (progn + (backward-up-list) + (and (not (memq (char-before) '(?` ?' ?,))) + (progn (forward-char 1) (point))))) + (beg (and beg (looking-at "[^0-9#'`,\"]") beg)) + (end (and beg (progn (forward-sexp) (point)))) + (end (and end + (char-after (point)) + (eq ?\s (char-syntax (char-after (point)))) + end)) + (sym (and beg end (buffer-substring-no-properties beg end))) + (str (and sym (racket--cmd/await repl-session-id + `(type ,how ,sym))))) + str) + (scan-error nil))))) + +(provide 'racket-eldoc) + +;; racket-eldoc.el ends here diff --git a/elpa/racket-mode-20200323.1739/racket-eldoc.elc b/elpa/racket-mode-20200323.1739/racket-eldoc.elc new file mode 100644 index 0000000000000000000000000000000000000000..81c282896b1e922ba12204e67631bcdb11ac043d GIT binary patch literal 928 zcmbtSZEw>s5RL|_ME(FDIZ~uGqAq!Bx2obzr4p4U1{A@Ewo~2MS*@jZu$_(V*K@x9G+ku1u|OH)4DPeU!(KA{F9uT> zLn;fol9r-zZ3}XWh$Qc4id&LzS?IUlC8vO7A>rfs5BNIyd`4!I*=&0L ziA+C)&-@PK1uX?N_kM&a!b|KtwCDXegJ6+H5iF9Zf9b9G_nojv;so(HW*%M%(s8t! z6)2}~-Z~R-cvd$!9z(HKBPV|G z4yGujas23L5gd>Uha{~Qo@wjJVOZu1G0x7CXZMq(jKE5Mmq}b%ldUsD)sD5s_j0c-375%K!?c8#lv$ zRgfmIu8V?eV(Rs7wuw}v(wI?Ofphy;8L#LK6&CDm#X*X432_3Q_6z7imPX++^gHNx NE!dw=Z$2*ce*@E71StRj literal 0 HcmV?d00001 diff --git a/elpa/racket-mode-20200218.1623/racket-font-lock.el b/elpa/racket-mode-20200323.1739/racket-font-lock.el similarity index 100% rename from elpa/racket-mode-20200218.1623/racket-font-lock.el rename to elpa/racket-mode-20200323.1739/racket-font-lock.el diff --git a/elpa/racket-mode-20200218.1623/racket-font-lock.elc b/elpa/racket-mode-20200323.1739/racket-font-lock.elc similarity index 100% rename from elpa/racket-mode-20200218.1623/racket-font-lock.elc rename to elpa/racket-mode-20200323.1739/racket-font-lock.elc diff --git a/elpa/racket-mode-20200218.1623/racket-imenu.el b/elpa/racket-mode-20200323.1739/racket-imenu.el similarity index 100% rename from elpa/racket-mode-20200218.1623/racket-imenu.el rename to elpa/racket-mode-20200323.1739/racket-imenu.el diff --git a/elpa/racket-mode-20200218.1623/racket-imenu.elc b/elpa/racket-mode-20200323.1739/racket-imenu.elc similarity index 100% rename from elpa/racket-mode-20200218.1623/racket-imenu.elc rename to elpa/racket-mode-20200323.1739/racket-imenu.elc diff --git a/elpa/racket-mode-20200218.1623/racket-indent.el b/elpa/racket-mode-20200323.1739/racket-indent.el similarity index 93% rename from elpa/racket-mode-20200218.1623/racket-indent.el rename to elpa/racket-mode-20200323.1739/racket-indent.el index 1a49d852..1753bfad 100644 --- a/elpa/racket-mode-20200218.1623/racket-indent.el +++ b/elpa/racket-mode-20200323.1739/racket-indent.el @@ -53,9 +53,6 @@ "When `racket--mode-edits-racket-p' instead use `prog-indent-sexp'." (apply (if (racket--mode-edits-racket-p) #'prog-indent-sexp orig) args)) -;; I don't want to muck with the old `defadvice' for this. Instead use -;; `advice-add' in Emacs 24.4+. Although we still support Emacs 24.3, -;; not sure how much longer; I'm OK having it silently not work. (when (fboundp 'advice-add) (advice-add 'lisp-indent-line :around #'racket--lisp-indent-line-advice) (advice-add 'indent-sexp :around #'racket--indent-sexp-advice)) @@ -63,51 +60,63 @@ (defun racket-indent-line (&optional _whole-exp) "Indent current line as Racket code. +Normally you don't need to use this command directly, it is used +automatically when you press keys like RET or TAB. However you +might refer to it when configuring custom indentation, explained +below. + This behaves like `lisp-indent-line', except that whole-line comments are treated the same regardless of whether they start with single or double semicolons. -- Automatically indents forms that start with `begin` in the usual - way that `begin` is indented. +- Automatically indents forms that start with \"begin\" in the + usual way that \"begin\" is indented. -- Automatically indents forms that start with `def` or `with-` in the - usual way that `define` is indented. +- Automatically indents forms that start with \"def\" or + \"with-\" in the usual way that \"define\" is indented. - Has rules for many specific standard Racket forms. To extend, use your Emacs init file to +#+BEGIN_SRC racket (put SYMBOL 'racket-indent-function INDENT) +#+END_SRC -where `SYMBOL` is the name of the Racket form (e.g. `'test-case`) -and `INDENT` is an integer or the symbol `'defun`. When `INDENT` -is an integer, the meaning is the same as for -`lisp-indent-function` and `scheme-indent-function`: Indent the -first `n` arguments specially and then indent any further -arguments like a body. +SYMBOL is the name of the Racket form like \"'test-case\" and +INDENT is an integer or the symbol \"'defun\". When INDENT is an +integer, the meaning is the same as for lisp-indent-function and +scheme-indent-function: Indent the first INDENT arguments +specially and indent any further arguments like a body. -For example in your `.emacs` file you could use: +For example: +#+BEGIN_SRC racket (put 'test-case 'racket-indent-function 1) +#+END_SRC -to change the indent of `test-case` from this: +This will change the indent of `test-case` from this: +#+BEGIN_SRC racket (test-case foo blah blah) +#+END_SRC to this: +#+BEGIN_SRC racket (test-case foo blah blah) +#+END_SRC -If `racket-indent-function` has no property for a symbol, -`scheme-indent-function` is also considered (although the with-x -indents defined by `scheme-mode` are ignored). This is only to -help people who may have extensive `scheme-indent-function` -settings, particularly in the form of file or dir local -variables. Otherwise prefer `racket-indent-function`." +If `racket-indent-function' has no property for a symbol, +scheme-indent-function is also considered, although the \"with-\" +indents defined by scheme-mode are ignored. This is only to help +people who may have extensive scheme-indent-function settings, +particularly in the form of file or dir local variables. +Otherwise prefer putting properties on `racket-indent-function'." (interactive) (pcase (racket--calculate-indent) (`() nil) diff --git a/elpa/racket-mode-20200218.1623/racket-indent.elc b/elpa/racket-mode-20200323.1739/racket-indent.elc similarity index 85% rename from elpa/racket-mode-20200218.1623/racket-indent.elc rename to elpa/racket-mode-20200323.1739/racket-indent.elc index 1b419c993d18c4457bf4e1063975acdf4788c82d..b5e9b6a1c4459fb2316dd16670e4e236a34f2465 100644 GIT binary patch delta 996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keywords-and-builtins.el b/elpa/racket-mode-20200323.1739/racket-keywords-and-builtins.el similarity index 100% rename from elpa/racket-mode-20200218.1623/racket-keywords-and-builtins.el rename to elpa/racket-mode-20200323.1739/racket-keywords-and-builtins.el diff --git a/elpa/racket-mode-20200218.1623/racket-keywords-and-builtins.elc b/elpa/racket-mode-20200323.1739/racket-keywords-and-builtins.elc similarity index 100% rename from elpa/racket-mode-20200218.1623/racket-keywords-and-builtins.elc rename to elpa/racket-mode-20200323.1739/racket-keywords-and-builtins.elc diff --git a/elpa/racket-mode-20200218.1623/racket-logger.el b/elpa/racket-mode-20200323.1739/racket-logger.el similarity index 98% rename from elpa/racket-mode-20200218.1623/racket-logger.el rename to elpa/racket-mode-20200323.1739/racket-logger.el index 7fdce68e..9b806c90 100644 --- a/elpa/racket-mode-20200218.1623/racket-logger.el +++ b/elpa/racket-mode-20200323.1739/racket-logger.el @@ -103,7 +103,8 @@ For more information see: "127.0.0.1" (1+ racket-command-port)))) (error (sit-for 0.1))))) - (process-send-string racket-logger--process racket--cmd-auth) + (process-send-string racket-logger--process + (format "%S\n" racket--cmd-auth)) (racket-logger--activate-config) (set-process-sentinel racket-logger--process #'racket-logger--process-sentinel)))) @@ -173,7 +174,7 @@ use `pop-to-buffer'." (racket-logger--connect)) ;; Give it a window if necessary (unless (get-buffer-window racket-logger--buffer-name) - (pcase (get-buffer-window racket--repl-buffer-name) + (pcase (get-buffer-window racket-repl-buffer-name) (`() (pop-to-buffer (get-buffer racket-logger--buffer-name))) (win (set-window-buffer (split-window win) (get-buffer racket-logger--buffer-name))))) diff --git a/elpa/racket-mode-20200218.1623/racket-logger.elc b/elpa/racket-mode-20200323.1739/racket-logger.elc similarity index 85% rename from elpa/racket-mode-20200218.1623/racket-logger.elc rename to elpa/racket-mode-20200323.1739/racket-logger.elc index 3d8b2c1c9e85c985181db09d1803d10121bfd7b4..aaf4541ab5444adfda149b8bd0017ee243497d4c 100644 GIT binary patch delta 181 zcmdlVdM$K=r7)xMW-DPaMwJ+26C)rt=2MSR0zxB010c^t0m?At0P@T>XNklxP5vXr z#T=8TG&w;=e)AJCIYw49Q_Wb-$?MgmCeK#l*{my}%*Cd~>giHY1aX z(d1pSZWHvW6-fXCz&CFzOFnOMqA^<0(HC_M! delta 165 zcmcZ>x<7P-r7)wxW-DPaMj1ZU7^N5^LxUJ&6C(vE!QrpbX) z@|*vP$uhE<7;469PEHV)-fShI$IN7Gxj9SPl99>4c=J*jZAKwW28<|W^Ccjer$z*Oc`Ki)xCL`m`kCgv0G8%BX|UNt OJ)4=y#C-BrEkyuX2QlgZ diff --git a/elpa/racket-mode-20200218.1623/racket-mode-autoloads.el b/elpa/racket-mode-20200323.1739/racket-mode-autoloads.el similarity index 56% rename from elpa/racket-mode-20200218.1623/racket-mode-autoloads.el rename to elpa/racket-mode-20200323.1739/racket-mode-autoloads.el index 7b0d43dd..b6262a6a 100644 --- a/elpa/racket-mode-20200218.1623/racket-mode-autoloads.el +++ b/elpa/racket-mode-20200323.1739/racket-mode-autoloads.el @@ -15,6 +15,13 @@ Fill a buffer with data to make a Racket Mode bug report. \(fn)" t nil) +;;;*** + +;;;### (autoloads nil "racket-cmd" "racket-cmd.el" (0 0 0 0)) +;;; Generated autoloads from racket-cmd.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-cmd" '("racket-"))) + ;;;*** ;;;### (autoloads nil "racket-collection" "racket-collection.el" @@ -36,7 +43,7 @@ Fill a buffer with data to make a Racket Mode bug report. ;;;;;; 0 0)) ;;; Generated autoloads from racket-complete.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-complete" '("racket-"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-complete" '("racket--"))) ;;;*** @@ -62,6 +69,14 @@ Fill a buffer with data to make a Racket Mode bug report. (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-debug" '("racket-"))) +;;;*** + +;;;### (autoloads nil "racket-describe" "racket-describe.el" (0 0 +;;;;;; 0 0)) +;;; Generated autoloads from racket-describe.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-describe" '("racket-"))) + ;;;*** ;;;### (autoloads nil "racket-edit" "racket-edit.el" (0 0 0 0)) @@ -71,6 +86,13 @@ Fill a buffer with data to make a Racket Mode bug report. (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-edit" '("racket-"))) +;;;*** + +;;;### (autoloads nil "racket-eldoc" "racket-eldoc.el" (0 0 0 0)) +;;; Generated autoloads from racket-eldoc.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-eldoc" '("racket--do-eldoc"))) + ;;;*** ;;;### (autoloads nil "racket-font-lock" "racket-font-lock.el" (0 @@ -180,17 +202,13 @@ If you run this command, ever, you should run it again after: ;;; Generated autoloads from racket-repl.el (autoload 'racket-repl "racket-repl" "\ -Show the Racket REPL buffer in some window. - -If NOSELECT is not nil, does not also select the REPL window. +Show a Racket REPL buffer in some window. *IMPORTANT* The main, intended use of Racket Mode's REPL is that you `find-file' some specific .rkt file, then `racket-run' it. The -REPL will then match that file. Also, various Racket Mode -features will work, such as completion, visiting definitions, and -so on. +REPL will then match that file. If the REPL isn't running, and you want to start it for no file in particular? Then you could use this command. But the resulting @@ -204,8 +222,99 @@ buffer to run command-line Racket. \(fn &optional NOSELECT)" t nil) +(autoload 'racket-run "racket-repl" "\ +Save the buffer in REPL and run your program. + +Runs the \"main\" submodule, if any, otherwise the file's module. +See also `racket-run-module-at-point'. + +With one C-u prefix, uses errortrace for improved stack traces. +Otherwise follows the `racket-error-context' setting. + +With two C-u prefixes, instruments code for step debugging. See +`racket-debug-mode' and the variable `racket-debuggable-files'. + +Each run occurs within a Racket custodian. Any prior run's +custodian is shut down, releasing resources like threads and +ports. Each run's evaluation environment is reset to the contents +of the source file. In other words, like Dr Racket, this provides +the benefit that your source file is the \"single source of +truth\". At the same time, the run gives you a REPL inside the +namespace of the module, giving you the ability to explore it +interactively. Any explorations are temporary, unless you also +make them to your source file, they will be lost on the next run. + +See also `racket-run-and-switch-to-repl', which is even more like +Dr Racket's Run command because it selects the REPL window after +running. + +In the `racket-repl-mode' buffer, output that describes a file +and position is automatically \"linkified\". Examples of such +text include: + +- Racket error messages. +- rackunit test failure location messages. +- print representation of path objects. + +To visit these locations, move point there and press RET or mouse +click. Or, use the standard `next-error' and `previous-error' +commands. + +\(fn &optional PREFIX)" t nil) + +(autoload 'racket-run-module-at-point "racket-repl" "\ +Save the buffer and run the moudule at point. + +Like `racket-run' but runs the innermost module around point. +This may be a submodule nested at any depth, or the file's +module. + +\(fn &optional PREFIX)" t nil) + (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-repl" '("racket-" "with-racket-repl-buffer"))) +;;;*** + +;;;### (autoloads nil "racket-repl-buffer-name" "racket-repl-buffer-name.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from racket-repl-buffer-name.el + +(autoload 'racket-repl-buffer-name-shared "racket-repl-buffer-name" "\ +All `racket-mode' edit buffers share one `racket-repl-mode' buffer. + +A value for the variable `racket-repl-buffer-name-function'. + +\(fn)" t nil) + +(autoload 'racket-repl-buffer-name-unique "racket-repl-buffer-name" "\ +Each `racket-mode' edit buffer gets its own `racket-repl-mode' buffer. + +A value for the variable `racket-repl-buffer-name-function'. + +\(fn)" t nil) + +(autoload 'racket-repl-buffer-name-project "racket-repl-buffer-name" "\ +All `racket-mode' buffers in a project share a `racket-repl-mode' buffer. + +A value for the variable `racket-repl-buffer-name-function'. + +The \"project\" is determined by trying, in order: + +- `projectile-project-root' +- `vc-root-dir' +- `file-name-directory' + +\(fn)" t nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-repl-buffer-name" '("racket-"))) + +;;;*** + +;;;### (autoloads nil "racket-show" "racket-show.el" (0 0 0 0)) +;;; Generated autoloads from racket-show.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-show" '("racket-"))) + ;;;*** ;;;### (autoloads nil "racket-smart-open" "racket-smart-open.el" @@ -327,6 +436,13 @@ can turn it off by setting `input-method-highlight-flag' to nil. (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-util" '("racket--"))) +;;;*** + +;;;### (autoloads nil "racket-visit" "racket-visit.el" (0 0 0 0)) +;;; Generated autoloads from racket-visit.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-visit" '("racket-"))) + ;;;*** ;;;### (autoloads nil "racket-wsl" "racket-wsl.el" (0 0 0 0)) @@ -334,6 +450,119 @@ can turn it off by setting `input-method-highlight-flag' to nil. (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-wsl" '("racket-"))) +;;;*** + +;;;### (autoloads nil "racket-xp" "racket-xp.el" (0 0 0 0)) +;;; Generated autoloads from racket-xp.el + +(autoload 'racket-xp-mode "racket-xp" "\ +A minor mode that analyzes expanded code to explain and explore. + +This minor mode is an optional enhancement to `racket-mode' edit +buffers. Like any minor mode, you can turn it on or off for a +specific buffer. If you always want to use it, put the following +code in your Emacs init file: + +#+BEGIN_SRC elisp + (require 'racket-xp) + (add-hook 'racket-mode-hook #'racket-xp-mode) +#+END_SRC + +Note: This mode won't do anything unless/until the Racket Mode +back end is running. It will try to start the back end +automatically. You do /not/ need to `racket-run' the buffer you +are editing. + +This mode uses the drracket/check-syntax package to analyze +fully-expanded programs, without needing to evaluate a.k.a. +\"run\" them. The resulting analysis provides information for: + +- Visually annotating bindings -- local or imported definitions + and references to them. + +- Completion candidates. + +- Defintions' source and documentation. + +When point is on a definition or use, related items are +highlighted using `racket-xp-def-face' and `racket-xp-use-face' +-- instead of drawing arrows as in Dr Racket. Information is +displayed using the function(s) in the hook variable +`racket-show-functions'; it is also available when hovering the +mouse cursor. Note: If you find these features too distracting +and/or slow, you may disable `cursor-sensor-mode'. The remaining +features discussed below will still work. + +You may also use commands to navigate among a definition and its +uses, or to rename a local definitions and all its uses. + +In the following little example, not only does +drracket/check-syntax distinguish the various \"x\" bindings, it +understands the two different imports of \"define\": + +#+BEGIN_SRC racket + #lang racket/base + (define x 1) + x + (let ([x x]) + (+ x 1)) + (module m typed/racket/base + (define x 2) + x) +#+END_SRC + +The function `racket-xp-complete-at-point' is added to the +variable `completion-at-point-functions'. Note that in this case, +it is not smart about submodules; identifiers are assumed to be +definitions from the file's module or its imports. In addition to +supplying completion candidates, it supports the +\":company-location\" property to inspect the definition of a +candidate and the \":company-doc-buffer\" property to view its +documentation. + +When you edit the buffer, existing annotations are retained; +their positions are updated to reflect the edit. Annotations for +new or deleted text are not requested until after +`racket-xp-after-change-refresh-delay' seconds. The request is +made asynchronously so that Emacs will not block -- for +moderately complex source files, it can take some seconds simply +to fully expand them, as well as a little more time for the +drracket/check-syntax analysis. When the results are ready, all +annotations for the buffer are completely refreshed. + +You may also set `racket-xp-after-change-refresh-delay' to nil +and use the `racket-xp-annotate' command manually. + +The mode line changes to reflect the current status of +annotations, and whether or not you had a syntax error. + +If you have one or more syntax errors, `racket-xp-next-error' and +`racket-xp-previous-error' to navigate among them. Although most +languages will stop after the first syntax error, some like Typed +Racket will try to collect and report multiple errors. + +Tip: This mode follows the convention that a minor mode may only +use a prefix key consisting of \"C-c\" followed by a punctuation +key. As a result, `racket-xp-control-c-hash-keymap' is bound to +\"C-c #\" by default. Although you might find this awkward to +type, remember that as an Emacs user, you are free to bind this +map to a more convenient prefix, and/or bind any individual +commands directly to whatever keys you prefer. + +\\{racket-xp-mode-map} + +\(fn &optional ARG)" t nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-xp" '("racket-"))) + +;;;*** + +;;;### (autoloads nil "racket-xp-complete" "racket-xp-complete.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from racket-xp-complete.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "racket-xp-complete" '("racket-"))) + ;;;*** ;;;### (autoloads nil nil ("racket-mode-pkg.el") (0 0 0 0)) diff --git a/elpa/racket-mode-20200218.1623/racket-mode-pkg.el b/elpa/racket-mode-20200323.1739/racket-mode-pkg.el similarity index 57% rename from elpa/racket-mode-20200218.1623/racket-mode-pkg.el rename to elpa/racket-mode-20200323.1739/racket-mode-pkg.el index 59b13b18..4e86dc1e 100644 --- a/elpa/racket-mode-20200218.1623/racket-mode-pkg.el +++ b/elpa/racket-mode-20200323.1739/racket-mode-pkg.el @@ -1,6 +1,7 @@ -(define-package "racket-mode" "20200218.1623" "Major mode for Racket language." - '((emacs "24.3") - (faceup "0.0.2")) +(define-package "racket-mode" "20200323.1739" "Major mode for Racket language." + '((emacs "25.1") + (faceup "0.0.2") + (pos-tip "20191127.1028")) :authors '(("Greg Hendershott")) :maintainer diff --git a/elpa/racket-mode-20200218.1623/racket-mode.el b/elpa/racket-mode-20200323.1739/racket-mode.el similarity index 87% rename from elpa/racket-mode-20200218.1623/racket-mode.el rename to elpa/racket-mode-20200323.1739/racket-mode.el index 0de5a094..ce4484a1 100644 --- a/elpa/racket-mode-20200218.1623/racket-mode.el +++ b/elpa/racket-mode-20200323.1739/racket-mode.el @@ -1,9 +1,9 @@ ;;; racket-mode.el --- Major mode for Racket language. -;; Copyright (c) 2013-2018 by Greg Hendershott. +;; Copyright (c) 2013-2020 by Greg Hendershott. ;; Package: racket-mode -;; Package-Requires: ((emacs "24.3") (faceup "0.0.2")) +;; Package-Requires: ((emacs "25.1") (faceup "0.0.2") (pos-tip "20191127.1028")) ;; Author: Greg Hendershott ;; URL: https://www.racket-mode.com/ @@ -23,18 +23,22 @@ ;; - Focus on Racket lang. ;; - Follow DrRacket concepts where applicable. ;; - Thorough font-lock and indent. -;; - Compatible with Emacs 24.3+ and Racket 6.2+. +;; - Compatible with Emacs 25.1+ and Racket 6.5+. ;; ;; Details: https://github.com/greghendershott/racket-mode ;;; Code: (require 'racket-edit) +(require 'racket-xp) +(require 'racket-custom) +(require 'racket-smart-open) (require 'racket-imenu) (require 'racket-profile) (require 'racket-logger) (require 'racket-stepper) (require 'racket-repl) +(require 'racket-repl-buffer-name) (require 'racket-collection) (require 'racket-bug-report) (require 'racket-util) @@ -43,7 +47,7 @@ (defvar racket-mode-map (racket--easy-keymap-define '((("C-c C-c" - "C-c C-k") racket-run) + "C-c C-k") racket-run-module-at-point) ("C-c C-z" racket-repl) ("" racket-run-and-switch-to-repl) ("M-C-" racket-racket) @@ -63,9 +67,6 @@ ("M-C-u" racket-backward-up-list) ("C-c C-p" racket-cycle-paren-shapes) ("M-C-y" racket-insert-lambda) - ("C-c C-d" racket-doc) - ("C-c C-." racket-describe) - ("M-." racket-visit-definition) ("M-C-." racket-visit-module) ("M-," racket-unvisit) ("C-c C-f" racket-fold-all-tests) @@ -98,9 +99,9 @@ ["Switch to REPL" racket-repl] ("Tools" ["Profile" racket-profile] - ["Check Syntax" racket-check-syntax-mode] ["Error Trace" racket-run-with-errortrace] - ["Step Debug" racket-run-with-debugging]) + ["Step Debug" racket-run-with-debugging] + ["Toggle XP Mode" racket-xp-mode]) "---" ["Comment" comment-dwim] ["Insert λ" racket-insert-lambda] @@ -109,7 +110,6 @@ ["Align" racket-align] ["Unalign" racket-unalign] "---" - ["Visit Definition" racket-visit-definition] ["Visit Module" racket-visit-module] ["Return from Visit" racket-unvisit] "---" @@ -123,8 +123,6 @@ ["Trim Requires" racket-trim-requires] ["Use #lang racket/base" racket-base-requires] "---" - ["Racket Documentation" racket-doc] - ["Describe" racket-describe] ["Start Faster" racket-mode-optimize-startup] ["Customize..." customize-mode])) @@ -139,7 +137,14 @@ \\{racket-mode-map}" (racket--common-variables) (racket--variables-imenu) - (hs-minor-mode t)) + (hs-minor-mode t) + (setq-local completion-at-point-functions (list #'racket-complete-at-point)) + (setq-local eldoc-documentation-function nil) + (funcall (or (and (functionp racket-repl-buffer-name-function) + racket-repl-buffer-name-function) + #'racket-repl-buffer-name-shared)) + (add-hook 'kill-buffer-hook + #'racket-mode-maybe-offer-to-kill-repl-buffer)) ;;;###autoload (progn diff --git a/elpa/racket-mode-20200218.1623/racket-mode.elc b/elpa/racket-mode-20200323.1739/racket-mode.elc similarity index 60% rename from elpa/racket-mode-20200218.1623/racket-mode.elc rename to elpa/racket-mode-20200323.1739/racket-mode.elc index df284ec37f1fe0a493136e1842a0b4fd3a440b5c..9aeeb349b578e5bb6ddcedc4f96c4f0bbd6beaf2 100644 GIT binary patch delta 638 zcmZ8eOG?8)0BsYjpcq_~tV%m=g|^_>B$FnJxaz`<1qBhoxJZ*}Eln~pP0)hi6@=M% z16>NafS$meM{p?~!AWdlaq*aWZ@%xnuf6a6ml`L_l7S=!8PyFXC+afkEfbAaxMt(l z2Z3o#aR{ww77{mOGuI44NPO&3of~Wh*mvMC8jWxOJ=4YXj*B;;OYF$O&Q*%`dF@wn19VcD6@=ueX+98 zw1sn|i&X=ulF(s-gc$UK&|!m?WL98HGWbnTRTx1GYVrkH>ab~#L5p9@&&7L-xW0qK z3Gs6Ka1?n~qRcX1i%owC0qoesf(((1z0ge0XUBjyaX?1$TK*>wXIEx`4{c!DHoPKa z3Z@e$?So_v($kW2Lzh4U?dBHP0jjR(@te3_ L;t|s6d!_aR=KaU* delta 400 zcmexh{mycOJk#W0CWXm!nOrCTVp_dT-lQR3LWqV;+5WXSo<-BhwhA7$XCdFa|z3 zK6zUR6DVxP2bScMcUF!uGBf~+m~$&aSjGl1X<#OwoS6LNP!V}f%@|{26CgI-d`n~n m<77{9Z@yRsGX)K06$L#76LU+G&4(X diff --git a/elpa/racket-mode-20200218.1623/racket-mode.info b/elpa/racket-mode-20200323.1739/racket-mode.info similarity index 62% rename from elpa/racket-mode-20200218.1623/racket-mode.info rename to elpa/racket-mode-20200323.1739/racket-mode.info index 2c1b11f8..933c7871 100644 --- a/elpa/racket-mode-20200218.1623/racket-mode.info +++ b/elpa/racket-mode-20200323.1739/racket-mode.info @@ -37,27 +37,61 @@ Configure * Key bindings:: * Font-lock (syntax highlighting):: * Completion:: +* Indent:: * paredit:: * smartparens:: +* Edit buffers and REPL buffers:: * eldoc:: * Start faster:: * Unicode input method:: Commands +* Edit:: +* Explore:: * Run:: * Test:: * Eval:: -* Visit:: -* Learn:: -* Edit:: +* Collections:: * Macro expand:: * Other:: +* Showing information:: +* Associating edit buffers with REPL buffers:: + +Edit + +* racket-insert-lambda:: +* racket-fold-all-tests:: +* racket-unfold-all-tests:: +* racket-tidy-requires:: +* racket-trim-requires:: +* racket-base-requires:: +* racket-indent-line:: +* racket-smart-open-bracket-mode:: +* racket-insert-closing:: +* racket-cycle-paren-shapes:: +* racket-backward-up-list:: +* racket-unicode-input-method-enable:: +* racket-align:: +* racket-unalign:: +* racket-complete-at-point:: + +Explore + +* racket-xp-mode:: +* racket-xp-visit-definition:: +* racket-xp-describe:: +* racket-xp-documentation:: Run * racket-run:: +* racket-run-and-switch-to-repl:: +* racket-run-module-at-point:: * racket-repl:: +* racket-repl-describe:: +* racket-repl-documentation:: +* racket-repl-visit-definition:: * racket-racket:: * racket-profile:: * racket-profile-mode:: @@ -76,38 +110,12 @@ Eval * racket-send-definition:: * racket-send-last-sexp:: -Visit +Collections -* racket-visit-definition:: * racket-visit-module:: -* racket-unvisit:: * racket-open-require-path:: * racket-find-collection:: -Learn - -* racket-describe:: -* racket-doc:: - -Edit - -* racket-insert-lambda:: -* racket-fold-all-tests:: -* racket-unfold-all-tests:: -* racket-tidy-requires:: -* racket-trim-requires:: -* racket-base-requires:: -* racket-indent-line:: -* racket-smart-open-bracket-mode:: -* racket-insert-closing:: -* racket-cycle-paren-shapes:: -* racket-backward-up-list:: -* racket-check-syntax-mode:: -* racket-unicode-input-method-enable:: -* racket-align:: -* racket-unalign:: -* racket-complete-at-point:: - Macro expand * racket-stepper-mode:: @@ -118,29 +126,44 @@ Macro expand Other +* racket-unvisit:: * racket-mode-start-faster:: + +Showing information + +* racket-show-echo-area:: +* racket-show-header-line:: +* racket-show-pos-tip:: + +Associating edit buffers with REPL buffers + +* racket-repl-buffer-name-shared:: +* racket-repl-buffer-name-unique:: +* racket-repl-buffer-name-project:: Variables * General variables:: * REPL variables:: * Other variables:: * Experimental debugger variables:: +* Showing information: Showing informationx. General variables * racket-program:: * racket-command-port:: -* racket-command-startup:: * racket-command-timeout:: * racket-memory-limit:: * racket-error-context:: -* racket-retry-as-skeleton:: * racket-user-command-line-arguments:: * racket-path-from-emacs-to-racket-function:: * racket-path-from-racket-to-emacs-function:: +* racket-xp-after-change-refresh-delay:: +* racket-xp-highlight-unused-regexp:: REPL variables +* racket-repl-buffer-name-function:: * racket-history-filter-regexp:: * racket-images-inline:: * racket-images-keep-last:: @@ -158,6 +181,10 @@ Other variables Experimental debugger variables * racket-debuggable-files:: + +Showing information + +* racket-show-functions:: Faces * All:: @@ -167,8 +194,9 @@ All * racket-keyword-argument-face:: * racket-selfeval-face:: * racket-here-string-face:: -* racket-check-syntax-def-face:: -* racket-check-syntax-use-face:: +* racket-xp-def-face:: +* racket-xp-use-face:: +* racket-xp-unused-face:: * racket-logger-config-face:: * racket-logger-topic-face:: * racket-logger-fatal-face:: @@ -188,17 +216,21 @@ variety of Emacs major and minor modes, including: • ‘racket-mode’: A major mode for editing ‘.rkt’ files. - • ‘racket-repl-mode’: A major mode for a Racket REPL. This uses a - “back end server” written in Racket, which is responsible for - running files and implementing commands that cannot be implemented - in Emacs Lisp.(1) + • *note racket-xp-mode::: An optional minor mode that enhances + ‘racket-mode’ to explain and explore code. - • Modes to support specific features, such as: + • ‘racket-repl-mode’: A major mode for running programs providing a + REPL. + + • Various other modes to support specific features: • *note racket-logger-mode:: • *note racket-profile-mode:: - • *note racket-check-syntax-mode:: • *note racket-debug-mode:: + Racket Mode uses a “back end server” written in Racket, which is +responsible for running files and implementing commands that cannot be +implemented in Emacs Lisp.(1) + For code, issues, and pull requests, see the Git repo (https://github.com/greghendershott/racket-mode). @@ -332,8 +364,10 @@ might want to set ‘racket-program’ to a full pathname like * Key bindings:: * Font-lock (syntax highlighting):: * Completion:: +* Indent:: * paredit:: * smartparens:: +* Edit buffers and REPL buffers:: * eldoc:: * Start faster:: * Unicode input method:: @@ -383,7 +417,7 @@ you might do so because you prefer a simpler appearance. languages.).  -File: racket-mode.info, Node: Completion, Next: paredit, Prev: Font-lock (syntax highlighting), Up: Configure +File: racket-mode.info, Node: Completion, Next: Indent, Prev: Font-lock (syntax highlighting), Up: Configure 3.3 Completion ============== @@ -393,22 +427,30 @@ This function is used by manual completion commands like ‘complete-symbol’ (bound by default to ‘C-M-i’ ), as well as by auto-completion packages like ‘company-mode’. - Racket Mode supplies such a function, which draws on all identifiers -_currently defined in the Racket namespace_. + • ‘racket-mode’ supplies ‘racket-complete-at-point’, which simply + supplies the same symbols that it knows how to font-lock. This + does _not_ require the Racket Mode back end to be running. But of + course the completion candidates do not correspond to your + program’s definitions or those it imports. This is a static, + “better than nothing” fallback. - Of course that means there must exist some Racket namespace. When -you first visit a ‘.rkt’ file, you need to ‘C-c C-c’ to *note -racket-run::. That makes the namespace match the file, and makes its -identifiers available to Racket Mode. (Otherwise, as a fallback, Racket -Mode uses the same list of identifiers for which it has defined *note -Font-lock (syntax highlighting)::.) + • ‘racket-xp-mode’ — an optional minor mode that enhances + ‘racket-mode’ — supplies ‘racket-xp-complete-at-point’, which uses + a static anaylsis to find local and imported binding names. + Although this requires the Racket Mode back end to be running — and + will automatically start it — it does _not_ require the edit buffer + to be ‘racket-run’. - Similarly, after you change the file, including its ‘require’ forms, -you’ll need to ‘C-c C-c’ again to make the resulting set of identifiers -available for completion. + • ‘racket-repl-mode’ supplies ‘racket-repl-complete-at-point’, which + uses the result of ‘namespace-mapped-symbols’ on the program + currently running in the REPL. - To have ‘TAB’ do completion as well as indent, add the following to -your Emacs init file: + These completion functions are set by default. (However, +‘racket-xp-mode’ is not enabled by default. To do so: *note +racket-xp-mode::.) + + If you want ‘TAB’ to do completion as well as indent, add the +following to your Emacs init file: (setq tab-always-indent 'complete) @@ -417,9 +459,18 @@ your Emacs init file: ‘racket-mode’ and ‘racket-repl-mode’.  -File: racket-mode.info, Node: paredit, Next: smartparens, Prev: Completion, Up: Configure +File: racket-mode.info, Node: Indent, Next: paredit, Prev: Completion, Up: Configure -3.4 paredit +3.4 Indent +========== + +Indentation can be customized in a way similar to lisp-mode and +scheme-mode: *note racket-indent-line::. + + +File: racket-mode.info, Node: paredit, Next: smartparens, Prev: Indent, Up: Configure + +3.5 paredit =========== If you use paredit (https://melpa.org/#/paredit), you might want to add @@ -449,9 +500,9 @@ keybindings to ‘paredit-mode-map’: ("M-{" . paredit-wrap-curly))))  -File: racket-mode.info, Node: smartparens, Next: eldoc, Prev: paredit, Up: Configure +File: racket-mode.info, Node: smartparens, Next: Edit buffers and REPL buffers, Prev: paredit, Up: Configure -3.5 smartparens +3.6 smartparens =============== If instead of paredit you prefer smartparens @@ -461,18 +512,36 @@ it provides for Lisp modes generally and for Racket Mode specifically: (require 'smartparens-config)  -File: racket-mode.info, Node: eldoc, Next: Start faster, Prev: smartparens, Up: Configure +File: racket-mode.info, Node: Edit buffers and REPL buffers, Next: eldoc, Prev: smartparens, Up: Configure -3.6 eldoc +3.7 Edit buffers and REPL buffers +================================= + +By default, all ‘racket-mode’ edit buffers share one ‘racket-repl-mode’ +buffer. For example, if you ‘racket-run’ “foo.rkt”, the REPL prompt +changes to “foo.rkt>”, and the REPL is inside the file module namespace. +If you then ‘racket-run’ “bar.rkt”, the REPL prompt changes to +“bar.rkt>”, and you are in that namespace. + + If you prefer, you can use more than one REPL buffer, by customizing +the variable *note racket-repl-buffer-name-function::: Another option is +to have one REPL buffer for each edit buffer, similar to Dr Racket. Yet +another option is to have files belong to the same project all share the +same REPL buffer. You can also define your own, custom function. + + +File: racket-mode.info, Node: eldoc, Next: Start faster, Prev: Edit buffers and REPL buffers, Up: Configure + +3.8 eldoc ========= By default Racket Mode sets ‘eldoc-documentation-function’ to ‘nil’ — no ‘eldoc-mode’ support. You may set it to ‘racket-eldoc-function’ in a -‘racket-mode-hook’ if you really want to use ‘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: +‘racket-mode-hook’ and ‘racket-repl-mode-hook’ if you really want to use +‘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: • Many Racket primitives are defined in ‘#%kernel’ or ‘#%runtime’. There’s no easy way to determine their argument lists. Most do not @@ -482,13 +551,17 @@ cases: functions. There’s no easy way to determine their “argument lists”. - A more satisfying experience is to use *note racket-describe:: or -*note racket-doc::. + • 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. + + A more satisfying experience is to use *note racket-xp-describe:: or +*note racket-xp-documentation::.  File: racket-mode.info, Node: Start faster, Next: Unicode input method, Prev: eldoc, Up: Configure -3.7 Start faster +3.9 Start faster ================ You can use *note racket-mode-start-faster:: to make the Racket REPL @@ -497,8 +570,8 @@ start faster.  File: racket-mode.info, Node: Unicode input method, Prev: Start faster, Up: Configure -3.8 Unicode input method -======================== +3.10 Unicode input method +========================= An optional Emacs input method, ‘racket-unicode’, lets you easily type various Unicode symbols that might be useful when writing Racket code. @@ -537,574 +610,21 @@ File: racket-mode.info, Node: Commands, Next: Variables, Prev: Reference, Up * Menu: +* Edit:: +* Explore:: * Run:: * Test:: * Eval:: -* Visit:: -* Learn:: -* Edit:: +* Collections:: * Macro expand:: * Other:: +* Showing information:: +* Associating edit buffers with REPL buffers::  -File: racket-mode.info, Node: Run, Next: Test, Up: Commands +File: racket-mode.info, Node: Edit, Next: Explore, Up: Commands -5.1 Run -======= - -* Menu: - -* racket-run:: -* racket-repl:: -* racket-racket:: -* racket-profile:: -* racket-profile-mode:: -* racket-logger:: -* racket-logger-mode:: -* racket-debug-mode:: - - -File: racket-mode.info, Node: racket-run, Next: racket-repl, Up: Run - -5.1.1 racket-run ----------------- - -‘C-c C-k’ or ‘C-c C-c’ - - Save and evaluate the buffer in REPL. - - With one C-u prefix, uses errortrace for improved stack traces. -Otherwise follows the *note racket-error-context:: setting. - - With two C-u prefixes, instruments code for step debugging. See -*note racket-debug-mode:: and the variable *note -racket-debuggable-files::. - - If point is within a Racket module form, the REPL “enters” that -submodule (uses its language info and namespace). - - When you run again, the file is evaluated from scratch — the -custodian releases resources like threads and the evaluation environment -is reset to the contents of the file. In other words, like DrRacket, -this provides the predictability of a “static” baseline, plus the -ability to explore interactively using the REPL. - - See also ‘racket-run-and-switch-to-repl’, which is even more like -DrRacket’s Run because it selects the REPL window (gives it the focus), -too. - - When *note racket-retry-as-skeleton:: is true, if your source file -has an error, a “skeleton” of your file is evaluated to get identifiers -from module languages, require forms, and definitions. That way, things -like completion and *note racket-describe:: are more likely to work -while you edit the file to fix the error. If not even the “skeleton” -evaluation succeeds, you’ll have only identifiers provided by -racket/base, until you fix the error and run again. - - Output in the Racket REPL buffer that describes a file and position -is automatically “linkified”. Examples of such text include: - - • Racket error messages. - • rackunit test failure location messages. - • print representation of path objects. - - To visit these locations, move point there and press RET or mouse -click. Or, use the standard ‘next-error’ and ‘previous-error’ commands. - - -File: racket-mode.info, Node: racket-repl, Next: racket-racket, Prev: racket-run, Up: Run - -5.1.2 racket-repl ------------------ - -‘C-c C-z’ - - Show the Racket REPL buffer in some window. - - If NOSELECT is not nil, does not also select the REPL window. - - *IMPORTANT* - - The main, intended use of Racket Mode’s REPL is that you ‘find-file’ -some specific .rkt file, then *note racket-run:: it. The REPL will then -match that file. Also, various Racket Mode features will work, such as -completion, visiting definitions, and so on. - - If the REPL isn’t running, and you want to start it for no file in -particular? Then you could use this command. But the resulting REPL -will have a minimal “#lang racket/base” namespace. You could enter -"(require racket)" if you want the equivalent of “#lang racket”. You -could also "(require racket/enter)" if you want things like “enter!”. -But in some sense you’d be “using it wrong”. If you really don’t want -to use Racket Mode’s REPL as intended, then you might as well use a -plain Emacs shell buffer to run command-line Racket. - - -File: racket-mode.info, Node: racket-racket, Next: racket-profile, Prev: racket-repl, Up: Run - -5.1.3 racket-racket -------------------- - -‘’ - - Do “racket ” in a shell buffer. - - -File: racket-mode.info, Node: racket-profile, Next: racket-profile-mode, Prev: racket-racket, Up: Run - -5.1.4 racket-profile --------------------- - -‘C-c C-o’ - - Runs with profiling instrumentation and shows results. - - Results are presented in a *note racket-profile-mode:: buffer, which -also lets you quickly view the source code. - - You may evaluate expressions in the REPL. They are also profiled. -Use ‘racket--profile-refresh’ to see the updated results. (In other -words a possible workflow is: *note racket-profile:: a .rkt file, call -one its functions in the REPL, and refresh the profile results.) - - Caveat: Only source files are instrumented. You may need to delete -compiled/*.zo files. - - -File: racket-mode.info, Node: racket-profile-mode, Next: racket-logger, Prev: racket-profile, Up: Run - -5.1.5 racket-profile-mode -------------------------- - -‘M-x’ ‘racket-profile-mode’ ‘RET’ - - Major mode for results of *note racket-profile::. - -Key Binding -‘,’ ‘racket--profile-sort’ -‘RET’ ‘racket--profile-visit’ -‘z’ ‘racket--profile-show-zero’ -‘p’ ‘racket--profile-prev’ -‘n’ ‘racket--profile-next’ -‘g’ ‘racket--profile-refresh’ -‘q’ ‘racket--profile-quit’ - - In addition to any hooks its parent mode ‘special-mode’ might have -run, this mode runs the hook ‘racket-profile-mode-hook’, as the final -step during initialization. - - -File: racket-mode.info, Node: racket-logger, Next: racket-logger-mode, Prev: racket-profile-mode, Up: Run - -5.1.6 racket-logger -------------------- - -‘C-c C-l’ - - Create the *note racket-logger-mode:: buffer and connect to logger -output. - - If the ‘racket-repl-mode’ buffer is displayed in a window, split that -window and put the logger in the bottom window. Otherwise, use -‘pop-to-buffer’. - - -File: racket-mode.info, Node: racket-logger-mode, Next: racket-debug-mode, Prev: racket-logger, Up: Run - -5.1.7 racket-logger-mode ------------------------- - -‘M-x’ ‘racket-logger-mode’ ‘RET’ - - Major mode for Racket logger output. - - The customization variable *note racket-logger-config:: determines -the levels for topics. During a session you may change topic levels -using ‘racket-logger-topic-level’. - - For more information see: - - -Key Binding -‘C-c C-z’ *note racket-repl:: -‘x’ ‘racket-logger-exit’ -‘g’ ‘racket-logger-clear’ -‘p’ ‘racket-logger-previous-item’ -‘n’ ‘racket-logger-next-item’ -‘w’ ‘toggle-truncate-lines’ -‘l’ ‘racket-logger-topic-level’ - - In addition to any hooks its parent mode ‘special-mode’ might have -run, this mode runs the hook ‘racket-logger-mode-hook’, as the final -step during initialization. - - -File: racket-mode.info, Node: racket-debug-mode, Prev: racket-logger-mode, Up: Run - -5.1.8 racket-debug-mode ------------------------ - -‘M-x’ ‘racket-debug-mode’ ‘RET’ - - Minor mode for debug breaks. - - This feature is **EXPERIMENTAL**!!! It is likely to have significant -limitations and bugs. You are welcome to open an issue to provide -feedback. Please understand that this feature might never be improved – -it might even be removed someday if it turns out to have too little -value and/or too much cost. - - How to debug: - - 1. “Instrument” code for step debugging. You can instrument entire - files, and also individual functions. - - a. Entire Files - - Choose *note racket-run:: with two prefixes – C-u C-u C-c C-c. The - file will be instrumented for step debugging before it is run. - Also instrumented are files determined by the variable *note - racket-debuggable-files::. - - The run will break at the first breakable position. - - Tip: After you run to completion and return to a normal REPL - prompt, the code remains instrumented. You may enter expressions - that evaluate instrumented code and it will break so you can step - debug again. - - b. Function Definitions - - Put point in a function ‘define’ form and C-u C-M-x to “instrument” - the function for step debugging. Then in the REPL, enter an - expression that causes the instrumented function to be run, - directly or indirectly. - - You can instrument any number of functions. - - You can even instrument while stopped at a break. For example, to - instrument a function you are about to call, so you can “step into” - it: - - • M-. a.k.a. *note racket-visit-definition::. - • C-u C-M-x to instrument the definition. - • M-, a.k.a. *note racket-unvisit::. - • Continue stepping. - Limitation: Instrumenting a function ~require~d from another module - won’t redefine that function. Instead, it attempts to define an - instrumented function of the same name, in the module the REPL is - inside. The define will fail if it needs definitions visible only - in that other module. In that case you’ll probably need to use - entire-file instrumentation as described above. - - 2. When a break occurs, the ‘racket-repl-mode’ prompt changes. In - this debug REPL, local variables are available for you to use and - even to ‘set!’. - - Also, in the ‘racket-mode’ buffer where the break is located, *note - racket-debug-mode:: is enabled. This minor mode makes the buffer - read-only, provides visual feedback – about the break position, - local variable values, and result values – and provides shortcut - keys: - -Key Binding -‘?’ ‘racket-debug-help’ -‘h’ ‘racket-debug-run-to-here’ -‘p’ ‘racket-debug-prev-breakable’ -‘n’ ‘racket-debug-next-breakable’ -‘c’ ‘racket-debug-continue’ -‘u’ ‘racket-debug-step-out’ -‘o’ ‘racket-debug-step-over’ -‘SPC’ ‘racket-debug-step’ - - -File: racket-mode.info, Node: Test, Next: Eval, Prev: Run, Up: Commands - -5.2 Test -======== - -* Menu: - -* racket-test:: -* racket-raco-test:: - - -File: racket-mode.info, Node: racket-test, Next: racket-raco-test, Up: Test - -5.2.1 racket-test ------------------ - -‘’ or ‘C-c C-t’ - - Run the “test” submodule. - - With prefix, runs with coverage instrumentation and highlights -uncovered code. - - Put your tests in a “test” submodule. For example: - - (module+ test - (require rackunit) - (check-true #t)) - - Any rackunit test failure messages show the location. You may use -‘next-error’ to jump to the location of each failing test. - - See also: - • *note racket-fold-all-tests:: - • *note racket-unfold-all-tests:: - - -File: racket-mode.info, Node: racket-raco-test, Prev: racket-test, Up: Test - -5.2.2 racket-raco-test ----------------------- - -‘M-x’ ‘racket-raco-test’ ‘RET’ - - Do “raco test -x ” in a shell buffer to run the “test” -submodule. - - -File: racket-mode.info, Node: Eval, Next: Visit, Prev: Test, Up: Commands - -5.3 Eval -======== - -* Menu: - -* racket-send-region:: -* racket-send-definition:: -* racket-send-last-sexp:: - - -File: racket-mode.info, Node: racket-send-region, Next: racket-send-definition, Up: Eval - -5.3.1 racket-send-region ------------------------- - -‘C-c C-r’ - - Send the current region (if any) to the Racket REPL. - - -File: racket-mode.info, Node: racket-send-definition, Next: racket-send-last-sexp, Prev: racket-send-region, Up: Eval - -5.3.2 racket-send-definition ----------------------------- - -‘C-M-x’ - - Send the current definition to the Racket REPL. - - -File: racket-mode.info, Node: racket-send-last-sexp, Prev: racket-send-definition, Up: Eval - -5.3.3 racket-send-last-sexp ---------------------------- - -‘C-x C-e’ - - Send the previous sexp to the Racket REPL. - - When the previous sexp is a sexp comment the sexp itself is sent, -without the #; prefix. - - -File: racket-mode.info, Node: Visit, Next: Learn, Prev: Eval, Up: Commands - -5.4 Visit -========= - -* Menu: - -* racket-visit-definition:: -* racket-visit-module:: -* racket-unvisit:: -* racket-open-require-path:: -* racket-find-collection:: - - -File: racket-mode.info, Node: racket-visit-definition, Next: racket-visit-module, Up: Visit - -5.4.1 racket-visit-definition ------------------------------ - -‘M-.’ - - Visit definition of identifier at point. - - If there is no identifier at point, prompt for it. - - With a prefix, always prompt for the identifier. - - Use *note racket-unvisit:: to return. - - Please keep in mind the following limitations: - - • Only finds symbols defined in the current namespace. You may need - to *note racket-run:: the current buffer, first. - - • Only visits the definition of module-level identifiers – things for - which Racket’s “identifier-binding” function returns information. - This does NOT include things such as local (nested) function - definitions or “racket/class” member functions. To find those in - the same file, you’ll need to use a normal Emacs text search - function like ‘isearch-forward’. - - • If the definition is found in Racket’s “#%kernel” module, it will - tell you so but won’t visit the definition site. - - -File: racket-mode.info, Node: racket-visit-module, Next: racket-unvisit, Prev: racket-visit-definition, Up: Visit - -5.4.2 racket-visit-module -------------------------- - -‘C-M-.’ - - Visit definition of module at point, e.g. net/url or “file.rkt”. - - If there is no module at point, prompt for it. - - With a prefix, always prompt for the module. - - Use *note racket-unvisit:: to return. - - See also: *note racket-find-collection::. - - -File: racket-mode.info, Node: racket-unvisit, Next: racket-open-require-path, Prev: racket-visit-module, Up: Visit - -5.4.3 racket-unvisit --------------------- - -‘M-,’ - - Return from previous *note racket-visit-definition:: or *note -racket-visit-module::. - - -File: racket-mode.info, Node: racket-open-require-path, Next: racket-find-collection, Prev: racket-unvisit, Up: Visit - -5.4.4 racket-open-require-path ------------------------------- - -‘C-c C-x C-f’ - - Like Dr Racket’s Open Require Path. - - Type (or delete) characters that are part of a module path name. -“Fuzzy” matches appear. For example try typing “t/t/r”. - - Choices are displayed in a vertical list. The current choice is at -the top, marked with “->”. - - • C-n and C-p move among the choices. - • RET on a directory adds its contents to the choices. - • RET on a file exits doing ‘find-file’. - • C-g aborts. - - Note: This requires Racket 6.1.1.6 or newer. Otherwise it won’t -error, it will just never return any matches. - - -File: racket-mode.info, Node: racket-find-collection, Prev: racket-open-require-path, Up: Visit - -5.4.5 racket-find-collection ----------------------------- - -‘M-x’ ‘racket-find-collection’ ‘RET’ - - Given a collection name, try to find its directory and files. - - Takes a collection name from point (or, with a prefix, prompts you). - - If only one directory is found, ‘ido-find-file-in-dir’ lets you pick -a file there. - - If more than one directory is found, ‘ido-completing-read’ lets you -pick one, then ‘ido-find-file-in-dir’ lets you pick a file there. - - Note: This requires the ‘raco-find-collection’ package to be -installed. To install it, in ‘shell’ enter: - - raco pkg install raco-find-collection - - Tip: This works best with ‘ido-enable-flex-matching’ set to t. Also -handy is the ‘flx-ido’ package from MELPA. - - See also: *note racket-visit-module:: and *note -racket-open-require-path::. - - -File: racket-mode.info, Node: Learn, Next: Edit, Prev: Visit, Up: Commands - -5.5 Learn -========= - -* Menu: - -* racket-describe:: -* racket-doc:: - - -File: racket-mode.info, Node: racket-describe, Next: racket-doc, Up: Learn - -5.5.1 racket-describe ---------------------- - -‘C-c C-.’ - - Describe the identifier at point in a ‘*Racket Describe*’ buffer. - - The intent is to give a quick reminder or introduction to something, -regardless of whether it has installed documentation – and to do so -within Emacs, without switching to a web browser. - - This buffer is also displayed when you use ‘company-mode’ and press -F1 or C-h in its pop up completion list. - - • If the identifier has installed Racket documentation, then a - simplified version of the HTML is presented in the buffer, - including the “blue box”, documentation prose, and examples. - - • Otherwise, if the identifier is a function, then its signature is - displayed, for example ‘(name arg-1-name arg-2-name)’. If it has a - contract or a Typed Racket type, that is also displayed. - - You can quit the buffer by pressing q. Also, at the bottom of the -buffer are Emacs buttons – which you may navigate among using TAB, and -activate using RET – for *note racket-visit-definition:: and *note -racket-doc::. - - -File: racket-mode.info, Node: racket-doc, Prev: racket-describe, Up: Learn - -5.5.2 racket-doc ----------------- - -‘C-c C-d’ - - View documentation of the identifier or string at point. - - Uses the default external web browser. - - If point is an identifier required in the current namespace that has -help, opens the web browser directly at that help topic. (i.e. Uses -the identifier variant of racket/help.) - - Otherwise, opens the ‘search for a term’ page, where you can choose -among multiple possibilities. (i.e. Uses the string variant of -racket/help.) - - With a C-u prefix, prompts for the identifier or quoted string, -instead of looking at point. - - -File: racket-mode.info, Node: Edit, Next: Macro expand, Prev: Learn, Up: Commands - -5.6 Edit +5.1 Edit ======== * Menu: @@ -1120,7 +640,6 @@ File: racket-mode.info, Node: Edit, Next: Macro expand, Prev: Learn, Up: Com * racket-insert-closing:: * racket-cycle-paren-shapes:: * racket-backward-up-list:: -* racket-check-syntax-mode:: * racket-unicode-input-method-enable:: * racket-align:: * racket-unalign:: @@ -1129,7 +648,7 @@ File: racket-mode.info, Node: Edit, Next: Macro expand, Prev: Learn, Up: Com  File: racket-mode.info, Node: racket-insert-lambda, Next: racket-fold-all-tests, Up: Edit -5.6.1 racket-insert-lambda +5.1.1 racket-insert-lambda -------------------------- ‘C-M-y’ @@ -1142,7 +661,7 @@ racket-unicode-input-method-enable::.  File: racket-mode.info, Node: racket-fold-all-tests, Next: racket-unfold-all-tests, Prev: racket-insert-lambda, Up: Edit -5.6.2 racket-fold-all-tests +5.1.2 racket-fold-all-tests --------------------------- ‘C-c C-f’ @@ -1152,7 +671,7 @@ File: racket-mode.info, Node: racket-fold-all-tests, Next: racket-unfold-all-t  File: racket-mode.info, Node: racket-unfold-all-tests, Next: racket-tidy-requires, Prev: racket-fold-all-tests, Up: Edit -5.6.3 racket-unfold-all-tests +5.1.3 racket-unfold-all-tests ----------------------------- ‘C-c C-u’ @@ -1162,7 +681,7 @@ File: racket-mode.info, Node: racket-unfold-all-tests, Next: racket-tidy-requi  File: racket-mode.info, Node: racket-tidy-requires, Next: racket-trim-requires, Prev: racket-unfold-all-tests, Up: Edit -5.6.4 racket-tidy-requires +5.1.4 racket-tidy-requires -------------------------- ‘M-x’ ‘racket-tidy-requires’ ‘RET’ @@ -1195,7 +714,7 @@ racket-base-requires::.  File: racket-mode.info, Node: racket-trim-requires, Next: racket-base-requires, Prev: racket-tidy-requires, Up: Edit -5.6.5 racket-trim-requires +5.1.5 racket-trim-requires -------------------------- ‘M-x’ ‘racket-trim-requires’ ‘RET’ @@ -1203,8 +722,8 @@ File: racket-mode.info, Node: racket-trim-requires, Next: racket-base-requires Like *note racket-tidy-requires:: but also deletes unnecessary requires. - Note: This only works when the source file can be evaluated with no -errors. + Note: This only works when the source file can be fully expanded with +no errors. Note: This only works for requires at the top level of a source file using #lang. It does NOT work for require forms inside module forms. @@ -1216,7 +735,7 @@ delete top level requires that are actually needed by such submodules.  File: racket-mode.info, Node: racket-base-requires, Next: racket-indent-line, Prev: racket-trim-requires, Up: Edit -5.6.6 racket-base-requires +5.1.6 racket-base-requires -------------------------- ‘M-x’ ‘racket-base-requires’ ‘RET’ @@ -1232,8 +751,8 @@ loading all of “racket” can reduce load time and memory footprint. Also, as does *note racket-trim-requires::, this removes unneeded modules and tidies everything into a single, sorted require form. - Note: This only works when the source file can be evaluated with no -errors. + Note: This only works when the source file can be fully expanded with +no errors. Note: This only works for requires at the top level of a source file using #lang. It does NOT work for require forms inside module forms. @@ -1247,58 +766,66 @@ changing “#lang typed/racket” to “#lang typed/racket/base”.  File: racket-mode.info, Node: racket-indent-line, Next: racket-smart-open-bracket-mode, Prev: racket-base-requires, Up: Edit -5.6.7 racket-indent-line +5.1.7 racket-indent-line ------------------------ ‘M-x’ ‘racket-indent-line’ ‘RET’ Indent current line as Racket code. + Normally you don’t need to use this command directly, it is used +automatically when you press keys like RET or TAB. However you might +refer to it when configuring custom indentation, explained below. + This behaves like ‘lisp-indent-line’, except that whole-line comments are treated the same regardless of whether they start with single or double semicolons. - • Automatically indents forms that start with ‘begin’ in the usual - way that ‘begin’ is indented. + • Automatically indents forms that start with “begin” in the usual + way that “begin” is indented. - • Automatically indents forms that start with ‘def’ or ‘with-’ in the - usual way that ‘define’ is indented. + • Automatically indents forms that start with “def” or “with-” in the + usual way that “define” is indented. • Has rules for many specific standard Racket forms. To extend, use your Emacs init file to - (put SYMBOL ‘racket-indent-function INDENT) + (put SYMBOL 'racket-indent-function INDENT) - where ‘SYMBOL’ is the name of the Racket form (e.g. ~’test-case~) -and ‘INDENT’ is an integer or the symbol ~’defun~. When ‘INDENT’ is an -integer, the meaning is the same as for ‘lisp-indent-function’ and -‘scheme-indent-function’: Indent the first ‘n’ arguments specially and -then indent any further arguments like a body. + SYMBOL is the name of the Racket form like “’test-case” and INDENT is +an integer or the symbol “’defun”. When INDENT is an integer, the +meaning is the same as for lisp-indent-function and +scheme-indent-function: Indent the first INDENT arguments specially and +indent any further arguments like a body. - For example in your ‘.emacs’ file you could use: + For example: - (put ‘test-case ‘racket-indent-function 1) + (put 'test-case 'racket-indent-function 1) - to change the indent of ‘test-case’ from this: + This will change the indent of ‘test-case’ from this: - (test-case foo blah blah) + (test-case foo + blah + blah) to this: - (test-case foo blah blah) + (test-case foo + blah + blah) If ‘racket-indent-function’ has no property for a symbol, -‘scheme-indent-function’ is also considered (although the with-x indents -defined by ‘scheme-mode’ are ignored). This is only to help people who -may have extensive ‘scheme-indent-function’ settings, particularly in -the form of file or dir local variables. Otherwise prefer +scheme-indent-function is also considered, although the “with-” indents +defined by scheme-mode are ignored. This is only to help people who may +have extensive scheme-indent-function settings, particularly in the form +of file or dir local variables. Otherwise prefer putting properties on ‘racket-indent-function’.  File: racket-mode.info, Node: racket-smart-open-bracket-mode, Next: racket-insert-closing, Prev: racket-indent-line, Up: Edit -5.6.8 racket-smart-open-bracket-mode +5.1.8 racket-smart-open-bracket-mode ------------------------------------ ‘M-x’ ‘racket-smart-open-bracket-mode’ ‘RET’ @@ -1340,7 +867,7 @@ variable ‘minor-mode-map-alist’.  File: racket-mode.info, Node: racket-insert-closing, Next: racket-cycle-paren-shapes, Prev: racket-smart-open-bracket-mode, Up: Edit -5.6.9 racket-insert-closing +5.1.9 racket-insert-closing --------------------------- ‘]’ or ‘)’ @@ -1356,7 +883,7 @@ added in Emacs 24.5.  File: racket-mode.info, Node: racket-cycle-paren-shapes, Next: racket-backward-up-list, Prev: racket-insert-closing, Up: Edit -5.6.10 racket-cycle-paren-shapes +5.1.10 racket-cycle-paren-shapes -------------------------------- ‘C-c C-p’ @@ -1364,9 +891,9 @@ File: racket-mode.info, Node: racket-cycle-paren-shapes, Next: racket-backward Cycle the sexpr among () [] {}.  -File: racket-mode.info, Node: racket-backward-up-list, Next: racket-check-syntax-mode, Prev: racket-cycle-paren-shapes, Up: Edit +File: racket-mode.info, Node: racket-backward-up-list, Next: racket-unicode-input-method-enable, Prev: racket-cycle-paren-shapes, Up: Edit -5.6.11 racket-backward-up-list +5.1.11 racket-backward-up-list ------------------------------ ‘C-M-u’ @@ -1380,36 +907,9 @@ not repeatedly. Instead, initially use comment, if any, then use normal ‘backward-up-list’ repeatedly.  -File: racket-mode.info, Node: racket-check-syntax-mode, Next: racket-unicode-input-method-enable, Prev: racket-backward-up-list, Up: Edit +File: racket-mode.info, Node: racket-unicode-input-method-enable, Next: racket-align, Prev: racket-backward-up-list, Up: Edit -5.6.12 racket-check-syntax-mode -------------------------------- - -‘M-x’ ‘racket-check-syntax-mode’ ‘RET’ - - Analyze the buffer and annotate with information. - - The buffer becomes read-only until you exit this minor mode. However -you may navigate the usual ways. When point is on a definition or use, -related items are highlighted and information is displayed in the echo -area. You may also use special commands to navigate among the -definition and its uses. - -Key Binding -‘r’ ‘racket-check-syntax-mode-rename’ -‘p’ ‘racket-check-syntax-mode-goto-prev-use’ -‘n’ ‘racket-check-syntax-mode-goto-next-use’ -‘.’ ‘racket-check-syntax-mode-goto-def’ -‘k’ ‘racket-check-syntax-mode-goto-prev-def’ -‘TAB’ ‘racket-check-syntax-mode-goto-next-def’ -‘j’ ‘racket-check-syntax-mode-goto-next-def’ -‘h’ ‘racket-check-syntax-mode-help’ -‘q’ ‘racket-check-syntax-mode-quit’ - - -File: racket-mode.info, Node: racket-unicode-input-method-enable, Next: racket-align, Prev: racket-check-syntax-mode, Up: Edit - -5.6.13 racket-unicode-input-method-enable +5.1.12 racket-unicode-input-method-enable ----------------------------------------- ‘M-x’ ‘racket-unicode-input-method-enable’ ‘RET’ @@ -1465,7 +965,7 @@ can turn it off by setting ‘input-method-highlight-flag’ to nil.  File: racket-mode.info, Node: racket-align, Next: racket-unalign, Prev: racket-unicode-input-method-enable, Up: Edit -5.6.14 racket-align +5.1.13 racket-align ------------------- ‘M-x’ ‘racket-align’ ‘RET’ @@ -1530,7 +1030,7 @@ For example:  File: racket-mode.info, Node: racket-unalign, Next: racket-complete-at-point, Prev: racket-align, Up: Edit -5.6.15 racket-unalign +5.1.14 racket-unalign --------------------- ‘M-x’ ‘racket-unalign’ ‘RET’ @@ -1543,24 +1043,747 @@ couple’s value.  File: racket-mode.info, Node: racket-complete-at-point, Prev: racket-unalign, Up: Edit -5.6.16 racket-complete-at-point +5.1.15 racket-complete-at-point ------------------------------- -Default value for the variable ‘completion-at-point-functions’. +A value for the variable ‘completion-at-point-functions’. - Completion candidates are drawn from the namespace symbols resulting -from the most recent *note racket-run:: of each .rkt file. If a file -has never been run, candidates default to values also used for font-lock -– an assortment of symbols from common Racket modules such as ‘racket’, -‘typed/racket’, and ‘syntax/parse’. - - Returns extra :company-doc-buffer and :company-location properties -for use by the ‘company-mode’ backend ‘company-capf’ – but not -:company-docsig, because it is frequently impossible to supply this -quickly enough or at all. + Completion candidates are drawn from the same symbols used for +font-lock. This is a static list. If you want dynamic, smarter +completion candidates, enable the minor mode *note racket-xp-mode::.  -File: racket-mode.info, Node: Macro expand, Next: Other, Prev: Edit, Up: Commands +File: racket-mode.info, Node: Explore, Next: Run, Prev: Edit, Up: Commands + +5.2 Explore +=========== + +* Menu: + +* racket-xp-mode:: +* racket-xp-visit-definition:: +* racket-xp-describe:: +* racket-xp-documentation:: + + +File: racket-mode.info, Node: racket-xp-mode, Next: racket-xp-visit-definition, Up: Explore + +5.2.1 racket-xp-mode +-------------------- + +‘M-x’ ‘racket-xp-mode’ ‘RET’ + + A minor mode that analyzes expanded code to explain and explore. + + This minor mode is an optional enhancement to ‘racket-mode’ edit +buffers. Like any minor mode, you can turn it on or off for a specific +buffer. If you always want to use it, put the following code in your +Emacs init file: + + (require 'racket-xp) + (add-hook 'racket-mode-hook #'racket-xp-mode) + + Note: This mode won’t do anything unless/until the Racket Mode back +end is running. It will try to start the back end automatically. You +do _not_ need to *note racket-run:: the buffer you are editing. + + This mode uses the drracket/check-syntax package to analyze +fully-expanded programs, without needing to evaluate a.k.a. “run” them. +The resulting analysis provides information for: + + • Visually annotating bindings – local or imported definitions and + references to them. + + • Completion candidates. + + • Defintions’ source and documentation. + + When point is on a definition or use, related items are highlighted +using *note racket-xp-def-face:: and *note racket-xp-use-face:: – +instead of drawing arrows as in Dr Racket. Information is displayed +using the function(s) in the hook variable *note +racket-show-functions::; it is also available when hovering the mouse +cursor. Note: If you find these features too distracting and/or slow, +you may disable ‘cursor-sensor-mode’. The remaining features discussed +below will still work. + + You may also use commands to navigate among a definition and its +uses, or to rename a local definitions and all its uses. + + In the following little example, not only does drracket/check-syntax +distinguish the various “x” bindings, it understands the two different +imports of “define”: + + #lang racket/base + (define x 1) + x + (let ([x x]) + (+ x 1)) + (module m typed/racket/base + (define x 2) + x) + + The function ‘racket-xp-complete-at-point’ is added to the variable +‘completion-at-point-functions’. Note that in this case, it is not +smart about submodules; identifiers are assumed to be definitions from +the file’s module or its imports. In addition to supplying completion +candidates, it supports the “:company-location” property to inspect the +definition of a candidate and the “:company-doc-buffer” property to view +its documentation. + + When you edit the buffer, existing annotations are retained; their +positions are updated to reflect the edit. Annotations for new or +deleted text are not requested until after *note +racket-xp-after-change-refresh-delay:: seconds. The request is made +asynchronously so that Emacs will not block – for moderately complex +source files, it can take some seconds simply to fully expand them, as +well as a little more time for the drracket/check-syntax analysis. When +the results are ready, all annotations for the buffer are completely +refreshed. + + You may also set *note racket-xp-after-change-refresh-delay:: to nil +and use the ‘racket-xp-annotate’ command manually. + + The mode line changes to reflect the current status of annotations, +and whether or not you had a syntax error. + + If you have one or more syntax errors, ‘racket-xp-next-error’ and +‘racket-xp-previous-error’ to navigate among them. Although most +languages will stop after the first syntax error, some like Typed Racket +will try to collect and report multiple errors. + + Tip: This mode follows the convention that a minor mode may only use +a prefix key consisting of “C-c” followed by a punctuation key. As a +result, ‘racket-xp-control-c-hash-keymap’ is bound to “C-c #” by +default. Although you might find this awkward to type, remember that as +an Emacs user, you are free to bind this map to a more convenient +prefix, and/or bind any individual commands directly to whatever keys +you prefer. + +Key Binding +‘C-x ,’ ‘racket-xp-next-error’ +‘M-g p’ ‘racket-xp-previous-error’ +‘M-g M-p’ ‘racket-xp-previous-error’ +‘M-g M-n’ ‘racket-xp-next-error’ +‘M-g n’ ‘racket-xp-next-error’ +‘M-.’ *note racket-xp-visit-definition:: +‘C-c C-d’ *note racket-xp-documentation:: +‘C-c C-.’ *note racket-xp-describe:: +‘C-c # g’ ‘racket-xp-annotate’ +‘C-c # r’ ‘racket-xp-rename’ +‘C-c # .’ *note racket-xp-visit-definition:: +‘C-c # p’ ‘racket-xp-previous-use’ +‘C-c # n’ ‘racket-xp-next-use’ +‘C-c # k’ ‘racket-xp-previous-definition’ +‘C-c # j’ ‘racket-xp-next-definition’ + + +File: racket-mode.info, Node: racket-xp-visit-definition, Next: racket-xp-describe, Prev: racket-xp-mode, Up: Explore + +5.2.2 racket-xp-visit-definition +-------------------------------- + +‘M-x’ ‘racket-xp-visit-definition’ ‘RET’ + + When point is on a use, go to its definition. + + With a prefix, prompts you, but in this case beware it assumes +definitions in or imported by the file module – not locals or +definitions in submodules. + + +File: racket-mode.info, Node: racket-xp-describe, Next: racket-xp-documentation, Prev: racket-xp-visit-definition, Up: Explore + +5.2.3 racket-xp-describe +------------------------ + +‘M-x’ ‘racket-xp-describe’ ‘RET’ + + Describe the identifier at point in a ‘*Racket Describe*’ buffer. + + With a prefix, prompts you, but in this case beware it assumes +definitions in or imported by the file module – not locals or +definitions in submodules. + + The intent is to give a quick reminder or introduction to something, +regardless of whether it has installed documentation – and to do so +within Emacs, without switching to a web browser. + + This buffer is also displayed when you use ‘company-mode’ and press +F1 or C-h in its pop up completion list. + + • If the identifier has installed Racket documentation, then a + simplified version of the HTML is presented in the buffer, + including the “blue box”, documentation prose, and examples. + + • Otherwise, if the identifier is a function, then its signature is + displayed, for example "(name arg-1-name arg-2-name)". + + You can quit the buffer by pressing q. Also, at the bottom of the +buffer are Emacs buttons – which you may navigate among using TAB, and +activate using RET – for *note racket-xp-visit-definition:: and *note +racket-xp-documentation::. + + +File: racket-mode.info, Node: racket-xp-documentation, Prev: racket-xp-describe, Up: Explore + +5.2.4 racket-xp-documentation +----------------------------- + +‘M-x’ ‘racket-xp-documentation’ ‘RET’ + + Show documentation for the identifier at point. + + This gives a “file:” URL to ‘browse-url’, which typically opens an +external web browser, but see that and the variable +‘browse-url-browser-function’. + + With a prefix, prompts you, but in this case beware it assumes +definitions in or imported by the file module – not locals or +definitions in submodules. + + +File: racket-mode.info, Node: Run, Next: Test, Prev: Explore, Up: Commands + +5.3 Run +======= + +* Menu: + +* racket-run:: +* racket-run-and-switch-to-repl:: +* racket-run-module-at-point:: +* racket-repl:: +* racket-repl-describe:: +* racket-repl-documentation:: +* racket-repl-visit-definition:: +* racket-racket:: +* racket-profile:: +* racket-profile-mode:: +* racket-logger:: +* racket-logger-mode:: +* racket-debug-mode:: + + +File: racket-mode.info, Node: racket-run, Next: racket-run-and-switch-to-repl, Up: Run + +5.3.1 racket-run +---------------- + +‘M-x’ ‘racket-run’ ‘RET’ + + Save the buffer in REPL and run your program. + + Runs the “main” submodule, if any, otherwise the file’s module. See +also *note racket-run-module-at-point::. + + With one C-u prefix, uses errortrace for improved stack traces. +Otherwise follows the *note racket-error-context:: setting. + + With two C-u prefixes, instruments code for step debugging. See +*note racket-debug-mode:: and the variable *note +racket-debuggable-files::. + + Each run occurs within a Racket custodian. Any prior run’s custodian +is shut down, releasing resources like threads and ports. Each run’s +evaluation environment is reset to the contents of the source file. In +other words, like Dr Racket, this provides the benefit that your source +file is the “single source of truth”. At the same time, the run gives +you a REPL inside the namespace of the module, giving you the ability to +explore it interactively. Any explorations are temporary, unless you +also make them to your source file, they will be lost on the next run. + + See also *note racket-run-and-switch-to-repl::, which is even more +like Dr Racket’s Run command because it selects the REPL window after +running. + + In the ‘racket-repl-mode’ buffer, output that describes a file and +position is automatically “linkified”. Examples of such text include: + + • Racket error messages. + • rackunit test failure location messages. + • print representation of path objects. + + To visit these locations, move point there and press RET or mouse +click. Or, use the standard ‘next-error’ and ‘previous-error’ commands. + + +File: racket-mode.info, Node: racket-run-and-switch-to-repl, Next: racket-run-module-at-point, Prev: racket-run, Up: Run + +5.3.2 racket-run-and-switch-to-repl +----------------------------------- + +‘’ + + This is *note racket-run:: followed by *note racket-repl::. + + +File: racket-mode.info, Node: racket-run-module-at-point, Next: racket-repl, Prev: racket-run-and-switch-to-repl, Up: Run + +5.3.3 racket-run-module-at-point +-------------------------------- + +‘C-c C-k’ or ‘C-c C-c’ + + Save the buffer and run the moudule at point. + + Like *note racket-run:: but runs the innermost module around point. +This may be a submodule nested at any depth, or the file’s module. + + +File: racket-mode.info, Node: racket-repl, Next: racket-repl-describe, Prev: racket-run-module-at-point, Up: Run + +5.3.4 racket-repl +----------------- + +‘C-c C-z’ + + Show a Racket REPL buffer in some window. + + *IMPORTANT* + + The main, intended use of Racket Mode’s REPL is that you ‘find-file’ +some specific .rkt file, then *note racket-run:: it. The REPL will then +match that file. + + If the REPL isn’t running, and you want to start it for no file in +particular? Then you could use this command. But the resulting REPL +will have a minimal “#lang racket/base” namespace. You could enter +"(require racket)" if you want the equivalent of “#lang racket”. You +could also "(require racket/enter)" if you want things like “enter!”. +But in some sense you’d be “using it wrong”. If you really don’t want +to use Racket Mode’s REPL as intended, then you might as well use a +plain Emacs shell buffer to run command-line Racket. + + +File: racket-mode.info, Node: racket-repl-describe, Next: racket-repl-documentation, Prev: racket-repl, Up: Run + +5.3.5 racket-repl-describe +-------------------------- + +‘M-x’ ‘racket-repl-describe’ ‘RET’ + + Describe the identifier at point in a ‘*Racket Describe*’ buffer. + + The intent is to give a quick reminder or introduction to something, +regardless of whether it has installed documentation – and to do so +within Emacs, without switching to a web browser. + + This buffer is also displayed when you use ‘company-mode’ and press +F1 or C-h in its pop up completion list. + + • If the identifier has installed Racket documentation, then a + simplified version of the HTML is presented in the buffer, + including the “blue box”, documentation prose, and examples. + + • Otherwise, if the identifier is a function, then its signature is + displayed, for example ‘(name arg-1-name arg-2-name)’. If it has a + contract or a Typed Racket type, that is also displayed. + + You can quit the buffer by pressing q. Also, at the bottom of the +buffer are Emacs buttons – which you may navigate among using TAB, and +activate using RET – for ‘racket-visit-definition’ and ‘racket-doc’. + + +File: racket-mode.info, Node: racket-repl-documentation, Next: racket-repl-visit-definition, Prev: racket-repl-describe, Up: Run + +5.3.6 racket-repl-documentation +------------------------------- + +‘M-x’ ‘racket-repl-documentation’ ‘RET’ + + View documentation of the identifier or string at point. + + Uses the default external web browser. + + If point is an identifier required in the current namespace that has +help, opens the web browser directly at that help topic. (i.e. Uses +the identifier variant of racket/help.) + + Otherwise, opens the ‘search for a term’ page, where you can choose +among multiple possibilities. (i.e. Uses the string variant of +racket/help.) + + With a C-u prefix, prompts for the identifier or quoted string, +instead of looking at point. + + +File: racket-mode.info, Node: racket-repl-visit-definition, Next: racket-racket, Prev: racket-repl-documentation, Up: Run + +5.3.7 racket-repl-visit-definition +---------------------------------- + +‘M-x’ ‘racket-repl-visit-definition’ ‘RET’ + + Visit definition of identifier at point. + + If there is no identifier at point, prompt for it. + + With a prefix, always prompt for the identifier. + + Use *note racket-unvisit:: to return. + + Please keep in mind the following limitations: + + • Finds symbols defined in the REPL’s namespace, which only includes + imported and module binding – but not local bindings. + + • If the definition is found in Racket’s “#%kernel” module, it will + tell you so but won’t visit the definition site. + + +File: racket-mode.info, Node: racket-racket, Next: racket-profile, Prev: racket-repl-visit-definition, Up: Run + +5.3.8 racket-racket +------------------- + +‘’ + + Do “racket ” in a shell buffer. + + +File: racket-mode.info, Node: racket-profile, Next: racket-profile-mode, Prev: racket-racket, Up: Run + +5.3.9 racket-profile +-------------------- + +‘C-c C-o’ + + Runs with profiling instrumentation and shows results. + + Results are presented in a *note racket-profile-mode:: buffer, which +also lets you quickly view the source code. + + You may evaluate expressions in the REPL. They are also profiled. +Use ‘racket--profile-refresh’ to see the updated results. (In other +words a possible workflow is: *note racket-profile:: a .rkt file, call +one its functions in the REPL, and refresh the profile results.) + + Caveat: Only source files are instrumented. You may need to delete +compiled/*.zo files. + + +File: racket-mode.info, Node: racket-profile-mode, Next: racket-logger, Prev: racket-profile, Up: Run + +5.3.10 racket-profile-mode +-------------------------- + +‘M-x’ ‘racket-profile-mode’ ‘RET’ + + Major mode for results of *note racket-profile::. + +Key Binding +‘,’ ‘racket--profile-sort’ +‘RET’ ‘racket--profile-visit’ +‘z’ ‘racket--profile-show-zero’ +‘p’ ‘racket--profile-prev’ +‘n’ ‘racket--profile-next’ +‘g’ ‘racket--profile-refresh’ +‘q’ ‘racket--profile-quit’ + + In addition to any hooks its parent mode ‘special-mode’ might have +run, this mode runs the hook ‘racket-profile-mode-hook’, as the final +step during initialization. + + +File: racket-mode.info, Node: racket-logger, Next: racket-logger-mode, Prev: racket-profile-mode, Up: Run + +5.3.11 racket-logger +-------------------- + +‘C-c C-l’ + + Create the *note racket-logger-mode:: buffer and connect to logger +output. + + If the ‘racket-repl-mode’ buffer is displayed in a window, split that +window and put the logger in the bottom window. Otherwise, use +‘pop-to-buffer’. + + +File: racket-mode.info, Node: racket-logger-mode, Next: racket-debug-mode, Prev: racket-logger, Up: Run + +5.3.12 racket-logger-mode +------------------------- + +‘M-x’ ‘racket-logger-mode’ ‘RET’ + + Major mode for Racket logger output. + + The customization variable *note racket-logger-config:: determines +the levels for topics. During a session you may change topic levels +using ‘racket-logger-topic-level’. + + For more information see: + + +Key Binding +‘C-c C-z’ *note racket-repl:: +‘x’ ‘racket-logger-exit’ +‘g’ ‘racket-logger-clear’ +‘p’ ‘racket-logger-previous-item’ +‘n’ ‘racket-logger-next-item’ +‘w’ ‘toggle-truncate-lines’ +‘l’ ‘racket-logger-topic-level’ + + In addition to any hooks its parent mode ‘special-mode’ might have +run, this mode runs the hook ‘racket-logger-mode-hook’, as the final +step during initialization. + + +File: racket-mode.info, Node: racket-debug-mode, Prev: racket-logger-mode, Up: Run + +5.3.13 racket-debug-mode +------------------------ + +‘M-x’ ‘racket-debug-mode’ ‘RET’ + + Minor mode for debug breaks. + + This feature is **EXPERIMENTAL**!!! It is likely to have significant +limitations and bugs. You are welcome to open an issue to provide +feedback. Please understand that this feature might never be improved – +it might even be removed someday if it turns out to have too little +value and/or too much cost. + + How to debug: + + 1. “Instrument” code for step debugging. You can instrument entire + files, and also individual functions. + + a. Entire Files + + Choose *note racket-run:: with two prefixes – C-u C-u C-c C-c. The + file will be instrumented for step debugging before it is run. + Also instrumented are files determined by the variable *note + racket-debuggable-files::. + + The run will break at the first breakable position. + + Tip: After you run to completion and return to a normal REPL + prompt, the code remains instrumented. You may enter expressions + that evaluate instrumented code and it will break so you can step + debug again. + + b. Function Definitions + + Put point in a function ‘define’ form and C-u C-M-x to “instrument” + the function for step debugging. Then in the REPL, enter an + expression that causes the instrumented function to be run, + directly or indirectly. + + You can instrument any number of functions. + + You can even instrument while stopped at a break. For example, to + instrument a function you are about to call, so you can “step into” + it: + + • M-. a.k.a. ‘racket-visit-definition’. + • C-u C-M-x to instrument the definition. + • M-, a.k.a. *note racket-unvisit::. + • Continue stepping. + Limitation: Instrumenting a function ~require~d from another module + won’t redefine that function. Instead, it attempts to define an + instrumented function of the same name, in the module the REPL is + inside. The define will fail if it needs definitions visible only + in that other module. In that case you’ll probably need to use + entire-file instrumentation as described above. + + 2. When a break occurs, the ‘racket-repl-mode’ prompt changes. In + this debug REPL, local variables are available for you to use and + even to ‘set!’. + + Also, in the ‘racket-mode’ buffer where the break is located, *note + racket-debug-mode:: is enabled. This minor mode makes the buffer + read-only, provides visual feedback – about the break position, + local variable values, and result values – and provides shortcut + keys: + +Key Binding +‘?’ ‘racket-debug-help’ +‘h’ ‘racket-debug-run-to-here’ +‘p’ ‘racket-debug-prev-breakable’ +‘n’ ‘racket-debug-next-breakable’ +‘c’ ‘racket-debug-continue’ +‘u’ ‘racket-debug-step-out’ +‘o’ ‘racket-debug-step-over’ +‘SPC’ ‘racket-debug-step’ + + +File: racket-mode.info, Node: Test, Next: Eval, Prev: Run, Up: Commands + +5.4 Test +======== + +* Menu: + +* racket-test:: +* racket-raco-test:: + + +File: racket-mode.info, Node: racket-test, Next: racket-raco-test, Up: Test + +5.4.1 racket-test +----------------- + +‘’ or ‘C-c C-t’ + + Run the “test” submodule. + + With prefix, runs with coverage instrumentation and highlights +uncovered code. + + Put your tests in a “test” submodule. For example: + + (module+ test + (require rackunit) + (check-true #t)) + + Any rackunit test failure messages show the location. You may use +‘next-error’ to jump to the location of each failing test. + + See also: + • *note racket-fold-all-tests:: + • *note racket-unfold-all-tests:: + + +File: racket-mode.info, Node: racket-raco-test, Prev: racket-test, Up: Test + +5.4.2 racket-raco-test +---------------------- + +‘M-x’ ‘racket-raco-test’ ‘RET’ + + Do “raco test -x ” in a shell buffer to run the “test” +submodule. + + +File: racket-mode.info, Node: Eval, Next: Collections, Prev: Test, Up: Commands + +5.5 Eval +======== + +* Menu: + +* racket-send-region:: +* racket-send-definition:: +* racket-send-last-sexp:: + + +File: racket-mode.info, Node: racket-send-region, Next: racket-send-definition, Up: Eval + +5.5.1 racket-send-region +------------------------ + +‘C-c C-r’ + + Send the current region (if any) to the Racket REPL. + + +File: racket-mode.info, Node: racket-send-definition, Next: racket-send-last-sexp, Prev: racket-send-region, Up: Eval + +5.5.2 racket-send-definition +---------------------------- + +‘C-M-x’ + + Send the current definition to the Racket REPL. + + +File: racket-mode.info, Node: racket-send-last-sexp, Prev: racket-send-definition, Up: Eval + +5.5.3 racket-send-last-sexp +--------------------------- + +‘C-x C-e’ + + Send the previous sexp to the Racket REPL. + + When the previous sexp is a sexp comment the sexp itself is sent, +without the #; prefix. + + +File: racket-mode.info, Node: Collections, Next: Macro expand, Prev: Eval, Up: Commands + +5.6 Collections +=============== + +* Menu: + +* racket-visit-module:: +* racket-open-require-path:: +* racket-find-collection:: + + +File: racket-mode.info, Node: racket-visit-module, Next: racket-open-require-path, Up: Collections + +5.6.1 racket-visit-module +------------------------- + +‘C-M-.’ + + Visit definition of module at point, e.g. net/url or “file.rkt”. + + If there is no module at point, prompt for it. + + With a prefix, always prompt for the module. + + Use *note racket-unvisit:: to return. + + See also: *note racket-find-collection::. + + +File: racket-mode.info, Node: racket-open-require-path, Next: racket-find-collection, Prev: racket-visit-module, Up: Collections + +5.6.2 racket-open-require-path +------------------------------ + +‘C-c C-x C-f’ + + Like Dr Racket’s Open Require Path. + + Type (or delete) characters that are part of a module path name. +“Fuzzy” matches appear. For example try typing “t/t/r”. + + Choices are displayed in a vertical list. The current choice is at +the top, marked with “->”. + + • C-n and C-p move among the choices. + • RET on a directory adds its contents to the choices. + • RET on a file exits doing ‘find-file’. + • C-g aborts. + + +File: racket-mode.info, Node: racket-find-collection, Prev: racket-open-require-path, Up: Collections + +5.6.3 racket-find-collection +---------------------------- + +‘M-x’ ‘racket-find-collection’ ‘RET’ + + Given a collection name, try to find its directory and files. + + Takes a collection name from point (or, with a prefix, prompts you). + + If only one directory is found, ‘ido-find-file-in-dir’ lets you pick +a file there. + + If more than one directory is found, ‘ido-completing-read’ lets you +pick one, then ‘ido-find-file-in-dir’ lets you pick a file there. + + Note: This requires the ‘raco-find-collection’ package to be +installed. To install it, in ‘shell’ enter: + + raco pkg install raco-find-collection + + Tip: This works best with ‘ido-enable-flex-matching’ set to t. Also +handy is the ‘flx-ido’ package from MELPA. + + See also: *note racket-visit-module:: and *note +racket-open-require-path::. + + +File: racket-mode.info, Node: Macro expand, Next: Other, Prev: Collections, Up: Commands 5.7 Macro expand ================ @@ -1661,19 +1884,31 @@ File: racket-mode.info, Node: racket-expand-last-sexp, Prev: racket-expand-def *note racket-run::.  -File: racket-mode.info, Node: Other, Prev: Macro expand, Up: Commands +File: racket-mode.info, Node: Other, Next: Showing information, Prev: Macro expand, Up: Commands 5.8 Other ========= * Menu: +* racket-unvisit:: * racket-mode-start-faster::  -File: racket-mode.info, Node: racket-mode-start-faster, Up: Other +File: racket-mode.info, Node: racket-unvisit, Next: racket-mode-start-faster, Up: Other -5.8.1 racket-mode-start-faster +5.8.1 racket-unvisit +-------------------- + +‘M-,’ + + Return from previous ‘racket-visit-definition’ or *note +racket-visit-module::. + + +File: racket-mode.info, Node: racket-mode-start-faster, Prev: racket-unvisit, Up: Other + +5.8.2 racket-mode-start-faster ------------------------------ ‘M-x’ ‘racket-mode-start-faster’ ‘RET’ @@ -1699,6 +1934,108 @@ Racket process, it will start faster. variable *note racket-program::. Otherwise, you might get an error message due to the bytecode being different versions. + +File: racket-mode.info, Node: Showing information, Next: Associating edit buffers with REPL buffers, Prev: Other, Up: Commands + +5.9 Showing information +======================= + +* Menu: + +* racket-show-echo-area:: +* racket-show-header-line:: +* racket-show-pos-tip:: + + +File: racket-mode.info, Node: racket-show-echo-area, Next: racket-show-header-line, Up: Showing information + +5.9.1 racket-show-echo-area +--------------------------- + +Show things in the echo area. + + A value for the variable *note racket-show-functions::. + + +File: racket-mode.info, Node: racket-show-header-line, Next: racket-show-pos-tip, Prev: racket-show-echo-area, Up: Showing information + +5.9.2 racket-show-header-line +----------------------------- + +Show things using a buffer header line. + + A value for the variable *note racket-show-functions::. + + When there is nothing to show, keep a blank header-line. That way, +the buffer below doesn’t “jump up and down” by a line as messages appear +and disappear. Only when V is nil do we remove the header line. + + +File: racket-mode.info, Node: racket-show-pos-tip, Prev: racket-show-header-line, Up: Showing information + +5.9.3 racket-show-pos-tip +------------------------- + +Show things using ‘pos-tip-show’ if available. + + A value for the variable *note racket-show-functions::. + + +File: racket-mode.info, Node: Associating edit buffers with REPL buffers, Prev: Showing information, Up: Commands + +5.10 Associating edit buffers with REPL buffers +=============================================== + +* Menu: + +* racket-repl-buffer-name-shared:: +* racket-repl-buffer-name-unique:: +* racket-repl-buffer-name-project:: + + +File: racket-mode.info, Node: racket-repl-buffer-name-shared, Next: racket-repl-buffer-name-unique, Up: Associating edit buffers with REPL buffers + +5.10.1 racket-repl-buffer-name-shared +------------------------------------- + +‘M-x’ ‘racket-repl-buffer-name-shared’ ‘RET’ + + All ‘racket-mode’ edit buffers share one ‘racket-repl-mode’ buffer. + + A value for the variable *note racket-repl-buffer-name-function::. + + +File: racket-mode.info, Node: racket-repl-buffer-name-unique, Next: racket-repl-buffer-name-project, Prev: racket-repl-buffer-name-shared, Up: Associating edit buffers with REPL buffers + +5.10.2 racket-repl-buffer-name-unique +------------------------------------- + +‘M-x’ ‘racket-repl-buffer-name-unique’ ‘RET’ + + Each ‘racket-mode’ edit buffer gets its own ‘racket-repl-mode’ +buffer. + + A value for the variable *note racket-repl-buffer-name-function::. + + +File: racket-mode.info, Node: racket-repl-buffer-name-project, Prev: racket-repl-buffer-name-unique, Up: Associating edit buffers with REPL buffers + +5.10.3 racket-repl-buffer-name-project +-------------------------------------- + +‘M-x’ ‘racket-repl-buffer-name-project’ ‘RET’ + + All ‘racket-mode’ buffers in a project share a ‘racket-repl-mode’ +buffer. + + A value for the variable *note racket-repl-buffer-name-function::. + + The “project” is determined by trying, in order: + + • ‘projectile-project-root’ + • ‘vc-root-dir’ + • ‘file-name-directory’ +  File: racket-mode.info, Node: Variables, Next: Faces, Prev: Commands, Up: Top @@ -1711,6 +2048,7 @@ File: racket-mode.info, Node: Variables, Next: Faces, Prev: Commands, Up: To * REPL variables:: * Other variables:: * Experimental debugger variables:: +* Showing information: Showing informationx.  File: racket-mode.info, Node: General variables, Next: REPL variables, Up: Variables @@ -1722,14 +2060,14 @@ File: racket-mode.info, Node: General variables, Next: REPL variables, Up: Va * racket-program:: * racket-command-port:: -* racket-command-startup:: * racket-command-timeout:: * racket-memory-limit:: * racket-error-context:: -* racket-retry-as-skeleton:: * racket-user-command-line-arguments:: * racket-path-from-emacs-to-racket-function:: * racket-path-from-racket-to-emacs-function:: +* racket-xp-after-change-refresh-delay:: +* racket-xp-highlight-unused-regexp::  File: racket-mode.info, Node: racket-program, Next: racket-command-port, Up: General variables @@ -1740,45 +2078,36 @@ File: racket-mode.info, Node: racket-program, Next: racket-command-port, Up: Pathname of the racket executable.  -File: racket-mode.info, Node: racket-command-port, Next: racket-command-startup, Prev: racket-program, Up: General variables +File: racket-mode.info, Node: racket-command-port, Next: racket-command-timeout, Prev: racket-program, Up: General variables 6.1.2 racket-command-port ------------------------- -Port number for Racket REPL command server. +Port number for Racket REPL server.  -File: racket-mode.info, Node: racket-command-startup, Next: racket-command-timeout, Prev: racket-command-port, Up: General variables +File: racket-mode.info, Node: racket-command-timeout, Next: racket-memory-limit, Prev: racket-command-port, Up: General variables -6.1.3 racket-command-startup +6.1.3 racket-command-timeout ---------------------------- -What to do when the REPL and command server aren’t available to send a -command. +How many seconds to wait for command server responses. - • nil: Show an error message explaining that you might need to start - or restart the Racket REPL. - - • positive number: Automatically try to start the REPL and wait that - number of seconds for command server to become available. - - -File: racket-mode.info, Node: racket-command-timeout, Next: racket-memory-limit, Prev: racket-command-startup, Up: General variables - -6.1.4 racket-command-timeout ----------------------------- - -How many seconds to wait for Racket REPL command server responses. + Note: This is mostly obsolete, fortunately, because it applies only +to commands that must block the Emacs UI until they get a response. +Instead most Racket Mode commands these days receive their response +asychronously.  File: racket-mode.info, Node: racket-memory-limit, Next: racket-error-context, Prev: racket-command-timeout, Up: General variables -6.1.5 racket-memory-limit +6.1.4 racket-memory-limit ------------------------- Terminate the Racket process if memory use exceeds this value in MB. -Changes to this value take effect upon the next *note racket-run::. A -value of 0 means no limit. + + Changes to this value take effect upon the next *note racket-run::. +A value of 0 means no limit. Caveat: This uses Racket’s ‘custodian-limit-memory’, which does not enforce the limit exactly. Instead, the program will be terminated upon @@ -1786,9 +2115,9 @@ the first garbage collection where memory exceeds the limit (maybe by a significant amount).  -File: racket-mode.info, Node: racket-error-context, Next: racket-retry-as-skeleton, Prev: racket-memory-limit, Up: General variables +File: racket-mode.info, Node: racket-error-context, Next: racket-user-command-line-arguments, Prev: racket-memory-limit, Up: General variables -6.1.6 racket-error-context +6.1.5 racket-error-context -------------------------- The level of context used for *note racket-run:: error stack traces. @@ -1811,30 +2140,9 @@ normally run with a faster setting, and temporarily re-run to get a more-helpful error message.  -File: racket-mode.info, Node: racket-retry-as-skeleton, Next: racket-user-command-line-arguments, Prev: racket-error-context, Up: General variables +File: racket-mode.info, Node: racket-user-command-line-arguments, Next: racket-path-from-emacs-to-racket-function, Prev: racket-error-context, Up: General variables -6.1.7 racket-retry-as-skeleton ------------------------------- - -Retry a “skeleton” of files with errors, for identifier names? - - When true: If your source file has an error, a “skeleton” of your -file is evaluated to get identifiers from module languages, ‘require’ -forms, and definitions. That way, things like completion and *note -racket-describe:: are more likely to work while you edit the file to fix -the error. - - Otherwise, you’ll have only identifiers provided by ‘racket/base’, -until you fix the error and run again. - - You might want to disable this if you work with files that take a -very long time to expand — because this feature needs to expand again -when there is an error. - - -File: racket-mode.info, Node: racket-user-command-line-arguments, Next: racket-path-from-emacs-to-racket-function, Prev: racket-retry-as-skeleton, Up: General variables - -6.1.8 racket-user-command-line-arguments +6.1.6 racket-user-command-line-arguments ---------------------------------------- List of command-line arguments to supply to your Racket program. @@ -1862,7 +2170,7 @@ example:  File: racket-mode.info, Node: racket-path-from-emacs-to-racket-function, Next: racket-path-from-racket-to-emacs-function, Prev: racket-user-command-line-arguments, Up: General variables -6.1.9 racket-path-from-emacs-to-racket-function +6.1.7 racket-path-from-emacs-to-racket-function ----------------------------------------------- A function used to transform Emacs Lisp pathnames before supplying to @@ -1875,10 +2183,10 @@ want to customize the “reverse”: *note racket-path-from-racket-to-emacs-function::.  -File: racket-mode.info, Node: racket-path-from-racket-to-emacs-function, Prev: racket-path-from-emacs-to-racket-function, Up: General variables +File: racket-mode.info, Node: racket-path-from-racket-to-emacs-function, Next: racket-xp-after-change-refresh-delay, Prev: racket-path-from-emacs-to-racket-function, Up: General variables -6.1.10 racket-path-from-racket-to-emacs-function ------------------------------------------------- +6.1.8 racket-path-from-racket-to-emacs-function +----------------------------------------------- A function used to transform pathnames supplied by the Racket back end before using them in Emacs. @@ -1892,6 +2200,29 @@ can set this to ‘racket-windows-to-wsl’. In that case you probably also want to customize the “reverse”: *note racket-path-from-emacs-to-racket-function::. + +File: racket-mode.info, Node: racket-xp-after-change-refresh-delay, Next: racket-xp-highlight-unused-regexp, Prev: racket-path-from-racket-to-emacs-function, Up: General variables + +6.1.9 racket-xp-after-change-refresh-delay +------------------------------------------ + +Seconds to wait before refreshing *note racket-xp-mode:: annotations. + + Set to nil to disable automatic refresh and manually use +‘racket-xp-annotate’. + + +File: racket-mode.info, Node: racket-xp-highlight-unused-regexp, Prev: racket-xp-after-change-refresh-delay, Up: General variables + +6.1.10 racket-xp-highlight-unused-regexp +---------------------------------------- + +Only give *note racket-xp-unused-face:: to unused bindings that match +this regexp. + + The default is to highlight indentifiers that do not start with an +underline, which is a common convention. +  File: racket-mode.info, Node: REPL variables, Next: Other variables, Prev: General variables, Up: Variables @@ -1900,6 +2231,7 @@ File: racket-mode.info, Node: REPL variables, Next: Other variables, Prev: Ge * Menu: +* racket-repl-buffer-name-function:: * racket-history-filter-regexp:: * racket-images-inline:: * racket-images-keep-last:: @@ -1907,9 +2239,34 @@ File: racket-mode.info, Node: REPL variables, Next: Other variables, Prev: Ge * racket-pretty-print::  -File: racket-mode.info, Node: racket-history-filter-regexp, Next: racket-images-inline, Up: REPL variables +File: racket-mode.info, Node: racket-repl-buffer-name-function, Next: racket-history-filter-regexp, Up: REPL variables -6.2.1 racket-history-filter-regexp +6.2.1 racket-repl-buffer-name-function +-------------------------------------- + +How to associate ‘racket-mode’ edit buffers with ‘racket-repl-mode’ +buffers. + + The default is nil, which is equivalent to supplying *note +racket-repl-buffer-name-shared::: One REPL buffer is shared. + + Other predefined choices include *note +racket-repl-buffer-name-unique:: and *note +racket-repl-buffer-name-project::. + + This is used when a ‘racket-mode’ buffer is created. Changing this +to a new value only affects ‘racket-mode’ buffers created later. + + Any such function takes no arguments, should look at +‘buffer-file-name’ if necessary, and either ‘setq-default’ or +‘setq-local’ the variable ‘racket-repl-buffer-name’ to a desired +‘racket-repl-mode’ buffer name. As a result, *note racket-run:: +commands will use a buffer of that name, creating it if necessary. + + +File: racket-mode.info, Node: racket-history-filter-regexp, Next: racket-images-inline, Prev: racket-repl-buffer-name-function, Up: REPL variables + +6.2.2 racket-history-filter-regexp ---------------------------------- Input matching this regexp are not saved on the history list. Defaults @@ -1918,7 +2275,7 @@ to a regexp ignoring all inputs of 0, 1, or 2 letters.  File: racket-mode.info, Node: racket-images-inline, Next: racket-images-keep-last, Prev: racket-history-filter-regexp, Up: REPL variables -6.2.2 racket-images-inline +6.2.3 racket-images-inline -------------------------- Whether to display inline images in the REPL. @@ -1926,7 +2283,7 @@ Whether to display inline images in the REPL.  File: racket-mode.info, Node: racket-images-keep-last, Next: racket-images-system-viewer, Prev: racket-images-inline, Up: REPL variables -6.2.3 racket-images-keep-last +6.2.4 racket-images-keep-last ----------------------------- How many images to keep in the image cache. @@ -1934,7 +2291,7 @@ How many images to keep in the image cache.  File: racket-mode.info, Node: racket-images-system-viewer, Next: racket-pretty-print, Prev: racket-images-keep-last, Up: REPL variables -6.2.4 racket-images-system-viewer +6.2.5 racket-images-system-viewer --------------------------------- Which system image viewer program to invoke upon M-x @@ -1943,10 +2300,10 @@ Which system image viewer program to invoke upon M-x  File: racket-mode.info, Node: racket-pretty-print, Prev: racket-images-system-viewer, Up: REPL variables -6.2.5 racket-pretty-print +6.2.6 racket-pretty-print ------------------------- -Use pretty-print instead of print in REPL. +Use pretty-print instead of print in REPL?  File: racket-mode.info, Node: Other variables, Next: Experimental debugger variables, Prev: REPL variables, Up: Variables @@ -1968,9 +2325,10 @@ File: racket-mode.info, Node: racket-indent-curly-as-sequence, Next: racket-in 6.3.1 racket-indent-curly-as-sequence ------------------------------------- -Indent ‘{}’ with items aligned with the head item? This is indirectly -disabled if *note racket-indent-sequence-depth:: is 0. This is safe to -set as a file-local variable. +Indent ‘{}’ with items aligned with the head item? + + This is indirectly disabled if *note racket-indent-sequence-depth:: +is 0. This is safe to set as a file-local variable.  File: racket-mode.info, Node: racket-indent-sequence-depth, Next: racket-pretty-lambda, Prev: racket-indent-curly-as-sequence, Up: Other variables @@ -1978,13 +2336,14 @@ File: racket-mode.info, Node: racket-indent-sequence-depth, Next: racket-prett 6.3.2 racket-indent-sequence-depth ---------------------------------- -To what depth should *note racket-indent-line:: search. This affects -the indentation of forms like ’() ‘() #() – and {} if *note -racket-indent-curly-as-sequence:: is t — but not #’() #‘() ,() ,@(). A -zero value disables, giving the normal indent behavior of DrRacket or -Emacs ‘lisp-mode’ derived modes like ‘scheme-mode’. Setting this to a -high value can make indentation noticeably slower. This is safe to set -as a file-local variable. +To what depth should *note racket-indent-line:: search. + + This affects the indentation of forms like ’() ‘() #() – and {} if +*note racket-indent-curly-as-sequence:: is t — but not #’() #‘() ,() +,@(). A zero value disables, giving the normal indent behavior of +DrRacket or Emacs ‘lisp-mode’ derived modes like ‘scheme-mode’. Setting +this to a high value can make indentation noticeably slower. This is +safe to set as a file-local variable.  File: racket-mode.info, Node: racket-pretty-lambda, Next: racket-smart-open-bracket-enable, Prev: racket-indent-sequence-depth, Up: Other variables @@ -1992,9 +2351,10 @@ File: racket-mode.info, Node: racket-pretty-lambda, Next: racket-smart-open-br 6.3.3 racket-pretty-lambda -------------------------- -Display lambda keywords using λ. This is DEPRECATED. Instead use -‘prettify-symbols-mode’ in newer verisons of Emacs, or, use *note -racket-insert-lambda:: to insert actual λ characters. +Display lambda keywords using λ. This is DEPRECATED. + + Instead use ‘prettify-symbols-mode’ in newer verisons of Emacs, or, +use *note racket-insert-lambda:: to insert actual λ characters.  File: racket-mode.info, Node: racket-smart-open-bracket-enable, Next: racket-logger-config, Prev: racket-pretty-lambda, Up: Other variables @@ -2031,7 +2391,7 @@ quieter. That way you can set the ‘* topic to a level like ‘debug and not get overhwelmed by these noisy topics.  -File: racket-mode.info, Node: Experimental debugger variables, Prev: Other variables, Up: Variables +File: racket-mode.info, Node: Experimental debugger variables, Next: Showing informationx, Prev: Other variables, Up: Variables 6.4 Experimental debugger variables =================================== @@ -2055,6 +2415,44 @@ directory of the file being run. The symbol ‘run-file may be supplied in the list; it will be replaced with the pathname of the file being run. Safe to set as a file-local variable. + +File: racket-mode.info, Node: Showing informationx, Prev: Experimental debugger variables, Up: Variables + +6.5 Showing information +======================= + +* Menu: + +* racket-show-functions:: + + +File: racket-mode.info, Node: racket-show-functions, Up: Showing informationx + +6.5.1 racket-show-functions +--------------------------- + +A special hook variable to customize ‘racket-show’. + + Example functions include + + • *note racket-show-echo-area:: + • *note racket-show-pos-tip:: + • *note racket-show-header-line:: + + Each function should accept two arguments: VAL and POS. + + VAL is: + + • Non-blank string: Display the string somehow. + + • Blank string: Hide any previously displayed string. + + • nil: Hide any persistent UI that might have been created to show + strings, such as by *note racket-show-header-line::. + + POS is the buffer position for which to show the message, nil meaning +use some default position. +  File: racket-mode.info, Node: Faces, Prev: Variables, Up: Top @@ -2076,8 +2474,9 @@ File: racket-mode.info, Node: All, Up: Faces * racket-keyword-argument-face:: * racket-selfeval-face:: * racket-here-string-face:: -* racket-check-syntax-def-face:: -* racket-check-syntax-use-face:: +* racket-xp-def-face:: +* racket-xp-use-face:: +* racket-xp-unused-face:: * racket-logger-config-face:: * racket-logger-topic-face:: * racket-logger-fatal-face:: @@ -2103,7 +2502,7 @@ File: racket-mode.info, Node: racket-selfeval-face, Next: racket-here-string-f Face for self-evaluating expressions like numbers, symbols, strings.  -File: racket-mode.info, Node: racket-here-string-face, Next: racket-check-syntax-def-face, Prev: racket-selfeval-face, Up: All +File: racket-mode.info, Node: racket-here-string-face, Next: racket-xp-def-face, Prev: racket-selfeval-face, Up: All 7.1.3 racket-here-string-face ----------------------------- @@ -2111,25 +2510,34 @@ File: racket-mode.info, Node: racket-here-string-face, Next: racket-check-synt Face for here strings.  -File: racket-mode.info, Node: racket-check-syntax-def-face, Next: racket-check-syntax-use-face, Prev: racket-here-string-face, Up: All +File: racket-mode.info, Node: racket-xp-def-face, Next: racket-xp-use-face, Prev: racket-here-string-face, Up: All -7.1.4 racket-check-syntax-def-face ----------------------------------- +7.1.4 racket-xp-def-face +------------------------ -Face *note racket-check-syntax-mode:: uses to highlight definitions. +Face *note racket-xp-mode:: uses to highlight definitions.  -File: racket-mode.info, Node: racket-check-syntax-use-face, Next: racket-logger-config-face, Prev: racket-check-syntax-def-face, Up: All +File: racket-mode.info, Node: racket-xp-use-face, Next: racket-xp-unused-face, Prev: racket-xp-def-face, Up: All -7.1.5 racket-check-syntax-use-face ----------------------------------- +7.1.5 racket-xp-use-face +------------------------ -Face *note racket-check-syntax-mode:: uses to highlight uses. +Face *note racket-xp-mode:: uses to highlight uses.  -File: racket-mode.info, Node: racket-logger-config-face, Next: racket-logger-topic-face, Prev: racket-check-syntax-use-face, Up: All +File: racket-mode.info, Node: racket-xp-unused-face, Next: racket-logger-config-face, Prev: racket-xp-use-face, Up: All -7.1.6 racket-logger-config-face +7.1.6 racket-xp-unused-face +--------------------------- + +Face *note racket-xp-mode:: uses to highlight unused requires or +definitions. + + +File: racket-mode.info, Node: racket-logger-config-face, Next: racket-logger-topic-face, Prev: racket-xp-unused-face, Up: All + +7.1.7 racket-logger-config-face ------------------------------- Face for *note racket-logger-mode:: configuration. @@ -2137,7 +2545,7 @@ Face for *note racket-logger-mode:: configuration.  File: racket-mode.info, Node: racket-logger-topic-face, Next: racket-logger-fatal-face, Prev: racket-logger-config-face, Up: All -7.1.7 racket-logger-topic-face +7.1.8 racket-logger-topic-face ------------------------------ Face for *note racket-logger-mode:: topics. @@ -2145,7 +2553,7 @@ Face for *note racket-logger-mode:: topics.  File: racket-mode.info, Node: racket-logger-fatal-face, Next: racket-logger-error-face, Prev: racket-logger-topic-face, Up: All -7.1.8 racket-logger-fatal-face +7.1.9 racket-logger-fatal-face ------------------------------ Face for *note racket-logger-mode:: fatal level. @@ -2153,15 +2561,15 @@ Face for *note racket-logger-mode:: fatal level.  File: racket-mode.info, Node: racket-logger-error-face, Next: racket-logger-warning-face, Prev: racket-logger-fatal-face, Up: All -7.1.9 racket-logger-error-face ------------------------------- +7.1.10 racket-logger-error-face +------------------------------- Face for *note racket-logger-mode:: error level.  File: racket-mode.info, Node: racket-logger-warning-face, Next: racket-logger-info-face, Prev: racket-logger-error-face, Up: All -7.1.10 racket-logger-warning-face +7.1.11 racket-logger-warning-face --------------------------------- Face for *note racket-logger-mode:: warning level. @@ -2169,7 +2577,7 @@ Face for *note racket-logger-mode:: warning level.  File: racket-mode.info, Node: racket-logger-info-face, Next: racket-logger-debug-face, Prev: racket-logger-warning-face, Up: All -7.1.11 racket-logger-info-face +7.1.12 racket-logger-info-face ------------------------------ Face for *note racket-logger-mode:: info level. @@ -2177,7 +2585,7 @@ Face for *note racket-logger-mode:: info level.  File: racket-mode.info, Node: racket-logger-debug-face, Prev: racket-logger-info-face, Up: All -7.1.12 racket-logger-debug-face +7.1.13 racket-logger-debug-face ------------------------------- Face for *note racket-logger-mode:: debug level. @@ -2186,115 +2594,134 @@ Face for *note racket-logger-mode:: debug level.  Tag Table: Node: Top220 -Node: Introduction3109 -Ref: Introduction-Footnote-14166 -Node: Install4561 -Node: Configure Emacs to use MELPA4882 -Node: Install Racket Mode5355 -Node: Minimal Racket5644 -Node: Uninstall6208 -Node: Update6496 -Node: Configure6943 -Node: Key bindings8054 -Node: Font-lock (syntax highlighting)8671 -Node: Completion9955 -Node: paredit11352 -Node: smartparens12349 -Node: eldoc12700 -Node: Start faster13714 -Node: Unicode input method13939 -Node: Reference14635 -Node: Commands15124 -Node: Run15328 -Node: racket-run15576 -Node: racket-repl17528 -Node: racket-racket18641 -Node: racket-profile18845 -Node: racket-profile-mode19560 -Node: racket-logger20619 -Node: racket-logger-mode21030 -Node: racket-debug-mode22398 -Node: Test25873 -Node: racket-test26018 -Node: racket-raco-test26639 -Node: Eval26896 -Node: racket-send-region27082 -Node: racket-send-definition27300 -Node: racket-send-last-sexp27549 -Node: Visit27859 -Node: racket-visit-definition28099 -Node: racket-visit-module29186 -Node: racket-unvisit29635 -Node: racket-open-require-path29900 -Node: racket-find-collection30676 -Node: Learn31627 -Node: racket-describe31775 -Node: racket-doc32943 -Node: Edit33613 -Node: racket-insert-lambda34160 -Node: racket-fold-all-tests34428 -Node: racket-unfold-all-tests34665 -Node: racket-tidy-requires34908 -Node: racket-trim-requires35965 -Node: racket-base-requires36680 -Node: racket-indent-line37935 -Node: racket-smart-open-bracket-mode39742 -Node: racket-insert-closing41397 -Node: racket-cycle-paren-shapes41888 -Node: racket-backward-up-list42139 -Node: racket-check-syntax-mode42689 -Node: racket-unicode-input-method-enable44210 -Node: racket-align46221 -Node: racket-unalign48199 -Node: racket-complete-at-point48542 -Node: Macro expand49345 -Node: racket-stepper-mode49608 -Node: racket-expand-file50656 -Node: racket-expand-region51380 -Node: racket-expand-definition51746 -Node: racket-expand-last-sexp52135 -Node: Other52487 -Node: racket-mode-start-faster52623 -Node: Variables53791 -Node: General variables54008 -Node: racket-program54460 -Node: racket-command-port54640 -Node: racket-command-startup54870 -Node: racket-command-timeout55398 -Node: racket-memory-limit55665 -Node: racket-error-context56268 -Node: racket-retry-as-skeleton57289 -Node: racket-user-command-line-arguments58157 -Node: racket-path-from-emacs-to-racket-function59020 -Node: racket-path-from-racket-to-emacs-function59707 -Node: REPL variables60466 -Node: racket-history-filter-regexp60772 -Node: racket-images-inline61084 -Node: racket-images-keep-last61331 -Node: racket-images-system-viewer61581 -Node: racket-pretty-print61877 -Node: Other variables62085 -Node: racket-indent-curly-as-sequence62421 -Node: racket-indent-sequence-depth62801 -Node: racket-pretty-lambda63488 -Node: racket-smart-open-bracket-enable63891 -Node: racket-logger-config64347 -Node: Experimental debugger variables65142 -Node: racket-debuggable-files65359 -Node: Faces66053 -Node: All66156 -Node: racket-keyword-argument-face66590 -Node: racket-selfeval-face66800 -Node: racket-here-string-face67059 -Node: racket-check-syntax-def-face67278 -Node: racket-check-syntax-use-face67561 -Node: racket-logger-config-face67839 -Node: racket-logger-topic-face68096 -Node: racket-logger-fatal-face68340 -Node: racket-logger-error-face68588 -Node: racket-logger-warning-face68838 -Node: racket-logger-info-face69095 -Node: racket-logger-debug-face69343 +Node: Introduction3813 +Ref: Introduction-Footnote-14972 +Node: Install5367 +Node: Configure Emacs to use MELPA5688 +Node: Install Racket Mode6161 +Node: Minimal Racket6450 +Node: Uninstall7014 +Node: Update7302 +Node: Configure7749 +Node: Key bindings8905 +Node: Font-lock (syntax highlighting)9522 +Node: Completion10806 +Node: Indent12646 +Node: paredit12867 +Node: smartparens13860 +Node: Edit buffers and REPL buffers14235 +Node: eldoc15129 +Node: Start faster16388 +Node: Unicode input method16613 +Node: Reference17311 +Node: Commands17800 +Node: Edit18083 +Node: racket-insert-lambda18582 +Node: racket-fold-all-tests18850 +Node: racket-unfold-all-tests19087 +Node: racket-tidy-requires19330 +Node: racket-trim-requires20387 +Node: racket-base-requires21107 +Node: racket-indent-line22367 +Node: racket-smart-open-bracket-mode24352 +Node: racket-insert-closing26007 +Node: racket-cycle-paren-shapes26498 +Node: racket-backward-up-list26749 +Node: racket-unicode-input-method-enable27309 +Node: racket-align29319 +Node: racket-unalign31297 +Node: racket-complete-at-point31640 +Node: Explore32062 +Node: racket-xp-mode32280 +Node: racket-xp-visit-definition37734 +Node: racket-xp-describe38188 +Node: racket-xp-documentation39541 +Node: Run40128 +Node: racket-run40545 +Node: racket-run-and-switch-to-repl42312 +Node: racket-run-module-at-point42589 +Node: racket-repl43008 +Node: racket-repl-describe43976 +Node: racket-repl-documentation45221 +Node: racket-repl-visit-definition46014 +Node: racket-racket46790 +Node: racket-profile47011 +Node: racket-profile-mode47726 +Node: racket-logger48787 +Node: racket-logger-mode49200 +Node: racket-debug-mode50570 +Node: Test54045 +Node: racket-test54190 +Node: racket-raco-test54811 +Node: Eval55068 +Node: racket-send-region55260 +Node: racket-send-definition55478 +Node: racket-send-last-sexp55727 +Node: Collections56037 +Node: racket-visit-module56255 +Node: racket-open-require-path56688 +Node: racket-find-collection57358 +Node: Macro expand58315 +Node: racket-stepper-mode58585 +Node: racket-expand-file59633 +Node: racket-expand-region60357 +Node: racket-expand-definition60723 +Node: racket-expand-last-sexp61112 +Node: Other61464 +Node: racket-unvisit61647 +Node: racket-mode-start-faster61882 +Node: Showing information63073 +Node: racket-show-echo-area63344 +Node: racket-show-header-line63606 +Node: racket-show-pos-tip64126 +Node: Associating edit buffers with REPL buffers64403 +Node: racket-repl-buffer-name-shared64736 +Node: racket-repl-buffer-name-unique65175 +Node: racket-repl-buffer-name-project65657 +Node: Variables66259 +Node: General variables66521 +Node: racket-program66996 +Node: racket-command-port67176 +Node: racket-command-timeout67398 +Node: racket-memory-limit67873 +Node: racket-error-context68479 +Node: racket-user-command-line-arguments69510 +Node: racket-path-from-emacs-to-racket-function70369 +Node: racket-path-from-racket-to-emacs-function71056 +Node: racket-xp-after-change-refresh-delay71858 +Node: racket-xp-highlight-unused-regexp72290 +Node: REPL variables72706 +Node: racket-repl-buffer-name-function73049 +Node: racket-history-filter-regexp74065 +Node: racket-images-inline74418 +Node: racket-images-keep-last74665 +Node: racket-images-system-viewer74915 +Node: racket-pretty-print75211 +Node: Other variables75419 +Node: racket-indent-curly-as-sequence75755 +Node: racket-indent-sequence-depth76138 +Node: racket-pretty-lambda76828 +Node: racket-smart-open-bracket-enable77235 +Node: racket-logger-config77691 +Node: Experimental debugger variables78486 +Node: racket-debuggable-files78732 +Node: Showing informationx79426 +Node: racket-show-functions79622 +Node: Faces80379 +Node: All80482 +Node: racket-keyword-argument-face80922 +Node: racket-selfeval-face81132 +Node: racket-here-string-face81391 +Node: racket-xp-def-face81600 +Node: racket-xp-use-face81833 +Node: racket-xp-unused-face82057 +Node: racket-logger-config-face82320 +Node: racket-logger-topic-face82570 +Node: racket-logger-fatal-face82814 +Node: racket-logger-error-face83062 +Node: racket-logger-warning-face83314 +Node: racket-logger-info-face83571 +Node: racket-logger-debug-face83819  End Tag Table diff --git a/elpa/racket-mode-20200218.1623/racket-parens.el b/elpa/racket-mode-20200323.1739/racket-parens.el similarity index 100% rename from elpa/racket-mode-20200218.1623/racket-parens.el rename to elpa/racket-mode-20200323.1739/racket-parens.el diff --git a/elpa/racket-mode-20200218.1623/racket-parens.elc b/elpa/racket-mode-20200323.1739/racket-parens.elc similarity index 100% rename from elpa/racket-mode-20200218.1623/racket-parens.elc rename to elpa/racket-mode-20200323.1739/racket-parens.elc diff --git a/elpa/racket-mode-20200218.1623/racket-ppss.el b/elpa/racket-mode-20200323.1739/racket-ppss.el similarity index 100% rename from elpa/racket-mode-20200218.1623/racket-ppss.el rename to elpa/racket-mode-20200323.1739/racket-ppss.el diff --git a/elpa/racket-mode-20200218.1623/racket-ppss.elc b/elpa/racket-mode-20200323.1739/racket-ppss.elc similarity index 100% rename from elpa/racket-mode-20200218.1623/racket-ppss.elc rename to elpa/racket-mode-20200323.1739/racket-ppss.elc diff --git a/elpa/racket-mode-20200218.1623/racket-profile.el b/elpa/racket-mode-20200323.1739/racket-profile.el similarity index 97% rename from elpa/racket-mode-20200218.1623/racket-profile.el rename to elpa/racket-mode-20200323.1739/racket-profile.el index ccfa8c99..4f26d5d3 100644 --- a/elpa/racket-mode-20200218.1623/racket-profile.el +++ b/elpa/racket-mode-20200323.1739/racket-profile.el @@ -17,7 +17,6 @@ ;; http://www.gnu.org/licenses/ for details. (require 'cl-lib) -(require 'racket-edit) (require 'racket-repl) (defvar racket--profile-results nil) @@ -47,9 +46,10 @@ delete compiled/*.zo files." (racket--repl-run nil 'profile - (lambda (_n/a) + (lambda () (message "Getting profile results...") (racket--cmd/async + (racket--repl-session-id) `(get-profile) (lambda (results) (message "") @@ -62,7 +62,9 @@ delete compiled/*.zo files." (defun racket--profile-refresh () (interactive) - (setq racket--profile-results (racket--cmd/await `(get-profile))) + (setq racket--profile-results + (racket--cmd/await (racket--repl-session-id) + `(get-profile))) (racket--profile-draw)) (defun racket--profile-draw () diff --git a/elpa/racket-mode-20200218.1623/racket-profile.elc b/elpa/racket-mode-20200323.1739/racket-profile.elc similarity index 88% rename from elpa/racket-mode-20200218.1623/racket-profile.elc rename to elpa/racket-mode-20200323.1739/racket-profile.elc index 252ce482bd78529affa6fc00bbd319b6c00b0db9..bd2215cf58e4a6b4118a4c2f89436183b237901a 100644 GIT binary patch delta 204 zcmbPlx!!WacE-s^7^OGAX1vJEXfSy{t2mcJjIn_U5SuDbzQbxKUX+-eom!%+Ta;Rm zqg$L>T%4Jor<<9wS(1&Pkv}$8!9+nrSw%rl!OYxTb8^3c(&P+wQC^T4#xY6)Afpr} z^K*+&=3(NP+{?x>c{Mv1E+Z#zVOM1|p4=^=BEJ9_{C delta 235 zcmZ2)Ip1=_c19gTgBW825H?nfF)}b$Qiv`}EiBC}N>xbC(ap(BQYcDH&Q2}SO-;!x z*?fxeCbNQ(skwp@RFff46W9bJkO@F+5~DQvD68FOX*NDaIiRwwbLn`j6$z(`R5WR$|>d^UB?*" (racket--buffer-file-name)))) + (setq-local racket-repl-buffer-name name))) + +;;;###autoload +(defun racket-repl-buffer-name-project () + "All `racket-mode' buffers in a project share a `racket-repl-mode' buffer. + +A value for the variable `racket-repl-buffer-name-function'. + +The \"project\" is determined by trying, in order: + +- `projectile-project-root' +- `vc-root-dir' +- `file-name-directory'" + (interactive) + (let* ((dir (file-name-directory (racket--buffer-file-name))) + (root (or (and (fboundp 'projectile-project-root) + (projectile-project-root dir)) + (and (fboundp 'vc-root-dir) + (vc-root-dir)) + dir)) + (name (format "*Racket REPL <%s>*" root))) + (setq-local racket-repl-buffer-name name))) + +(defun racket-mode-maybe-offer-to-kill-repl-buffer () + "Maybe offer to kill a `racket-repl-mode' buffer. + +A value for `kill-buffer-hook'. + +Offer to kill a `racket-repl-mode' buffer when killing the last +`racket-mode' buffer using it. Although is not necessary to do +so, a user might want to do some \"cleanup\" -- especially if +they're using a `racket-repl-buffer-name-function' such as +`racket-repl-buffer-name-unique'." + (when (eq major-mode 'racket-mode) + (pcase (get-buffer racket-repl-buffer-name) + ((and (pred bufferp) repl-buffer) + (let ((n (1- + (length + (racket--buffers-using-repl racket-repl-buffer-name))))) + (if (zerop n) + (when (y-or-n-p + (format "No other buffers using %s -- also kill it? " + racket-repl-buffer-name)) + ;; They already said yes. Avoid another prompt about + ;; killing the buffer's process. + (pcase (get-buffer-process repl-buffer) + ((and (pred processp) repl-process) + (set-process-query-on-exit-flag repl-process nil))) + (kill-buffer repl-buffer)) + (message "%s other buffer%s still using %s" + n + (if (= n 1) "" "s") + racket-repl-buffer-name))))))) + +(defun racket--buffers-using-repl (repl-buffer-name) + (seq-filter (lambda (buffer) + (with-current-buffer buffer + (and (eq major-mode 'racket-mode) + (equal racket-repl-buffer-name repl-buffer-name)))) + (buffer-list))) + +(provide 'racket-repl-buffer-name) + +;; racket-repl-buffer-name.el ends here diff --git a/elpa/racket-mode-20200323.1739/racket-repl-buffer-name.elc b/elpa/racket-mode-20200323.1739/racket-repl-buffer-name.elc new file mode 100644 index 0000000000000000000000000000000000000000..86bd58191be112f8d156d8e49869f0aeeb2c2fe7 GIT binary patch literal 3006 zcmc&$TW{Mo6n64ZECLGjZ4Vo;6QzOUA`Eni?PS?43(_rEFI(C^#RWo3bj(H~9g%Y8 z{ra6lNw#wXQWV1sC?Un8L-IQxzmEsUua3TMwOZc6!2ulUd?GWEx{g$Eob$xMR1`*P z1yOG&b|cr)j)7+x=!uoN{D)f{Hanghd_R^3MwkUkBMhW7#dDcJsuN=isV>YmjuyrO zPg9Y?e3o#3C)&T0Bh{EgX$y%~mSb>fM{Ez@D0cYn=;Q>FF)w&xaf#b*dahD18WOHx zC?M1P#w7Jt3S;{b&JS`tv+*YdEulB{~)058@!eCtM#yAvNfU zmOC+ag1!%Dg}5qZApp_16qY5Wu{v*hg_vYbyR~u%Sd74ELdPdPz?Nf`v&(+Y0Att8@-(b{1>MV95_Ax^VJLg zBgC+^@f>!b8^#?_2ulUZE*$e@JYV}ARNz8b0}>y7t>$6>3ofOSSBQIqOXx6(gBTE) zIM~G}sMr#PAyO!O*07~w$sLHWfH}7}k%AvK%}+1<23A&=k1-4PQcMstjuHo_KFe&sWk=UAe{6B-&^WGy-{dzhdP_={V%B~X+ZzmSloi&onlV+C zj(q&AMa>mz_r9ez4RzhnH`MJyJwla_gC0KpRboY@BcI2Lrqqj#Jj{mCP?sv5G=;p4 z6fB`cdhsCL?qyZCKCxjK?=5H*_jchmpP}GuQZ29=E+y*PoB(FrSg#SkWwAt8q!?*;@F3W+E-%JJJ+e3@5@8H4ka`;Z(ldG+cYrQh zKrS!F7OuIn)fie_j^s@;!Bsi&fiVzfA`*$NJOerMP=se~6z*!aTR7aS!(d9(JZ|Qz zzO4t`V&(9(UiiNTaadU0eU{ zUES_|Ai5t=aKB=27_JR`VtV%vd>clqm?DhbQHXcz6yfd)zU-1e^m?n6dxkxXjDpC0 zg}I`D25`P8baVWU*`kOdPN)^HJ;#rumE}LqYIFWc7tR8kQ?RtlN)ne0mE59cR_&^j z=Ck^>VXjP!vOoYchS?RH%umM~4H^qt%uTtf>ZYN(^9-*$j_uO^4F1w=Bv8aCI*Igu z0%VePhoNm0IFn-HZ)w>m;}_(BE>pAGoalIgJj0om7l2)Zmx!!p*QW6y1m6eWpr`IN zC$t~;JI+v}F5snRq@3-tUq8Hjd3?&=9KJs8+$Vp`Nom zN0Ch|eMlBqU5$*mVyML^?v+(7?pH2tK_s{$imYLp*m3h|YoM?b45B#dRB5Jo1x?T! ur%uV??DJSahUjBXML<*-bo{!YER)7AkVC>ogxnUEYAW#-_|UDW racket-repl-mode associations + +;; There are some nuances here regarding these variables being +;; buffer-local or not, and, whether the variables have any meaning in +;; certain modes, or not. We use Emacs variable semantics to handle +;; the association between `racket-mode' edit buffers and +;; `racket-repl-mode' buffers, for a variety of use cases the user +;; might prefer. These range from all edit buffers sharing one REPL +;; buffer (the traditional default for Racket Mode), up to each edit +;; buffers having its own REPL (as in Dr Racket), or anything in +;; between (such as one REPL per projectile project, or whatever). +;; Some of these scenarios might benefit from some higher-level UI. +;; But ultimately they reduce to setting the variable +;; `racket-repl-buffer-name' globally and/or locally for `racket-mode' +;; buffers -- that is the fundamental representation. Similarly, each +;; `racket-repl-mode' buffer has an always-buffer-local value for the +;; variable `racket--repl-session-id'. (Note that +;; `racket-repl-buffer-name' only has meaning for `racket-mode' +;; buffers, and `racket--repl-session-id' only has meaning for +;; `racket-repl-mode' buffers. Emacs variables exist for all buffers +;; using all major modes. All we can do is remember in which buffers +;; they mean something as opposed to being ignored..) + +(defvar racket-repl-buffer-name "*Racket REPL*" + "The name of the `racket-repl-mode' buffer associated with `racket-mode' buffer. + +Important: This variable only means something in each +`racket-mode' buffer. It has no meaning in `racket-repl-mode' or +other buffers. + +By default all `racket-mode' edit buffers share the same REPL. +However, a buffer may `setq-local' this to some other value. See +the defcustom `racket-repl-buffer-name-function' and example +values for it in racket-repl-buffer-name.el.") + +(defvar-local racket--repl-session-id nil + "The REPL session ID returned from the back end. + +Must be supplied in command requests, although for some commands it can be nil. + +Important: This variable only means something in each +`racket-repl-mode' buffer. It has no meaning in `racket-mode' or +other buffers. Futhermore, it is /always/ buffer-local in each +`racket-repl-mode' buffer. Instead of accessing this directly, +use the function `racket--repl-session-id', which helps select +the correct `racket-repl-mode' buffer, if any.") + +(defun racket--repl-session-id () + "Use this to get a REPL session ID. +The result might be nil if no REPL buffer exists, or if it does +but does not have a live session." + (if (eq major-mode 'racket-repl-mode) + racket--repl-session-id + (let ((buffer (get-buffer racket-repl-buffer-name))) + (when buffer + (with-current-buffer racket-repl-buffer-name + racket--repl-session-id))))) + +(defun racket--call-with-repl-buffer (thunk) + (pcase (get-buffer (if (eq major-mode 'racket-repl-mode) + (buffer-file-name) + racket-repl-buffer-name)) + ((and (pred bufferp) buf) + (with-current-buffer buf (funcall thunk))))) + +(defmacro with-racket-repl-buffer (&rest body) + "Execute forms in BODY with `racket-repl-mode' temporarily current buffer." + (declare (indent 0) (debug t)) + `(racket--call-with-repl-buffer (lambda () ,@body))) + +(defun racket--repl-live-p () + "Does a Racket REPL buffer exist and have a live Racket process?" + (and (racket--repl-session-id) + (comint-check-proc racket-repl-buffer-name))) + +;;; Misc + +(defun racket-repl--input-filter (str) + "Don't save anything matching `racket-history-filter-regexp'." + (not (string-match racket-history-filter-regexp str))) + +(defalias 'racket-repl-eval-or-newline-and-indent #'racket-repl-submit) + +(defun racket-repl-submit (&optional prefix) + "Submit your input to the Racket REPL. + +If the REPL is running a Racket lang whose language-info has a +'drracket:submit-predicate, that is first called to see if the +input is valid to be submitted. + +With a prefix: After sending your input and a newline, also calls +`process-send-eof' -- because some langs require EOF to mark the +end of an interactive expression/statement." + (interactive "P") + (let* ((proc (get-buffer-process (current-buffer))) + (_ (unless proc (user-error "Current buffer has no process"))) + (text (substring-no-properties (funcall comint-get-old-input))) + (submitp + (if racket-use-repl-submit-predicate + (cl-case (racket--cmd/await (racket--repl-session-id) + `(repl-submit? ,text t)) + ((t) t) + ((nil) (user-error "Not a complete expression, according to the current lang's submit-predicate.")) + ((default) (racket--repl-complete-sexp-p proc))) + (racket--repl-complete-sexp-p proc)))) + (if (not submitp) + (newline-and-indent) + (comint-send-input) + (remove-text-properties comint-last-input-start + comint-last-input-end + '(font-lock-face comint-highlight-input)) + ;; Hack for datalog/lang + (when prefix (process-send-eof proc))))) + +(defun racket--repl-complete-sexp-p (proc) + (condition-case nil + (let* ((beg (marker-position (process-mark proc))) + (end (save-excursion + (goto-char beg) + (forward-list 1) ;scan-error unless complete sexp + (point))) + (blankp (save-excursion + (save-match-data + (goto-char beg) + (equal end + (re-search-forward (rx (1+ (or (syntax whitespace) + (syntax comment-start) + (syntax comment-end)))) + end + t)))))) + (not (or (equal beg end) blankp))) + (scan-error nil))) + +(defun racket-repl-exit (&optional killp) + "End the Racket REPL process. + +Effectively the same as entering `(exit)` at the prompt, but +works even when the module language doesn't provide any binding +for `exit`. + +With a prefix, closes the entire back end process --- the command +server and all REPL sessions." + (interactive "P") + (cond (killp + (message "Killing entire Racket Mode back end process") + (racket--cmd-close)) + ((racket--cmd-open-p) ;don't auto-start the back end + (racket--cmd/async (racket--repl-session-id) `(exit))) + (t + (user-error "Back end is not running")))) + +;;;###autoload +(defun racket-repl (&optional noselect) + "Show a Racket REPL buffer in some window. + +*IMPORTANT* + +The main, intended use of Racket Mode's REPL is that you +`find-file' some specific .rkt file, then `racket-run' it. The +REPL will then match that file. + +If the REPL isn't running, and you want to start it for no file +in particular? Then you could use this command. But the resulting +REPL will have a minimal \"#lang racket/base\" namespace. You +could enter \"(require racket)\" if you want the equivalent of +\"#lang racket\". You could also \"(require racket/enter)\" if +you want things like \"enter!\". But in some sense you'd be +\"using it wrong\". If you really don't want to use Racket Mode's +REPL as intended, then you might as well use a plain Emacs shell +buffer to run command-line Racket." + (interactive "P") + (cl-labels + ((display-and-maybe-select + () + (display-buffer racket-repl-buffer-name) + (unless noselect + (select-window (get-buffer-window racket-repl-buffer-name t))))) + (if (racket--repl-live-p) + (display-and-maybe-select) + (racket--repl-start + (lambda () + (racket--repl-refresh-namespace-symbols) + (display-and-maybe-select)))))) + +;;; Run + +;; Note: These commands are to be run when current-buffer is a +;; `racket-mode' buffer. The reason they are defined here is because +;; they use a `racket-repl-mode' buffer, and, one could use +;; `racket-mode' to edit files without using these commands. + +;;;###autoload +(defun racket-run (&optional prefix) + "Save the buffer in REPL and run your program. + +Runs the \"main\" submodule, if any, otherwise the file's module. +See also `racket-run-module-at-point'. + +With one C-u prefix, uses errortrace for improved stack traces. +Otherwise follows the `racket-error-context' setting. + +With two C-u prefixes, instruments code for step debugging. See +`racket-debug-mode' and the variable `racket-debuggable-files'. + +Each run occurs within a Racket custodian. Any prior run's +custodian is shut down, releasing resources like threads and +ports. Each run's evaluation environment is reset to the contents +of the source file. In other words, like Dr Racket, this provides +the benefit that your source file is the \"single source of +truth\". At the same time, the run gives you a REPL inside the +namespace of the module, giving you the ability to explore it +interactively. Any explorations are temporary, unless you also +make them to your source file, they will be lost on the next run. + +See also `racket-run-and-switch-to-repl', which is even more like +Dr Racket's Run command because it selects the REPL window after +running. + +In the `racket-repl-mode' buffer, output that describes a file +and position is automatically \"linkified\". Examples of such +text include: + +- Racket error messages. +- rackunit test failure location messages. +- print representation of path objects. + +To visit these locations, move point there and press RET or mouse +click. Or, use the standard `next-error' and `previous-error' +commands." + (interactive "P") + (racket--repl-run (list (racket--buffer-file-name) 'main) + (pcase prefix + (`(4) 'high) + (`(16) 'debug) + (_ racket-error-context)))) + +;;;###autoload +(defun racket-run-module-at-point (&optional prefix) + "Save the buffer and run the moudule at point. + +Like `racket-run' but runs the innermost module around point. +This may be a submodule nested at any depth, or the file's +module." + (interactive "P") + (racket--repl-run (racket--what-to-run) + (pcase prefix + (`(4) 'high) + (`(16) 'debug) + (_ racket-error-context)))) + +(defun racket-run-with-errortrace () + "Run with `racket-error-context' temporarily set to \"high\". +This is just `racket-run' with a C-u prefix. Defined as a function so +it can be a menu target." + (interactive) + (racket-run '(4))) + +(defun racket-run-with-debugging () + "Run with `racket-error-context' temporarily set to 'debug. +This is just `racket-run' with a double C-u prefix. Defined as a +function so it can be a menu target." + (interactive) + (racket-run '(16))) + +(defun racket-run-and-switch-to-repl (&optional prefix) + "This is `racket-run' followed by `racket-repl'." + (interactive "P") + (racket-run prefix) + (racket-repl)) + +(defun racket-test (&optional coverage) + "Run the \"test\" submodule. + +With prefix, runs with coverage instrumentation and highlights +uncovered code. + +Put your tests in a \"test\" submodule. For example: + +#+BEGIN_SRC racket + (module+ test + (require rackunit) + (check-true #t)) +#+END_SRC + +Any rackunit test failure messages show the location. You may use +`next-error' to jump to the location of each failing test. + +See also: +- `racket-fold-all-tests' +- `racket-unfold-all-tests' +" + (interactive "P") + (let ((mod-path (list 'submod (racket--buffer-file-name) 'test)) + (buf (current-buffer))) + (if (not coverage) + (racket--repl-run mod-path) + (message "Running test submodule with coverage instrumentation...") + (racket--repl-run + mod-path + 'coverage + (lambda () + (message "Getting coverage results...") + (racket--cmd/async + (racket--repl-session-id) + `(get-uncovered) + (lambda (xs) + (pcase xs + (`() (message "Full coverage.")) + ((and xs `((,beg0 . ,_) . ,_)) + (message "Missing coverage in %s place(s)." (length xs)) + (with-current-buffer buf + (dolist (x xs) + (let ((o (make-overlay (car x) (cdr x) buf))) + (overlay-put o 'name 'racket-uncovered-overlay) + (overlay-put o 'priority 100) + (overlay-put o 'face font-lock-warning-face))) + (goto-char beg0))))))))))) + +(add-hook 'racket--repl-before-run-hook #'racket--remove-coverage-overlays) + +(defun racket--remove-coverage-overlays () + (remove-overlays (point-min) (point-max) 'name 'racket-uncovered-overlay)) + +(defvar-local racket-user-command-line-arguments + nil + "List of command-line arguments to supply to your Racket program. + +Accessible in your Racket program in the usual way --- the +parameter `current-command-line-arguments` and friends. + +This is an Emacs buffer-local variable --- convenient to set as a +file local variable. For example at the end of your .rkt file: + +#+BEGIN_SRC elisp + ;; Local Variables: + ;; racket-user-command-line-arguments: (\"-f\" \"bar\") + ;; End: +#+END_SRC + +Set this way, the value must be an *unquoted* list of strings. +For example: + +#+BEGIN_SRC elisp + (\"-f\" \"bar\") +#+END_SRC + +The following values will /not/ work: + +#+BEGIN_SRC elisp + '(\"-f\" \"bar\") + (list \"-f\" \"bar\") +#+END_SRC +") + +(defvar racket--repl-before-run-hook nil + "Thunks to do before each `racket--repl-run'.") + +(defvar racket--repl-after-run-hook nil + "Thunks to do after each `racket--repl-run'. +Here \"after\" means that the run has completed and e.g. the REPL +is waiting at another prompt.") + +(defun racket--repl-run (&optional what-to-run context-level callback) + "Do an initial or subsequent run. + +WHAT-TO-RUN should be a cons of a file name to a list of +submodule symbols. Or if nil, defaults to `racket--what-to-run'. + +CONTEXT-LEVEL should be a valid value for the variable +`racket-error-context', 'coverage, or 'profile. Or if nil, +defaults to the variable `racket-error-context'. + +CALLBACK is used as the callback for `racket--cmd/async'; it may +be nil which is equivalent to #'ignore. + +- If the REPL is not live, create it. + +- If the REPL is live, send a 'run command to the backend's TCP + server." + (unless (eq major-mode 'racket-mode) + (user-error "Only works from a `racket-mode' buffer")) + (run-hook-with-args 'racket--repl-before-run-hook) + (let* ((cmd (racket--repl-make-run-command (or what-to-run (racket--what-to-run)) + (or context-level racket-error-context))) + (after (lambda (_ignore) + (run-hook-with-args 'racket--repl-after-run-hook) + (when callback + (funcall callback))))) + (cond ((racket--repl-live-p) + (racket--cmd/async (racket--repl-session-id) cmd after) + (display-buffer racket-repl-buffer-name)) + (t + (racket--repl-start + (lambda () + (racket--cmd/async (racket--repl-session-id) cmd after) + (display-buffer racket-repl-buffer-name))))))) + +(defun racket--repl-make-run-command (what-to-run &optional context-level) + "Form a `run` command sexpr for the backend. +WHAT-TO-RUN may be nil, meaning just a `racket/base` namespace." + (let ((context-level (or context-level racket-error-context))) + (list 'run + what-to-run + racket-memory-limit + racket-pretty-print + context-level + racket-user-command-line-arguments + (when (and what-to-run (eq context-level 'debug)) + (racket--debuggable-files (car what-to-run)))))) + +(defun racket--repl-start (callback) + "Create a `comint-mode' / `racket-repl-mode' buffer connected to a REPL session. + +Sets `racket--repl-session-id'. + +This does not display the buffer or change the selected window." + (racket--cmd/async + nil + `(no-op) ;automatically start back-end if necessary + (lambda (_n/a) + (with-current-buffer (get-buffer-create racket-repl-buffer-name) + ;; Add a pre-output hook that reads `(ok ,id) -- possibly over + ;; multiple calls -- to set `racket--repl-session-id' then + ;; removes itself. + (let ((hook nil) + (buf (generate-new-buffer " *racket-repl-session-id-reader*"))) + (setq hook (lambda (txt) + (with-current-buffer buf + (goto-char (point-max)) + (insert txt) + (goto-char (point-min))) + (pcase (ignore-errors (read buf)) + (`(ok ,id) + (setq racket--repl-session-id id) + (run-with-timer 0.001 nil callback) + (remove-hook 'comint-preoutput-filter-functions hook t) + (prog1 + (with-current-buffer buf + (buffer-substring (if (eq (char-after) ?\n) + (1+ (point)) + (point)) + (point-max))) + (kill-buffer buf))) + (_ "")))) + (add-hook 'comint-preoutput-filter-functions hook nil t)) + + (make-comint-in-buffer racket-repl-buffer-name + (current-buffer) + (cons "127.0.0.1" racket-command-port)) + (process-send-string (get-buffer-process (current-buffer)) + (format "%S\n" racket--cmd-auth)) + (set-process-coding-system (get-buffer-process (current-buffer)) + 'utf-8 'utf-8) ;for e.g. λ + (racket-repl-mode))))) + +;;; Misc + +(defun racket-repl-file-name () + "Return the file running in the REPL, or nil. + +The result can be nil if the REPL is not started, or if it is +running no particular file." + (when (comint-check-proc racket-repl-buffer-name) + (racket--cmd/await (racket--repl-session-id) `(path)))) + +(defun racket--in-repl-or-its-file-p () + "Is current-buffer `racket-repl-mode' or buffer for file active in it?" + (or (eq (current-buffer) + (get-buffer racket-repl-buffer-name)) + (let ((buf-file (racket--buffer-file-name)) + (repl-file (racket-repl-file-name))) + (and buf-file repl-file (string-equal buf-file repl-file))))) + +(defun racket-repl-switch-to-edit () + "Switch to the window for the buffer of the file running in the REPL. + +If no buffer is visting the file, `find-file' it in `other-window'. + +If the REPL is running no file -- if the prompt is `>` -- use the +most recent `racket-mode' buffer, if any." + (interactive) + (pcase (racket-repl-file-name) + (`() (let ((buffer (racket--most-recent-racket-mode-buffer))) + (unless buffer + (user-error "There are no racket-mode buffers")) + (pop-to-buffer buffer t))) + (path (let ((buffer (find-buffer-visiting path))) + (if buffer + (pop-to-buffer buffer t) + (other-window 1) + (find-file path)))))) + +(defun racket--most-recent-racket-mode-buffer () + (cl-some (lambda (b) + (with-current-buffer b + (and (eq major-mode 'racket-mode) b))) + (buffer-list))) + +;;; send to REPL + +(defun racket--send-region-to-repl (start end) + "Internal function to send the region to the Racket REPL. + +Before sending the region, calls `racket-repl' and +`racket--repl-forget-errors'. Also inserts a ?\n at the process +mark so that output goes on a fresh line, not on the same line as +the prompt. + +Afterwards displays the buffer in some window." + (unless (and start end) + (error "start and end must not be nil")) + ;; Save the current buffer in case something changes it before we + ;; call `comint-send-region'; see e.g. issue 407. + (let ((source-buffer (current-buffer))) + (racket-repl t) + (racket--repl-forget-errors) + (let ((proc (get-buffer-process racket-repl-buffer-name))) + (with-racket-repl-buffer + (save-excursion + (goto-char (process-mark proc)) + (insert ?\n) + (set-marker (process-mark proc) (point)))) + (with-current-buffer source-buffer + (comint-send-region proc start end) + (comint-send-string proc "\n"))) + (display-buffer racket-repl-buffer-name))) + +(defun racket-send-region (start end) + "Send the current region (if any) to the Racket REPL." + (interactive "r") + (unless (region-active-p) + (user-error "No region")) + (racket--send-region-to-repl start end)) + +(defun racket-send-definition (&optional prefix) + "Send the current definition to the Racket REPL." + (interactive "P") + (save-excursion + (end-of-defun) + (let ((end (point))) + (beginning-of-defun) + (if prefix + (racket--debug-send-definition (point) end) + (racket--send-region-to-repl (point) end))))) + +(defun racket-send-last-sexp () + "Send the previous sexp to the Racket REPL. + +When the previous sexp is a sexp comment the sexp itself is sent, +without the #; prefix." + (interactive) + (racket--send-region-to-repl (racket--repl-last-sexp-start) + (point))) + +(defun racket-eval-last-sexp () + "Eval the previous sexp asynchronously and `message' the result." + (interactive) + (racket--cmd/async + (racket--repl-session-id) + `(eval + ,(buffer-substring-no-properties (racket--repl-last-sexp-start) + (point))) + (lambda (v) + (message "%s" v)))) + +(defun racket--repl-last-sexp-start () + (save-excursion + (condition-case () + (progn + (backward-sexp) + (if (save-match-data (looking-at "#;")) + (+ (point) 2) + (point))) + (scan-error (user-error "There isn't a complete s-expression before point"))))) + +(defun racket--repl-forget-errors () + "Forget existing errors in the REPL. +Although they remain clickable they will be ignored by +`next-error' and `previous-error'" + (with-racket-repl-buffer + (compilation-forget-errors) + ;; `compilation-forget-errors' may have just set + ;; `compilation-messages-start' to a marker at position 1. But in + ;; that case process output (including error messages) will be + ;; inserted ABOVE the marker, in which case `next-error' won't see + ;; them. Instead use a non-marker position like 1 or use nil. + (when (and (markerp compilation-messages-start) + (equal (marker-position compilation-messages-start) 1) + (equal (marker-buffer compilation-messages-start) (current-buffer))) + (setq compilation-messages-start nil)))) + +(add-hook 'racket--repl-before-run-hook #'racket--repl-forget-errors) + +;;; Inline images in REPL + +(defvar racket-image-cache-dir nil) + +(defun racket-repl--list-image-cache () + "List all the images in the image cache." + (and racket-image-cache-dir + (file-directory-p racket-image-cache-dir) + (let ((files (directory-files-and-attributes + racket-image-cache-dir t "racket-image-[0-9]*.png"))) + (mapcar #'car + (sort files (lambda (a b) + (< (float-time (nth 6 a)) + (float-time (nth 6 b))))))))) + +(defun racket-repl--clean-image-cache () + "Clean all except for the last `racket-images-keep-last' +images in 'racket-image-cache-dir'." + (interactive) + (dolist (file (butlast (racket-repl--list-image-cache) + racket-images-keep-last)) + (delete-file file))) + +(defun racket-repl-display-images (_txt) + "Replace all image patterns with actual images. +A value for the variable `comint-output-filter-functions'." + (with-silent-modifications + (save-excursion + (goto-char (point-min)) + (while (re-search-forward "\"#\"" nil t) + ;; can't pass a filename to create-image because emacs might + ;; not display it before it gets deleted (race condition) + (let* ((file (match-string 1)) + (begin (match-beginning 0)) + (end (match-end 0))) + (delete-region begin end) + (goto-char begin) + (if (and racket-images-inline (display-images-p)) + (insert-image (create-image file) "[image]") + (goto-char begin) + (insert "[image] ; use M-x racket-view-last-image to view")) + (setq racket-image-cache-dir (file-name-directory file)) + (racket-repl--clean-image-cache)))))) + +(defun racket-view-last-image (n) + "Open the last displayed image using `racket-images-system-viewer'. + +With prefix arg, open the N-th last shown image." + (interactive "p") + (let ((images (reverse (racket-repl--list-image-cache)))) + (if (>= (length images) n) + (start-process "Racket image view" + nil + racket-images-system-viewer + (nth (- n 1) images)) + (error "There aren't %d recent images" n)))) + +;;; Completion + +(defvar racket--repl-namespace-symbols nil) + +(defun racket--repl-refresh-namespace-symbols () + (racket--cmd/async + (racket--repl-session-id) + '(syms) + (lambda (syms) + (setq racket--repl-namespace-symbols syms)))) + +(add-hook 'racket--repl-after-run-hook #'racket--repl-refresh-namespace-symbols) + +(defun racket--repl-completion-candidates-for-prefix (prefix) + (all-completions prefix racket--repl-namespace-symbols)) + +(defun racket-repl-complete-at-point () + "A value for the variable `completion-at-point-functions'. + +Completion candidates are drawn from the REPL namespace symbols. + +Returns extra :company-doc-buffer and :company-location +properties for use by the `company-mode' backend `company-capf' +-- but not :company-docsig, because it is frequently impossible +to supply this quickly enough or at all." + (racket--call-with-completion-prefix-positions + (lambda (beg end) + (list beg + end + (completion-table-dynamic + #'racket--repl-completion-candidates-for-prefix) + :predicate #'identity + :exclusive 'no + :company-doc-buffer #'racket--repl-company-doc-buffer + :company-location #'racket--repl-company-location)))) + +(defun racket--repl-company-doc-buffer (str) + (racket--do-describe 'namespace (racket--repl-session-id) str)) + +(defun racket--repl-company-location (str) + (pcase (racket--cmd/await (racket--repl-session-id) + `(def-in-namespace ,str)) + (`(,path ,line ,_) (cons path line)))) + +(defun racket-repl-eldoc-function () + "A value for the variable `eldoc-documentation-function'. + +By default `racket-repl-mode' sets `eldoc-documentation-function' +to nil -- no `eldoc-mode' support. You may set it to this +function in a `racket-repl-mode-hook' if you really want to use +`eldoc-mode'. But it is not a very satisfying experience because +Racket is not a very \"eldoc friendly\" language. + +Sometimes we can discover argument lists from source -- but this +can be slow. + +For code that has been run in the REPL, we can use its namespace +to discover contracts or types -- but otherwise we cannot. + +Many interesting Racket forms are syntax (macros) without any +easy way to discover their \"argument lists\". Similarly many +Racket functions or syntax are defined in #%kernel and the source +is not available. If they have documentation with a \"bluebox\", +we can show it -- but often it is not a single-line format +typical for eldoc. + +So if you are expecting an eldoc experience similar to Emacs +Lisp, you will be disappointed. + +A more satisfying experience is to use `racket-repl-describe' or +`racket-repl-documentation'." + (racket--do-eldoc 'namespace (racket--repl-session-id))) + +;;; describe + +(defun racket-repl-describe (&optional prefix) +"Describe the identifier at point in a `*Racket Describe*` buffer. + +The intent is to give a quick reminder or introduction to +something, regardless of whether it has installed documentation +-- and to do so within Emacs, without switching to a web browser. + +This buffer is also displayed when you use `company-mode' and +press F1 or C-h in its pop up completion list. + +- If the identifier has installed Racket documentation, then a + simplified version of the HTML is presented in the buffer, + including the \"blue box\", documentation prose, and examples. + +- Otherwise, if the identifier is a function, then its signature + is displayed, for example `(name arg-1-name arg-2-name)`. If it + has a contract or a Typed Racket type, that is also displayed. + +You can quit the buffer by pressing q. Also, at the bottom of the +buffer are Emacs buttons -- which you may navigate among using +TAB, and activate using RET -- for `racket-visit-definition' and +`racket-doc'." + (interactive "P") + (pcase (racket--symbol-at-point-or-prompt prefix "Describe: " + racket--repl-namespace-symbols) + ((and (pred stringp) str) + (racket--do-describe + 'namespace + (racket--repl-session-id) + str + t + (lambda () + (racket--do-visit-def-or-mod (racket--repl-session-id) + `(def namespace ,str))) + (lambda () + (racket--cmd/async (racket--repl-session-id) + `(doc namespace ,str) + #'browse-url)))))) + +;;; Visit + +(defun racket-repl-visit-definition (&optional prefix) + "Visit definition of identifier at point. + +If there is no identifier at point, prompt for it. + +With a prefix, always prompt for the identifier. + +Use `racket-unvisit' to return. + +Please keep in mind the following limitations: + +- Finds symbols defined in the REPL's namespace, which only + includes imported and module binding -- but not local bindings. + +- If the definition is found in Racket's \"#%kernel\" module, it + will tell you so but won't visit the definition site." + (interactive "P") + (pcase (racket--symbol-at-point-or-prompt prefix "Visit definition of: " + racket--repl-namespace-symbols) + ((and (pred stringp) str) (racket--repl-visit-symbol-definition str)))) + +;; TODO: Move to `racket-xp-mode', or arrange for this to call that or +;; this depending on current-buffer. +(defun racket-lispy-visit-symbol-definition (str) + "Function called by lispy.el's `lispy-goto-symbol' for Racket +symbol definition lookup." + (racket--repl-visit-symbol-definition str)) + +(defun racket--repl-visit-symbol-definition (str) + (racket--do-visit-def-or-mod (racket--repl-session-id) + `(def namespace ,str))) + +;;; Doc + +(defun racket-repl-documentation (&optional prefix) + "View documentation of the identifier or string at point. + +Uses the default external web browser. + +If point is an identifier required in the current namespace that +has help, opens the web browser directly at that help +topic. (i.e. Uses the identifier variant of racket/help.) + +Otherwise, opens the 'search for a term' page, where you can +choose among multiple possibilities. (i.e. Uses the string +variant of racket/help.) + +With a C-u prefix, prompts for the identifier or quoted string, +instead of looking at point." + (interactive "P") + (pcase (racket--symbol-at-point-or-prompt prefix "Documentation for: " + racket--repl-namespace-symbols) + ((and (pred stringp) str) (racket--cmd/async (racket--repl-session-id) + `(doc namespace ,str) + #'browse-url)))) + +;;; racket-repl-mode + +(defvar racket-repl-mode-map + (racket--easy-keymap-define + '(("C-m" racket-repl-submit) + ("C-j" newline-and-indent) + ("TAB" indent-for-tab-command) + ("C-M-u" racket-backward-up-list) + ("C-M-q" prog-indent-sexp) + ("C-a" comint-bol) + ("C-w" comint-kill-region) + ("" comint-kill-whole-line) + ("C-c C-e f" racket-expand-file) + ("C-c C-e x" racket-expand-definition) + ("C-c C-e e" racket-expand-last-sexp) + ("C-c C-e r" racket-expand-region) + ("M-C-y" racket-insert-lambda) + ("C-c C-d" racket-repl-documentation) + ("C-c C-." racket-repl-describe) + ("M-." racket-repl-visit-definition) + ("C-M-." racket-visit-module) + ("M-," racket-unvisit) + ("C-c C-z" racket-repl-switch-to-edit) + ("C-c C-l" racket-logger) + ("C-c C-\\" racket-repl-exit) + ((")" "]" "}") racket-insert-closing))) + "Keymap for Racket REPL mode.") + +(easy-menu-define racket-repl-mode-menu racket-repl-mode-map + "Menu for Racket REPL mode." + '("Racket-REPL" + ["Break" comint-interrupt-subjob] + ["Exit" racket-repl-exit] + "---" + ["Insert Lambda" racket-insert-lambda] ;λ in string breaks menu + ["Indent Region" indent-region] + ["Cycle Paren Shapes" racket-cycle-paren-shapes] + ("Macro Expand" + ["File" racket-expand-file] + ["Region" racket-expand-region :active (region-active-p)] + ["Definition" racket-expand-definition] + ["Last S-Expression" racket-expand-last-sexp]) + "---" + ["Visit Definition" racket-visit-definition] + ["Visit Module" racket-visit-module] + ["Return from Visit" racket-unvisit] + "---" + ["Racket Documentation" racket-doc] + ["Describe" racket-describe] + "---" + ["Switch to Edit Buffer" racket-repl-switch-to-edit])) + +(define-derived-mode racket-repl-mode comint-mode "Racket-REPL" + "Major mode for Racket REPL. +\\{racket-repl-mode-map}" + (racket--common-variables) + (setq-local comint-use-prompt-regexp nil) + (setq-local comint-prompt-read-only t) + (setq-local comint-scroll-show-maximum-output nil) ;t slow for big outputs + (setq-local mode-line-process nil) + (setq-local comint-input-filter #'racket-repl--input-filter) + (setq-local completion-at-point-functions (list #'racket-repl-complete-at-point)) + (setq-local eldoc-documentation-function nil) + (add-hook 'comint-output-filter-functions #'racket-repl-display-images) + (compilation-setup t) + (setq-local + compilation-error-regexp-alist + (list + ;; Any apparent file:line:col + (list (rx (group-n 1 (+? (not (syntax whitespace)))) + (any ?\: ?\.) + (group-n 2 (+ digit)) + (any ?\: ?\.) + (group-n 3 (+ digit))) + #'racket--adjust-group-1 2 3) + ;; Any path struct + (list (rx "#)))) ?\>) + #'racket--adjust-group-1 nil nil 0)))) + +(defun racket--adjust-group-1 () + (list (funcall racket-path-from-racket-to-emacs-function (match-string 1)))) + +(provide 'racket-repl) + +;; racket-repl.el ends here diff --git a/elpa/racket-mode-20200323.1739/racket-repl.elc b/elpa/racket-mode-20200323.1739/racket-repl.elc new file mode 100644 index 0000000000000000000000000000000000000000..1df1f648f1c2622a4ba00bdc2393cdb3119a3d89 GIT binary patch literal 33200 zcmcJYiFX^eIc4yZ?0M%9YBepMIL`j?X58VcNGZ zgHf_~*6q!bSLt*%7>|Gu0+KgmXE>})i5F7(kK)5mB$PkQ6gyi4Q7 z{J6Hwl~L{Pv)u;|lHO@|+U?Dm;%ytgJL)I1ankFKlA|;kj=QBn!ct~Q+MNyu=`@+2 z(y-a`aRI^K^-mM{d;e7`mGz_Zd0Oj@`)N`=Xw~cdG;SO;8~UK1X7Nj__@!O^(kXt~ zEPmN4d}-8+Uy9>2isLkj<1~unG>YRi;y8`1gI1HtHX8?3pSoRX#w+!$YVv%VezzD* z(*y**Oy{ilY%)ye+4p`r>rDq>G2Bmw5K;WnTg>L;v+UdW>%VIKcZE9u>MX+Q7fi&XqHfJBWCaBkr7o(mqx0Xm)q;I++yNdOL+bpNlRyQI z`wLXNYW&e`p2DxNRkzm@SfO?!nLc8sHy@tguAr0*u#pHdDy>u24UX)Q8vEfAiO zf3g-xa=90gRHM~S{%C7+4mn9-LZiL{fo)Xwp{Z#)6N{b=PEL)WGzTUO#~VHRknqL8 z2ul2LEX+t1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NZOuEL}!C=_h+v&C60?4~s+Ds!%0b!0?DfxXZz9A{BNG|n~fj&~R#{QrFR!bTy&P`8st3>U5{F7S?tey80cN##2w5VI{pJg7lcg`y$L z#e2*1F}ZF#%#kV08#i{#CXMD-P==3n`<6)1zDBWTYp`nlXBM8to$odeVK!+vh9&8V#C92{gk*Y}9 z_5S+ZQF7vJd01Nk6iAV}yWjnOcRYLb`r^l4ujieeoxz1JD_MxtEu?~1B~J{jL~W#2 z5RHei+gVGS11}2Dm6fIZn_JvAL(gqq=h8riR-iG$K)O-9lnJCdF}9ZKy*b9++F0Oe zDpI)h5}ppD)Bo5=HQG?xLZX%Bc(}0{o8lM6&aW;mFCoc!%@d0u9y|A3rC>B9T)|R6 zq4_;09TWqC*M$@{*c=Z=aqAaT@I?;=@THIEdHvOw;O+Tq_?ej0iWl(P zo2$W7ub+yH7m^z|>g<_ZuicRT!MW6}hrGX@%rra{(gBHSk(+Bh($vw1gn9v zehfE4ROGGT>ZWtXoHMx2x%Jk3bL{fjg|id|(m?g6jx6|pHDv`28o>HW^;-F`+@Liw z0Ni*TdIP+wu(sM`(zL4~yivsl))e1c7aM9b)v!jjic+tHM?Bug|4Ed!zdAHq(vY5z zC~~zz4354b1|u9Xj+6ZZr`Pb?PM|v`7%Hpe7D|32SfLYMuv?9FTaM&TZcHOM=6afo zU;*Qf`RSx%K8(6rySo1U!Rq?A4MY)*CT;lxhD%UxL&y2(s{?$G5keeHo?+dM=P~t% zFm&p4Q#>EWxEyo{5mJ(~lv~~+yX!K6bL7(H{5XC4u)?03U>;T?u~=&}gKcHUh*LtbdQO$vYReFxV1e_ph01wY(L~O#Z+^+=^~8rD)_ xzhGu#tSBK{>PDp%d}IWNt|OchR5x{S6Vg+AErh32S3&)%)+;=J?=~8E{{W8%p~nCK literal 0 HcmV?d00001 diff --git a/elpa/racket-mode-20200218.1623/racket-smart-open.el b/elpa/racket-mode-20200323.1739/racket-smart-open.el similarity index 100% rename from elpa/racket-mode-20200218.1623/racket-smart-open.el rename to elpa/racket-mode-20200323.1739/racket-smart-open.el diff --git a/elpa/racket-mode-20200218.1623/racket-smart-open.elc b/elpa/racket-mode-20200323.1739/racket-smart-open.elc similarity index 100% rename from elpa/racket-mode-20200218.1623/racket-smart-open.elc rename to elpa/racket-mode-20200323.1739/racket-smart-open.elc diff --git a/elpa/racket-mode-20200218.1623/racket-stepper.el b/elpa/racket-mode-20200323.1739/racket-stepper.el similarity index 84% rename from elpa/racket-mode-20200218.1623/racket-stepper.el rename to elpa/racket-mode-20200323.1739/racket-stepper.el index 4af979d3..6d091d01 100644 --- a/elpa/racket-mode-20200218.1623/racket-stepper.el +++ b/elpa/racket-mode-20200323.1739/racket-stepper.el @@ -1,6 +1,6 @@ ;;; racket-stepper.el -*- lexical-binding: t; -*- -;; Copyright (c) 2018 by Greg Hendershott. +;; Copyright (c) 2018-2020 by Greg Hendershott. ;; Portions Copyright (C) 1985-1986, 1999-2013 Free Software Foundation, Inc. ;; Author: Greg Hendershott @@ -18,7 +18,7 @@ (require 'easymenu) (require 'rx) -(require 'racket-common) +(require 'racket-cmd) (require 'racket-custom) (require 'racket-repl) (require 'racket-util) @@ -56,7 +56,7 @@ Used by the commands `racket-expand-file', \\{racket-stepper-mode-map} " (setq header-line-format - "Press RET to step. C-h m to see help.") + "Press RET to step. C-u RET to step all. C-h m to see help.") (setq-local font-lock-defaults (list racket-stepper-font-lock-keywords t))) ;keywords only -- not strings/comments @@ -128,11 +128,21 @@ Uses Racket's `expand-once` in the namespace from the most recent (buffer-substring-no-properties beg end) prefix)))) +(defvar racket--stepper-repl-session-id nil + "The REPL session used when stepping. +May be nil for 'file stepping, but must be valid for 'expr stepping.") + (defun racket-stepper--start (which str into-base) "Ensure buffer and issue initial command. WHICH should be 'expr or 'file. STR should be the expression or pathname. INTO-BASE is treated as a raw prefix arg and converted to boolp." + (unless (eq major-mode 'racket-mode) + (error "Only works from racket-mode buffers")) + (setq racket--stepper-repl-session-id (racket--repl-session-id)) + (unless (or racket--stepper-repl-session-id + (eq which 'file)) + (error "Only works when the racket-mode buffer has a REPL buffer, and, you should racket-run first")) ;; Create buffer if necessary (unless (get-buffer racket-stepper--buffer-name) (with-current-buffer (get-buffer-create racket-stepper--buffer-name) @@ -145,27 +155,30 @@ INTO-BASE is treated as a raw prefix arg and converted to boolp." (let ((inhibit-read-only t)) (delete-region (point-min) (point-max)) (insert "Starting macro expansion stepper... please wait...\n")) - (racket--cmd/async `(macro-stepper (,which . ,str) + (racket--cmd/async racket--stepper-repl-session-id + `(macro-stepper (,which . ,str) ,(and into-base t)) #'racket-stepper--insert)) -(defun racket-stepper--insert (step) +(defun racket-stepper--insert (steps) (with-current-buffer racket-stepper--buffer-name (let ((inhibit-read-only t)) (goto-char (point-max)) - (pcase step - (`(original . ,text) - (delete-region (point-min) (point-max)) - (insert "Original\n" text "\n" "\n")) - (`(final . ,text) (insert "Final\n" text "\n")) - (`(,label . ,diff) (insert label "\n" diff "\n"))) + (dolist (step steps) + (pcase step + (`(original . ,text) + (delete-region (point-min) (point-max)) + (insert "Original\n" text "\n" "\n")) + (`(final . ,text) (insert "Final\n" text "\n")) + (`(,label . ,diff) (insert label "\n" diff "\n")))) (racket-stepper-previous-item) (when (equal (selected-window) (get-buffer-window (current-buffer))) (recenter))))) -(defun racket-stepper-step () - (interactive) - (racket--cmd/async `(macro-stepper/next) +(defun racket-stepper-step (prefix) + (interactive "P") + (racket--cmd/async racket--stepper-repl-session-id + `(macro-stepper/next ,(if prefix 'all 'next)) #'racket-stepper--insert)) (defconst racket-stepper--item-rx diff --git a/elpa/racket-mode-20200218.1623/racket-stepper.elc b/elpa/racket-mode-20200323.1739/racket-stepper.elc similarity index 72% rename from elpa/racket-mode-20200218.1623/racket-stepper.elc rename to elpa/racket-mode-20200323.1739/racket-stepper.elc index 47fba8573f23113f04da56322fd9f8cab40933c7..31c258c672bebc2e8daf76404df281977e2feb9d 100644 GIT binary patch delta 1120 zcmah|OK;Oa5RQ{pEh(ZD^`RuC9ULU$(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8m%18WP&bnC6^Ab?5ctQ#wv+r z*bBBt%q+oxz>Ezg1xqc*sdlImRD-n6*l;AC;-`zNhieyCAJ+iakj{F{ut9*J^@pD@ zZ~&{SYV;eIyMEQrHcqk2#Xng8xWJhixs2^SgvoJTNHilt{3`H%dwu-l$)AkfK0+O- z5M)3q0^cY*r+s-7BAtOCdLQkx5RuOPL}MGWp^4;FTo&xu+<^4a;o=;+u|Lk^7}U`) zdFkY0i#t1_pjXBu7;eq8aJ@AK^7 zi7TNJN5@sL+OE<6m18!r6Ky1Z1;zw!aAl)w=I4%gm|$CeF>%L$lt|iiQqUABy9uI` z#`xDdD@3I<5m(G?Mo*=Ou_3xf^Nc`;POzhK#J|<}ofKc*px_MJ-4dsbXb(JpHv&t%R8d~RXf*=dYWrWfz6T~>rT8aI z{6pYVvi!Ga-G#GNf`(K0fx!&M73{e100jtIT} amt 0) + (if (>= ix-next (length uses)) 0 ix-next) + (if (< ix-next 0) (1- (length uses)) ix-next))) + (next (nth ix-next uses))) + (goto-char (car next)))))) + (_ (pcase (get-text-property (point) 'racket-xp-def) + (`(,_kind ,_id ((,beg ,_end) . ,_)) (goto-char beg)))))) + +(defun racket-xp-next-use () + "When point is on a use, go to the next, sibling use." + (interactive) + (racket-xp--forward-use 1)) + +(defun racket-xp-previous-use () + "When point is on a use, go to the previous, sibling use." + (interactive) + (racket-xp--forward-use -1)) + +(defun racket-xp-rename () + "Rename a local definition and its uses in the current file." + (interactive) + (pcase-let* + (;; Try to get a def prop and a use prop at point + (def-prop (get-text-property (point) 'racket-xp-def)) + (uses-prop (get-text-property (point) 'racket-xp-use)) + (_ (unless (or uses-prop def-prop) + (user-error "Not a definition or use"))) + ;; OK, we have one of the props. Use it to get the the other one. + (uses-prop (or uses-prop + (pcase-let ((`(,_kind ,_id ((,beg ,_end) . ,_)) def-prop)) + (get-text-property beg 'racket-xp-use)))) + (def-prop (or def-prop + (pcase-let ((`(,beg ,_end) uses-prop)) + (get-text-property beg 'racket-xp-def)))) + (`(,kind ,old-id ,uses-locs) def-prop) + (_ (unless (eq kind 'local) + (user-error "Can only rename local definitions, not imports"))) + (def-loc uses-prop) + (locs (cons def-loc uses-locs)) + (new-id (read-from-minibuffer (format "Rename %s to: " old-id))) + (marker-pairs (mapcar (lambda (loc) + (let ((beg (make-marker)) + (end (make-marker))) + (set-marker beg (nth 0 loc) (current-buffer)) + (set-marker end (nth 1 loc) (current-buffer)) + (list beg end))) + locs)) + (point-marker (let ((m (make-marker))) + (set-marker m (point) (current-buffer))))) + ;; Don't let our after-change hook run until all changes are + ;; made, otherwise check-syntax will find a syntax error. + (let ((inhibit-modification-hooks t)) + (dolist (marker-pair marker-pairs) + (let ((beg (marker-position (nth 0 marker-pair))) + (end (marker-position (nth 1 marker-pair)))) + (delete-region beg end) + (goto-char beg) + (insert new-id)))) + (goto-char (marker-position point-marker)) + (racket-xp-annotate))) + +(defun racket--xp-forward-prop (prop amt) + "Move point to the next or previous occurrence of PROP, if any. +If moved, return the new position, else nil." + ;; Someday/maybe: Handle more than just -1 or 1. + (let ((f (cl-case amt + (-1 #'previous-single-property-change) + ( 1 #'next-single-property-change)))) + (pcase (and f (funcall f (point) prop)) + ((and (pred integerp) pos) + ;; Unless this is where the prop starts, find that. + (unless (get-text-property pos prop) + (setq pos (funcall f pos prop))) + (when pos (goto-char pos)) + pos)))) + +(defun racket-xp-next-definition () + "Move point to the next definition." + (interactive) + (racket--xp-forward-prop 'racket-xp-def 1)) + +(defun racket-xp-previous-definition () + "Move point to the previous definition." + (interactive) + (racket--xp-forward-prop 'racket-xp-def -1)) + +;;; Errors + +(defvar-local racket--xp-errors (vector)) +(defvar-local racket--xp-errors-index 0) + +(defun racket--xp-clear-errors () + (setq racket--xp-errors (vector)) + (setq racket--xp-errors-index 0)) + +(defun racket--xp-add-error (path beg str) + (setq racket--xp-errors + (vconcat racket--xp-errors + (vector (list path beg str))))) + +(defun racket--xp-next-error (&optional amt reset) + "Move AMT errors, if any. + +If there are any check-syntax errors, moves among them, wrapping +around at the first and last errors. + +Otherwise delegate to `compilation-next-error-function' in +`racket-repl-mode'. That way, things still work as you would want +when using `racket-run', e.g. for runtime evaluation errors that +won't be found merely from expansion." + (interactive) + (let ((len (length racket--xp-errors))) + (if (zerop len) + (with-racket-repl-buffer + (compilation-next-error-function amt reset)) + (if reset + (setq racket--xp-errors-index 0) + (setq racket--xp-errors-index + (mod (+ racket--xp-errors-index amt) + len))) + (pcase-let ((`(,path ,pos ,str) + (aref racket--xp-errors + racket--xp-errors-index))) + (cond ((equal path (racket--buffer-file-name)) + (goto-char pos)) + (t + (find-file path) + (goto-char pos))) + (message "%s" str))))) + +(defun racket-xp-next-error () + (interactive) + (racket--xp-next-error 1 nil)) + +(defun racket-xp-previous-error () + (interactive) + (racket--xp-next-error -1 nil)) + +;;; Change hook and idle timer + +(defvar-local racket--xp-annotate-idle-timer nil) + +(defun racket--xp-after-change-hook (_beg _end _len) + (when (timerp racket--xp-annotate-idle-timer) + (cancel-timer racket--xp-annotate-idle-timer)) + (racket--xp-set-status 'outdated) + (when racket-xp-after-change-refresh-delay + (racket--xp-start-idle-timer (current-buffer)))) + +(defun racket--xp-start-idle-timer (buffer) + (setq racket--xp-annotate-idle-timer + (run-with-idle-timer racket-xp-after-change-refresh-delay + nil ;no repeat + #'racket--xp-on-idle-timer + buffer))) + +(defun racket--xp-on-idle-timer (buffer) + "Handle after-change-hook => idle-timer expiration. +If no longer current-buffer, don't annotate at all. Otherwise, if +we detect some completion process is underway, don't annotate +now, set timer to check again later. Why? Typically, if the user +then makes some completion choice, that will edit the buffer, +causing the after-change-hook to run again, and schedule another +idle timer. But just in case they don't, we schedule a retry." + (when (equal buffer (current-buffer)) + (if (racket--xp-completing-p) + (racket--xp-start-idle-timer buffer) + (racket--xp-annotate)))) + +(defun racket--xp-completing-p () + "Is completion underway? +This is ad hoc and forensic." + (or (get-buffer-window "*Completions*") + (and (boundp 'company-pseudo-tooltip-overlay) + company-pseudo-tooltip-overlay))) + +;;; Annotation + +(defun racket-xp-annotate () + "Request the buffer to be analyzed and annotated. + +If you have set `racket-xp-after-change-refresh-delay' to nil -- +or to a very large amount -- you can use this command to annotate +manually." + (interactive) + (racket--xp-annotate + (lambda () ;nudge the cursor-sensor stuff to refresh + (when (and (boundp 'cursor-sensor-mode) cursor-sensor-mode) + (racket--xp-cursor-sensor (selected-window) + (point-min) + 'entered))))) + +(defun racket--xp-annotate (&optional after-thunk) + (racket--xp-set-status 'running) + (racket--cmd/async + nil + `(check-syntax ,(or (racket--buffer-file-name) (buffer-name)) + ,(buffer-substring-no-properties (point-min) (point-max))) + (racket--restoring-current-buffer + (lambda (response) + (racket-show "") + (racket--xp-clear-errors) + (pcase response + (`(check-syntax-ok + (completions . ,completions) + (annotations . ,annotations)) + (racket--xp-clear) + (setq-local racket--xp-binding-completions completions) + (racket--xp-insert annotations) + (racket--xp-set-status 'ok) + (when (and annotations after-thunk) + (funcall after-thunk))) + (`(check-syntax-errors . ,xs) + ;; Don't do full `racket--xp-clear': The old completions and + ;; some old annotations may be helpful to user while editing + ;; to correct the error. However do clear things related to + ;; previous _errors_. + (racket--xp-clear t) + (racket--xp-insert xs) + (racket--xp-set-status 'err))))))) + +(defun racket--xp-insert (xs) + "Insert text properties." + (with-silent-modifications + (overlay-recenter (point-max)) + (dolist (x xs) + (pcase x + (`(error ,path ,beg ,end ,str) + (racket--xp-add-error path beg str) + (when (equal path (racket--buffer-file-name)) + (remove-text-properties + beg end + (list 'help-echo nil + 'racket-xp-def nil + 'racket-xp-use nil + 'cursor-sensor-functions nil)) + (racket--add-overlay beg end racket-xp-error-face) + (add-text-properties + beg end + (list 'help-echo str + 'cursor-sensor-functions (list #'racket--xp-cursor-sensor))))) + (`(info ,beg ,end ,str) + (add-text-properties + beg end + (list 'help-echo str + 'cursor-sensor-functions (list #'racket--xp-cursor-sensor))) + (when (and (string-equal str "no bound occurrences") + (string-match-p racket-xp-highlight-unused-regexp + (buffer-substring beg end))) + (racket--add-overlay beg end racket-xp-unused-face))) + (`(unused-require ,beg ,end) + (add-text-properties + beg end + (list 'help-echo "unused require" + 'cursor-sensor-functions (list #'racket--xp-cursor-sensor))) + (racket--add-overlay beg end racket-xp-unused-face)) + (`(def/uses ,def-beg ,def-end ,req ,id ,uses) + (let ((def-beg (copy-marker def-beg t)) + (def-end (copy-marker def-end t)) + (uses (mapcar (lambda (use) + (mapcar (lambda (pos) + (copy-marker pos t)) + use)) + uses))) + (add-text-properties + (marker-position def-beg) + (marker-position def-end) + (list 'racket-xp-def (list req id uses) + 'cursor-sensor-functions (list #'racket--xp-cursor-sensor))) + (dolist (use uses) + (pcase-let* ((`(,use-beg ,use-end) use)) + (add-text-properties + (marker-position use-beg) + (marker-position use-end) + (append + (list 'racket-xp-use (list def-beg def-end) + 'cursor-sensor-functions (list #'racket--xp-cursor-sensor)) + (when (eq req 'local) + (list 'help-echo "Defined locally")))))))) + (`(external-def ,beg ,end ,path ,subs ,ids) + (add-text-properties + beg end + (list 'racket-xp-visit (list path subs ids)))) + (`(doc ,beg ,end ,path ,anchor) + (add-text-properties + beg end + (list 'racket-xp-doc (list path anchor)))))))) + +(defun racket--xp-clear (&optional only-errors-p) + (with-silent-modifications + (racket--xp-clear-errors) + (racket--remove-overlays-in-buffer racket-xp-error-face) + (unless only-errors-p + (setq-local racket--xp-binding-completions nil) + (racket--remove-overlays-in-buffer racket-xp-def-face + racket-xp-use-face + racket-xp-unused-face) + (remove-text-properties + (point-min) (point-max) + (list 'help-echo nil + 'racket-xp-def nil + 'racket-xp-use nil + 'racket-xp-visit nil + 'racket-xp-doc nil + 'cursor-sensor-functions nil))))) + +;;; Mode line status + +(defvar-local racket--xp-mode-status nil) + +(defun racket--xp-set-status (&optional which) + (setq racket--xp-mode-status which) + (force-mode-line-update)) + +(defun racket--xp-mode-lighter () + (let ((prefix "Rkt")) + (pcase-let* + ((status (and (racket--cmd-open-p) + racket--xp-mode-status)) + (`(,suffix ,face ,help-echo) + (cl-case status + ((ok) '("✓" nil + "Syntax OK")) + ((err) `("✗" (face (:inherit error)) + "Syntax error")) + ((outdated) `("…" nil + "Outdated: Waiting for `racket-xp-after-change-refresh-delay' or manual `racket-xp-annotate'")) + ((running) '("λ" nil + "Getting analysis from Racket Mode back-end and annotating")) + (otherwise '("λ" (face (:strike-through t)) + "Racket Mode back-end not available"))))) + `(" " (:propertize ,(concat prefix suffix) + ,@face + help-echo ,help-echo))))) + +(provide 'racket-xp) + +;; racket-xp.el ends here diff --git a/elpa/racket-mode-20200323.1739/racket-xp.elc b/elpa/racket-mode-20200323.1739/racket-xp.elc new file mode 100644 index 0000000000000000000000000000000000000000..5ce7ff0ca80bd0f1acae199e6d63a0a33b9aba8a GIT binary patch literal 28854 zcmdsg>2@4PmL3)oB1?x_dZuT3IqeA+r3N4&!OF~9K+0`#gG8R@W{}!Opa+Sn1W?V| zR9Qt3-90{j2mkON|MpAx9sCe}5`W*l5t)%y1xRY2ImgH9CaWqkGUCRKyWbnZ&vqZ* z|Hq}JrOIcYeP-?t`=f3z?Z}Vr!0h&uc4pqB4U7H_hjF-OJfz+#MVTy)?^4<$k6b#Z}iW9ghK3 z_2A=d-JB*FR;>6lM`%{$MKJ;IC0K3M-1um7Q?LYNpYva(QrS2>o1{T|*hx)wKd#mA zC%nENh5W)lk^dw1f7JaS4gW{e|IzY(gf;(%KTqh-6LOwft7^U0tWGM4OcxccQpv9(IpUdiXOj-Tr7eo`85d=}~vk70NWEmT8t| zW^$5_)8WzQmC83K>A(!Sy)82w^v*zW?WD(dvYXNoq+?FpplN5@NdL)}kUbt&yoV+T zOa?yaC1V4E z>R{N-&Z=7`OVL1P!k7Sb`=2TsfbR_^u?Pivawq~_cNUD;*KFMQ$ZVTdSOdMyzeUCz z4|_p7I7zaT;B|V|Pex#;d9ow5J-}Zv{?z%Ufj>=tY3;{h4PU|#f7mBPpOAe*^a;@? zYP8*A+x{b=#L|FZ)B?lfbddBh+_B#%f(k7C%G_Fr;68XaSb$UDsuo=#`hEsNfycEO zJPKnh+CvNXLOkC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Uds4#VnQkUs+N!V`CB&yXkT(ug0?-?PuP_kQ!< zZ&g{t-hpSQ_71d**gE{ACg3OS9(+>0$R|d_C+wg7qZ|MBqJvC#frXE!AVxh&Gtbul z#^Sj)ElT$Vg3T4-&rgr~doN40zdpxQ-#mPD|KYjJzuA(8{z$3BgyhnO8TQ2v6H*Md-g{6hrVC@XC_@uI2 zQgLh7R-e=Pz6^G*!Ft%Q-n)lF8E4n?Q_P&1c&d-I>fUQy6W}n408YT;1yIv^jBR81 z8kaCu|M!3YuT@C^RbS}8O7ZNE_!o*cU?u3&|5h~{a@2a`HjDw>t|6ZAaEyOY&b=WP z1z*C26_OK?H~-83u;V_nt+&lL366{*sKhMoK|#i)Sa&HOv(ADX4I7qTuyL|=PHH1n zob!MEPdnw8_I?9*b+)E=_w>?@C*T3YfBPe#GVsymbol label))) + + (define (write-responses-forever) + (elisp-writeln (sync response-channel + debug-notify-channel) + out) + (flush-output out) + (write-responses-forever)) + + ;; With all the pieces defined, let's go: + (thread write-responses-forever) + (elisp-writeln `(ready) out) + (let read-a-command () + (match (elisp-read in) + [(list* nonce sid sexp) (thread (do-command/queue-response nonce sid sexp)) + (read-a-command)] + [(? eof-object?) (void)])) ) + +(define (command-invocation-label nonce sid sexp) + (~v + (list nonce + (if (null? sid) "*" sid) + (let limit-strings ([v sexp]) + (cond [(list? v) (map limit-strings v)] + [(string? v) (~a #:max-width 80 #:limit-marker "⋯" v)] + [else v]))))) + +(define/contract (command sexpr) + (-> pair? any/c) + (define-values (dir file mod-path) (maybe-mod->dir/file/rmp + (current-session-maybe-mod))) + (define path (and dir file (build-path dir file))) + ;; Note: Intentionally no "else" match clause -- let caller handle + ;; exn and supply a consistent exn response format. + (match sexpr + ;; Currently, we're called from `call-with-session-context` which + ;; uses the possibly non-nil session id to look up the possible + ;; REPL session, and set some parameters. That's because I chose + ;; to make the session ID an additional "prefix" parameter for ALL + ;; commands, like the nonce, and just after the nonce (see above). + ;; That was convenient to let call-with-session-context wrap + ;; everything, and not fiddle with individual commands. However. + ;; Only _some_ commands need a valid session ID. It might be + ;; clearer (if more tedious) to make that be an explicit new + ;; argument for only such commands. And for those commands that + ;; already have a "how" argument, instead of supplying 'namespace, + ;; they would supply the session ID. Just in case I do that, + ;; someday, I'm grouping the commands in these three categories, + ;; below. + + ;; Commands that do NOT need a REPL session + [`(no-op) #t] + [`(check-syntax ,path-str ,code) (check-syntax path-str code)] + [`(macro-stepper ,str ,into-base?) (macro-stepper str into-base?)] + [`(macro-stepper/next ,what) (macro-stepper/next what)] + [`(find-collection ,str) (find-collection str)] + [`(module-names) (module-names)] + [`(requires/tidy ,reqs) (requires/tidy reqs)] + [`(requires/trim ,path-str ,reqs) (requires/trim path-str reqs)] + [`(requires/base ,path-str ,reqs) (requires/base path-str reqs)] + + ;; Commands that MIGHT need a REPL session for context (e.g. its + ;; namespace), if their first "how" argument is 'namespace. + [`(def ,how ,str) (find-definition how str)] + [`(def/drr ,how ,path ,subs ,ids) (find-definition/drracket-jump how path subs ids)] + [`(describe ,how ,str) (describe how str)] + [`(doc ,how ,str) (doc how str)] + [`(type ,how ,v) (type how v)] + + ;; Commands that DEFINITELY DO need a REPL session for context, + ;; e.g. its namespace. Should they pass a session-id explicitly, + ;; now? + [`(run ,what ,mem ,pp? ,ctx ,args ,dbg) + (run what mem pp? ctx args dbg)] + [`(path) (or path 'top)] + [`(syms) (syms)] + [`(mod ,sym) (find-module sym (current-session-maybe-mod))] + [`(get-profile) (get-profile)] + [`(get-uncovered) (get-uncovered path)] + [`(eval ,v) (eval-command v)] + [`(repl-submit? ,str ,eos?) (repl-submit? str eos?)] + [`(debug-eval ,src ,l ,c ,p ,code) (debug-eval src l c p code)] + [`(debug-resume ,v) (debug-resume v)] + [`(debug-disable) (debug-disable)] + [`(exit) (exit-repl-session (current-session-id))])) + +;;; A few commands defined here + +(define/contract (repl-submit? text eos) + (-> string? elisp-bool/c (or/c 'default #t #f)) + (if (current-session-submit-pred) + ((current-session-submit-pred) (open-input-string text) (as-racket-bool eos)) + 'default)) + +(define (syms) + (sort (map symbol->string (namespace-mapped-symbols)) + string string? string?) + (define results + (call-with-values (λ () + ((current-eval) (string->namespace-syntax str))) + list)) + (~a (map ~v results) "\n")) + +;;; find-collection + +(define-polyfill (find-collection-dir str) + #:module find-collection/find-collection + (error 'find-collection-dir + "For this to work, you need to `raco pkg install raco-find-collection`")) + +(define/contract (find-collection str) + (-> path-string? (listof string?)) + (map path->string (find-collection-dir str))) diff --git a/elpa/racket-mode-20200323.1739/racket/commands/check-syntax.rkt b/elpa/racket-mode-20200323.1739/racket/commands/check-syntax.rkt new file mode 100644 index 00000000..c0af33a3 --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/commands/check-syntax.rkt @@ -0,0 +1,379 @@ +#lang racket/base + +(require racket/format + (only-in racket/list remove-duplicates) + racket/match + racket/set + racket/class + drracket/check-syntax + ;; drracket/check-syntax does not re-provide build-trace% + (only-in drracket/private/syncheck/traversals + build-trace%) + "../imports.rkt" + "../syntax.rkt" + "../util.rkt") + +(provide check-syntax) + +(module+ test + (require rackunit)) + +;; Our front-end issues check-syntax requests after the user edits a +;; buffer, plus a short idle delay (e.g. 1 second). +;; +;; On complex inputs it can take many seconds to expand and analyze. +;; (By far mostly the expansion; although we do cache expanded syntax, +;; that doesn't always help.) +;; +;; As a result, we might be called to do a path-str for which a +;; previous command thread is still running. Although that will work +;; _correctly_, eventually, it is wasteful -- both here in the +;; back-end (calculating) and in the front-end (updating buffer +;; properties). +;; +;; Instead: We'd like to kill the old command thread and inform our +;; front-end that the old command was "canceled". We can do so here +;; simply by `break-threading`ing the thread already running the +;; command for the same file. +;; +;; How/why this works: See how command-server.rkt handles exn:break by +;; returning a `(break)` response, and, how racket-cmd.el handles that +;; by doing nothing (except cleaning up its nonce->callback +;; hash-table). + +(define check-syntax + (let ([sema (make-semaphore 1)] ;guard concurrent use of ht + [ht (make-hash)]) ;path-str -> thread + (λ (path-str code-str) + (dynamic-wind + (λ () (call-with-semaphore + sema + (λ () + (define (break-thread/log thd) + (log-racket-mode-info "cancel ~v" thd) + (break-thread thd)) + (cond [(hash-ref ht path-str #f) => break-thread/log]) + (hash-set! ht path-str (current-thread))))) + (λ () (do-check-syntax path-str code-str)) + (λ () (call-with-semaphore + sema + (λ () + (hash-remove! ht path-str)))))))) + +;; Note: Instead of using the `show-content` wrapper, we give already +;; fully expanded syntax directly to `make-traversal`. Why? Expansion +;; can be slow. 1. We need exp stx for other purposes here. Dumb to +;; expand twice. 2. We might not even need to expand once, now: +;; string->expanded-syntax maintains a cache. +;; +;; [One nuance of caching expanded syntax is that we also cache the +;; namespace used while expanding -- that needs to be the +;; current-namespace for things like module->imports. Likewise +;; currently-load-relative-directory. That is why +;; string->expanded-syntax uses a "call-with" "continuation style": it +;; sets parameters when calling the continuation function.] + +(define (do-check-syntax path-str code-str) + (define path (string->path path-str)) + (parameterize ([error-display-handler (our-error-display-handler path-str code-str)] + [pre-exn-errors '()]) + (with-handlers ([exn:fail? (handle-fail path-str code-str)]) + (with-time/log (~a "total " path-str) + (string->expanded-syntax path + code-str + (analyze path code-str)))))) + +(define ((analyze path code-str) stx) + (define o (new build-trace% [src path])) + (parameterize ([current-annotations o]) + (define-values (expanded-expression expansion-completed) + (make-traversal (current-namespace) + (current-load-relative-directory))) + (with-time/log 'drracket/check-syntax/expanded-expression + (expanded-expression stx)) + (with-time/log 'drracket/check-syntax/expansion-completed + (expansion-completed))) + (define synchecks (send o get-trace)) + + ;; + ;; Annotations + ;; + + ;; Note: We adjust all positions to 1-based Emacs `point' values. + + ;; I've seen drracket/check-syntax return bogus positions for e.g. + ;; add-mouse-over-status so here's some validation. + (define code-len (string-length code-str)) + (define (valid-pos? pos) (and (<= 0 pos) (< pos code-len))) + (define (valid-beg/end? beg end) + (and (< beg end) (valid-pos? beg) (valid-pos? end))) + + ;; [1] Most syncheck:xxx items we simply transform 1:1. + (define infos + (with-time/log 'infos + (remove-dupes-and-falses + (for/list ([x (in-list synchecks)]) + ;; Give these all a common prefix so we can sort. + (define (item sym beg end . more) + (list* sym (add1 beg) (add1 end) more)) + (match x + [(vector 'syncheck:add-mouse-over-status beg end str) + #:when (valid-beg/end? beg end) + ;; Avoid silly "imported from “\"file.rkt\"”" + (define cleansed (regexp-replace* #px"[“””]" str "")) + (item 'info beg end + cleansed)] + [(vector 'syncheck:add-docs-menu + beg + end + _sym + _ + (app path->string help-path-str) + _anchor + help-anchor-text) + (item 'doc beg end + help-path-str + help-anchor-text)] + [(and (vector 'syncheck:add-jump-to-definition + beg + end + (app symbol->string drracket-id-str) + path + submods) + syncheck) + ;; - drracket/check-syntax only reports the file, not the + ;; position within. We can find that using our + ;; def-in-file. + ;; + ;; - drracket/check-syntax uses identifier-binding which + ;; isn't smart about contracting and/or renaming + ;; provides. As a result, the value of the id here can + ;; be wrong. e.g. For "make-traversal" it will report + ;; "provide/contract-id-make-traversal.1". It's good to + ;; try both ids with def-in-file. + ;; + ;; However, calling def-in-file here/now for all jumps + ;; would be quite slow. Futhermore, a user might not + ;; actually use the jumps -- maybe not any, probably not + ;; most, certainly not all. + ;; + ;; Sound like a job for a thunk, e.g. racket/promise + ;; delay/force? We can't marshal a promise between Racket + ;; back end and Emacs front end. We can do the moral + ;; equivalent: Simply return the info that the front end + ;; should give to the "def/drr" command if/as/when needed. + (cond [(file-exists? path) + (define orig-str (substring code-str beg end)) + (item 'external-def beg end + path + submods + (if (equal? drracket-id-str orig-str) + (list drracket-id-str) + (list drracket-id-str orig-str)))] + [else + ;; https://gist.github.com/greghendershott/5dd59c00f8daa2ce0987ad343244489e + (log-racket-mode-warning "bad path in ~v" syncheck) + #f])] + [(vector 'syncheck:add-unused-require beg end) + (item 'unused-require beg end)] + [_ #f]))))) + + ;; [2] Consolidate the add-arrow/name-dup items into a hash table + ;; with one item per definition. The key is the definition position. + ;; The value is the set of its uses' positions. + (define ht-defs/uses (make-hash)) + (with-time/log 'make-ht-defs/uses + (for ([x (in-list synchecks)]) + (match x + [(or (vector 'syncheck:add-arrow/name-dup + def-beg def-end + use-beg use-end + _ _ req _) + (vector 'syncheck:add-arrow/name-dup/pxpy + def-beg def-end _ _ + use-beg use-end _ _ + _ _ req _)) + (hash-update! ht-defs/uses + (list (substring code-str def-beg def-end) + (match req + ['module-lang 'module-lang] + [#t 'import] + [#f 'local]) + (add1 def-beg) + (add1 def-end)) + (λ (v) (set-add v (list (add1 use-beg) + (add1 use-end)))) + (set))] + [_ #f]))) + ;; Convert the hash table into a list sorted by use positions. + (define defs/uses + (with-time/log 'defs/uses + (for/list ([(def uses) (in-hash ht-defs/uses)]) + (match-define (list sym req def-beg def-end) def) + (list 'def/uses + def-beg def-end + req sym + (sort (set->list uses) < #:key car))))) + + ;; [3] `annotations` = `infos` + `defs/uses` + (define annotations (sort (append infos defs/uses) < #:key cadr)) + + ;; + ;; Completion candidates + ;; + + (define completions-set (mutable-set)) + + ;; [1] Locals. When a definition isn't yet used, there will be no + ;; syncheck:add-arrow annotation because drracket doesn't need to + ;; draw an arrow from something to nothing. There _will_ however be + ;; a "no bound occurrences" mouseover. Although it's hacky to match + ;; on a string like that, it's the best way to get _all_ local + ;; completion candidates. It's the same reason why we go to the work + ;; in imported-completions to find _everything_ imported that + ;; _could_ be used. + (for ([x (in-list synchecks)]) + (match x + [(vector 'syncheck:add-mouse-over-status beg end + (or "no bound occurrences" + (pregexp "^\\d+ bound occurrences?$"))) + #:when (valid-beg/end? beg end) + (set-add! completions-set + (substring code-str beg end))] + [_ (void)])) + + ;; [2] Imports + (with-time/log 'imports + (imports stx completions-set)) + (define completions (sort (set->list completions-set) + string<=?)) + + ;; + ;; Final answer for Emacs front-end + ;; + (list 'check-syntax-ok + (cons 'completions completions) + (cons 'annotations annotations))) + +(define (remove-dupes-and-falses xs) + (remove-duplicates (filter values xs))) + +;; Typed Racket can report multiple errors. The protocol: it calls +;; error-display-handler for each one. There is a final, actual +;; exn:fail:syntax raised, but it's not useful for us: Although its +;; srclocs correspond to the locations, its message is just a summary. +;; Here we collect each message and location in a parameter, and when +;; the final summary exn is raised, we ignore it and use these. Note +;; that Typed Racket is the only such example I'm aware of, but if +;; something else wanted to report multiple errors, and it used a +;; similar approach, we'd handle it here, too. +(define pre-exn-errors (make-parameter '())) +(define ((our-error-display-handler path-str code-str) msg exn) + (when (and (exn:fail:syntax? exn) + (exn:srclocs? exn)) + (pre-exn-errors (append (pre-exn-errors) + (exn->errors path-str code-str exn))))) + +(define ((handle-fail path-str code-str) e) + (cons + 'check-syntax-errors + (cond + ;; Multiple errors. See comment above. + [(not (null? (pre-exn-errors))) + (pre-exn-errors)] + ;; The intended use of exn:srclocs is a _single_ error, with zero + ;; or more locations from least to most specific -- not multiple + ;; errors. + [(exn:srclocs? e) + (exn->errors path-str code-str e)] + ;; A single error with no srcloc at all. Although probably + ;; unlikely with exn:fail:syntax during expansion (as opposed to + ;; runtime errors) do handle it: + [else + (default-errors path-str code-str e)]))) + +(define (exn->errors path-str code-str e) + (define (->path-string v) + (match v + [(? path-string? v) v] + [(? path? v) (path->string v)])) + (match ((exn:srclocs-accessor e) e) + [(list) + (match e + ;; exn:fail:syntax and exn:fail:read can have empty srclocs + ;; list -- but additional struct member has list of syntaxes + ;; from least to most specific. Use the most-specific, only. + [(or (exn:fail:syntax msg _marks (list _ ... stx)) + (exn:fail:read msg _marks (list _ ... stx))) + #:when (not (exn:fail:read:eof? e)) + (define pos (syntax-position stx)) + (define span (syntax-span stx)) + (cond [(and pos span) + (list + (list 'error + (->path-string (or (syntax-source stx) path-str)) + pos + (+ pos span) + msg))] + [else (default-errors path-str code-str e)])] + [_ (default-errors path-str code-str e)])] + [(list _ ... (? srcloc? most-specific)) + (match-define (srcloc path _ _ pos span) most-specific) + (list + (list 'error + (->path-string path) + pos + (+ pos span) + (exn-message e)))] + [_ (default-errors path-str code-str e)])) + +(define (default-errors path-str code-str e) + ;; As a fallback, here, we extract position from the exn-message. + ;; Unfortunately that's line:col and we need to return beg:end. + (define pos (exn-message->pos code-str (exn-message e))) + (list + (list 'error + path-str + pos + (add1 pos) + (exn-message e)))) + +(define (exn-message->pos code-str msg) + (match msg + [(pregexp "^.+?:(\\d+)[:.](\\d+): " + (list _ (app string->number line) (app string->number col))) + (define in (open-input-string code-str)) + (port-count-lines! in) + (let loop ([n 1]) + (cond [(= n line) (+ 1 (file-position in) col)] + [(eof-object? (read-line in)) 1] + [else (loop (add1 n))]))] + [_ 1])) + +(module+ test + (check-equal? + (exn-message->pos "12\n4567\n9" + ; ^ + "/path/to/foo.rkt:2:2: some problem") + 6) + (check-equal? + (exn-message->pos "012\n4567\n9" + ; ^ + "/path/to/foo.rkt:999:2: some problem") + 1)) + +(module+ example + (require racket/file) + (define (check-file path) + (time (do-check-syntax path (file->string path)))) + (check-file (path->string (syntax-source #'here)))) + +(module+ test + (require racket/file) + (define (check-this-file path) + (check-not-exn + (λ () + (time (void (do-check-syntax path (file->string path))))))) + (check-this-file (path->string (syntax-source #'here))) + ;; Again to exercise and test cache + (check-this-file (path->string (syntax-source #'here)))) diff --git a/elpa/racket-mode-20200218.1623/racket/commands/coverage.rkt b/elpa/racket-mode-20200323.1739/racket/commands/coverage.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/commands/coverage.rkt rename to elpa/racket-mode-20200323.1739/racket/commands/coverage.rkt diff --git a/elpa/racket-mode-20200323.1739/racket/commands/describe.rkt b/elpa/racket-mode-20200323.1739/racket/commands/describe.rkt new file mode 100644 index 00000000..346a4067 --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/commands/describe.rkt @@ -0,0 +1,127 @@ +#lang racket/base + +(require racket/contract + racket/format + racket/match + racket/port + (only-in xml xexpr->string) + (only-in "../find.rkt" find-signature) + "../identifier.rkt" + "../scribble.rkt") + +(provide type + describe) + +(module+ test + (require rackunit)) + +;;; type + +(define/contract (type how str) + (-> how/c string? (or/c #f string?)) + (or (and (eq? how 'namespace) + (->identifier 'namespace str type-or-contract)) + (->identifier how str identifier->bluebox) + (match (find-signature how str) + [#f #f] + [x (~a x)]))) + +(define (type-or-contract v) ;any/c -> (or/c #f string?) + (or + ;; 1. Try using Typed Racket's REPL simplified type. + (with-handlers ([exn:fail? (λ _ #f)]) + (match (with-output-to-string + (λ () + ((current-eval) + (cons '#%top-interaction v)))) + [(pregexp "^- : (.*) \\.\\.\\..*\n" (list _ t)) t] + [(pregexp "^- : (.*)\n$" (list _ t)) t])) + ;; 2. Try to find a contract. + (with-handlers ([exn:fail? (λ _ #f)]) + (parameterize ([error-display-handler (λ _ (void))]) + ((current-eval) + (cons '#%top-interaction + `(if (has-contract? ,v) + (~a (contract-name (value-contract ,v))) + (error "")))))))) + +;;; describe + +;; If a symbol has installed documentation, display it. +;; +;; Otherwise, walk the source to find a function definition signature +;; (the argument names may have explanatory value). When using a +;; module->namespace, also look for Typed Racket type or a contract, +;; if any. + +(define/contract (describe how str) + (-> (or/c how/c + (cons/c path-string? string?) + (list/c path-string?)) + string? + string?) + (match how + [(list (? path-string? path)) + (or (path+anchor->html (cons path #f)) + "Documentation not found")] + [(cons (? path-string? path) (? string? anchor)) + (or (path+anchor->html (cons path anchor)) + "Documentation not found")] + [(and (or 'namespace (? path-string?)) how) + (->identifier how str + (λ (stx) + (or (path+anchor->html (binding->path+anchor stx)) + (sig-and/or-type how stx))))])) + +(define/contract (sig-and/or-type how stx) + (-> how/c identifier? string?) + (define dat (syntax->datum stx)) + (define s (match (find-signature how (symbol->string dat)) + [#f #f] + [x (~a x)])) + (define t (and (eq? how 'namespace) + (type-or-contract stx))) + (xexpr->string + `(div () + (h1 () ,(or s (~a dat))) + ,(cond [(not (or s t)) + `(p () + (em () ,(if (eq? how 'namespace) + "(Found no documentation, signature, type, or contract.)" + "(Found no documentation or signature.")))] + [t `(pre () ,t)] + [else ""]) + (br ())))) + +(module+ test + (require rackunit + (only-in xml string->xexpr) + "../syntax.rkt") + ;; Check something that is in the namespace resulting from + ;; module->namespace on, say, this source file. + (parameterize ([current-namespace (module->namespace (syntax-source #'this-file))]) + (check-equal? + ;; Convert back to an xexpr because easier to grok test and also + ;; older xexpr->string probably used
instead of
. + (string->xexpr (describe 'namespace "describe")) + `(div () + (h1 () "(describe how str)") + (pre () "(-" ">" " (or/c (or/c (quote namespace) path-string?) (cons/c path-string? string?) (list/c path-string?)) string? string?)") + (br ())))) + + ;; Check something that is not in the current namespace, but is an + ;; identifier in the lexical context of an expanded module form -- + ;; including imported identifiers -- from the expanded syntax + ;; cache. + (define path-str "/path/to/foobar.rkt") + (define code-str (~a '(module foobar racket/base + (define (fun a b c) + (void))))) + ;; Get the expanded syntax in our cache + (string->expanded-syntax path-str code-str void) + ;; Note that this doesn't find contracts, just sigs. + (check-equal? + (string->xexpr (describe path-str "fun")) + `(div () + (h1 () "(fun a b c)") + (br ())))) diff --git a/elpa/racket-mode-20200218.1623/racket/commands/find-module.rkt b/elpa/racket-mode-20200323.1739/racket/commands/find-module.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/commands/find-module.rkt rename to elpa/racket-mode-20200323.1739/racket/commands/find-module.rkt diff --git a/elpa/racket-mode-20200323.1739/racket/commands/help.rkt b/elpa/racket-mode-20200323.1739/racket/commands/help.rkt new file mode 100644 index 00000000..00ac366a --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/commands/help.rkt @@ -0,0 +1,51 @@ +#lang at-exp racket/base + +(require (only-in scribble/core tag?) + scribble/xref + setup/dirs + setup/xref + net/uri-codec + racket/contract + racket/format + racket/match + "../identifier.rkt") + +(provide doc) + +;; Once upon a time, you could enter commands in the REPL like ",doc". +;; It made sense to open the browser here -- despite needing junk to +;; convince macOS to open a file: URL using anchors a.k.a. fragments. +;; +;; But nowadays? Just return the URL. Let Emacs open the browser. +;; Especially because now check-syntax sometimes returns a help URL, +;; in which case the front end should just open the browser. Given +;; that case, let's always open the browser one consistent way -- in +;; Emacs using browse-url. + +;; We are lazy-required so `delay`-ing would be N/A. +(define xref (load-collections-xref)) + +(define/contract (doc how str) + (-> how/c string? string?) + (or (->identifier how str stx->uri-string) + (search str))) + +(define (stx->uri-string stx) + (~a "file://" + (match (and xref (xref-binding->definition-tag xref stx 0)) + [(? tag? tag) + (define-values (path anchor) (xref-tag->path+anchor xref tag)) + (~a path "#" anchor)] + [_ (search (~a (syntax->datum stx)))]))) + +(define (search str) + (~a (for/or ([f (in-list (list find-user-doc-dir find-doc-dir))]) + (search-dir f)) + "?q=" + (uri-encode str))) + +(define (search-dir f) + (match (f) + [(? path? dir) (define path (build-path dir "search/index.html")) + (and (file-exists? path) (path->string path))] + [_ #f])) diff --git a/elpa/racket-mode-20200323.1739/racket/commands/macro.rkt b/elpa/racket-mode-20200323.1739/racket/commands/macro.rkt new file mode 100644 index 00000000..a8583071 --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/commands/macro.rkt @@ -0,0 +1,169 @@ +#lang racket/base + +(require (only-in macro-debugger/stepper-text + stepper-text) + racket/contract + racket/file + racket/format + racket/match + (only-in racket/path + path-only) + racket/pretty + racket/system + "../elisp.rkt" + "../repl.rkt" + "../syntax.rkt" + "../util.rkt") + +(provide macro-stepper + macro-stepper/next) + +(define step/c (cons/c (or/c 'original string? 'final) string?)) +(define step-proc/c (-> (or/c 'next 'all) (listof step/c))) +(define step-proc #f) + +(define/contract (make-expr-stepper str) + (-> string? step-proc/c) + (unless (current-session-id) + (error 'make-expr-stepper "Does not work without a running REPL")) + (define step-num #f) + (define last-stx (string->namespace-syntax str)) + (define/contract (step what) step-proc/c + (cond [(not step-num) + (set! step-num 0) + (list (cons 'original + (pretty-format-syntax last-stx)))] + [else + (define result + (let loop () + (define this-stx (expand-once last-stx)) + (cond [(equal? (syntax->datum last-stx) + (syntax->datum this-stx)) + (cond [(eq? what 'all) + (list (cons 'final + (pretty-format-syntax this-stx)))] + [else (list)])] + [else + (set! step-num (add1 step-num)) + (define step + (cons (~a step-num ": expand-once") + (diff-text (pretty-format-syntax last-stx) + (pretty-format-syntax this-stx) + #:unified 3))) + (set! last-stx this-stx) + (cond [(eq? what 'all) (cons step (loop))] + [else (list step)])]))) + (match result + [(list) (list (cons 'final + (pretty-format-syntax last-stx)))] + [v v])])) + step) + +(define/contract (make-file-stepper path into-base?) + (-> (and/c path-string? absolute-path?) boolean? step-proc/c) + (assert-file-stepper-works) + (define stx (file->syntax path)) + (define dir (path-only path)) + (define ns (make-base-namespace)) + (define raw-step (parameterize ([current-load-relative-directory dir] + [current-namespace ns]) + (stepper-text stx + (if into-base? (λ _ #t) (not-in-base))))) + (define step-num #f) + (define step-last-after "") + (log-racket-mode-debug "~v ~v ~v" path into-base? raw-step) + (define/contract (step what) step-proc/c + (cond [(not step-num) + (set! step-num 0) + (list (cons 'original + (pretty-format-syntax stx)))] + [else + (define out (open-output-string)) + (cond [(parameterize ([current-output-port out]) + (raw-step what)) + (log-racket-mode-debug "~v" (get-output-string out)) + (define in (open-input-string (get-output-string out))) + (let loop () + (match (parameterize ([current-input-port in]) + (read-step)) + [(? eof-object?) + (cond [(eq? what 'all) + (list (cons 'final step-last-after))] + [else (list)])] + [(list title before after) + (set! step-num (add1 step-num)) + (set! step-last-after after) + (cons (cons (~a step-num ": " title) + (diff-text before after #:unified 3)) + (loop))]))] + [else + (list (cons 'final step-last-after))])])) + step) + +(define (read-step) + (define title (read-line)) + (define before (read)) + (define _arrow (read)) ; '==> + (define after (read)) + (read-line) + (match (read-line) + [(? eof-object? e) e] + [_ (list title + (pretty-format #:mode 'write before) + (pretty-format #:mode 'write after))])) + +(define (assert-file-stepper-works) + (define step (stepper-text #'(module example racket/base 42))) + (unless (step 'next) + (error 'macro-debugger/stepper-text + "does not work in your version of Racket.\nPlease try an older or newer version."))) + +(define/contract (macro-stepper what into-base?) + (-> (or/c (cons/c 'expr string?) (cons/c 'file path-string?)) elisp-bool/c + (list/c step/c)) + (set! step-proc + (match what + [(cons 'expr str) (make-expr-stepper str)] + [(cons 'file path) (make-file-stepper path (as-racket-bool into-base?))])) + (macro-stepper/next 'next)) + +(define/contract (macro-stepper/next what) step-proc/c + (unless step-proc + (error 'macro-stepper "Nothing to expand")) + (define v (step-proc what)) + (match v + [(list (cons 'final _)) (set! step-proc #f)] + [_ (void)]) + v) + +;; Borrowed from xrepl. +(define not-in-base + (λ () (let ([base-stxs #f]) + (unless base-stxs + (set! base-stxs ; all ids that are bound to a syntax in racket/base + (parameterize ([current-namespace (make-base-namespace)]) + (let-values ([(vals stxs) (module->exports 'racket/base)]) + (map (λ (s) (namespace-symbol->identifier (car s))) + (cdr (assq 0 stxs))))))) + (λ (id) (not (ormap (λ (s) (free-identifier=? id s)) base-stxs)))))) + +(define (diff-text before-text after-text #:unified [-U 3]) + (define template "racket-mode-syntax-diff-~a") + (define (make-temporary-file-with-text str) + (define file (make-temporary-file template)) + (with-output-to-file file #:mode 'text #:exists 'replace + (λ () (displayln str))) + file) + (define before-file (make-temporary-file-with-text before-text)) + (define after-file (make-temporary-file-with-text after-text)) + (define out (open-output-string)) + (begin0 (parameterize ([current-output-port out]) + (system (format "diff -U ~a ~a ~a" -U before-file after-file)) + (match (get-output-string out) + ["" " \n"] + [(pregexp "\n(@@.+@@\n.+)$" (list _ v)) v])) + (delete-file before-file) + (delete-file after-file))) + +(define (pretty-format-syntax stx) + (pretty-format #:mode 'write (syntax->datum stx))) diff --git a/elpa/racket-mode-20200323.1739/racket/commands/module-names.rkt b/elpa/racket-mode-20200323.1739/racket/commands/module-names.rkt new file mode 100644 index 00000000..9890cd36 --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/commands/module-names.rkt @@ -0,0 +1,90 @@ +#lang racket/base + +(require racket/contract + racket/match + racket/set + racket/string + (only-in "../util.rkt" + path-has-extension? + path-replace-extension)) + +(provide module-names) + +(struct collection + (maybe-prefix ;(or/c #f string?) when a rktd link entry starts with a string + path)) ;path? + +(define (module-names) + (define results (mutable-set)) + (for ([coll (in-set (collections))]) + (define top (collection-path coll)) + (when (safe-directory-exists? top) + (parameterize ([current-directory top]) + (for ([raw-p (in-directory #f use?)]) + (define p (maybe-prefix-path-for-collection coll raw-p)) + (define-values (base name dir?) (split-path p)) + (define name-str (path->string name)) + (when (and (use? p) + (or dir? + (path-has-extension? p #"rkt") + (path-has-extension? p #"ss"))) + (define v (path->string + ;; path/to/main.rkt => path/to + (match (explode-path p) + [(list xs ..1 (== (build-path "main.rkt"))) + (apply build-path xs)] + [_ (path-replace-extension p #"")]))) + (set-add! results v)))))) + (sort (set->list results) + stringstring name)) + (and (not (string-prefix? name-str ".")) + (not (member name-str '("compiled" + "info.rkt" + "private" + "scribblings" + "tests"))))) + +(define (collections) + (define results (mutable-set)) + (for ([link-file (in-list (current-library-collection-links))]) + (cond [link-file + (when (file-exists? link-file) + (define-values (base name dir?) (split-path link-file)) + (match (with-handlers ([exn:fail? (λ (x) '())]) + (call-with-input-file link-file read)) + [(? list? vs) + (for ([v (in-list vs)]) + (when (if (and (list? v) (= 3 (length v))) + (and (regexp? (list-ref v 2)) + (regexp-match (list-ref v 2) (version))) + #t) + (define prefix (if (string? (list-ref v 0)) + (list-ref v 0) + #f)) + (define path (simplify-path + (if (relative-path? (list-ref v 1)) + (build-path base (list-ref v 1)) + (list-ref v 1)))) + (set-add! results + (collection prefix + path))))] + [_ (void)]))] + [else + (for ([p (in-list (current-library-collection-paths))]) + (set-add! results (collection #f + (simplify-path p))))])) + results) + +(define (maybe-prefix-path-for-collection coll path) + (if (collection-maybe-prefix coll) + (build-path (collection-maybe-prefix coll) path) + path)) + +(define/contract (safe-directory-exists? d) + (-> path-string? boolean?) + (with-handlers ([exn:fail? (λ (x) #f)]) + (directory-exists? d))) diff --git a/elpa/racket-mode-20200218.1623/racket/commands/profile.rkt b/elpa/racket-mode-20200323.1739/racket/commands/profile.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/commands/profile.rkt rename to elpa/racket-mode-20200323.1739/racket/commands/profile.rkt diff --git a/elpa/racket-mode-20200218.1623/racket/commands/requires.rkt b/elpa/racket-mode-20200323.1739/racket/commands/requires.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/commands/requires.rkt rename to elpa/racket-mode-20200323.1739/racket/commands/requires.rkt diff --git a/elpa/racket-mode-20200218.1623/racket/debug-annotator.rkt b/elpa/racket-mode-20200323.1739/racket/debug-annotator.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/debug-annotator.rkt rename to elpa/racket-mode-20200323.1739/racket/debug-annotator.rkt diff --git a/elpa/racket-mode-20200218.1623/racket/debug.rkt b/elpa/racket-mode-20200323.1739/racket/debug.rkt similarity index 94% rename from elpa/racket-mode-20200218.1623/racket/debug.rkt rename to elpa/racket-mode-20200323.1739/racket/debug.rkt index d3a9c4f5..f1d834e7 100644 --- a/elpa/racket-mode-20200218.1623/racket/debug.rkt +++ b/elpa/racket-mode-20200323.1739/racket/debug.rkt @@ -4,17 +4,15 @@ gui-debugger/marks racket/contract racket/format - racket/lazy-require racket/list racket/match + (only-in racket/path path-only) racket/set - racket/string syntax/modread + "debug-annotator.rkt" "interactions.rkt" "util.rkt") -(lazy-require ["debug-annotator.rkt" (annotate-for-single-stepping)]) - (module+ test (require rackunit)) @@ -23,12 +21,7 @@ debug-resume debug-disable make-debug-eval-handler - next-break - set-debug-repl-namespace!) - -(define debug-repl-ns (make-base-namespace)) -(define (set-debug-repl-namespace! ns) - (set! debug-repl-ns ns)) + next-break) ;; A gui-debugger/marks "mark" is a thunk that returns a ;; full-mark-struct -- although gui-debugger/marks doesn't provide @@ -111,13 +104,12 @@ ;; Start a debug repl on its own thread, because below we're going to ;; block indefinitely with (channel-get on-resume-channel), waiting for ;; the Emacs front end to issue a debug-resume command. - (define repl-thread (parameterize ([current-namespace debug-repl-ns]) - (thread (repl src pos top-mark)))) + (define repl-thread (thread (repl src pos top-mark))) ;; The on-break-channel is how we notify the Emacs front-end. This ;; is a synchronous channel-put but it should return fairly quickly, - ;; as soon as the TCP command server gets and writes it. In other - ;; words, this is sent as a notification, unlike a command response - ;; as a result of a request. + ;; as soon as the command server gets and writes it. In other words, + ;; this is sent as a notification, unlike a command response as a + ;; result of a request. (define this-break-id (new-break-id)) ;; If it is not possible to round-trip serialize/deserialize the ;; values, use the original values when stepping (don't attempt to @@ -190,6 +182,7 @@ (cons src right)))) 'all)) (match* [break-when before/after] + [['none _] 'none] [['all _] 'all] [['out _] (big-step (debug-marks ccm))] [['over 'before] (big-step (cons top-mark (debug-marks ccm)))] @@ -208,7 +201,6 @@ (-> continuation-mark-set? (listof mark/c)) (continuation-mark-set->list ccm debug-key)) - ;;; Debug REPL (define ((repl src pos top-mark)) @@ -244,7 +236,7 @@ (identifier? #'id) (hash-has-key? ht (syntax->datum #'id))) (let ([set (hash-ref ht (syntax->datum #'id))] - [v (eval #'e debug-repl-ns)]) + [v (eval #'e)]) (set v) #`(void))] ;; Wrap stx in a let-syntax form with a make-set!-transformer for @@ -332,15 +324,13 @@ (eval-syntax (annotate (expand-syntax top-stx))))] [else (orig-eval top-stx)])])) -;; This never seems to be called ??? (define (load-module/annotate file m) (display-commented (format "~v" `(load-module/annotate ,file ,m))) - (define-values (base _ __) (split-path file)) (call-with-input-file* file (λ (in) (port-count-lines! in) (parameterize ([read-accept-compiled #f] - [current-load-relative-directory base]) + [current-load-relative-directory (path-only file)]) (with-module-reading-parameterization (λ () (define e (parameterize ([current-namespace (make-base-namespace)]) diff --git a/elpa/racket-mode-20200218.1623/racket/elisp.rkt b/elpa/racket-mode-20200323.1739/racket/elisp.rkt similarity index 73% rename from elpa/racket-mode-20200218.1623/racket/elisp.rkt rename to elpa/racket-mode-20200323.1739/racket/elisp.rkt index 917ca652..c7892cb5 100644 --- a/elpa/racket-mode-20200218.1623/racket/elisp.rkt +++ b/elpa/racket-mode-20200323.1739/racket/elisp.rkt @@ -3,8 +3,7 @@ (require racket/contract racket/match racket/port - racket/set - racket/string) + racket/set) (provide elisp-read elisp-writeln @@ -40,15 +39,15 @@ (define (racket->elisp v) (match v - [(or #f (list)) 'nil] - [#t 't] - [(? list? xs) (map racket->elisp xs)] - [(cons x y) (cons (racket->elisp x) (racket->elisp y))] - [(? path? v) (path->string v)] - [(? hash? v) (for/list ([(k v) (in-hash v)]) - (cons (racket->elisp k) (racket->elisp v)))] - [(? set? v) (map racket->elisp (set->list v))] - [v v])) + [(or #f (list)) 'nil] + [#t 't] + [(? list? xs) (map racket->elisp xs)] + [(cons x y) (cons (racket->elisp x) (racket->elisp y))] + [(? path? v) (path->string v)] + [(? hash? v) (for/list ([(k v) (in-hash v)]) + (cons (racket->elisp k) (racket->elisp v)))] + [(? generic-set? v) (map racket->elisp (set->list v))] + [v v])) (module+ test (require rackunit) diff --git a/elpa/racket-mode-20200218.1623/racket/error.rkt b/elpa/racket-mode-20200323.1739/racket/error.rkt similarity index 79% rename from elpa/racket-mode-20200218.1623/racket/error.rkt rename to elpa/racket-mode-20200323.1739/racket/error.rkt index fa78e3ed..6269ca7d 100644 --- a/elpa/racket-mode-20200218.1623/racket/error.rkt +++ b/elpa/racket-mode-20200323.1739/racket/error.rkt @@ -1,6 +1,8 @@ #lang at-exp racket/base -(require racket/format +(require (only-in pkg/db get-catalogs) + (only-in pkg/lib pkg-catalog-suggestions-for-module) + racket/format racket/match (only-in racket/path path-only) racket/runtime-path @@ -111,8 +113,17 @@ ;; `fully-qualify-error-path`. Here we handle only strings we create ;; ourselves, such as for the Context "stack trace". (define (source-location->string x) - (match-define (srcloc src line col pos span) x) - (format "~a:~a:~a" src (or line "1") (or col "1"))) + (define src + ;; Although I want to find/fix this properly upstream -- is + ;; something a path-string? when it should be a path? -- for now + ;; just catch here the case where the source is a string like + ;; "\"/path/to/file.rkt\"" i.e. in quotes. + (match (srcloc-source x) + [(pregexp "^\"(.+)\"$" (list _ unquoted)) unquoted] + [v v])) + (define line (or (srcloc-line x) "1")) + (define col (or (srcloc-column x) "1")) + (format "~a:~a:~a" src line col)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -171,40 +182,28 @@ '()))) (check-equal? (get-output-string o) ""))) -(define maybe-suggest-packages - (with-handlers ([exn:fail? (λ _ void)]) - (with-dynamic-requires ([racket/base exn:missing-module?] - [racket/base exn:missing-module-accessor] - [pkg/db get-catalogs] - [pkg/lib pkg-catalog-suggestions-for-module]) - (λ (exn) - (when (exn:missing-module? exn) - (match (get-catalogs) - [(list) - (display-commented - @~a{----- - Can't suggest packages to install, because pkg/db get-catalogs is '(). - To configure: - 1. Start DrRacket. - 2. Choose "File | Package Mananger". - 3. Click "Available from Catalog". - 4. When prompted, click "Update". - -----})] - [_ - (define mod ((exn:missing-module-accessor exn) exn)) - (match (pkg-catalog-suggestions-for-module mod) - [(list) void] - [(list p) - (display-commented - @~a{Try "raco pkg install @|p|" ?})] - [(? list? ps) - (display-commented - @~a{Try "raco pkg install" one of @(string-join ps ", ") ?})] - [_ void])])))))) +(define (maybe-suggest-packages exn) + (when (exn:missing-module? exn) + (match (get-catalogs) + [(list) + (display-commented + @~a{----- + Can't suggest packages to install, because pkg/db get-catalogs is '(). + To configure: + 1. Start DrRacket. + 2. Choose "File | Package Manager". + 3. Click "Available from Catalog". + 4. When prompted, click "Update". + -----})] + [_ + (define mod ((exn:missing-module-accessor exn) exn)) + (match (pkg-catalog-suggestions-for-module mod) + [(list) void] + [(list p) + (display-commented + @~a{Try "raco pkg install @|p|" ?})] + [(? list? ps) + (display-commented + @~a{Try "raco pkg install" one of @(string-join ps ", ") ?})] + [_ void])]))) -(module+ test - ;; Point of this test is older Rackets where the with-handlers - ;; clause is exercised. - (check-not-exn - (λ () - (maybe-suggest-packages (exn:fail "" (current-continuation-marks)))))) diff --git a/elpa/racket-mode-20200218.1623/racket/example/example.rkt b/elpa/racket-mode-20200323.1739/racket/example/example.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/example/example.rkt rename to elpa/racket-mode-20200323.1739/racket/example/example.rkt diff --git a/elpa/racket-mode-20200218.1623/racket/example/example.rkt.faceup b/elpa/racket-mode-20200323.1739/racket/example/example.rkt.faceup similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/example/example.rkt.faceup rename to elpa/racket-mode-20200323.1739/racket/example/example.rkt.faceup diff --git a/elpa/racket-mode-20200218.1623/racket/example/indent.rkt b/elpa/racket-mode-20200323.1739/racket/example/indent.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/example/indent.rkt rename to elpa/racket-mode-20200323.1739/racket/example/indent.rkt diff --git a/elpa/racket-mode-20200218.1623/racket/example/indent.rkt.faceup b/elpa/racket-mode-20200323.1739/racket/example/indent.rkt.faceup similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/example/indent.rkt.faceup rename to elpa/racket-mode-20200323.1739/racket/example/indent.rkt.faceup diff --git a/elpa/racket-mode-20200218.1623/racket/find-module-path-completions.rkt b/elpa/racket-mode-20200323.1739/racket/find-module-path-completions.rkt similarity index 76% rename from elpa/racket-mode-20200218.1623/racket/find-module-path-completions.rkt rename to elpa/racket-mode-20200323.1739/racket/find-module-path-completions.rkt index 0d619c23..c1f4bad1 100644 --- a/elpa/racket-mode-20200218.1623/racket/find-module-path-completions.rkt +++ b/elpa/racket-mode-20200323.1739/racket/find-module-path-completions.rkt @@ -19,7 +19,8 @@ ;;; devoted to this. For example "HELLO?\n" => "OK\n\n" / "ERROR\n\n". ;;; Thereafter the status quo loop.) -(require racket/match) +(require racket/match + "util.rkt") (module+ main (define dir (current-directory)) ;FIXME: Get from command-line @@ -33,13 +34,12 @@ (loop))) (exit 0)) +(define-polyfill (find-module-path-completions dir) + #:module drracket/find-module-path-completions + (λ (_str) (list))) (define (init dir) - (with-handlers ([exn:fail? (λ _ (λ _ (void)))]) - ;; (error 'test-error) ;<- un-comment this to exercise failure path - (define fmpc (dynamic-require 'drracket/find-module-path-completions - 'find-module-path-completions)) - (define get (fmpc dir)) - (λ (str) - (for ([x (in-list (get str))]) - (displayln (path->string (cadr x))))))) + (define get (find-module-path-completions dir)) + (λ (str) + (for ([x (in-list (get str))]) + (displayln (path->string (cadr x)))))) diff --git a/elpa/racket-mode-20200323.1739/racket/find.rkt b/elpa/racket-mode-20200323.1739/racket/find.rkt new file mode 100644 index 00000000..d481aa37 --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/find.rkt @@ -0,0 +1,338 @@ +#lang racket/base + +(require racket/contract + (only-in racket/function curry) + racket/list + racket/match + "identifier.rkt" + "syntax.rkt") + +(provide find-definition + find-definition/drracket-jump + find-signature) + +(module+ test + (require rackunit + racket/format)) + +;; Note: Unfortunately identifier-binding can't report the definition +;; id in the case of a contract-out and a rename-out, both. For +;; `(provide (contract-out [rename orig new contract]))` +;; identifier-binding reports (1) the contract wrapper as the id, and +;; (2) `new` as the nominal-id -- but NOT (3) `orig`. We handle such +;; cases; see `find-def-in-file` and its use of `$renaming-provde`, +;; below. +;; +;; Another tricky case: "foo" is defined in def.rkt. repro.rkt +;; requires def.rkt and re-provides "foo" using contract-out. When +;; user.rkt requires repro.rkt, identifier-binding will report "foo" +;; the id (yay!) but report the defining file is repro.rkt -- not +;; def.rkt (boo!). We handle such cases. + +(define location/c (list/c path-string? natural-number/c natural-number/c)) + +;; Try to find a definition, using as a head start information +;; supplied by drracket/check-syntax. It did the "fast" work for all +;; uses (calling identifier-binding) and we recorded that answer to +;; give the front end. If the user wants to visit any of those, the +;; front end gives us that info, and we do the "slow" work. +(define/contract (find-definition/drracket-jump how-path src-path submods id-strs) + (-> (and/c how/c (not/c 'namespace)) path-string? (listof symbol?) (listof string?) + (or/c #f 'kernel location/c)) + (or (for/or ([id-str (in-list id-strs)]) + (match (find-def-in-file (string->symbol id-str) how-path src-path submods) + [(list stx path _submods) + (list (->path-string (or (syntax-source stx) path)) + (or (syntax-line stx) 1) + (or (syntax-column stx) 0))] + [v v])) + ;; Handle possible re-provide with a contract: Try again + ;; starting with that other src-path. i.e. Do automatically what + ;; the user could: Open that file, and try visit-definition + ;; again, there. from that. + (and (not (path-string-equal? how-path src-path)) + (for/or ([id-str (in-list id-strs)]) + (find-definition src-path id-str))) + ;; As a final fallback, return the reported file:1:0. At least + ;; give user a head start. + (list src-path 1 0))) + +;; Try to find a definition. +(define/contract (find-definition how str) + (-> how/c string? + (or/c #f 'kernel location/c)) + (match (find-def how str) + [(list stx path _submods) + (list (->path-string (or (syntax-source stx) path)) + (or (syntax-line stx) 1) + (or (syntax-column stx) 0))] + [v v])) + +;; Try to find the definition of `str`, returning its signature or #f. +;; When defined in 'kernel, returns a form saying so, not #f. +(define/contract (find-signature how str) + (-> how/c string? + (or/c #f pair?)) + (match (find-def how str) + ['kernel '("defined in #%kernel, signature unavailable")] + [(list id-stx path submods) + (get-syntax how path + (λ (mod-stx) + (match ($signature (syntax-e id-stx) + (submodule-syntax submods mod-stx)) + [(? syntax? stx) (syntax->datum stx)] + [_ #f])))] + [v v])) + +(define stx+path+mods/c (list/c syntax? path-string? (listof symbol?))) + +(define/contract (find-def how str) + (-> how/c string? + (or/c #f 'kernel stx+path+mods/c)) + (->identifier-resolved-binding-info + how str + (λ (results) + (match results + [(? list? bindings) + (or (for/or ([x (in-list (remove-duplicates bindings))]) + (match x + [(cons _id 'kernel) 'kernel] + [(list* id path submods) (find-def-in-file id how path submods)])) + ;; Handle possible re-provide with a contract: Try again + ;; starting with that other src-path. i.e. Automatically + ;; do what the user could: Open that file, and try + ;; visit-definition again, there. + (match results + [(list (list* src-id src-path src-subs) + (list* nom-id _)) + (or (and (or (equal? how 'namespace) + (not (path-string-equal? how src-path))) + (for/or ([id (in-list (list src-id nom-id))]) + (find-def (path->string src-path) (symbol->string id)))) + ;; As a final fallback, return the reported + ;; file:1:0. At least give user a head start. + (list (datum->syntax #f src-id (list src-path 1 0 #f #f)) + src-path + '()))] + [_ #f]))] + [_ #f])))) + +(define/contract (find-def-in-file id-sym how path submods) + (-> symbol? how/c path-string? (listof symbol?) + (or/c #f stx+path+mods/c)) + (define subs (curry submodule-syntax submods)) + (match (or (get-expanded-syntax + how path + (λ (stx) + ($definition id-sym (subs stx)))) + (get-syntax + how path + (λ (stx) + (match ($renaming-provide id-sym (subs stx)) + [(? identifier? id) + (define id-sym (syntax-e id)) + (get-expanded-syntax + how path + (λ (stx) + ($definition id-sym (subs stx))))] + [_ #f])))) + [(? syntax? stx) (list stx path submods)] + [_ #f])) + +;; Given a submodule path as a list of symbols, and the syntax for a +;; file's entire module form: Return the (sub)module contents as +;; #'(begin . contents). +(define/contract (submodule-syntax sub-mod-syms stx) + (-> (listof symbol?) syntax? (or/c #f syntax?)) + ;; Prepend #f as the outermost module name to match, meaning "any". + (sub-stx (cons #f sub-mod-syms) stx)) + +(define (sub-stx mods stx) + (match-define (cons this more) mods) + (define (subs stxs) + (if (empty? more) + #`(begin . #,stxs) + (ormap (λ (stx) (sub-stx more stx)) + (syntax->list stxs)))) + (syntax-case* stx (module #%module-begin) syntax-e-eq? + [(module name _ (#%module-begin . stxs)) + (or (not this) (eq? this (syntax-e #'name))) + (subs #'stxs)] + [(module name _ . stxs) + (or (not this) (eq? this (syntax-e #'name))) + (subs #'stxs)] + [_ #f])) + +(module+ test + (check-equal? (syntax->datum + (submodule-syntax '(a b c) + #'(module file racket + (module a racket + (module not-b racket #f) + (module b racket + (module not-c racket #f) + (module c racket "bingo") + (module not-c racket #f)) + (module not-b racket #f))))) + '(begin "bingo"))) + +;; Given a symbol and syntax, return syntax corresponding to the +;; definition. Intentionally does NOT walk into module forms, so, give +;; us the module bodies wrapped in begin. +;; +;; If `stx` is expanded we can find things defined via definer +;; macros. +;; +;; If `stx` is not expanded, we will miss some things, however the +;; syntax will be closer to what a human expects -- e.g. `(define (f +;; x) x)` instead of `(define-values (f) (lambda (x) x))`. +(define ($definition sym stx) ;;symbol? syntax? -> syntax? + (define eq-sym? (make-eq-sym? sym)) + ;; This is a hack to handle definer macros that neglect to set + ;; srcloc properly using syntax/loc or (format-id ___ #:source __): + ;; If the stx lacks srcloc and its parent stx has srcloc, return the + ;; parent stx instead. Caveats: 1. Assumes caller only cares about + ;; the srcloc. 2. We only check immediate parent. 3. We only use + ;; this for define-values and define-syntaxes, below, on the + ;; assumption that this only matters for fully-expanded syntax. + (define (loc s) + (if (and (not (syntax-line s)) + (syntax-line stx)) + stx + s)) + (syntax-case* stx + (begin define-values define-syntaxes + define define/contract + define-syntax struct define-struct) + syntax-e-eq? + [(begin . stxs) (ormap (λ (stx) ($definition sym stx)) + (syntax->list #'stxs))] + [(define (s . _) . _) (eq-sym? #'s) stx] + [(define/contract (s . _) . _) (eq-sym? #'s) stx] + [(define s . _) (eq-sym? #'s) stx] + [(define-values (ss ...) . _) (ormap eq-sym? (syntax->list #'(ss ...))) + (loc (ormap eq-sym? (syntax->list #'(ss ...))))] + [(define-syntax (s . _) . _) (eq-sym? #'s) stx] + [(define-syntax s . _) (eq-sym? #'s) stx] + [(define-syntaxes (ss ...) . _) (ormap eq-sym? (syntax->list #'(ss ...))) + (loc (ormap eq-sym? (syntax->list #'(ss ...))))] + [(define-struct s . _) (eq-sym? #'s) stx] + [(define-struct (s _) . _) (eq-sym? #'s) stx] + [(struct s . _) (eq-sym? #'s) stx] + [(struct (s _) . _) (eq-sym? #'s) stx] + [_ #f])) + +;; Given a symbol and syntax, return syntax corresponding to the +;; function definition signature. The input syntax should NOT be +;; `expand`ed. This intentionally does NOT walk into module forms, so, +;; give us the module bodies wrapped in begin. +(define ($signature sym stx) ;;symbol? syntax? -> (or/c #f list?) + (define eq-sym? (make-eq-sym? sym)) + (syntax-case* stx (begin define define/contract case-lambda) syntax-e-eq? + [(begin . stxs) (ormap (λ (stx) ($signature sym stx)) + (syntax->list #'stxs))] + [(define (s . as) . _) (eq-sym? #'s) #'(s . as)] + [(define/contract (s . as) . _) (eq-sym? #'s) #'(s . as)] + [(define s (case-lambda [(ass ...) . _] ...)) (eq-sym? #'s) #'((s ass ...) ...)] + [_ #f])) + +;; Find sym in a contracting and/or renaming provide, and return the +;; syntax for the ORIGINAL identifier (before being contracted and/or +;; renamed). The input syntax should NOT be expanded. +(define ($renaming-provide sym stx) ;;symbol? syntax? -> syntax? + (define eq-sym? (make-eq-sym? sym)) + (syntax-case* stx (begin provide provide/contract) syntax-e-eq? + [(begin . stxs) + (ormap (λ (stx) ($renaming-provide sym stx)) + (syntax->list #'stxs))] + [(provide/contract . stxs) + (for/or ([stx (syntax->list #'stxs)]) + (syntax-case stx () + [(s _) (eq-sym? #'s)] + [_ #f]))] + [(provide . stxs) + (for/or ([stx (syntax->list #'stxs)]) + (syntax-case* stx (contract-out rename-out) syntax-e-eq? + [(contract-out . stxs) + (for/or ([stx (syntax->list #'stxs)]) + (syntax-case* stx (rename) syntax-e-eq? + [(rename orig s _) (eq-sym? #'s) #'orig] + [(s _) (eq-sym? #'s) #'s] + [_ #f]))] + [(rename-out . stxs) + (for/or ([stx (syntax->list #'stxs)]) + (syntax-case* stx () syntax-e-eq? + [(orig s) (eq-sym? #'s) #'orig] + [_ #f]))] + [_ #f]))] + [_ #f])) + +(module+ test + ;; Just a quick smoke test. See test/find.rkt for many more tests. + ;; + ;; Exercise where the "how" is a path-string, meaning look up that + ;; path from our cache, not on disk. + (let ([path-str "/tmp/x.rkt"] + [code-str (~a `(module x racket/base + (define (module-function-binding x y z) (+ 1 x)) + (define module-variable-binding 42)))]) + (string->expanded-syntax path-str code-str void) + (check-equal? (find-signature path-str "module-function-binding") + '(module-function-binding x y z)) + (check-equal? (find-definition path-str "module-function-binding") + `(,path-str 1 31)) + (check-equal? (find-definition path-str "module-variable-binding") + `(,path-str 1 79))) + ;; Exercise the "make-traversal" scenario described in comments + ;; above. + (let ([path-str "/tmp/x.rkt"] + [code-str (~a `(module x racket/base + (require drracket/check-syntax) + "make-traversal"))]) + (string->expanded-syntax path-str code-str void) + (check-match (find-definition path-str "make-traversal") + (list (pregexp "private/syncheck/traversals.rkt$") _ _)))) + +;; These `get-syntax` and `get-expanded-syntax` functions handle where +;; we get the syntax. +;; +;; The special case is when `how` is a path-string. That path doesn't +;; necessarily exist as a file, or the file may be outdated. The path +;; may simply be the syntax-source for a string from an unsaved Emacs +;; buffer. So when we need to get syntax for such a path, we need to +;; get it from our cache -- NOT from a file. (How it got in the cache +;; previously was from some check-syntax.) +;; +;; Things like identifier-binding may tell us to look at such a path, +;; or at a path for a real existing/updated file. This helps sort out +;; the various cases. + +(define (get-syntax how path-str k) + (match how + ['namespace (file->syntax path-str k)] + [(? path-string? how-path) (if (path-string-equal? path-str how-path) + (path->existing-syntax path-str k) + (file->syntax path-str k))])) + +;; For when we use syntax-case* simply for syntax-e equality. +(define (syntax-e-eq? a b) + (eq? (syntax-e a) (syntax-e b))) + +(define ((make-eq-sym? sym) stx) + (and (eq? sym (syntax-e stx)) stx)) + +(define (get-expanded-syntax how path-str k) + (match how + ['namespace (file->expanded-syntax path-str k)] + [(? path-string? how-path) (if (path-string-equal? path-str how-path) + (path->existing-expanded-syntax path-str k) + (file->expanded-syntax path-str k))])) + +(define (path-string-equal? a b) + (equal? (->path-string a) + (->path-string b))) + +(define (->path-string v) + (cond [(path? v) (path->string v)] + [(path-string? v) v] + [else (error 'path-string-equal? "not a path or path-string?" v)])) diff --git a/elpa/racket-mode-20200323.1739/racket/fresh-line.rkt b/elpa/racket-mode-20200323.1739/racket/fresh-line.rkt new file mode 100644 index 00000000..e294be37 --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/fresh-line.rkt @@ -0,0 +1,37 @@ +#lang racket/base + +(provide fresh-line + zero-column!) + +;; Borrowed from xrepl + +(define last-output-port (make-parameter #f)) +(define last-error-port (make-parameter #f)) + +(define (maybe-new-output-ports) + (define (maybe last cur) + (unless (eq? (last) (cur)) + (when (and (last) + (not (port-closed? (last)))) + (flush-output (last))) ;just in case + (last (cur)) + (flush-output (last)) + (port-count-lines! (last)))) + (maybe last-output-port current-output-port) + (maybe last-error-port current-error-port)) + +(define (fresh-line [stderr? #f]) + (maybe-new-output-ports) + (define port (if stderr? (last-error-port) (last-output-port))) + (flush-output port) + (define-values [line col pos] (port-next-location port)) + (unless (eq? col 0) (newline))) + +(define (zero-column!) + ;; there's a problem whenever there's some printout followed by a + ;; read: the cursor will be at column zero, but the port counting + ;; will think that it's still right after the printout; call this + ;; function in such cases to adjust the column to 0. + (maybe-new-output-ports) + (define-values [line col pos] (port-next-location (last-output-port))) + (set-port-next-location! (last-output-port) line 0 pos)) diff --git a/elpa/racket-mode-20200218.1623/racket/gui.rkt b/elpa/racket-mode-20200323.1739/racket/gui.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/gui.rkt rename to elpa/racket-mode-20200323.1739/racket/gui.rkt diff --git a/elpa/racket-mode-20200323.1739/racket/identifier.rkt b/elpa/racket-mode-20200323.1739/racket/identifier.rkt new file mode 100644 index 00000000..94b35d86 --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/identifier.rkt @@ -0,0 +1,190 @@ +#lang racket/base + +(require racket/contract + racket/format + racket/match + "syntax.rkt") + +(provide how/c + ->identifier + ->identifier-resolved-binding-info) + +;;; Creating identifiers from symbols or strings + +;; A simplifying helper for commands that want to work both ways, and +;; accept a first "how" or "context" argument that is either +;; 'namespace or a path-string. +(define how/c (or/c 'namespace path-string?)) + +(define/contract (->identifier how v k) + (-> how/c (or/c symbol? string?) (-> syntax? any) any) + (match how + ['namespace (->identifier/namespace v k)] + [(? (and string? path-string?) p) (->identifier/expansion p v k)])) + +(define/contract (->identifier/namespace v k) + (-> (or/c symbol? string?) (-> identifier? any/c) any/c) + (define sym->id namespace-symbol->identifier) + (k (cond [(string? v) (sym->id (string->symbol v))] + [(symbol? v) (sym->id v)]))) + +;; We use path-str to get expanded module syntax from the cache via +;; path->existing-expanded-syntax, and use the 'module-body-context +;; syntax property -- starting in Racket 6.5 -- which can be used as +;; lexical context to make an identifier. This lets identifier-binding +;; work for identifiers as if they were in that body's lexical context +;; -- including imported identifiers that aren't actually used as +;; bindings in the module body. +(define/contract (->identifier/expansion path-str v k) + (-> path-string? + (or/c symbol? string?) + (-> identifier? any/c) + any/c) + (path->existing-expanded-syntax + path-str + (λ (stx) + (define (sym->id v) + (expanded-module+symbol->identifier path-str stx v)) + (k (cond [(string? v) (sym->id (string->symbol v))] + [(symbol? v) (sym->id v)]))))) + +(define/contract (expanded-module+symbol->identifier path-str exp-mod-stx sym) + (-> path-string? syntax? symbol? identifier?) + ;; For imported bindings, this creates syntax where + ;; identifier-binding will report a module-path-index that can be + ;; resolved to a path that exists. Great! + ;; + ;; For module bindings, identifier-binding will say that the binding + ;; exists. Good! But. Until a module declaration is evaluated, the + ;; module has no name. As a result, the module-path-index is + ;; reported as #. That would + ;; resolve to -- wrong. + ;; + ;; Work-around: Let's record the path in the identifier's + ;; syntax-source. Doing so won't change what identifier-binding + ;; reports, but it means mpi->path can handle such a module path + ;; index by instead using the path from syntax-source. + (datum->syntax (syntax-property exp-mod-stx 'module-body-context) + sym + (list (string->path path-str) #f #f #f #f))) + + +;;; Massaging values returned by identifier-binding + + ;; A composition that does the right thing, including when making an +;; identifier that is a module binding. +(define (->identifier-resolved-binding-info how v k) + (->identifier how v + (λ (id) + (k (resolve-identifier-binding-info + id + (identifier-binding id)))))) + +;; Given an identifier and the result from identifier-binding, returns +;; a subset of the information, where the module path indexes are +;; resolved to actual paths, and where the 'lexical value is treated +;; as #f. +(define/contract (resolve-identifier-binding-info id binding-info) + (-> identifier? + (or/c 'lexical + #f + (list/c module-path-index? + symbol? + module-path-index? + symbol? + exact-nonnegative-integer? + (or/c exact-integer? #f) + (or/c exact-integer? #f)) + (list/c symbol?)) + (or/c #f + (listof (cons/c symbol? + (or/c 'kernel + (cons/c path-string? (listof symbol?))))))) + (match binding-info + [(list source-mpi source-id + nominal-source-mpi nominal-source-id + source-phase + import-phase + nominal-export-phase) + (list (cons source-id (id+mpi->path id source-mpi)) + (cons nominal-source-id (id+mpi->path id nominal-source-mpi)))] + [_ #f])) + +(define/contract (id+mpi->path id mpi) + (-> identifier? + module-path-index? + (or/c 'kernel + (cons/c path-string? (listof symbol?)))) + (cond [;; We could check below for the interned -- or not in older + ;; Rackets -- symbol '|expanded module|. That seems smelly. + ;; Instead if we're a "self" module, and if the identifier + ;; has a location -- probably supplied above by our + ;; expanded-module+symbol->identifier -- use that source. + (and (self-module? mpi) + (syntax-source id)) + (list (syntax-source id))] + [else + (match (resolved-module-path-name + (module-path-index-resolve mpi)) + [(? hash-percent-symbol) 'kernel] + [(? path-string? path) (list path)] + [(? symbol? sym) + (list (build-path (current-load-relative-directory) + (~a sym ".rkt")))] + [(list (? path-string? path) (? symbol? subs) ...) + (list* path subs)] + ;; I've seen this odd case occur only when running + ;; test/find.rkt. The module path index is + ;; #, and resolving that is (find-examples m) when + ;; it should be '(# m). + [(list (? symbol?) (? symbol? subs) ...) + (list* (syntax-source id) subs)])])) + +(define (self-module? mpi) + (define-values (a b) (module-path-index-split mpi)) + (and (not a) (not b))) + +(define (hash-percent-symbol v) + (and (symbol? v) + (regexp-match? #px"^#%" (symbol->string v)))) + +(module+ test + (require rackunit + "syntax.rkt") + ;; Check something that is in the namespace resulting from + ;; module->namespace on, say, this source file. + (parameterize ([current-namespace (module->namespace (syntax-source #'here))]) + (check-not-false (->identifier-resolved-binding-info 'namespace 'match values)) + (check-not-false (->identifier-resolved-binding-info 'namespace "match" values))) + + ;; Check something that is not in the current namespace, but is an + ;; identifier in the lexical context of an expanded module form -- + ;; including imported identifiers -- from the expanded syntax + ;; cache. + (define path-str "/path/to/foobar.rkt") + (define code-str (~a '(module foobar racket/base + (require net/url racket/set) + (let ([a-lexical-binding 42]) + a-lexical-binding) + (define a-module-binding 42) + a-module-binding))) + ;; Get the expanded syntax in our cache + (string->expanded-syntax path-str code-str void) + ;; Simple imported binding + (check-not-false (->identifier-resolved-binding-info path-str 'set? values)) + (check-not-false (->identifier-resolved-binding-info path-str "set?" values)) + ;; Import where renaming/contracting is involved + (check-not-false (->identifier-resolved-binding-info path-str 'get-pure-port values)) + (check-not-false (->identifier-resolved-binding-info path-str "get-pure-port" values)) + ;; Get a module binding + (check-equal? (->identifier-resolved-binding-info path-str "a-module-binding" values) + (let ([path (string->path path-str)]) + `((a-module-binding ,path) + (a-module-binding ,path)))) + ;; Get a lexical binding: Should return false + (check-false (->identifier-resolved-binding-info path-str "a-lexical-binding" values)) + ;; Get something that's not a binding in at all: Should return false + (check-false (->identifier-resolved-binding-info path-str "ASDFASDFDS" values)) + ;; Get whatever in some file not in expanded syntax cache: Should return false + (check-false (->identifier-resolved-binding-info "not/yet/expanded.rkt" "whatever" values))) diff --git a/elpa/racket-mode-20200218.1623/racket/image.rkt b/elpa/racket-mode-20200323.1739/racket/image.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/image.rkt rename to elpa/racket-mode-20200323.1739/racket/image.rkt diff --git a/elpa/racket-mode-20200323.1739/racket/imports.rkt b/elpa/racket-mode-20200323.1739/racket/imports.rkt new file mode 100644 index 00000000..e635c761 --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/imports.rkt @@ -0,0 +1,268 @@ +#lang racket/base + +(require racket/contract + racket/format + racket/match + racket/set + "util.rkt") + +(provide imports) + +;;; Finding completion candidates from imports + +;; drracket/check-syntax tells us about local definitions (which is +;; great!), and, tells us about imported definitions -- but only those +;; already _used_. Obviously, a major use case for completion is +;; typing _new_ uses of available definitions, too. e.g. "What is that +;; string-xxx function I'm not yet using in this file?" So we want to +;; supply that full set. +;; +;; If you have a namespace from module->namespace, you can use +;; namespace-mapped-symbols -- easy! However we do NOT want to +;; instantiate the module, i.e. "run the user's code". We want to +;; supply this information using the same sort of "passive" analaysis +;; done by check-syntax, before the user even runs the file (if ever). +;; +;; module->exports is a good starting point, but not the whole answer: +;; Imports can be filtered and renamed -- e.g. only-in, except-in, +;; prefix-in, rename-in. +;; +;; AFAICT there is no good way to get completions from all imported +;; identifiers, except attempting to parse the complete #%require +;; grammar including `prefix` and renaming forms like `just-meta`, and +;; apply that information to tweak the answer from module->exports. + +;; It is important to run this with the correct parameterization of +;; current-namespace and current-load-relative-directory. +(define/contract (imports stx [sos (mutable-set)]) + (->* (syntax?) (set-mutable?) set-mutable?) + + (define (handle-module stx) + (syntax-case stx (module #%module-begin #%plain-module-begin #%require) + [(module _id lang (#%module-begin e ...)) + (handle-module-level #'(e ...) #'lang)] + [(module _id lang (#%plain-module-begin e ...)) + (handle-module-level #'(e ...) #'lang)])) + + (define (handle-module-level es lang) + (module-exported-strings lang lang) + (for ([e (in-syntax es)]) + (syntax-case* e (#%require module module*) symbolic-compare? + [(#%require e ...) + (for ([spec (in-syntax #'(e ...))]) + (handle-raw-require-spec spec lang))] + [(module _id sub-mod-lang (_mb e ...)) + (handle-module-level #'(e ...) #'sub-mod-lang)] + [(module* _id sub-mod-lang (_mb e ...)) + (handle-module-level #'(e ...) (if (syntax-e #'sub-mod-lang) + #'sub-mod-lang + lang))] + [ _ (void)]))) + + (define (handle-raw-require-spec spec lang) + (syntax-case* spec (for-meta for-syntax for-template for-label just-meta) symbolic-compare? + [(for-meta _phase specs ...) + (for ([spec (in-syntax #'(specs ...))]) + (handle-phaseless-spec spec lang))] + [(for-syntax specs ...) + (for ([spec (in-syntax #'(specs ...))]) + (handle-phaseless-spec spec lang))] + [(for-template specs ...) + (for ([spec (in-syntax #'(specs ...))]) + (handle-phaseless-spec spec lang))] + [(for-label specs ...) + (for ([spec (in-syntax #'(specs ...))]) + (handle-phaseless-spec spec lang))] + [(just-meta phase specs ...) + (for ([spec (in-syntax #'(specs ...))]) + (handle-raw-require-spec spec lang))] + [raw-module-path + (handle-phaseless-spec #'raw-module-path lang)])) + + (define (handle-phaseless-spec spec lang) + (syntax-case* spec (only prefix all-except prefix-all-except rename) + symbolic-compare? + [(only _raw-module-path id ...) + (set-union! sos + (syntax->string-set #'(id ...)))] + [(prefix prefix-id raw-module-path) + (module-exported-strings #'raw-module-path + lang + #:prefix #'prefix-id)] + [(all-except raw-module-path id ...) + (module-exported-strings #'raw-module-path + lang + #:except (syntax->string-set #'(id ...)))] + [(prefix-all-except prefix-id raw-module-path id ...) + (module-exported-strings #'raw-module-path + lang + #:prefix #'prefix-id + #:except (syntax->string-set #'(id ...)))] + [(rename raw-module-path local-id exported-id) + (begin + (unless (eq? (syntax-e #'raw-module-path) (syntax-e lang)) + (set-remove! sos (->str #'exported-id))) + (set-add! sos (->str #'local-id)))] + [raw-module-path + (module-path? (syntax->datum #'raw-module-path)) + (module-exported-strings #'raw-module-path + lang)])) + + (define (module-exported-strings raw-module-path + lang + #:except [exceptions (set)] + #:prefix [prefix #'""]) + ;; NOTE: Important to run this with the correct parameterization of + ;; current-namespace and current-load-relative-directory. + (define (add-exports mp) + (define-values (vars stxs) (module->exports mp)) + (define orig + (for*/mutable-set ([vars+stxs (in-list (list vars stxs))] + [phases (in-list vars+stxs)] + [export (in-list (cdr phases))]) + (->str (car export)))) + ;; If imports are from the module language, then {except rename + ;; prefix}-in do NOT remove imports under the original name. + ;; Otherwise they do. + (if (eq? (syntax-e raw-module-path) (syntax-e lang)) + (set-union! sos orig) + (set-subtract! sos orig exceptions)) + (for ([v (in-set orig)]) + (set-add! sos (~a (->str prefix) v)))) + + ;; Ignore non-external module paths: module->exports can't handle + ;; them, and anyway, drracket/check-syntax will contribute + ;; completion candidates for local definitions, we don't need to + ;; find them here. + (syntax-case* raw-module-path (quote submod) symbolic-compare? + [(quote _) sos] + [(submod "." . _) sos] + [_ (add-exports (syntax->datum raw-module-path))])) + + (handle-module stx) + sos) + +(define (->str v) + (match v + [(? syntax?) (->str (syntax-e v))] + [(? symbol?) (symbol->string v)] + [(? string?) v])) + +(define (syntax->string-set s) + (for/mutable-set ([s (in-syntax s)]) + (->str s))) + +(define (symbolic-compare? x y) + (eq? (syntax-e x) (syntax-e y))) + +(module+ completions-example + (parameterize ([current-namespace (make-base-namespace)]) + (define stx + (expand + #'(module m racket/base + (module sub racket/base (void)) + (require racket/require + (submod "." sub) + (except-in "../error.rkt" show-full-path-in-errors) + (prefix-in XXX: (except-in racket/file other-write-bit)) + (rename-in racket/path [path-only PATH-ONLY]))))) + (syntax->datum stx) + (imports stx))) + +(module+ test + (require rackunit + version/utils) + ;; Compare the results to namespace-mapped-symbols. + (module mod racket/base + (module sub racket/base + (define provided-by-submodule 42) + (provide provided-by-submodule)) + (require (rename-in racket/path + [path-only PATH-ONLY]) + (except-in racket/base println) + (rename-in racket/base + [display DISPLAY]) + (prefix-in PREFIX: (only-in racket/base displayln)) + (for-syntax (rename-in racket/syntax [format-id FORMAT-ID])) + (submod "." sub)) + (define-namespace-anchor nsa) + (define nsms (map symbol->string + (namespace-mapped-symbols + (namespace-anchor->namespace nsa)))) + (provide nsms)) + (require 'mod) + (define mod/stx + (expand + #`(module mod racket/base + (module sub racket/base + (define provided-by-submodule 42) + (provide provided-by-submodule)) + (require (rename-in racket/path + [path-only PATH-ONLY]) + (except-in racket/base println) + (rename-in racket/base + [display DISPLAY]) + (prefix-in PREFIX: (only-in racket/base displayln)) + (for-syntax (rename-in racket/syntax [format-id FORMAT-ID])) + (submod "." sub)) + (eprintf "I should not print!")))) + (let (;; The world according to `namespace-mapped-symbols` + [nsms (list->set nsms)] + ;; The world according to our `imports` + [cs (parameterize ([current-namespace (make-base-namespace)]) + (define stx (expand mod/stx)) + (time (imports stx)))]) + ;; Test {prefix rename except}-in, keeping mind that they work + ;; differently for requires that modify the module language + ;; imports. + (check-false (set-member? cs "path-only") + "rename-in not from module language hides old name") + (check-true (set-member? cs "PATH-ONLY") + "rename-in not from module language has new name ") + (check-true (set-member? cs "display") + "rename-in from module language does not hide old name") + (check-true (set-member? cs "DISPLAY") + "rename-in from module language has new name") + (check-true (set-member? cs "displayln") + "prefix-in from module language does not hide old name") + (check-true (set-member? cs "PREFIX:displayln") + "prefix-in from module language is available under new name") + ;; namespace-mapped-symbols will return some definitions beyond + ;; those imported -- it includes {top module}-level bindings. This + ;; test accounts for that with a dumb ad hoc list. (More nifty + ;; would be to walk our test stx and build that list.) + ;; + ;; FIXME? Travis CI says this test fails prior to Racket 7.0: + ;; namespace-mapped-symbols reports ~400 more symbols -- + ;; apparently from full racket (should be racket/base). Huh?? + ;; Well, _our_ results are correct. For now, let's just do the + ;; test on Racket 7.0+. + (when (version<=? "7.0" (version)) + (check-equal? (set-subtract nsms cs) + (set "tmp.1" "nsms" "nsa" "provided-by-submodule") + "namespace-mapped-symbols returns only a few more, non-imported definitions")))) + +(module+ slow-test + ;; Exercise our parsing of the #%require grammar: Try doing + ;; (check-not-exn (imports stx)) on many files in the Racket + ;; distribution. Grammar mistakes will raise exn:fail:syntax. + (require rackunit + racket/path + "syntax.rkt") + (define (check path) + (parameterize ([current-load-relative-directory (path-only path)] + [current-namespace (make-base-namespace)]) + (file->expanded-syntax + path + (λ (stx) + (check-not-exn (λ () (imports stx)) + (format "#%require grammar handles ~v" path)))))) + (for* ([roots (in-list '(("racket.rkt" "typed") + ("core.rkt" "typed-racket") + ("main.rkt" "racket")))] + [path (in-directory + (path-only + (apply collection-file-path roots)))] + #:when (equal? #"rkt" (filename-extension path))) + (println path) + (check path))) diff --git a/elpa/racket-mode-20200218.1623/racket/instrument.rkt b/elpa/racket-mode-20200323.1739/racket/instrument.rkt similarity index 92% rename from elpa/racket-mode-20200218.1623/racket/instrument.rkt rename to elpa/racket-mode-20200323.1739/racket/instrument.rkt index 4c7c0240..370f4b79 100644 --- a/elpa/racket-mode-20200218.1623/racket/instrument.rkt +++ b/elpa/racket-mode-20200323.1739/racket/instrument.rkt @@ -8,7 +8,9 @@ (only-in errortrace/stacktrace stacktrace^ stacktrace@ - stacktrace-imports^) + stacktrace-imports^ + original-stx + expanded-stx) racket/format racket/match racket/unit @@ -30,15 +32,6 @@ (define instrumenting-enabled (make-parameter #f)) -;; These two parameters added to errortrace/stacktrace circa 6.0. They -;; help make-st-mark capture the original, unexpanded syntax, which is -;; nicer to report in a stack trace. Lacking that in older Rackets, -;; the srcloc is still correct and Emacs next-error will work. -(define original-stx (with-handlers ([exn:fail? (λ _ (make-parameter #f))]) - (dynamic-require 'errortrace/stacktrace 'original-stx))) -(define expanded-stx (with-handlers ([exn:fail? (λ _ (make-parameter #f))]) - (dynamic-require 'errortrace/stacktrace 'expanded-stx))) - (define ((make-instrumented-eval-handler [orig-eval (current-eval)]) orig-exp) ;; This is modeled after the one in DrRacket. (cond diff --git a/elpa/racket-mode-20200323.1739/racket/interactions.rkt b/elpa/racket-mode-20200323.1739/racket/interactions.rkt new file mode 100644 index 00000000..bace50f9 --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/interactions.rkt @@ -0,0 +1,76 @@ +#lang racket/base + +(require racket/match + "fresh-line.rkt" + "util.rkt") + +(provide current-interaction-chan + current-sync/yield + make-get-interaction + get-interaction) + +;; A channel to which a thread puts interactions that it reads using +;; the current-read-interaction handler (which can be set by a lang +;; from its configure-runtime, so, this should be compatible with +;; any lang, even non-sexpr langs). +;; +;; This is its own thread and channel for a couple reasons: +;; +;; - Issue #311. A consumer can use sync/timeout to avoid displaying a +;; prompt when multiple interactions are waiting. +;; +;; - Debugging. We can switch from the normal REPL to a debugger REPL, +;; without input being stuck inside a read call for the former. +;; +;; One wrinkle is we need to be careful about calling yield instead of +;; sync when the gui is active. See issue #326. +;; +;; Another wrinkle: We should handle eof-object? and exn:fail:network? +;; by doing an exit and letting the exit-handler in run.rkt cleanup +;; the TCP connection. This handles the case where e.g. the user kills +;; the REPL buffer and its process on the client/Emacs side. We used +;; to have code here in an effort support lang/datalog using eof as an +;; expression separator -- but that just causes an endless loop 100% +;; CPU spike with an abandoned tcp-input-port. So give up on that, +;; reverting issue #305. + +(define current-interaction-chan (make-parameter #f)) + +;; Call this from a REPL manager thread after current-input-port is +;; set appropriately (e.g. to a TCP input port not stdin). +(define (make-get-interaction) + (define ch (make-channel)) + (current-interaction-chan ch) + (thread read-interaction/put-channel) + ch) + +(define (read-interaction/put-channel) + (define in ((current-get-interaction-input-port))) + (define (read-interaction) + (with-handlers ([exn:fail? values]) + ((current-read-interaction) (object-name in) in))) + (match (read-interaction) + [(? eof-object?) (log-racket-mode-info "read-interaction: eof") + (exit 'get-interaction-eof)] + [(? exn:fail? e) (channel-put (current-interaction-chan) e)] ;raise in other thread + [v (channel-put (current-interaction-chan) v)]) + (read-interaction/put-channel)) + +(define current-sync/yield (make-parameter sync)) ;see issue #326 + +(define (get-interaction prompt) + (match (or (sync/timeout 0.01 (current-interaction-chan)) ;see issue #311 + (begin (display-prompt prompt) + ((current-sync/yield) (current-interaction-chan)))) + [(? exn:fail:network?) (log-racket-mode-info "get-interaction: exn:fail:network\n") + (exit 'get-interaction-exn:fail:network)] + [(? exn:fail? exn) (raise exn)] + [v v])) + +(define (display-prompt str) + (flush-output (current-error-port)) + (fresh-line) + (display str) + (display "> ") + (flush-output) + (zero-column!)) diff --git a/elpa/racket-mode-20200218.1623/racket/keywords.rkt b/elpa/racket-mode-20200323.1739/racket/keywords.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/keywords.rkt rename to elpa/racket-mode-20200323.1739/racket/keywords.rkt diff --git a/elpa/racket-mode-20200218.1623/racket/logger.rkt b/elpa/racket-mode-20200323.1739/racket/logger.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/logger.rkt rename to elpa/racket-mode-20200323.1739/racket/logger.rkt diff --git a/elpa/racket-mode-20200323.1739/racket/main.rkt b/elpa/racket-mode-20200323.1739/racket/main.rkt new file mode 100644 index 00000000..0537f1f3 --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/main.rkt @@ -0,0 +1,35 @@ +#lang racket/base + +(require racket/match + racket/port + version/utils + "logger.rkt" + "command-server.rkt" + "repl.rkt") + +(module+ main + (define expected-version "6.5") + (define actual-version (version)) + (unless (version<=? expected-version actual-version) + (error 'racket-mode "needs at least Racket ~a but you have ~a" + expected-version + actual-version)) + + (define-values (command-port launch-token) + (match (current-command-line-arguments) + [(vector port token) + (values (string->number port) token)] + [v + (eprintf "Bad command-line arguments: ~v\n" v) + (exit)])) + + ;; Save original current-{input output}-port to give to + ;; command-server-loop for command I/O. + (let ([stdin (current-input-port)] + [stdout (current-output-port)]) + ;; Set no-ops so e.g. rando print can't bork the command I/O. + (parameterize ([current-input-port (open-input-bytes #"")] + [current-output-port (open-output-nowhere)]) + (start-repl-session-server command-port launch-token) + (start-logger-server (add1 command-port) launch-token) + (command-server-loop stdin stdout)))) diff --git a/elpa/racket-mode-20200218.1623/racket/mod.rkt b/elpa/racket-mode-20200323.1739/racket/mod.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/mod.rkt rename to elpa/racket-mode-20200323.1739/racket/mod.rkt diff --git a/elpa/racket-mode-20200218.1623/racket/print.rkt b/elpa/racket-mode-20200323.1739/racket/print.rkt similarity index 100% rename from elpa/racket-mode-20200218.1623/racket/print.rkt rename to elpa/racket-mode-20200323.1739/racket/print.rkt diff --git a/elpa/racket-mode-20200323.1739/racket/repl.rkt b/elpa/racket-mode-20200323.1739/racket/repl.rkt new file mode 100644 index 00000000..bb45639e --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/repl.rkt @@ -0,0 +1,435 @@ +#lang racket/base +;; Do NOT use `at-exp` in this file! See issue #290. + +(require racket/contract + racket/match + racket/set + racket/tcp + (only-in "debug.rkt" make-debug-eval-handler next-break) + "elisp.rkt" + "error.rkt" + "gui.rkt" + "instrument.rkt" + "interactions.rkt" + "mod.rkt" + "print.rkt" + (only-in "syntax.rkt" with-expanded-syntax-caching-evaluator) + "util.rkt") + +(provide start-repl-session-server + run + call-with-session-context + exit-repl-session + current-session-id + current-session-maybe-mod + current-session-submit-pred) + +;;; REPL session "housekeeping" + +(define next-session-number 0) + +(define drracket:submit-predicate/c (-> input-port? boolean? boolean?)) + +(define-struct/contract session + ([thread thread?] ;the repl manager thread + [repl-msg-chan channel?] ;see repl-message structs + [interaction-chan channel?] + [ns namespace?] + [maybe-mod (or/c #f mod?)] + [submit-pred (or/c #f drracket:submit-predicate/c)]) + #:transparent) + +(define sessions (make-hash)) + +(define current-session-id (make-parameter #f)) +(define current-repl-msg-chan (make-parameter #f)) +;current-interaction-chan defined in "interactions.rkt" +(define current-session-maybe-mod (make-parameter #f)) +(define current-session-submit-pred (make-parameter #f)) + +;;; Messages to each repl manager thread + +;; Definitions for context-level member of run-config struct + +(define profile/coverage-levels + ;; "sibling" levels that need instrument plus... + '(profile ;profiling-enabled + coverage)) ;execute-counts-enabled + +(define instrument-levels + `(high ;compile-context-preservation-enabled #t + instrument + ,@profile/coverage-levels)) + +(define context-levels + `(low ;compile-context-preservation-enabled #f + medium ;compile-context-preservation-enabled #t + ,@instrument-levels + debug)) + +(define (context-level? v) (memq? v context-levels)) +(define (instrument-level? v) (memq? v instrument-levels)) +(define (profile/coverage-level? v) (memq? v profile/coverage-levels)) +(define (debug-level? v) (eq? v 'debug)) + +;; The message structs + +(define-struct/contract repl-manager-thread-message ()) + +(define-struct/contract (load-gui repl-manager-thread-message) + ([in-repl? boolean?])) + +(define-struct/contract (run-config repl-manager-thread-message) + ([maybe-mod (or/c #f mod?)] + [memory-limit exact-nonnegative-integer?] ;0 = no limit + [pretty-print? boolean?] + [context-level context-level?] + [cmd-line-args (vectorof string?)] + [debug-files (set/c path?)] + [ready-thunk (-> any/c)])) + +(define (initial-run-config ready-thunk) + (run-config #f ;maybe-mod + 0 ;memory-limit + #f ;pretty-print? + 'low ;context-level + #() ;cmd-line-args + (set) ;debug-files + ready-thunk)) + +;;; Functionality provided for commands + +;; A way to parameterize commands that need to work with a specific +;; REPL session. Called from command-server thread. +(define (call-with-session-context sid proc . args) + (log-racket-mode-debug "~v" sessions) + (match (hash-ref sessions sid #f) + [(and (session _thd msg-ch int-ch ns maybe-mod submit-pred) s) + (log-racket-mode-debug "call-with-session-context ~v => ~v" sid s) + (parameterize ([current-repl-msg-chan msg-ch] + [current-interaction-chan int-ch] + [current-namespace ns] + [current-session-id sid] + [current-session-maybe-mod maybe-mod] + [current-session-submit-pred submit-pred]) + (apply proc args))] + [_ + (log-racket-mode-debug "call-with-session-context ~v -- no session found" sid) + (apply proc args)])) + +;; Command. Called from command-server thread +(define (exit-repl-session sid) + (match (hash-ref sessions sid #f) + [(struct* session ([thread t])) + (log-racket-mode-debug "exit-repl: break-thread for ~v" sid) + (break-thread t 'terminate)] + [_ (log-racket-mode-error "exit-repl: ~v not in `sessions`" sid)])) + +;; Command. Called from command-server thread +(define/contract (run what mem pp ctx args dbgs) + (-> list? number? elisp-bool/c context-level? list? (listof path-string?) + list?) + (define ready-channel (make-channel)) + (channel-put (current-repl-msg-chan) + (run-config (->mod/existing what) + mem + (as-racket-bool pp) + ctx + (list->vector args) + (list->set (map string->path dbgs)) + (λ () (channel-put ready-channel what)))) + ;; Waiting for this allows the command response to be used as the + ;; all-clear for additional commands that need the module load to be + ;; done and entering a REPL for that module. For example, to compose + ;; run with get-profile or get-uncovered. + (sync ready-channel)) + +;;; REPL session server + +(define (start-repl-session-server port launch-token) + (thread (listener-thread-thunk port launch-token))) + +(define ((listener-thread-thunk port launch-token)) + (define listener (tcp-listen port 4 #t "127.0.0.1")) + (let accept-a-connection () + (define custodian (make-custodian)) + (parameterize ([current-custodian custodian]) + ;; `exit` in a REPL should terminate that REPL session -- not + ;; the entire back end server. Also, this is opportunity to + ;; remove the session from `sessions` hash table. + (define (our-exit-handler code) + (log-racket-mode-info "(our-exit-handler ~v) ~v" + code (current-session-id)) + (when (current-session-id) ;might exit before session created + (hash-remove! sessions (current-session-id)) + (log-racket-mode-debug "sessions: ~v" sessions)) + (custodian-shutdown-all custodian)) + (parameterize ([exit-handler our-exit-handler]) + (define-values (in out) (tcp-accept listener)) + (parameterize ([current-input-port in] + [current-output-port out] + [current-error-port out]) + (for ([p (in-list (list in out))]) + (file-stream-buffer-mode p 'none)) ;would 'line be sufficient? + ;; Immediately after connecting, the client must send us + ;; exactly the same launch token value that it gave us as a + ;; command line argument when it started us. Else we close + ;; the connection. See issue #327. + (define supplied-token (elisp-read in)) + (unless (equal? launch-token supplied-token) + (log-racket-mode-fatal "Authorization failed: ~v" + supplied-token) + (exit 'racket-mode-repl-auth-failure)) + (thread repl-manager-thread-thunk)))) + (accept-a-connection))) + +(define (repl-manager-thread-thunk) + (define session-id (format "repl-session-~a" + (begin0 next-session-number + (inc! next-session-number)))) + (log-racket-mode-info "start ~v" session-id) + (parameterize ([error-display-handler our-error-display-handler] + [current-session-id session-id] + [current-repl-msg-chan (make-channel)] + [current-interaction-chan (make-get-interaction)]) + (do-run + (initial-run-config + (λ () + ;; Write a sexpr containing the session-id, which the client + ;; can use in certain commands that need to run in the context + ;; of a specific REPL. We wait to do so until this ready-thunk + ;; to ensure the `sessions` hash table has this session before + ;; any subsequent commands use call-with-session-context. + (elisp-writeln `(ok ,session-id) (current-output-port)) + (flush-output) + (display-commented (string-append "\n" (banner)))))))) + +(define (do-run cfg) ;run-config? -> void? + (match-define (run-config maybe-mod + mem-limit + pretty-print? + context-level + cmd-line-args + debug-files + ready-thunk) cfg) + (define-values (dir file mod-path) (maybe-mod->dir/file/rmp maybe-mod)) + ;; Always set current-directory and current-load-relative-directory + ;; to match the source file. + (current-directory dir) + (current-load-relative-directory dir) + ;; Make src-loc->string provide full pathnames + (show-full-path-in-errors) + ;; Custodian for the REPL. + (define repl-cust (make-custodian)) + (when (< 0 mem-limit) + (custodian-limit-memory repl-cust + (inexact->exact (round (* 1024 1024 mem-limit))) + repl-cust)) + ;; If racket/gui/base isn't loaded, the current-eventspace parameter + ;; doesn't exist, so make a "dummy" parameter of that name. + (define current-eventspace (txt/gui (make-parameter #f) current-eventspace)) + + ;; Create REPL thread + (define repl-thread + (parameterize* ;; Use `parameterize*` because the order matters. + (;; FIRST: current-custodian and current-namespace, so in + ;; effect for later parameterizations. + [current-custodian repl-cust] + [current-namespace (if mod-path + ((txt/gui make-base-empty-namespace + make-gui-empty-namespace)) + ((txt/gui make-base-namespace + make-gui-namespace)))] + ;; OTHERS: + [compile-enforce-module-constants #f] + [compile-context-preservation-enabled (not (eq? context-level 'low))] + [current-eval + (cond [(debug-level? context-level) (make-debug-eval-handler debug-files)] + [(instrument-level? context-level)(make-instrumented-eval-handler)] + [else (current-eval)])] + [instrumenting-enabled (instrument-level? context-level)] + [profiling-enabled (eq? context-level 'profile)] + [test-coverage-enabled (eq? context-level 'coverage)] + [current-sync/yield (txt/gui sync yield)] + ;; LAST: `current-eventspace` because `make-eventspace` + ;; creates an event handler thread -- now. We want that + ;; thread to inherit the parameterizations above. (Otherwise + ;; in the non-gui case, we call `thread` below in the body of + ;; the parameterize* form, so that's fine.) + [current-eventspace ((txt/gui void make-eventspace))]) + ;; repl-thunk will either be used as the thunk for a thread we + ;; make directly -- or, when racket/gui/base is instantiated, + ;; installed as the current eventspace's event queue via + ;; queue-callback, running under (eventspace-handler-thread + ;; (current-eventspace)). + (define (repl-thunk) + ;; 0. Command line arguments + (current-command-line-arguments cmd-line-args) + ;; 1. Set print hooks and output handlers + (set-print-parameters pretty-print?) + (set-output-handlers) + ;; 2. If module, require and enter its namespace, etc. + (with-expanded-syntax-caching-evaluator maybe-mod + (when (and maybe-mod mod-path) + (parameterize ([current-module-name-resolver module-name-resolver-for-run]) + ;; When exn:fail during module load, re-run. + (define (load-exn-handler exn) + (define new-mod + (match mod-path + [`(submod ,(== file) main) + (log-racket-mode-debug "~v not found, retry as ~v" + mod-path (build-path dir file)) + (->mod/existing (build-path dir file))] + ;; Else display exn and retry as "empty" REPL. + [_ + (display-exn exn) + #f])) + (channel-put (current-repl-msg-chan) + (struct-copy run-config cfg [maybe-mod new-mod])) + (sync never-evt)) ;manager thread will shutdown custodian + (with-handlers ([exn? load-exn-handler]) + (maybe-configure-runtime mod-path) ;FIRST: see #281 + (current-namespace + (parameterize ([current-load-relative-directory dir] + [current-directory dir]) + (dynamic-require mod-path #f) + (module->namespace mod-path))) + (maybe-warn-about-submodules mod-path context-level) + (check-#%top-interaction))))) + ;; 3. Record information about our session + (hash-set! sessions + (current-session-id) + (session (current-thread) + (current-repl-msg-chan) + (current-interaction-chan) + (current-namespace) + maybe-mod + (get-repl-submit-predicate maybe-mod))) + (log-racket-mode-debug "sessions: ~v" sessions) + ;; 4. Now that the program has run, and `sessions` is updated, + ;; call the ready-thunk. On REPL startup this lets us wait + ;; sending the repl-session-id until `sessions` is updated. + ;; And for subsequent run commands, this lets us it wait to + ;; send a response. + (ready-thunk) + ;; 5. read-eval-print-loop + (parameterize ([current-prompt-read (make-prompt-read maybe-mod)] + [current-module-name-resolver module-name-resolver-for-repl]) + ;; Note that read-eval-print-loop catches all non-break + ;; exceptions. + (read-eval-print-loop))) + + ;; Main thread: Run repl-thunk on a plain thread, or, on the + ;; eventspace thread via queue-callback. Return the thread. + (define t/v ((txt/gui thread queue-callback ) repl-thunk)) + (define thd ((txt/gui (λ _ t/v) eventspace-handler-thread) (current-eventspace))) + thd)) + + ;; Main thread: Wait for message from REPL thread on channel. Also + ;; catch breaks, in which case we (a) break the REPL thread so + ;; display-exn runs there, and (b) continue from the break instead + ;; of re-running so that the REPL environment is maintained. + (define message + (call-with-exception-handler + (match-lambda + [(and (or (? exn:break:terminate?) (? exn:break:hang-up?)) e) e] + [(exn:break _msg _marks continue) (break-thread repl-thread) (continue)] + [e e]) + (λ () (sync (current-repl-msg-chan))))) + (match context-level + ['profile (clear-profile-info!)] + ['coverage (clear-test-coverage-info!)] + [_ (void)]) + (custodian-shutdown-all repl-cust) + (newline) ;; FIXME: Move this to racket-mode.el instead? + (match message + [(? run-config? new-cfg) (do-run new-cfg)] + [(load-gui repl?) (require-gui repl?) (do-run cfg)])) + +(define/contract ((make-prompt-read m)) + (-> (or/c #f mod?) (-> any)) + (begin0 (get-interaction (maybe-mod->prompt-string m)) + ;; let debug-instrumented code break again + (next-break 'all))) + +;; +(define/contract (get-repl-submit-predicate m) + (-> (or/c #f mod?) (or/c #f drracket:submit-predicate/c)) + (define-values (dir file rmp) (maybe-mod->dir/file/rmp m)) + (define path (and dir file (build-path dir file))) + (and path rmp + (or (with-handlers ([exn:fail? (λ _ #f)]) + (match (with-input-from-file (build-path dir file) read-language) + [(? procedure? get-info) + (match (get-info 'drracket:submit-predicate #f) + [#f #f] + [v v])] + [_ #f])) + (with-handlers ([exn:fail? (λ _ #f)]) + (match (module->language-info rmp #t) + [(vector mp name val) + (define get-info ((dynamic-require mp name) val)) + (get-info 'drracket:submit-predicate #f)] + [_ #f]))))) + +(define (maybe-configure-runtime mod-path) + ;; Do configure-runtime when available. + ;; Important for langs like Typed Racket. + (with-handlers ([exn:fail? void]) + (match (module->language-info mod-path #t) + [(vector mp name val) + (define get-info ((dynamic-require mp name) val)) + (define configs (get-info 'configure-runtime '())) + (for ([config (in-list configs)]) + (match-let ([(vector mp name val) config]) + ((dynamic-require mp name) val)))] + [_ (void)]) + (define cr-submod `(submod + ,@(match mod-path + [(list 'submod sub-paths ...) sub-paths] + [_ (list mod-path)]) + configure-runtime)) + (when (module-declared? cr-submod) + (dynamic-require cr-submod #f)))) + +(define (check-#%top-interaction) + ;; Check that the lang defines #%top-interaction + (unless (memq '#%top-interaction (namespace-mapped-symbols)) + (display-commented + "Because the language used by this module provides no #%top-interaction\n you will be unable to evaluate expressions here in the REPL."))) + +;; Catch attempt to load racket/gui/base for the first time. +(define (make-module-name-resolver repl?) + (let ([orig-resolver (current-module-name-resolver)]) + (define (resolve mp rmp stx load?) + (when (and load? (memq mp '(racket/gui/base + racket/gui/dynamic + scheme/gui/base))) + (unless (gui-required?) + (channel-put (current-repl-msg-chan) + (load-gui repl?)) + (sync never-evt))) + (orig-resolver mp rmp stx load?)) + (case-lambda + [(rmp ns) (orig-resolver rmp ns)] + [(mp rmp stx) (resolve mp rmp stx #t)] + [(mp rmp stx load?) (resolve mp rmp stx load?)]))) +(define module-name-resolver-for-run (make-module-name-resolver #f)) +(define module-name-resolver-for-repl (make-module-name-resolver #t)) + +;;; Output handlers; see issues #381 #397 + +;; These are plain procedures not parameters. Therefore to reset them +;; for each user program run, we must call them each time with the +;; original value. What original value? It suffices to use the value +;; in effect when this back end starts, i.e. the default +;; port-xxx-handler. + +(define the-default-output-handlers + (for/hash ([get/set (in-list (list port-write-handler + port-display-handler + port-print-handler))]) + (values get/set (get/set (current-output-port))))) + +(define (set-output-handlers) + (for ([(get/set v) (in-hash the-default-output-handlers)]) + (get/set (current-output-port) v))) diff --git a/elpa/racket-mode-20200218.1623/racket/scribble.rkt b/elpa/racket-mode-20200323.1739/racket/scribble.rkt similarity index 69% rename from elpa/racket-mode-20200218.1623/racket/scribble.rkt rename to elpa/racket-mode-20200323.1739/racket/scribble.rkt index 77d56076..f5b19984 100644 --- a/elpa/racket-mode-20200218.1623/racket/scribble.rkt +++ b/elpa/racket-mode-20200323.1739/racket/scribble.rkt @@ -2,46 +2,58 @@ (require (only-in html read-html-as-xml) + racket/contract racket/file racket/format racket/function racket/match racket/path + racket/promise + racket/string + (only-in scribble/core + tag?) scribble/xref + scribble/blueboxes setup/xref (only-in xml xml->xexpr element xexpr->string)) -(provide scribble-doc/html - binding->path+anchor) +(provide binding->path+anchor + path+anchor->html + identifier->bluebox) -;;; Extract Scribble documentation as modified HTML suitable for -;;; Emacs' shr renderer. +(module+ test + (require rackunit)) -(define (scribble-doc/html stx) - (define xexpr (scribble-doc/xexpr stx)) - (and xexpr (xexpr->string xexpr))) +(define xref (delay/thread (load-collections-xref))) -(define (scribble-doc/xexpr stx) - (define-values (path xexpr) (scribble-doc/xexpr-raw stx)) - (and path xexpr (massage-xexpr path xexpr))) +(define/contract (binding->path+anchor stx) + (-> identifier? (or/c #f (cons/c path-string? (or/c #f string?)))) + (let* ([xref (force xref)] + [tag (xref-binding->definition-tag xref stx 0)] + [p+a (and tag (tag->path+anchor xref tag))]) + p+a)) -(define (scribble-doc/xexpr-raw stx) - (define-values (path anchor) (binding->path+anchor stx)) - (cond [(and path anchor) - (values path (scribble-get-xexpr path anchor))] - [else (values #f #f)])) +(define (tag->path+anchor xref tag) + (define-values (path anchor) (xref-tag->path+anchor xref tag)) + (and path anchor (cons path anchor))) -(define (binding->path+anchor stx) - (define xref (load-collections-xref)) - (define tag (and (identifier? stx) - (xref-binding->definition-tag xref stx 0))) - (cond [tag (xref-tag->path+anchor xref tag)] - [else (values #f #f)])) +;;; Scribble docs as HTML suitable for Emacs' shr renderer -(define (scribble-get-xexpr path anchor) +(define/contract (path+anchor->html path+anchor) + (-> (or/c #f (cons/c path-string? (or/c #f string?))) + (or/c #f string?)) + (match path+anchor + [(cons path anchor) + (let* ([xexpr (get-raw-xexpr path anchor)] + [xexpr (and xexpr (massage-xexpr path xexpr))] + [html (and xexpr (xexpr->string xexpr))]) + html)] + [_ #f])) + +(define (get-raw-xexpr path anchor) (define (heading-element? x) (match x [(cons (or 'h1 'h2 'h3 'h4 'h5 'h6) _) #t] @@ -64,21 +76,20 @@ [xs `(div () ,@xs)])) (module+ test - (require rackunit) (test-case "procedure" - (check-not-false (scribble-doc/xexpr #'print))) + (check-not-false (path+anchor->html (binding->path+anchor #'print)))) (test-case "syntax" - (check-not-false (scribble-doc/xexpr #'match))) + (check-not-false (path+anchor->html (binding->path+anchor #'match)))) (test-case "parameter" - (check-not-false (scribble-doc/xexpr #'current-eval))) + (check-not-false (path+anchor->html (binding->path+anchor #'current-eval)))) (test-case "indented sub-item" - (check-not-false (scribble-doc/xexpr #'struct-out))) + (check-not-false (path+anchor->html (binding->path+anchor #'struct-out)))) (test-case "deftogether" (test-case "1 of 2" - (check-not-false (scribble-doc/xexpr #'lambda))) + (check-not-false (path+anchor->html (binding->path+anchor #'lambda)))) (test-case "2 of 2" - (check-not-false (scribble-doc/xexpr #'λ)))) - (check-not-false (scribble-doc/xexpr #'xref-binding->definition-tag))) + (check-not-false (path+anchor->html (binding->path+anchor #'λ))))) + (check-not-false (path+anchor->html (binding->path+anchor #'xref-binding->definition-tag)))) (define (main-elements x) (match x @@ -190,7 +201,7 @@ (define hs (match* [kind-xexprs provide-xexprs] [[`() `()] `()] - [[ks ps] `((span ([style "color: #C0C0C0"]) ,@ks 'nbsp ,@ps))])) + [[ks ps] `((span () ,@ks 'nbsp ,@ps))])) `(div () ,@hs ,@xs)])) (module+ test @@ -200,3 +211,31 @@ (img ([x "x"] [src "foo.png"] [y "y"])))) `(div () (img ([src "file:///path/to/foo.png"] [x "x"] [y "y"]))))) + +;;; Blueboxes + +(define bluebox-cache (delay/thread (make-blueboxes-cache #t))) + +(define/contract (identifier->bluebox stx) + (-> identifier? (or/c #f string?)) + (match (xref-binding->definition-tag (force xref) stx 0) + [(? tag? tag) + (match (fetch-blueboxes-strs tag #:blueboxes-cache (force bluebox-cache)) + [(list* _kind strs) + (string-replace (string-join strs "\n") + "\u00A0" + " ")] + [_ #f])] + [_ #f])) + +(module+ test + ;; This test succeeds on all Racket versions before and after 6.10. + ;; I spent an hour installing 6.10 locally and exploring the problem + ;; but so far have no clue. As neither 6.10 nor I are getting any + ;; younger, I am choosing to ignore this, for now. + ;; + ;; Probably https://github.com/racket/drracket/issues/118 + (unless (equal? (version) "6.10") + (check-equal? (identifier->bluebox #'list) + "(list v ...) -> list?\n v : any/c")) + (check-false (identifier->bluebox (datum->syntax #f (gensym))))) diff --git a/elpa/racket-mode-20200323.1739/racket/syntax.rkt b/elpa/racket-mode-20200323.1739/racket/syntax.rkt new file mode 100644 index 00000000..66947852 --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/syntax.rkt @@ -0,0 +1,227 @@ +#lang racket/base + +(require (only-in openssl/md5 md5) + racket/contract + racket/match + (only-in racket/path path-only) + syntax/modread + syntax/parse/define + "mod.rkt") + +(provide with-expanded-syntax-caching-evaluator + file->syntax + file->expanded-syntax + string->expanded-syntax + path->existing-syntax + path->existing-expanded-syntax) + +(define-logger racket-mode-syntax-cache) + +;; Return a syntax object for the contents of `path`. The resulting +;; syntax is applied to `k` while the parameter +;; current-load-relative-directory is set correctly for `path`. +(define/contract (file->syntax path [k values]) + (->* (path-string?) + ((-> syntax? any)) + any) + (define dir (path-only path)) + (parameterize ([current-load-relative-directory dir] + [current-directory dir]) + (k + (with-module-reading-parameterization + (λ () + (with-input-from-file path + (λ () + (port-count-lines! (current-input-port)) + (match (read-syntax) + [(? eof-object?) #'""] + [stx stx])))))))) + +;; Same but from a string, where `path` is used for the load relative +;; directory and given to read-syntax as the source +(define/contract (string->syntax path code-str [k values]) + (->* (path-string? string?) + ((-> syntax? any)) + any) + (define dir (path-only path)) + (parameterize ([current-load-relative-directory dir] + [current-directory dir]) + (k + (with-module-reading-parameterization + (λ () + (define in (open-input-string code-str)) + (port-count-lines! in) + (match (read-syntax path in) + [(? eof-object?) #'""] + [stx stx])))))) + +;;; expanded syntax caching + +(define/contract (call-with-expanded-syntax-caching-evaluator maybe-mod thk) + (-> (or/c mod? #f) (-> any) any) + (before-run maybe-mod) + (begin0 + (parameterize ([current-eval (make-eval-handler maybe-mod)]) + (thk)) + (after-run maybe-mod))) + +(define-simple-macro (with-expanded-syntax-caching-evaluator mm:expr e:expr ...+) + (call-with-expanded-syntax-caching-evaluator mm (λ () e ...))) + +;; Call this early in a file run, _before_ any evaluation. +(define (before-run _maybe-mod) + ;; Don't actually flush the entire cache anymore. Because we're also + ;; using this for check-syntax. TODO: Some new strategy, or, let the + ;; cache grow indefinitely? + ;; + ;; Note: The case of same path with different digest is handled when + ;; we lookup items from the hash. It's considered a cache miss, we + ;; expand again, and that is the new value in the hash for that + ;; path. + (void)) + +(define ((make-eval-handler _maybe-mod [orig-eval (current-eval)]) e) + (cond [(and (syntax? e) + (syntax-source e) + (path-string? (syntax-source e)) + (not (compiled-expression? (syntax-e e)))) + (define expanded-stx (expand e)) + (cache-set! (syntax-source e) + e + expanded-stx + (file->digest (syntax-source e)) + (current-namespace) + (current-load-relative-directory)) + (orig-eval expanded-stx)] + [else (orig-eval e)])) + +(define (after-run _maybe-mod) + (void)) + +;; cache : (hash/c path? cache-entry?) +(struct cache-entry (stx exp-stx digest namespace load-relative-directory)) +(define cache (make-hash)) +(define last-mod #f) + +(define/contract (cache-set! path stx exp-stx digest namespace load-rel-dir) + (-> path? syntax? syntax? string? namespace? path-string? any) + (hash-set! cache path + (cache-entry stx + exp-stx + digest + namespace + load-rel-dir))) + +(define (->path v) + (cond [(path? v) v] + [(path-string? v) (string->path v)] + [else (error '->path "not path? or path-string?" v)])) + +;; Returns the result of applying `k` to the expanded syntax, with the +;; correct parameterization of current-namespace and +;; current-load-relative-directory. Note that `k` deliberately does +;; not default to `values` because trying to use the syntax without +;; the correct parameterizations will often result in bugs, sometimes +;; subtle and confusing. So this "CPS" approach guides you to do the +;; right thing. +(define/contract (file->expanded-syntax path-str k) + (-> path-string? (-> syntax? any) any) + (define path (->path path-str)) + (define digest (file->digest path)) + (match (hash-ref cache path #f) + [(cache-entry _stx exp-stx (== digest) namespace load-rel-dir) + (log-racket-mode-syntax-cache-info "file->expanded-syntax cache hit ~v ~v" path digest) + (parameterize ([current-namespace namespace] + [current-load-relative-directory load-rel-dir] + [current-directory load-rel-dir]) + (k exp-stx))] + [_ + (log-racket-mode-syntax-cache-info "file->expanded-syntax cache MISS ~v ~v" path digest) + (file->syntax + path + (λ (stx) + ;; Create and parameterize a namespace here. file->syntax + ;; already parameterized the directory before calling us. + (parameterize ([current-namespace (make-base-namespace)]) + (define exp-stx (expand stx)) + (cache-set! path stx exp-stx digest (current-namespace) (current-load-relative-directory)) + (k exp-stx))))])) + +;; Same but when you don't have a file. +(define/contract (string->expanded-syntax path-str code-str k) + (-> path-string? string? (-> syntax? any) any) + (define path (->path path-str)) + (define digest (string->digest code-str)) + (match (hash-ref cache path #f) + [(cache-entry _stx exp-stx (== digest) namespace load-rel-dir) + (log-racket-mode-syntax-cache-info "string->expanded-syntax cache hit ~v ~v" path digest) + (parameterize ([current-namespace namespace] + [current-load-relative-directory load-rel-dir] + [current-directory load-rel-dir]) + (k exp-stx))] + [_ + (log-racket-mode-syntax-cache-info "string->expanded-syntax cache MISS ~v ~v" path digest) + (string->syntax + path-str code-str + (λ (stx) + ;; Create and parameterize a namespace here. string->syntax + ;; already parameterized the directory before calling us. + (parameterize ([current-namespace (make-base-namespace)]) + (define exp-stx (expand stx)) + (cache-set! path stx exp-stx digest (current-namespace) (current-load-relative-directory)) + (k exp-stx))))])) + +(define/contract (file->digest path) + (-> path? string?) + (call-with-input-file path md5)) + +(define/contract (string->digest str) + (-> string? string?) + (md5 (open-input-string str))) + +;; Like string->syntax but given only the path-str and only if syntax +;; already in the cache, as a result of previously calling +;; string->expanded-syntax. Intended for use by identifier.rkt. +(define/contract (path->existing-syntax path-str k) + (-> path-string? (-> syntax? any) any) + (define path (->path path-str)) + (match (hash-ref cache path #f) + [(cache-entry stx _exp-stx _digest namespace load-rel-dir) + (log-racket-mode-syntax-cache-info "path->existing-syntax cache hit ~v (ignoring digest)" path) + (parameterize ([current-namespace namespace] + [current-load-relative-directory load-rel-dir] + [current-directory load-rel-dir]) + (k stx))] + [#f + (log-racket-mode-syntax-cache-warning "path->existing-syntax cache MISS ~v (ignoring digest)" path) + #f])) + +;; Like string->expanded-syntax but given only the path-str and only +;; if expanded syntax already in the cache, as a result of previously +;; calling string->expanded-syntax. Intended for use by +;; identifier.rkt. +(define/contract (path->existing-expanded-syntax path-str k) + (-> path-string? (-> syntax? any) any) + (define path (->path path-str)) + (match (hash-ref cache path #f) + [(cache-entry _stx exp-stx _digest namespace load-rel-dir) + (log-racket-mode-syntax-cache-info "path->existing-expanded-syntax cache hit ~v (ignoring digest)" path) + (parameterize ([current-namespace namespace] + [current-load-relative-directory load-rel-dir] + [current-directory load-rel-dir]) + (k exp-stx))] + [#f + (log-racket-mode-syntax-cache-warning "path->existing-expanded-syntax cache MISS ~v (ignoring digest)" path) + #f])) + +(module+ test + (require rackunit + racket/file) + (define this-path (syntax-source #'here)) + (define this-string (file->string this-path)) + (check-equal? (file->digest this-path) + (string->digest this-string)) + (check-equal? (file->expanded-syntax this-path values) + (string->expanded-syntax this-path this-string values)) + (check-equal? (path->existing-expanded-syntax this-path (λ (_stx) 42)) + 42)) diff --git a/elpa/racket-mode-20200218.1623/racket/test/find-examples.rkt b/elpa/racket-mode-20200323.1739/racket/test/find-examples.rkt similarity index 89% rename from elpa/racket-mode-20200218.1623/racket/test/find-examples.rkt rename to elpa/racket-mode-20200323.1739/racket/test/find-examples.rkt index 29e7ca65..adf7ecbb 100644 --- a/elpa/racket-mode-20200218.1623/racket/test/find-examples.rkt +++ b/elpa/racket-mode-20200323.1739/racket/test/find-examples.rkt @@ -2,7 +2,7 @@ (require racket/contract) -;; Examples for test/defn.rkt. +;; Examples for test/find.rkt. (define (plain x) x) (provide plain) @@ -53,3 +53,9 @@ (provide a-number) (define a-parameter (make-parameter #f)) (provide a-parameter) + +(module m racket/base + (define from-m #f) + (provide from-m)) +(require 'm) +(provide (contract-out [from-m any/c])) diff --git a/elpa/racket-mode-20200218.1623/racket/test/find.rkt b/elpa/racket-mode-20200323.1739/racket/test/find.rkt similarity index 58% rename from elpa/racket-mode-20200218.1623/racket/test/find.rkt rename to elpa/racket-mode-20200323.1739/racket/test/find.rkt index a9965dce..ceb1abf8 100644 --- a/elpa/racket-mode-20200218.1623/racket/test/find.rkt +++ b/elpa/racket-mode-20200323.1739/racket/test/find.rkt @@ -6,101 +6,104 @@ rackunit syntax/modread "../find.rkt" + "../syntax.rkt" "find-examples.rkt") -(define-runtime-path dot-dot "..") +(define (not-0 v) (not (= 0 v))) +(define (not-1 v) (not (= 1 v))) -(define-namespace-anchor nsa) -(parameterize ([current-namespace (namespace-anchor->namespace nsa)]) - (define (not-0 v) (not (= 0 v))) - (define (not-1 v) (not (= 1 v))) +(define-runtime-path parent-dir "..") - (check-equal? (find-definition "display") +(define (test how) + (check-equal? (find-definition how "display") 'kernel) - (check-equal? (find-signature "display") + (check-equal? (find-signature how "display") '("defined in #%kernel, signature unavailable")) - (check-match (find-definition "displayln") + (check-match (find-definition how "displayln") (list (pregexp "/racket/private/misc\\.rkt$") (? not-1) (? not-0))) - (check-equal? (find-signature "displayln") + (check-equal? (find-signature how "displayln") '((displayln v) (displayln v p))) ;case-lambda defn ;; Test a definer macro that (as of Racket 6.7) does not properly ;; set srcloc: Can we at least return a specfic location for its ;; parent syntax (as opposed to line 1 column 0)? - (check-match (find-definition "in-hash") + (check-match (find-definition how "in-hash") (list (pregexp "/racket/private/for.rkt$") (? not-1) (? not-0))) ;; Tests for specific locations in find-examples.rkt - (check-match (find-definition "plain") + (check-match (find-definition how "plain") (list (pregexp "find-examples.rkt$") 7 9)) - (check-equal? (find-signature "plain") + (check-equal? (find-signature how "plain") '(plain x)) - (check-match (find-definition "renamed") + (check-match (find-definition how "renamed") (list (pregexp "find-examples.rkt$") 7 9)) - (check-equal? (find-signature "renamed") + (check-equal? (find-signature how "renamed") '(plain x)) - (check-match (find-definition "contracted1") + (check-match (find-definition how "contracted1") (list (pregexp "find-examples.rkt$") 11 9)) - (check-equal? (find-signature "contracted1") + (check-equal? (find-signature how "contracted1") '(contracted1 x)) - (check-match (find-definition "contracted2") + (check-match (find-definition how "contracted2") (list (pregexp "find-examples.rkt$") 13 9)) - (check-equal? (find-signature "contracted2") + (check-equal? (find-signature how "contracted2") '(contracted2 x)) - (check-match (find-definition "contracted/renamed") + (check-match (find-definition how "contracted/renamed") (list (pregexp "find-examples.rkt$") 16 9)) - (check-equal? (find-signature "contracted/renamed") + (check-equal? (find-signature how "contracted/renamed") '(c/r x)) - (check-match (find-definition "plain-by-macro") + (check-match (find-definition how "plain-by-macro") (list (pregexp "find-examples.rkt$") 23 15)) - (check-false (find-signature "plain-by-macro")) + (check-false (find-signature how "plain-by-macro")) - (check-match (find-definition "contracted-by-macro") + (check-match (find-definition how "contracted-by-macro") (list (pregexp "find-examples.rkt$") 29 20)) - (check-false (find-signature "contracted-by-macro")) + (check-false (find-signature how "contracted-by-macro")) - (check-match (find-definition "sub") + (check-match (find-definition how "sub") (list (pregexp "find-examples.rkt$") 38 11)) - (check-equal? (find-signature "sub") + (check-equal? (find-signature how "sub") '(sub x)) - (check-match (find-definition "sub/renamed") + (check-match (find-definition how "sub/renamed") (list (pregexp "find-examples.rkt$") 38 11)) - (check-equal? (find-signature "sub/renamed") + (check-equal? (find-signature how "sub/renamed") '(sub x)) - (check-match (find-definition "foo") + (check-match (find-definition how "foo") (list (pregexp "find-examples.rkt$") 48 9)) - (check-equal? (find-signature "foo") + (check-equal? (find-signature how "foo") '(foo x)) - (check-match (find-definition "a-number") + (check-match (find-definition how "a-number") (list (pregexp "find-examples.rkt$") 52 8)) - (check-match (find-definition "a-parameter") + (check-match (find-definition how "a-parameter") (list (pregexp "find-examples.rkt$") 54 8)) + (check-match (find-definition how "from-m") + (list (pregexp "find-examples.rkt$") 58 10)) + ;; This is (roughly) a test of opening a Racket source file and ;; doing M-. on every non-list sexpr: Call find-definition on each ;; sexpr. Not-found (#f) is fine. But fail test for (list _ 1 0) -- ;; i.e. the source file was found, but not the location within. (define (check-non-bof-location file) (define ht (make-hash)) - (define (find k) ;memoized find-definition + (define (find k) ;memoized find-definition how (hash-ref ht k (λ () - (define v (find-definition (format "~a" k))) + (define v (find-definition how (format "~a" k))) (hash-set! ht k v) v))) (define (walk v) @@ -117,5 +120,17 @@ ;; `racket-visit-definition` takes text from an Emacs buffer. (λ () (with-input-from-file file read))))) (for ([file '("commands/requires.rkt" - "run.rkt")]) - (check-non-bof-location (build-path dot-dot file)))) + "repl.rkt")]) + (check-non-bof-location (build-path parent-dir file)))) + + +;; Exercise "how" = 'namespace +(define-namespace-anchor nsa) +(parameterize ([current-namespace (namespace-anchor->namespace nsa)]) + (test 'namespace)) + +;; Exercise "how" = a specific file +(define this-file (path->string (syntax-source #'here))) +(file->expanded-syntax this-file + (λ (_stx) + (test this-file))) diff --git a/elpa/racket-mode-20200323.1739/racket/util.rkt b/elpa/racket-mode-20200323.1739/racket/util.rkt new file mode 100644 index 00000000..10ac3d0d --- /dev/null +++ b/elpa/racket-mode-20200323.1739/racket/util.rkt @@ -0,0 +1,110 @@ +#lang racket/base + +(require (for-syntax racket/base) + syntax/stx + syntax/parse/define + racket/format + (only-in racket/path + filename-extension)) + +(provide display-commented + string->namespace-syntax + syntax-or-sexpr->syntax + syntax-or-sexpr->sexpr + nat/c + pos/c + inc! + memq? + in-syntax + log-racket-mode-debug + log-racket-mode-info + log-racket-mode-warning + log-racket-mode-error + log-racket-mode-fatal + time-apply/log + with-time/log + define-polyfill + path-has-extension? + path-replace-extension) + +(define (display-commented str) + (eprintf "; ~a\n" + (regexp-replace* "\n" str "\n; "))) + +(define (string->namespace-syntax str) + (namespace-syntax-introduce + (read-syntax #f (open-input-string str)))) + +(define (syntax-or-sexpr->syntax v) + (if (syntax? v) + v + (namespace-syntax-introduce (datum->syntax #f v)))) + +(define (syntax-or-sexpr->sexpr v) + (if (syntax? v) + (syntax-e v) + v)) + +(define nat/c exact-nonnegative-integer?) +(define pos/c exact-positive-integer?) + +(define-simple-macro (inc! v:id) + (set! v (add1 v))) + +(define (memq? x xs) + (and (memq x xs) #t)) + +;;; in-syntax: Not defined until Racket 6.3 + +(define-sequence-syntax in-syntax + (λ () #'in-syntax/proc) + (λ (stx) + (syntax-case stx () + [[(id) (_ arg)] + #'[(id) (in-list (in-syntax/proc arg))]]))) + +(define (in-syntax/proc stx) + (or (stx->list stx) + (raise-type-error 'in-syntax "stx-list" stx))) + +;;; logger / timing + +(define-logger racket-mode) + +(define (time-apply/log what proc args) + (define-values (vs cpu real gc) (time-apply proc args)) + (define (fmt n) (~v #:align 'right #:min-width 4 n)) + (log-racket-mode-debug "~a cpu | ~a real | ~a gc <= ~a" + (fmt cpu) (fmt real) (fmt gc) what) + (apply values vs)) + +(define-simple-macro (with-time/log what e ...+) + (time-apply/log what (λ () e ...) '())) + +;;; Path extension for Racket versions < 6.6 + +(define-simple-macro (define-polyfill (id:id arg:expr ...) + #:module mod:id + body:expr ...+) + (define id + (with-handlers ([exn:fail? (λ (_exn) + (λ (arg ...) body ...))]) + (dynamic-require 'mod 'id)))) + +(define-polyfill (path-has-extension? path ext) + #:module racket/path + (let ([ext (if (string? ext) (string->bytes/utf-8 ext) ext)]) + (equal? (filename-extension path) ext))) + +(define-polyfill (path-replace-extension path ext) + #:module racket/path + (path-replace-suffix path ext)) + +(module+ test + (require rackunit) + (check-true (path-has-extension? "/path/to/foo.EXT" "EXT")) + (check-true (path-has-extension? (build-path "/path/to/foo.EXT") "EXT")) + (check-equal? (path-replace-extension "/path/to/foo.OLD" ".NEW") + (build-path "/path/to/foo.NEW")) + (check-equal? (path-replace-extension (build-path "/path/to/foo.OLD") ".NEW") + (build-path "/path/to/foo.NEW"))) diff --git a/elpa/spacemacs-theme-20200127.1656/spacemacs-common.el b/elpa/spacemacs-theme-20200127.1656/spacemacs-common.el deleted file mode 100644 index 5f61b85b..00000000 --- a/elpa/spacemacs-theme-20200127.1656/spacemacs-common.el +++ /dev/null @@ -1,1018 +0,0 @@ -;;; spacemacs-common.el --- Color theme with a dark and light versions. - -;; Copyright (C) 2015-2018 Nasser Alshammari - -;; Author: Nasser Alshammari -;; URL: -;; -;; Version: 0.1 -;; Keywords: color, theme -;; Package-Requires: ((emacs "24")) - -;; Initially created with the help of emacs-theme-generator, . - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;; This file is not part of Emacs. - -;;; Commentary: - -;; This is a color theme for spacemacs . -;; It comes with two versions, dark and light and should work well in -;; a 256 color terminal. - -;;; Code: - -(defgroup spacemacs-theme nil - "Spacemacs-theme options." - :group 'faces) - -(defcustom spacemacs-theme-comment-bg t - "Use a background for comment lines." - :type 'boolean - :group 'spacemacs-theme) - -(defcustom spacemacs-theme-comment-italic nil - "Enable italics for comments and also disable background." - :type 'boolean - :group 'spacemacs-theme) - -(defcustom spacemacs-theme-keyword-italic nil - "Enable italics for keywords." - :type 'boolean - :group 'spacemacs-theme) - -(defcustom spacemacs-theme-org-agenda-height nil - "If non-nil, use varying text heights for agenda items. - -Note that if you change this to a non-nil value, you may want to -also adjust the value of `org-agenda-tags-column'. If that is set -to 'auto, tags may not be properly aligned. " - :type 'boolean - :group 'spacemacs-theme) - -(defcustom spacemacs-theme-org-height t - "Use varying text heights for org headings." - :type 'boolean - :group 'spacemacs-theme) - -(defcustom spacemacs-theme-org-bold t - "Inherit text bold for org headings" - :type 'boolean - :group 'spacemacs-theme) - -(defcustom spacemacs-theme-org-priority-bold t - "Inherit text bold for priority items in agenda view" - :type 'boolean - :group 'spacemacs-theme) - -(defcustom spacemacs-theme-org-highlight nil - "Highlight org headings." - :type 'boolean - :group 'spacemacs-theme) - -(defcustom spacemacs-theme-custom-colors nil - "Specify a list of custom colors." - :type 'alist - :group 'spacemacs-theme) - -(defcustom spacemacs-theme-underline-parens t - "If non-nil, underline matching parens when using `show-paren-mode' or similar." - :type 'boolean - :group 'spacemacs-theme) - -(defun true-color-p () - (or - (display-graphic-p) - (= (tty-display-color-cells) 16777216))) - -(defun create-spacemacs-theme (variant theme-name) - (let ((class '((class color) (min-colors 89))) ;; ~~ Dark ~~ ~~ Light ~~ - ;; GUI TER GUI TER - ;; generic - (act1 (if (eq variant 'dark) (if (true-color-p) "#222226" "#121212") (if (true-color-p) "#e7e5eb" "#d7dfff"))) - (act2 (if (eq variant 'dark) (if (true-color-p) "#5d4d7a" "#444444") (if (true-color-p) "#d3d3e7" "#afafd7"))) - (base (if (eq variant 'dark) (if (true-color-p) "#b2b2b2" "#b2b2b2") (if (true-color-p) "#655370" "#5f5f87"))) - (base-dim (if (eq variant 'dark) (if (true-color-p) "#686868" "#585858") (if (true-color-p) "#a094a2" "#afafd7"))) - (bg1 (if (eq variant 'dark) (if (true-color-p) "#292b2e" "#262626") (if (true-color-p) "#fbf8ef" "#ffffff"))) - (bg2 (if (eq variant 'dark) (if (true-color-p) "#212026" "#1c1c1c") (if (true-color-p) "#efeae9" "#e4e4e4"))) - (bg3 (if (eq variant 'dark) (if (true-color-p) "#100a14" "#121212") (if (true-color-p) "#e3dedd" "#d0d0d0"))) - (bg4 (if (eq variant 'dark) (if (true-color-p) "#0a0814" "#080808") (if (true-color-p) "#d2ceda" "#bcbcbc"))) - (border (if (eq variant 'dark) (if (true-color-p) "#5d4d7a" "#111111") (if (true-color-p) "#b3b9be" "#b3b9be"))) - (cblk (if (eq variant 'dark) (if (true-color-p) "#cbc1d5" "#b2b2b2") (if (true-color-p) "#655370" "#5f5f87"))) - (cblk-bg (if (eq variant 'dark) (if (true-color-p) "#2f2b33" "#262626") (if (true-color-p) "#e8e3f0" "#ffffff"))) - (cblk-ln (if (eq variant 'dark) (if (true-color-p) "#827591" "#af5faf") (if (true-color-p) "#9380b2" "#af5fdf"))) - (cblk-ln-bg (if (eq variant 'dark) (if (true-color-p) "#373040" "#333333") (if (true-color-p) "#ddd8eb" "#dfdfff"))) - (cursor (if (eq variant 'dark) (if (true-color-p) "#e3dedd" "#d0d0d0") (if (true-color-p) "#100a14" "#121212"))) - (const (if (eq variant 'dark) (if (true-color-p) "#a45bad" "#d75fd7") (if (true-color-p) "#4e3163" "#8700af"))) - (comment (if (eq variant 'dark) (if (true-color-p) "#2aa1ae" "#008787") (if (true-color-p) "#2aa1ae" "#008787"))) - (comment-light (if (eq variant 'dark) (if (true-color-p) "#2aa1ae" "#008787") (if (true-color-p) "#a49da5" "#008787"))) - (comment-bg (if (eq variant 'dark) (if (true-color-p) "#292e34" "#262626") (if (true-color-p) "#ecf3ec" "#ffffff"))) - (comp (if (eq variant 'dark) (if (true-color-p) "#c56ec3" "#d75fd7") (if (true-color-p) "#6c4173" "#8700af"))) - (err (if (eq variant 'dark) (if (true-color-p) "#e0211d" "#e0211d") (if (true-color-p) "#e0211d" "#e0211d"))) - (func (if (eq variant 'dark) (if (true-color-p) "#bc6ec5" "#d75fd7") (if (true-color-p) "#6c3163" "#8700af"))) - (head1 (if (eq variant 'dark) (if (true-color-p) "#4f97d7" "#268bd2") (if (true-color-p) "#3a81c3" "#268bd2"))) - (head1-bg (if (eq variant 'dark) (if (true-color-p) "#293239" "#262626") (if (true-color-p) "#edf1ed" "#ffffff"))) - (head2 (if (eq variant 'dark) (if (true-color-p) "#2d9574" "#2aa198") (if (true-color-p) "#2d9574" "#2aa198"))) - (head2-bg (if (eq variant 'dark) (if (true-color-p) "#293235" "#262626") (if (true-color-p) "#edf2e9" "#ffffff"))) - (head3 (if (eq variant 'dark) (if (true-color-p) "#67b11d" "#67b11d") (if (true-color-p) "#67b11d" "#5faf00"))) - (head3-bg (if (eq variant 'dark) (if (true-color-p) "#293235" "#262626") (if (true-color-p) "#edf2e9" "#ffffff"))) - (head4 (if (eq variant 'dark) (if (true-color-p) "#b1951d" "#875f00") (if (true-color-p) "#b1951d" "#875f00"))) - (head4-bg (if (eq variant 'dark) (if (true-color-p) "#32322c" "#262626") (if (true-color-p) "#f6f1e1" "#ffffff"))) - (highlight (if (eq variant 'dark) (if (true-color-p) "#444155" "#444444") (if (true-color-p) "#d3d3e7" "#d7d7ff"))) - (highlight-dim (if (eq variant 'dark) (if (true-color-p) "#3b314d" "#444444") (if (true-color-p) "#e7e7fc" "#d7d7ff"))) - (keyword (if (eq variant 'dark) (if (true-color-p) "#4f97d7" "#268bd2") (if (true-color-p) "#3a81c3" "#268bd2"))) - (lnum (if (eq variant 'dark) (if (true-color-p) "#44505c" "#444444") (if (true-color-p) "#a8a8bf" "#af87af"))) - (mat (if (eq variant 'dark) (if (true-color-p) "#86dc2f" "#86dc2f") (if (true-color-p) "#ba2f59" "#af005f"))) - (meta (if (eq variant 'dark) (if (true-color-p) "#9f8766" "#af875f") (if (true-color-p) "#da8b55" "#df5f5f"))) - (str (if (eq variant 'dark) (if (true-color-p) "#2d9574" "#2aa198") (if (true-color-p) "#2d9574" "#2aa198"))) - (suc (if (eq variant 'dark) (if (true-color-p) "#86dc2f" "#86dc2f") (if (true-color-p) "#42ae2c" "#00af00"))) - (ttip (if (eq variant 'dark) (if (true-color-p) "#9a9aba" "#888888") (if (true-color-p) "#8c799f" "#5f5f87"))) - (ttip-sl (if (eq variant 'dark) (if (true-color-p) "#5e5079" "#333333") (if (true-color-p) "#c8c6dd" "#afafff"))) - (ttip-bg (if (eq variant 'dark) (if (true-color-p) "#34323e" "#444444") (if (true-color-p) "#e2e0ea" "#dfdfff"))) - (type (if (eq variant 'dark) (if (true-color-p) "#ce537a" "#df005f") (if (true-color-p) "#ba2f59" "#af005f"))) - (var (if (eq variant 'dark) (if (true-color-p) "#7590db" "#8787d7") (if (true-color-p) "#715ab1" "#af5fd7"))) - (war (if (eq variant 'dark) (if (true-color-p) "#dc752f" "#dc752f") (if (true-color-p) "#dc752f" "#dc752f"))) - - ;; colors - (aqua (if (eq variant 'dark) (if (true-color-p) "#2d9574" "#2aa198") (if (true-color-p) "#2d9574" "#2aa198"))) - (aqua-bg (if (eq variant 'dark) (if (true-color-p) "#293235" "#262626") (if (true-color-p) "#edf2e9" "#ffffff"))) - (green (if (eq variant 'dark) (if (true-color-p) "#67b11d" "#67b11d") (if (true-color-p) "#67b11d" "#5faf00"))) - (green-bg (if (eq variant 'dark) (if (true-color-p) "#293235" "#262626") (if (true-color-p) "#edf2e9" "#ffffff"))) - (green-bg-s (if (eq variant 'dark) (if (true-color-p) "#29422d" "#262626") (if (true-color-p) "#dae6d0" "#ffffff"))) - (cyan (if (eq variant 'dark) (if (true-color-p) "#28def0" "#00ffff") (if (true-color-p) "#21b8c7" "#008080"))) - (red (if (eq variant 'dark) (if (true-color-p) "#f2241f" "#d70000") (if (true-color-p) "#f2241f" "#d70008"))) - (red-bg (if (eq variant 'dark) (if (true-color-p) "#3c2a2c" "#262626") (if (true-color-p) "#faede4" "#ffffff"))) - (red-bg-s (if (eq variant 'dark) (if (true-color-p) "#512e31" "#262626") (if (true-color-p) "#eed9d2" "#ffffff"))) - (blue (if (eq variant 'dark) (if (true-color-p) "#4f97d7" "#268bd2") (if (true-color-p) "#3a81c3" "#268bd2"))) - (blue-bg (if (eq variant 'dark) (if (true-color-p) "#293239" "#262626") (if (true-color-p) "#edf1ed" "#d7d7ff"))) - (blue-bg-s (if (eq variant 'dark) (if (true-color-p) "#2d4252" "#262626") (if (true-color-p) "#d1dcdf" "#d7d7ff"))) - (magenta (if (eq variant 'dark) (if (true-color-p) "#a31db1" "#af00df") (if (true-color-p) "#a31db1" "#800080"))) - (yellow (if (eq variant 'dark) (if (true-color-p) "#b1951d" "#875f00") (if (true-color-p) "#b1951d" "#875f00"))) - (yellow-bg (if (eq variant 'dark) (if (true-color-p) "#32322c" "#262626") (if (true-color-p) "#f6f1e1" "#ffffff")))) - - (cl-loop for (cvar . val) in spacemacs-theme-custom-colors - do (set cvar val)) - - (custom-theme-set-faces - theme-name - -;;;;; basics - `(cursor ((,class (:background ,cursor)))) - `(custom-button ((,class :background ,bg2 :foreground ,base :box (:line-width 2 :style released-button)))) - `(default ((,class (:background ,bg1 :foreground ,base)))) - `(default-italic ((,class (:italic t)))) - `(error ((,class (:foreground ,err)))) - `(eval-sexp-fu-flash ((,class (:background ,suc :foreground ,bg1)))) - `(eval-sexp-fu-flash-error ((,class (:background ,err :foreground ,bg1)))) - `(font-lock-builtin-face ((,class (:foreground ,keyword)))) - `(font-lock-comment-face ((,class (:foreground ,(if spacemacs-theme-comment-italic comment-light comment) :background ,(when spacemacs-theme-comment-bg comment-bg) :slant ,(if spacemacs-theme-comment-italic 'italic 'normal))))) - `(font-lock-constant-face ((,class (:foreground ,const)))) - `(font-lock-doc-face ((,class (:foreground ,meta)))) - `(font-lock-function-name-face ((,class (:foreground ,func :inherit bold)))) - `(font-lock-keyword-face ((,class (:inherit bold :foreground ,keyword :slant ,(if spacemacs-theme-keyword-italic 'italic 'normal))))) - `(font-lock-negation-char-face ((,class (:foreground ,const)))) - `(font-lock-preprocessor-face ((,class (:foreground ,func)))) - `(font-lock-reference-face ((,class (:foreground ,const)))) - `(font-lock-string-face ((,class (:foreground ,str)))) - `(font-lock-type-face ((,class (:foreground ,type :inherit bold)))) - `(font-lock-variable-name-face ((,class (:foreground ,var)))) - `(font-lock-warning-face ((,class (:foreground ,war :background ,bg1)))) - `(fringe ((,class (:background ,bg1 :foreground ,base)))) - `(header-line ((,class :background ,bg2))) - `(highlight ((,class (:foreground ,base :background ,highlight)))) - `(hl-line ((,class (:background ,bg2 :extend t)))) - `(isearch ((,class (:foreground ,bg1 :background ,mat)))) - `(lazy-highlight ((,class (:background ,green-bg-s :weight normal)))) - `(link ((,class (:foreground ,comment :underline t)))) - `(link-visited ((,class (:foreground ,comp :underline t)))) - `(match ((,class (:background ,highlight :foreground ,mat)))) - `(minibuffer-prompt ((,class (:inherit bold :foreground ,keyword)))) - `(page-break-lines ((,class (:foreground ,act2)))) - `(region ((,class (:background ,highlight :extend t)))) - `(secondary-selection ((,class (:background ,bg3)))) - `(shadow ((,class (:foreground ,base-dim)))) - `(success ((,class (:foreground ,suc)))) - `(tooltip ((,class (:background ,ttip-sl :foreground ,base :bold nil :italic nil :underline nil)))) - `(vertical-border ((,class (:foreground ,border)))) - `(warning ((,class (:foreground ,war)))) - -;;;;; ace-window - `(aw-leading-char-face ((,class (:foreground ,func :weight bold :height 2.0 :box (:line-width 1 :color ,keyword :style released-button))))) - -;;;;; ahs - `(ahs-face ((,class (:background ,highlight)))) - `(ahs-plugin-whole-buffer-face ((,class (:background ,mat :foreground ,bg1)))) - -;;;;; anzu-mode - `(anzu-mode-line ((,class (:foreground ,yellow :inherit bold)))) - -;;;;; auto-complete - `(ac-completion-face ((,class (:background ,ttip-bg :foreground ,ttip)))) - -;;;;; avy - `(avy-lead-face ((,class (:background ,green-bg :foreground ,green)))) - `(avy-lead-face-0 ((,class (:background ,green-bg :foreground ,yellow)))) - `(avy-lead-face-1 ((,class (:background ,green-bg :foreground ,magenta)))) - `(avy-lead-face-2 ((,class (:background ,green-bg :foreground ,blue)))) - -;;;;; calfw - `(cfw:face-title ((,class (:foreground ,head1 :height 2.0 :weight bold :inherit variable-pitch)))) - `(cfw:face-header ((,class (:foreground ,base :weight bold)))) - `(cfw:face-saturday ((,class (:foreground ,base :weight bold)))) - `(cfw:face-sunday ((,class (:foreground ,base :weight bold)))) - `(cfw:face-holiday ((,class (:foreground ,head1 :weight bold)))) - `(cfw:face-grid ((,class (:foreground ,border)))) - `(cfw:face-default-content ((,class (:foreground ,green)))) - `(cfw:face-periods ((,class (:foreground ,cyan)))) - `(cfw:face-day-title ((,class (:background ,head1-bg)))) - `(cfw:face-default-day ((,class (:foreground ,base :weight bold)))) - `(cfw:face-annotation ((,class (:foreground ,aqua)))) - `(cfw:face-disable ((,class (:foreground ,base-dim)))) - `(cfw:face-today-title ((,class (:background ,blue :weight bold)))) - `(cfw:face-today ((,class (:background ,head1-bg :weight bold)))) - `(cfw:face-select ((,class (:background ,magenta :weight bold)))) - `(cfw:face-toolbar ((,class (:foreground ,base :background ,bg1)))) - `(cfw:face-toolbar-button-off ((,class (:foreground ,base :weight bold)))) - `(cfw:face-toolbar-button-on ((,class (:foreground ,base :weight bold)))) - -;;;;; centaur-tabs - `(centaur-tabs-default ((,class (:background ,bg1 :foreground ,bg1)))) - `(centaur-tabs-selected ((,class (:background ,bg1 :foreground ,base :weight bold)))) - `(centaur-tabs-unselected ((,class (:background ,bg2 :foreground ,base-dim :weight light)))) - `(centaur-tabs-selected-modified ((,class (:background ,bg1 - :foreground ,blue :weight bold)))) - `(centaur-tabs-unselected-modified ((,class (:background ,bg2 :weight light - :foreground ,blue)))) - `(centaur-tabs-active-bar-face ((,class (:background ,keyword)))) - `(centaur-tabs-modified-marker-selected ((,class (:inherit 'centaur-tabs-selected :foreground,keyword)))) - `(centaur-tabs-modified-marker-unselected ((,class (:inherit 'centaur-tabs-unselected :foreground,keyword)))) - -;;;;; cider - `(cider-enlightened ((,class (:background nil :box (:color ,yellow :line-width -1 :style nil) :foreground ,yellow)))) - `(cider-enlightened-local ((,class (:foreground ,yellow)))) - `(cider-instrumented-face ((,class (:background nil :box (:color ,red :line-width -1 :style nil) :foreground ,red)))) - `(cider-result-overlay-face ((,class (:background nil :box (:color ,blue :line-width -1 :style nil) :foreground ,blue)))) - `(cider-test-error-face ((,class (:background ,war :foreground ,bg1)))) - `(cider-test-failure-face ((,class (:background ,err :foreground ,bg1)))) - `(cider-test-success-face ((,class (:background ,suc :foreground ,bg1)))) - `(cider-traced-face ((,class :box (:color ,cyan :line-width -1 :style nil)))) - -;;;;; company - `(company-echo-common ((,class (:background ,base :foreground ,bg1)))) - `(company-preview ((,class (:background ,ttip-bg :foreground ,ttip)))) - `(company-preview-common ((,class (:background ,ttip-bg :foreground ,base)))) - `(company-preview-search ((,class (:inherit match)))) - `(company-scrollbar-bg ((,class (:background ,bg2)))) - `(company-scrollbar-fg ((,class (:background ,act2)))) - `(company-template-field ((,class (:inherit region)))) - `(company-tooltip ((,class (:background ,ttip-bg :foreground ,ttip)))) - `(company-tooltip-annotation ((,class (:foreground ,type)))) - `(company-tooltip-common ((,class (:background ,ttip-bg :foreground ,keyword)))) - `(company-tooltip-common-selection ((,class (:foreground ,base)))) - `(company-tooltip-mouse ((,class (:inherit highlight)))) - `(company-tooltip-search ((,class (:inherit match)))) - `(company-tooltip-selection ((,class (:background ,ttip-sl :foreground ,base)))) - -;;;;; diff - `(diff-added ((,class :background nil :foreground ,green :extend t))) - `(diff-changed ((,class :background nil :foreground ,blue))) - `(diff-header ((,class :background ,cblk-ln-bg :foreground ,func :extend t))) - `(diff-file-header ((,class :background ,cblk-ln-bg :foreground ,cblk :extend t))) - `(diff-indicator-added ((,class :background nil :foreground ,green :extend t))) - `(diff-indicator-changed ((,class :background nil :foreground ,blue))) - `(diff-indicator-removed ((,class :background nil :foreground ,red))) - `(diff-refine-added ((,class :background ,green :foreground ,bg1))) - `(diff-refine-changed ((,class :background ,blue :foreground ,bg1))) - `(diff-refine-removed ((,class :background ,red :foreground ,bg1))) - `(diff-removed ((,class :background nil :foreground ,red :extend t))) - -;;;;; diff-hl - `(diff-hl-change ((,class :background ,blue-bg-s :foreground ,blue))) - `(diff-hl-delete ((,class :background ,red-bg-s :foreground ,red))) - `(diff-hl-insert ((,class :background ,green-bg-s :foreground ,green))) - -;;;;; dired - `(dired-directory ((,class (:foreground ,keyword :background ,bg1 :inherit bold)))) - `(dired-flagged ((,class (:foreground ,red)))) - `(dired-header ((,class (:foreground ,comp :inherit bold)))) - `(dired-ignored ((,class (:inherit shadow)))) - `(dired-mark ((,class (:foreground ,comp :inherit bold)))) - `(dired-marked ((,class (:foreground ,magenta :inherit bold)))) - `(dired-perm-write ((,class (:foreground ,base :underline t)))) - `(dired-symlink ((,class (:foreground ,cyan :background ,bg1 :inherit bold)))) - `(dired-warning ((,class (:foreground ,war)))) - -;;;;; doom-modeline - `(doom-modeline-bar ((,class (:background ,keyword)))) - -;;;;; ediff - `(ediff-current-diff-A ((,class(:background ,red-bg :foreground ,red :extend t)))) - `(ediff-current-diff-Ancestor ((,class(:background ,aqua-bg :foreground ,aqua :extend t)))) - `(ediff-current-diff-B ((,class(:background ,green-bg :foreground ,green :extend t)))) - `(ediff-current-diff-C ((,class(:background ,blue-bg :foreground ,blue :extend t)))) - `(ediff-even-diff-A ((,class(:background ,bg3 :extend t)))) - `(ediff-even-diff-Ancestor ((,class(:background ,bg3 :extend t)))) - `(ediff-even-diff-B ((,class(:background ,bg3 :extend t)))) - `(ediff-even-diff-C ((,class(:background ,bg3 :extend t)))) - `(ediff-fine-diff-A ((,class(:background ,red :foreground ,bg1 :extend t)))) - `(ediff-fine-diff-Ancestor ((,class(:background nil :inherit bold :extend t)))) - `(ediff-fine-diff-B ((,class(:background ,green :foreground ,bg1)))) - `(ediff-fine-diff-C ((,class(:background ,blue :foreground ,bg1)))) - `(ediff-odd-diff-A ((,class(:background ,bg4 :extend t)))) - `(ediff-odd-diff-Ancestor ((,class(:background ,bg4 :extend t)))) - `(ediff-odd-diff-B ((,class(:background ,bg4 :extend t)))) - `(ediff-odd-diff-C ((,class(:background ,bg4 :extend t)))) - -;;;;; ein - `(ein:cell-input-area((,class (:background ,bg2)))) - `(ein:cell-input-prompt ((,class (:foreground ,suc)))) - `(ein:cell-output-prompt ((,class (:foreground ,err)))) - `(ein:notification-tab-normal ((,class (:foreground ,keyword)))) - `(ein:notification-tab-selected ((,class (:foreground ,suc :inherit bold)))) - -;;;;; eldoc - `(eldoc-highlight-function-argument ((,class (:foreground ,mat :inherit bold)))) - -;;;;; elfeed - `(elfeed-search-date-face ((,class (:foreground ,head2)))) - `(elfeed-search-feed-face ((,class (:foreground ,blue)))) - `(elfeed-search-tag-face ((,class (:foreground ,func)))) - `(elfeed-search-title-face ((,class (:foreground ,var)))) - `(elfeed-search-unread-title-face ((,class (:foreground ,base)))) - -;;;;; enh-ruby - `(enh-ruby-op-face ((,class (:background ,bg1 :foreground ,base)))) - `(enh-ruby-string-delimiter-face ((,class (:foreground ,str)))) - -;;;;; erc - `(erc-input-face ((,class (:foreground ,func)))) - `(erc-my-nick-face ((,class (:foreground ,keyword)))) - `(erc-nick-default-face ((,class (:foreground ,keyword)))) - `(erc-nick-prefix-face ((,class (:foreground ,yellow)))) - `(erc-notice-face ((,class (:foreground ,str)))) - `(erc-prompt-face ((,class (:foreground ,mat :inherit bold)))) - `(erc-timestamp-face ((,class (:foreground ,keyword)))) - -;;;;; eshell - `(eshell-ls-archive ((,class (:foreground ,red :inherit bold)))) - `(eshell-ls-backup ((,class (:inherit font-lock-comment-face)))) - `(eshell-ls-clutter ((,class (:inherit font-lock-comment-face)))) - `(eshell-ls-directory ((,class (:foreground ,keyword :inherit bold)))) - `(eshell-ls-executable ((,class (:foreground ,suc :inherit bold)))) - `(eshell-ls-missing ((,class (:inherit font-lock-warning-face)))) - `(eshell-ls-product ((,class (:inherit font-lock-doc-face)))) - `(eshell-ls-special ((,class (:foreground ,yellow :inherit bold)))) - `(eshell-ls-symlink ((,class (:foreground ,cyan :inherit bold)))) - `(eshell-ls-unreadable ((,class (:foreground ,base)))) - `(eshell-prompt ((,class (:foreground ,keyword :inherit bold)))) - -;;;;; ESS - `(ess-assignment-face ((,class (:foreground ,type :inherit bold)))) - `(ess-backquoted-face ((,class (:foreground ,var)))) - `(ess-constant-face ((,class (:inherit font-lock-constant-face)))) - `(ess-f-t-face ((,class (:inherit font-lock-constant-face)))) - `(ess-function-call-face ((,class (:foreground ,func)))) - `(ess-keyword-face ((,class (:inherit font-lock-keyword-face)))) - `(ess-matrix-face ((,class (:foreground ,base-dim)))) - `(ess-modifiers-face ((,class (:foreground ,keyword)))) - `(ess-numbers-face ((,class (:inherit font-lock-constant-face)))) - `(ess-operator-face ((,class (:foreground ,var)))) - `(ess-paren-face ((,class (:foreground ,blue)))) - `(ess-r-control-flow-keyword-face ((,class (:foreground ,keyword)))) - `(ess-r-signal-keyword-face ((,class (:foreground ,war)))) - -;;;;; evil - `(evil-ex-lazy-highlight ((,class (:background ,mat :foreground ,bg1)))) - `(evil-ex-substitute-matches ((,class (:background ,red-bg :foreground ,red)))) - `(evil-ex-substitute-replacement ((,class (:background ,green-bg :foreground ,green)))) - -;;;;; evil-goggles - `(evil-goggles--pulse-face ((,class (:background ,yellow-bg :foreground ,yellow)))) - `(evil-goggles-change-face ((,class (:background ,blue-bg-s :foreground ,blue)))) - `(evil-goggles-commentary-face ((,class (:background ,aqua-bg :foreground ,aqua)))) - `(evil-goggles-delete-face ((,class (:background ,red-bg-s :foreground ,red)))) - `(evil-goggles-fill-and-move-face ((,class (:background ,green-bg-s :foreground ,green)))) - `(evil-goggles-indent-face ((,class (:background ,green-bg-s :foreground ,green)))) - `(evil-goggles-join-face ((,class (:background ,green-bg-s :foreground ,green)))) - `(evil-goggles-nerd-commenter-face ((,class (:background ,aqua-bg :foreground ,aqua)))) - `(evil-goggles-paste-face ((,class (:background ,green-bg-s :foreground ,green)))) - `(evil-goggles-record-macro-face ((,class (:background ,blue-bg-s :foreground ,blue)))) - `(evil-goggles-replace-with-register-face ((,class (:background ,yellow-bg :foreground ,yellow)))) - `(evil-goggles-set-marker-face ((,class (:background ,blue-bg-s :foreground ,blue)))) - `(evil-goggles-shift-face ((,class (:background ,blue-bg-s :foreground ,blue)))) - `(evil-goggles-surround-face ((,class (:background ,blue-bg-s :foreground ,blue)))) - `(evil-goggles-yank-face ((,class (:background ,blue-bg-s :foreground ,blue)))) - `(evil-goggles-undo-redo-add-face ((,class (:background ,green-bg-s :foreground ,green)))) - `(evil-goggles-undo-redo-change-face ((,class (:background ,blue-bg-s :foreground ,blue)))) - `(evil-goggles-undo-redo-remove-face ((,class (:background ,red-bg-s :foreground ,red)))) - -;;;;; evil-mc - `(evil-mc-cursor-bar-face ((,class (:foreground ,aqua)))) - `(evil-mc-cursor-default-face ((,class (:background ,aqua :foreground ,bg4)))) - `(evil-mc-cursor-hbar-face ((,class (:foreground ,aqua)))) - `(evil-mc-region-face ((,class (:inherit highlight)))) - -;;;;; flycheck - `(flycheck-error - ((,(append '((supports :underline (:style line))) class) - (:underline (:style line :color ,err))) - (,class (:foreground ,base :background ,err :inherit bold :underline t)))) - `(flycheck-error-list-checker-name ((,class (:foreground ,keyword)))) - `(flycheck-fringe-error ((,class (:foreground ,err :inherit bold)))) - `(flycheck-fringe-info ((,class (:foreground ,keyword :inherit bold)))) - `(flycheck-fringe-warning ((,class (:foreground ,war :inherit bold)))) - `(flycheck-info - ((,(append '((supports :underline (:style line))) class) - (:underline (:style line :color ,keyword))) - (,class (:foreground ,base :background ,keyword :inherit bold :underline t)))) - `(flycheck-warning - ((,(append '((supports :underline (:style line))) class) - (:underline (:style line :color ,war))) - (,class (:foreground ,base :background ,war :inherit bold :underline t)))) - -;;;;; flymake - `(flymake-error ((,(append '((supports :underline (:style line))) class) - (:underline (:style line :color ,err))) - (,class (:foreground ,base :background ,err :inherit bold :underline t)))) - `(flymake-note ((,(append '((supports :underline (:style line))) class) - (:underline (:style wave :color ,keyword))) - (,class (:foreground ,base :background ,keyword :inherit bold :underline t)))) - `(flymake-warning ((,(append '((supports :underline (:style line))) class) - (:underline (:style line :color ,war))) - (,class (:foreground ,base :background ,war :inherit bold :underline t)))) - -;;;;; flyspell - `(flyspell-incorrect ((,(append '((supports :underline (:style line))) class) - (:underline (:style wave :color ,war))) - (,class (:foreground ,base :background ,war :inherit bold :underline t)))) - `(flyspell-duplicate ((,(append '((supports :underline (:style line))) class) - (:underline (:style wave :color ,keyword))) - (,class (:foreground ,base :background ,keyword :inherit bold :underline t)))) - -;;;;; jabber - `(jabber-activity-face ((,class (:inherit bold :foreground ,red)))) - `(jabber-activity-personal-face ((,class (:inherit bold :foreground ,blue)))) - `(jabber-chat-error ((,class (:inherit bold :foreground ,red)))) - `(jabber-chat-prompt-foreign ((,class (:inherit bold :foreground ,red)))) - `(jabber-chat-prompt-local ((,class (:inherit bold :foreground ,blue)))) - `(jabber-chat-prompt-system ((,class (:inherit bold :foreground ,green)))) - `(jabber-chat-text-foreign ((,class (:foreground ,base)))) - `(jabber-chat-text-local ((,class (:foreground ,base)))) - `(jabber-rare-time-face ((,class (:foreground ,green)))) - `(jabber-roster-user-away ((,class (:foreground ,yellow)))) - `(jabber-roster-user-chatty ((,class (:inherit bold :foreground ,green)))) - `(jabber-roster-user-dnd ((,class (:foreground ,red)))) - `(jabber-roster-user-error ((,class (:foreground ,err)))) - `(jabber-roster-user-offline ((,class (:foreground ,base)))) - `(jabber-roster-user-online ((,class (:inherit bold :foreground ,green)))) - `(jabber-roster-user-xa ((,class (:foreground ,aqua)))) - -;;;;; git-gutter-fr - `(git-gutter-fr:added ((,class (:foreground ,green :inherit bold)))) - `(git-gutter-fr:deleted ((,class (:foreground ,war :inherit bold)))) - `(git-gutter-fr:modified ((,class (:foreground ,keyword :inherit bold)))) - -;;;;; git-timemachine - `(git-timemachine-minibuffer-detail-face ((,class (:foreground ,blue :inherit bold :background ,blue-bg)))) - -;;;;; gnus - `(gnus-emphasis-highlight-words ((,class (:background ,suc :foreground ,bg1)))) - `(gnus-header-content ((,class (:foreground ,keyword)))) - `(gnus-header-from ((,class (:foreground ,var)))) - `(gnus-header-name ((,class (:foreground ,comp)))) - `(gnus-header-subject ((,class (:foreground ,func :inherit bold)))) - `(gnus-summary-cancelled ((,class (:background ,war :foreground ,bg1)))) - -;;;;; guide-key - `(guide-key/highlight-command-face ((,class (:foreground ,base)))) - `(guide-key/key-face ((,class (:foreground ,keyword)))) - `(guide-key/prefix-command-face ((,class (:foreground ,keyword :inherit bold)))) - -;;;;; helm - `(helm-bookmark-directory ((,class (:inherit helm-ff-directory)))) - `(helm-bookmark-file ((,class (:foreground ,base)))) - `(helm-bookmark-gnus ((,class (:foreground ,comp)))) - `(helm-bookmark-info ((,class (:foreground ,comp)))) - `(helm-bookmark-man ((,class (:foreground ,comp)))) - `(helm-bookmark-w3m ((,class (:foreground ,comp)))) - `(helm-buffer-directory ((,class (:foreground ,base :background ,bg1)))) - `(helm-buffer-file ((,class (:foreground ,base :background ,bg1)))) - `(helm-buffer-not-saved ((,class (:foreground ,comp :background ,bg1)))) - `(helm-buffer-process ((,class (:foreground ,keyword :background ,bg1)))) - `(helm-buffer-saved-out ((,class (:foreground ,base :background ,bg1)))) - `(helm-buffer-size ((,class (:foreground ,base :background ,bg1)))) - `(helm-candidate-number ((,class (:background ,bg1 :foreground ,keyword :inherit bold)))) - `(helm-ff-directory ((,class (:foreground ,keyword :background ,bg1 :inherit bold)))) - `(helm-ff-dotted-directory ((,class (:foreground ,keyword :background ,bg1 :inherit bold)))) - `(helm-ff-dotted-symlink-directory ((,class (:foreground ,cyan :background ,bg1 :inherit bold)))) - `(helm-ff-executable ((,class (:foreground ,suc :background ,bg1 :weight normal)))) - `(helm-ff-file ((,class (:foreground ,base :background ,bg1 :weight normal)))) - `(helm-ff-invalid-symlink ((,class (:foreground ,red :background ,bg1 :inherit bold)))) - `(helm-ff-prefix ((,class (:foreground ,bg1 :background ,keyword :weight normal)))) - `(helm-ff-symlink ((,class (:foreground ,cyan :background ,bg1 :inherit bold)))) - `(helm-grep-cmd-line ((,class (:foreground ,base :background ,bg1)))) - `(helm-grep-file ((,class (:foreground ,base :background ,bg1)))) - `(helm-grep-finish ((,class (:foreground ,base :background ,bg1)))) - `(helm-grep-lineno ((,class (:foreground ,type :background ,bg1 :inherit bold)))) - `(helm-grep-match ((,class (:foreground nil :background nil :inherit helm-match)))) - `(helm-header ((,class (:foreground ,base :background ,bg1 :underline nil :box nil)))) - `(helm-header-line-left-margin ((,class (:foreground ,keyword :background ,nil)))) - `(helm-match ((,class (:background ,head1-bg :foreground ,head1)))) - `(helm-match-item ((,class (:background ,head1-bg :foreground ,head1)))) - `(helm-moccur-buffer ((,class (:foreground ,var :background ,bg1)))) - `(helm-selection ((,class (:background ,highlight)))) - `(helm-selection-line ((,class (:background ,bg2)))) - `(helm-separator ((,class (:foreground ,comp :background ,bg1)))) - `(helm-source-header ((,class (:background ,comp :foreground ,bg1 :inherit bold)))) - `(helm-time-zone-current ((,class (:foreground ,keyword :background ,bg1)))) - `(helm-time-zone-home ((,class (:foreground ,comp :background ,bg1)))) - `(helm-visible-mark ((,class (:foreground ,keyword :background ,bg3)))) - -;;;;; helm-swoop - `(helm-swoop-target-line-block-face ((,class (:foreground ,base :background ,highlight)))) - `(helm-swoop-target-line-face ((,class (:background ,highlight)))) - `(helm-swoop-target-word-face ((,class (:background ,highlight :foreground ,mat)))) - -;;;;; highlights - `(hi-green ((,class (:foreground ,green :background ,green-bg)))) - `(hi-yellow ((,class (:foreground ,yellow :background ,yellow-bg)))) - -;;;;; highlight-indentation - `(highlight-indentation-face ((,class (:background ,comment-bg)))) - -;;;;; highlight-symbol - `(highlight-symbol-face ((,class (:background ,bg2)))) - -;;;;; hydra - `(hydra-face-blue ((,class (:foreground ,blue)))) - `(hydra-face-red ((,class (:foreground ,red)))) - -;;;;; ido - `(ido-first-match ((,class (:foreground ,comp :inherit bold)))) - `(ido-only-match ((,class (:foreground ,mat :inherit bold)))) - `(ido-subdir ((,class (:foreground ,keyword)))) - `(ido-vertical-match-face ((,class (:foreground ,comp :underline nil)))) - -;;;;; info - `(info-header-xref ((,class (:foreground ,func :underline t)))) - `(info-menu ((,class (:foreground ,suc)))) - `(info-node ((,class (:foreground ,func :inherit bold)))) - `(info-quoted-name ((,class (:foreground ,keyword)))) - `(info-reference-item ((,class (:background nil :underline t :inherit bold)))) - `(info-string ((,class (:foreground ,str)))) - `(info-title-1 ((,class (:height 1.4 :inherit bold)))) - `(info-title-2 ((,class (:height 1.3 :inherit bold)))) - `(info-title-3 ((,class (:height 1.3)))) - `(info-title-4 ((,class (:height 1.2)))) - -;;;;; ivy - `(ivy-current-match ((,class (:background ,highlight :inherit bold)))) - `(ivy-minibuffer-match-face-1 ((,class (:inherit bold)))) - `(ivy-minibuffer-match-face-2 ((,class (:foreground ,head1 :underline t)))) - `(ivy-minibuffer-match-face-3 ((,class (:foreground ,head4 :underline t)))) - `(ivy-minibuffer-match-face-4 ((,class (:foreground ,head3 :underline t)))) - `(ivy-remote ((,class (:foreground ,cyan)))) - -;;;;; ivy-posframe - `(ivy-posframe ((,class (:background ,bg3)))) - -;;;;; latex - `(font-latex-bold-face ((,class (:foreground ,comp)))) - `(font-latex-italic-face ((,class (:foreground ,keyword :italic t)))) - `(font-latex-match-reference-keywords ((,class (:foreground ,const)))) - `(font-latex-match-variable-keywords ((,class (:foreground ,var)))) - `(font-latex-sectioning-0-face ((,class (:inherit bold :foreground ,head3 :height ,(if spacemacs-theme-org-height 1.3 1.0) :background ,(when spacemacs-theme-org-highlight head3-bg))))) - `(font-latex-sectioning-1-face ((,class (:inherit bold :foreground ,head4 :height ,(if spacemacs-theme-org-height 1.3 1.0) :background ,(when spacemacs-theme-org-highlight head4-bg))))) - `(font-latex-sectioning-2-face ((,class (:inherit bold :foreground ,head1 :height ,(if spacemacs-theme-org-height 1.3 1.0) :background ,(when spacemacs-theme-org-highlight head1-bg))))) - `(font-latex-sectioning-3-face ((,class (:inherit bold :foreground ,head2 :height ,(if spacemacs-theme-org-height 1.2 1.0) :background ,(when spacemacs-theme-org-highlight head2-bg))))) - `(font-latex-sectioning-4-face ((,class (:bold nil :foreground ,head3 :height ,(if spacemacs-theme-org-height 1.1 1.0) :background ,(when spacemacs-theme-org-highlight head3-bg))))) - `(font-latex-sectioning-5-face ((,class (:bold nil :foreground ,head4 :background ,(when spacemacs-theme-org-highlight head4-bg))))) - `(font-latex-string-face ((,class (:foreground ,str)))) - `(font-latex-warning-face ((,class (:foreground ,war)))) - -;;;;; ledger-mode - `(ledger-font-directive-face ((,class (:foreground ,meta)))) - `(ledger-font-posting-amount-face ((,class (:foreground ,yellow)))) - `(ledger-font-posting-date-face ((,class (:foreground ,head1)))) - `(ledger-occur-xact-face ((,class (:background ,bg2)))) - -;;;;; linum-mode - `(linum ((,class (:foreground ,lnum :background ,bg2 :inherit default)))) - -;;;;; line-numbers - `(line-number ((,class (:foreground ,lnum :background ,bg2 :inherit default)))) - `(line-number-current-line ((,class (:foreground ,base :background ,bg2 :inherit line-number)))) - -;;;;; linum-relative - `(linum-relative-current-face ((,class (:foreground ,comp)))) - -;;;;; magit - `(magit-blame-culprit ((,class :background ,yellow-bg :foreground ,yellow))) - `(magit-blame-date ((,class :background ,yellow-bg :foreground ,green))) - `(magit-blame-hash ((,class :background ,yellow-bg :foreground ,func))) - `(magit-blame-header ((,class :background ,yellow-bg :foreground ,green))) - `(magit-blame-heading ((,class :background ,yellow-bg :foreground ,green))) - `(magit-blame-name ((,class :background ,yellow-bg :foreground ,yellow))) - `(magit-blame-sha1 ((,class :background ,yellow-bg :foreground ,func))) - `(magit-blame-subject ((,class :background ,yellow-bg :foreground ,yellow))) - `(magit-blame-summary ((,class :background ,yellow-bg :foreground ,yellow :extend t))) - `(magit-blame-time ((,class :background ,yellow-bg :foreground ,green))) - `(magit-branch ((,class (:foreground ,const :inherit bold)))) - `(magit-branch-current ((,class (:background ,blue-bg :foreground ,blue :inherit bold :box t)))) - `(magit-branch-local ((,class (:background ,blue-bg :foreground ,blue :inherit bold)))) - `(magit-branch-remote ((,class (:background ,aqua-bg :foreground ,aqua :inherit bold)))) - `(magit-diff-context-highlight ((,class (:background ,bg2 :foreground ,base :extend t)))) - `(magit-diff-hunk-heading ((,class (:background ,ttip-bg :foreground ,ttip :extend t)))) - `(magit-diff-hunk-heading-highlight ((,class (:background ,ttip-sl :foreground ,base :extend t)))) - `(magit-hash ((,class (:foreground ,var)))) - `(magit-hunk-heading ((,class (:background ,bg3 :extend t)))) - `(magit-hunk-heading-highlight ((,class (:background ,bg3 :extend t)))) - `(magit-item-highlight ((,class :background ,bg2 :extend t))) - `(magit-log-author ((,class (:foreground ,func)))) - `(magit-log-head-label-head ((,class (:background ,yellow :foreground ,bg1 :inherit bold)))) - `(magit-log-head-label-local ((,class (:background ,keyword :foreground ,bg1 :inherit bold)))) - `(magit-log-head-label-remote ((,class (:background ,suc :foreground ,bg1 :inherit bold)))) - `(magit-log-head-label-tags ((,class (:background ,magenta :foreground ,bg1 :inherit bold)))) - `(magit-log-head-label-wip ((,class (:background ,cyan :foreground ,bg1 :inherit bold)))) - `(magit-log-sha1 ((,class (:foreground ,str)))) - `(magit-process-ng ((,class (:foreground ,war :inherit bold)))) - `(magit-process-ok ((,class (:foreground ,func :inherit bold)))) - `(magit-reflog-amend ((,class (:foreground ,magenta)))) - `(magit-reflog-checkout ((,class (:foreground ,blue)))) - `(magit-reflog-cherry-pick ((,class (:foreground ,green)))) - `(magit-reflog-commit ((,class (:foreground ,green)))) - `(magit-reflog-merge ((,class (:foreground ,green)))) - `(magit-reflog-other ((,class (:foreground ,cyan)))) - `(magit-reflog-rebase ((,class (:foreground ,magenta)))) - `(magit-reflog-remote ((,class (:foreground ,cyan)))) - `(magit-reflog-reset ((,class (:foreground ,red)))) - `(magit-section-heading ((,class (:foreground ,keyword :inherit bold :extend t)))) - `(magit-section-highlight ((,class (:background ,bg2 :extend t)))) - `(magit-section-title ((,class (:background ,bg1 :foreground ,keyword :inherit bold)))) - -;;;;; man - `(Man-overstrike ((,class (:foreground ,head1 :inherit bold)))) - `(Man-reverse ((,class (:foreground ,highlight)))) - `(Man-underline ((,class (:foreground ,comp :underline t)))) - -;;;;; markdown - `(markdown-header-face-1 ((,class (:inherit bold :foreground ,head1 :height ,(if spacemacs-theme-org-height 1.3 1.0) :background ,(when spacemacs-theme-org-highlight head1-bg))))) - `(markdown-header-face-2 ((,class (:inherit bold :foreground ,head2 :height ,(if spacemacs-theme-org-height 1.2 1.0) :background ,(when spacemacs-theme-org-highlight head2-bg))))) - `(markdown-header-face-3 ((,class (:bold nil :foreground ,head3 :height ,(if spacemacs-theme-org-height 1.1 1.0) :background ,(when spacemacs-theme-org-highlight head3-bg))))) - `(markdown-header-face-4 ((,class (:bold nil :foreground ,head4 :background ,(when spacemacs-theme-org-highlight head4-bg))))) - `(markdown-header-face-5 ((,class (:bold nil :foreground ,head1)))) - `(markdown-header-face-6 ((,class (:bold nil :foreground ,head2)))) - `(markdown-table-face ((,class (:foreground ,base :background ,head1-bg)))) - -;;;;; mode-line - `(mode-line ((,class (:foreground ,base :background ,act1 :box (:color ,border :line-width 1))))) - `(mode-line-buffer-id ((,class (:inherit bold :foreground ,func)))) - `(mode-line-inactive ((,class (:foreground ,base :background ,bg1 :box (:color ,border :line-width 1))))) - -;;;;; mu4e - `(mu4e-attach-number-face ((,class (:foreground ,var)))) - `(mu4e-cited-1-face ((,class (:foreground ,head1)))) - `(mu4e-cited-2-face ((,class (:foreground ,head2)))) - `(mu4e-cited-3-face ((,class (:foreground ,head3)))) - `(mu4e-cited-4-face ((,class (:foreground ,head4)))) - `(mu4e-cited-5-face ((,class (:foreground ,head1)))) - `(mu4e-cited-6-face ((,class (:foreground ,head2)))) - `(mu4e-cited-7-face ((,class (:foreground ,head3)))) - `(mu4e-contact-face ((,class (:foreground ,func)))) - `(mu4e-draft-face ((,class (:foreground ,var)))) - `(mu4e-flagged-face ((,class (:foreground ,yellow :inherit bold)))) - `(mu4e-header-key-face ((,class (:foreground ,meta :inherit bold)))) - `(mu4e-header-title-face ((,class (:foreground ,keyword :inherit bold)))) - `(mu4e-header-marks-face ((,class (:foreground ,comp)))) - `(mu4e-header-value-face ((,class (:foreground ,keyword :inherit bold)))) - `(mu4e-header-highlight-face ((,class (:background ,highlight)))) - `(mu4e-highlight-face ((,class (:foreground ,comp)))) - `(mu4e-title-face ((,class (:foreground ,head2 :inherit bold)))) - `(mu4e-replied-face ((,class (:foreground ,green)))) - `(mu4e-modeline-face ((,class (:foreground ,yellow)))) - `(mu4e-special-header-value-face ((,class (:foreground ,green)))) - `(mu4e-unread-face ((,class (:foreground ,head1 :inherit bold)))) - `(mu4e-view-url-number-face ((,class (:foreground ,comp)))) - -;;;;; mu4e-maildirs - `(mu4e-maildirs-extension-maildir-hl-face ((,class (:foreground ,head1 :inherit bold)))) - -;;;;; notmuch - `(notmuch-search-date ((,class (:foreground ,func)))) - `(notmuch-search-flagged-face ((,class (:weight extra-bold)))) - `(notmuch-search-non-matching-authors ((,class (:foreground ,base-dim)))) - `(notmuch-search-unread-face ((,class (:background ,highlight-dim)))) - `(notmuch-tag-face ((,class (:foreground ,keyword)))) - `(notmuch-tag-flagged ((,class (:foreground ,war)))) - -;;;;; neotree - `(neo-dir-link-face ((,class (:foreground ,keyword :inherit bold)))) - `(neo-expand-btn-face ((,class (:foreground ,base)))) - `(neo-file-link-face ((,class (:foreground ,base)))) - `(neo-root-dir-face ((,class (:foreground ,func :inherit bold)))) - -;;;;; org - `(org-agenda-clocking ((,class (:background ,highlight :foreground ,comp)))) - `(org-agenda-date ((,class (:foreground ,var :height ,(if spacemacs-theme-org-agenda-height 1.1 1.0))))) - `(org-agenda-date-today ((,class (:foreground ,keyword :inherit bold :height ,(if spacemacs-theme-org-agenda-height 1.3 1.0))))) - `(org-agenda-date-weekend ((,class (:inherit bold :foreground ,var)))) - `(org-agenda-done ((,class (:foreground ,suc :height ,(if spacemacs-theme-org-agenda-height 1.2 1.0))))) - `(org-agenda-structure ((,class (:inherit bold :foreground ,comp)))) - `(org-block ((,class (:background ,cblk-bg :foreground ,cblk :extend t)))) - `(org-block-begin-line ((,class (:background ,cblk-ln-bg :foreground ,cblk-ln :extend t)))) - `(org-block-end-line ((,class (:background ,cblk-ln-bg :foreground ,cblk-ln :extend t)))) - `(org-clock-overlay ((,class (:foreground ,comp)))) - `(org-code ((,class (:foreground ,cyan)))) - `(org-column ((,class (:background ,highlight)))) - `(org-column-title ((,class (:background ,highlight)))) - `(org-date ((,class (:underline t :foreground ,var)))) - `(org-date-selected ((,class (:background ,func :foreground ,bg1)))) - `(org-document-info-keyword ((,class (:foreground ,meta)))) - `(org-document-title ((,class (:foreground ,func :inherit bold :height ,(if spacemacs-theme-org-height 1.4 1.0) :underline t)))) - `(org-done ((,class (:foreground ,suc :inherit bold :background ,green-bg)))) - `(org-ellipsis ((,class (:foreground ,keyword)))) - `(org-footnote ((,class (:underline t :foreground ,base)))) - `(org-hide ((,class (:foreground ,base)))) - `(org-kbd ((,class (:inherit region :foreground ,base :box (:line-width 1 :style released-button))))) - `(org-level-1 ((,class (:inherit bold :bold ,(if spacemacs-theme-org-bold 'unspecified nil) :foreground ,head1 :height ,(if spacemacs-theme-org-height 1.3 1.0) :background ,(when spacemacs-theme-org-highlight head1-bg))))) - `(org-level-2 ((,class (:inherit bold :bold ,(if spacemacs-theme-org-bold 'unspecified nil) :foreground ,head2 :height ,(if spacemacs-theme-org-height 1.2 1.0) :background ,(when spacemacs-theme-org-highlight head2-bg))))) - `(org-level-3 ((,class (:bold nil :foreground ,head3 :height ,(if spacemacs-theme-org-height 1.1 1.0) :background ,(when spacemacs-theme-org-highlight head3-bg))))) - `(org-level-4 ((,class (:bold nil :foreground ,head4 :background ,(when spacemacs-theme-org-highlight head4-bg))))) - `(org-level-5 ((,class (:bold nil :foreground ,head1)))) - `(org-level-6 ((,class (:bold nil :foreground ,head2)))) - `(org-level-7 ((,class (:bold nil :foreground ,head3)))) - `(org-level-8 ((,class (:bold nil :foreground ,head4)))) - `(org-link ((,class (:underline t :foreground ,comment)))) - `(org-meta-line ((,class (:foreground ,meta)))) - `(org-mode-line-clock-overrun ((,class (:foreground ,err)))) - `(org-priority ((,class (:foreground ,war :inherit bold :bold ,(if spacemacs-theme-org-priority-bold 'unspecified nil))))) - `(org-quote ((,class (:inherit org-block :slant italic)))) - `(org-scheduled ((,class (:foreground ,comp)))) - `(org-scheduled-today ((,class (:foreground ,func :height ,(if spacemacs-theme-org-agenda-height 1.2 1.0))))) - `(org-scheduled-previously ((,class (:foreground ,base :slant italic)))) - `(org-sexp-date ((,class (:foreground ,base)))) - `(org-special-keyword ((,class (:foreground ,func)))) - `(org-table ((,class (:foreground ,base :background ,head1-bg)))) - `(org-tag ((,class (:foreground ,meta)))) - `(org-time-grid ((,class (:foreground ,str)))) - `(org-todo ((,class (:foreground ,war :inherit bold :background ,yellow-bg)))) - `(org-upcoming-deadline ((,class (:foreground ,war :inherit org-priority)))) - `(org-upcoming-distant-deadline ((,class (:foreground ,suc :inherit org-priority)))) - `(org-verbatim ((,class (:foreground ,keyword)))) - `(org-verse ((,class (:inherit org-block :slant italic)))) - `(org-warning ((,class (:foreground ,err :inherit org-priority)))) - -;;;;; outline - `(outline-1 ((,class (:inherit org-level-1)))) - `(outline-2 ((,class (:inherit org-level-2)))) - `(outline-3 ((,class (:inherit org-level-3)))) - `(outline-4 ((,class (:inherit org-level-4)))) - `(outline-5 ((,class (:inherit org-level-5)))) - `(outline-6 ((,class (:inherit org-level-6)))) - `(outline-7 ((,class (:inherit org-level-7)))) - `(outline-8 ((,class (:inherit org-level-8)))) - -;;;;; perspective - `(persp-selected-face ((,class (:inherit bold :foreground ,func)))) - -;;;;; popup - `(popup-enu-selection-face ((,class (:background ,ttip-sl :foreground ,base)))) - `(popup-face ((,class (:background ,ttip-bg :foreground ,ttip)))) - `(popup-isearch-match ((,class (:inherit match)))) - `(popup-menu-face ((,class (:background ,ttip-bg :foreground ,base)))) - `(popup-menu-mouse-face ((,class (:inherit highlight)))) - `(popup-scroll-bar-background-face ((,class (:background ,bg2)))) - `(popup-scroll-bar-foreground-face ((,class (:background ,act2)))) - `(popup-tip-face ((,class (:background ,ttip-sl :foreground ,base :bold nil :italic nil :underline nil)))) - -;;;;; powerline - `(powerline-active1 ((,class (:background ,act2 :foreground ,base)))) - `(powerline-active2 ((,class (:background ,act2 :foreground ,base)))) - `(powerline-inactive1 ((,class (:background ,bg2 :foreground ,base)))) - `(powerline-inactive2 ((,class (:background ,bg2 :foreground ,base)))) - -;;;;; rainbow-delimiters - `(rainbow-delimiters-depth-1-face ((,class :foreground ,keyword))) - `(rainbow-delimiters-depth-2-face ((,class :foreground ,func))) - `(rainbow-delimiters-depth-3-face ((,class :foreground ,str))) - `(rainbow-delimiters-depth-4-face ((,class :foreground ,green))) - `(rainbow-delimiters-depth-5-face ((,class :foreground ,yellow))) - `(rainbow-delimiters-depth-6-face ((,class :foreground ,keyword))) - `(rainbow-delimiters-depth-7-face ((,class :foreground ,func))) - `(rainbow-delimiters-depth-8-face ((,class :foreground ,str))) - `(rainbow-delimiters-mismatched-face ((,class :foreground ,err :overline t))) - `(rainbow-delimiters-unmatched-face ((,class :foreground ,err :overline t))) - -;;;;; rcirc - `(rcirc-bright-nick ((,class (:background ,aqua-bg :foreground ,cyan)))) - `(rcirc-dim-nick ((,class (:foreground ,base-dim)))) - `(rcirc-keyword ((,class (:background ,green-bg-s :foreground ,green)))) - `(rcirc-timestamp ((,class (:foreground ,keyword)))) - `(rcirc-track-keyword ((,class (:background ,green :foreground ,bg1)))) - `(rcirc-url ((,class (:inherit link)))) - -;;;;; shm - `(shm-current-face ((,class (:background ,green-bg-s)))) - `(shm-quarantine-face ((,class (:background ,red-bg-s)))) - -;;;;; show-paren - `(show-paren-match ((,class (:foreground ,mat :inherit bold :underline ,(when spacemacs-theme-underline-parens t))))) - `(show-paren-match-expression ((,class (:background ,green-bg-s)))) - `(show-paren-mismatch ((,class (:foreground ,err :inherit bold :underline ,(when spacemacs-theme-underline-parens t))))) - -;;;;; smartparens - `(sp-pair-overlay-face ((,class (:background ,highlight :foreground nil)))) - `(sp-show-pair-match-face ((,class (:foreground ,mat :inherit bold :underline ,(when spacemacs-theme-underline-parens t))))) - -;;;;; smerge - `(smerge-base ((,class (:background ,yellow-bg :extend t)))) - `(smerge-markers ((,class (:background ,ttip-bg :foreground ,ttip :extend t)))) - `(smerge-mine ((,class (:background ,red-bg)))) - `(smerge-other ((,class (:background ,green-bg)))) - `(smerge-refined-added ((,class (:background ,green-bg-s :foreground ,green)))) - `(smerge-refined-changed ((,class (:background ,blue-bg-s :foreground ,blue)))) - `(smerge-refined-removed ((,class (:background ,red-bg-s :foreground ,red)))) - -;;;;; solaire - `(solaire-default-face ((,class (:inherit default :background ,bg2)))) - `(solaire-minibuffer-face ((,class (:inherit default :background ,bg2)))) - `(solaire-hl-line-face ((,class (:inherit hl-line :background ,bg2)))) - `(solaire-org-hide-face ((,class (:inherit org-hide :background ,bg2)))) - -;;;;; spaceline - `(spaceline-flycheck-error ((,class (:foreground ,err)))) - `(spaceline-flycheck-info ((,class (:foreground ,keyword)))) - `(spaceline-flycheck-warning((,class (:foreground ,war)))) - `(spaceline-python-venv ((,class (:foreground ,comp)))) - -;;;;; spacemacs-specific - `(spacemacs-transient-state-title-face ((,class (:background nil :foreground ,comp :box nil :inherit bold)))) - -;;;;; swiper - `(swiper-line-face ((,class (:background ,highlight :inherit bold)))) - `(swiper-match-face-1 ((,class (:inherit bold)))) - `(swiper-match-face-2 ((,class (:foreground ,head1 :underline t)))) - `(swiper-match-face-3 ((,class (:foreground ,head4 :underline t)))) - `(swiper-match-face-4 ((,class (:foreground ,head3 :underline t)))) - -;;;;; tabbar - `(tabbar-button ((,class (:inherit tabbar-default )))) - `(tabbar-button-highlight ((,class (:inherit tabbar-default)))) - `(tabbar-default ((,class (:background ,bg1 :foreground ,head1 :height 0.9)))) - `(tabbar-highlight ((,class (:underline t)))) - `(tabbar-selected ((,class (:inherit tabbar-default :foreground ,func :weight bold)))) - `(tabbar-selected-modified ((,class (:inherit tabbar-default :foreground ,red :weight bold)))) - `(tabbar-separator ((,class (:inherit tabbar-default)))) - `(tabbar-unselected ((,class (:inherit tabbar-default :background ,bg1 :slant italic :weight light)))) - `(tabbar-unselected-modified ((,class (:inherit tabbar-unselected :background ,bg1 :foreground ,red)))) - -;;;;; term - `(term ((,class (:foreground ,base :background ,bg1)))) - `(term-color-black ((,class (:foreground ,bg4 :background ,bg4)))) - `(term-color-blue ((,class (:foreground ,keyword :background ,keyword)))) - `(term-color-cyan ((,class (:foreground ,cyan :background ,cyan)))) - `(term-color-green ((,class (:foreground ,green :background ,green)))) - `(term-color-magenta ((,class (:foreground ,magenta :background ,magenta)))) - `(term-color-red ((,class (:foreground ,red :background ,red)))) - `(term-color-white ((,class (:foreground ,base :background ,base)))) - `(term-color-yellow ((,class (:foreground ,yellow :background ,yellow)))) - -;;;;; vterm - `(vterm-color-default ((,class (:foreground ,base :background ,bg1)))) - ;; vterm-color-black used to render black color code. - ;; The foreground color is used as ANSI color 0 and the background - ;; color is used as ANSI color 8. - `(vterm-color-black ((,class (:foreground ,bg4 :background ,bg4)))) - `(vterm-color-blue ((,class (:foreground ,blue :background ,blue)))) - `(vterm-color-cyan ((,class (:foreground ,cyan :background ,cyan)))) - `(vterm-color-green ((,class (:foreground ,green :background ,green)))) - `(vterm-color-magenta ((,class (:foreground ,magenta :background ,magenta)))) - `(vterm-color-red ((,class (:foreground ,red :background ,red)))) - `(vterm-color-white ((,class (:foreground ,base :background ,base)))) - `(vterm-color-yellow ((,class (:foreground ,yellow :background ,yellow)))) - -;;;;; tide - `(tide-hl-identifier-face ((,class (:foreground ,yellow :background ,yellow-bg)))) - -;;;;; treemacs - `(treemacs-git-added-face ((,class (:foreground ,green :background ,green-bg)))) - `(treemacs-git-conflict-face ((,class (:foreground ,red :background ,red-bg)))) - `(treemacs-git-ignored-face ((,class (:foreground ,yellow)))) - `(treemacs-git-modified-face ((,class (:foreground ,blue :background ,blue-bg)))) - `(treemacs-git-untracked-face ((,class (:foreground ,aqua :background ,aqua-bg)))) - -;;;;; web-mode - `(web-mode-builtin-face ((,class (:inherit ,font-lock-builtin-face)))) - `(web-mode-comment-face ((,class (:inherit ,font-lock-comment-face)))) - `(web-mode-constant-face ((,class (:inherit ,font-lock-constant-face)))) - `(web-mode-current-element-highlight-face ((,class (:background ,bg3)))) - `(web-mode-doctype-face ((,class (:inherit ,font-lock-comment-face)))) - `(web-mode-function-name-face ((,class (:inherit ,font-lock-function-name-face)))) - `(web-mode-html-attr-name-face ((,class (:foreground ,func)))) - `(web-mode-html-attr-value-face ((,class (:foreground ,keyword)))) - `(web-mode-html-tag-face ((,class (:foreground ,keyword)))) - `(web-mode-keyword-face ((,class (:foreground ,keyword)))) - `(web-mode-string-face ((,class (:foreground ,str)))) - `(web-mode-symbol-face ((,class (:foreground ,type)))) - `(web-mode-type-face ((,class (:inherit ,font-lock-type-face)))) - `(web-mode-warning-face ((,class (:inherit ,font-lock-warning-face)))) - -;;;;; which-key - `(which-key-command-description-face ((,class (:foreground ,base)))) - `(which-key-group-description-face ((,class (:foreground ,keyword)))) - `(which-key-key-face ((,class (:foreground ,func :inherit bold)))) - `(which-key-separator-face ((,class (:background nil :foreground ,str)))) - `(which-key-special-key-face ((,class (:background ,func :foreground ,bg1)))) - -;;;;; which-function-mode - `(which-func ((,class (:foreground ,func)))) - -;;;;; whitespace-mode - `(whitespace-empty ((,class (:background nil :foreground ,yellow)))) - `(whitespace-indentation ((,class (:background nil :foreground ,war)))) - `(whitespace-line ((,class (:background nil :foreground ,comp)))) - `(whitespace-newline ((,class (:background nil :foreground ,comp)))) - `(whitespace-space ((,class (:background nil :foreground ,act2)))) - `(whitespace-space-after-tab ((,class (:background nil :foreground ,yellow)))) - `(whitespace-space-before-tab ((,class (:background nil :foreground ,yellow)))) - `(whitespace-tab ((,class (:background nil :foreground ,act2)))) - `(whitespace-trailing ((,class (:background ,err :foreground ,war)))) - -;;;;; other, need more work - `(ac-completion-face ((,class (:underline t :foreground ,keyword)))) - `(ffap ((,class (:foreground ,base)))) - `(flx-highlight-face ((,class (:foreground ,comp :underline nil)))) - `(icompletep-determined ((,class :foreground ,keyword))) - `(js2-external-variable ((,class (:foreground ,comp)))) - `(js2-function-param ((,class (:foreground ,const)))) - `(js2-jsdoc-html-tag-delimiter ((,class (:foreground ,str)))) - `(js2-jsdoc-html-tag-name ((,class (:foreground ,keyword)))) - `(js2-jsdoc-value ((,class (:foreground ,str)))) - `(js2-private-function-call ((,class (:foreground ,const)))) - `(js2-private-member ((,class (:foreground ,base)))) - `(js3-error-face ((,class (:underline ,war)))) - `(js3-external-variable-face ((,class (:foreground ,var)))) - `(js3-function-param-face ((,class (:foreground ,keyword)))) - `(js3-instance-member-face ((,class (:foreground ,const)))) - `(js3-jsdoc-tag-face ((,class (:foreground ,keyword)))) - `(js3-warning-face ((,class (:underline ,keyword)))) - `(slime-repl-inputed-output-face ((,class (:foreground ,comp)))) - `(trailing-whitespace ((,class :foreground nil :background ,err))) - `(undo-tree-visualizer-current-face ((,class :foreground ,keyword))) - `(undo-tree-visualizer-default-face ((,class :foreground ,base))) - `(undo-tree-visualizer-register-face ((,class :foreground ,comp))) - `(undo-tree-visualizer-unmodified-face ((,class :foreground ,var)))) - - (custom-theme-set-variables - theme-name - -;;;;; ansi-color-names - `(ansi-color-names-vector [,bg4 ,red ,green ,yellow ,blue ,magenta ,cyan ,base]) - -;;;;; hl-todo - `(hl-todo-keyword-faces '(("TODO" . ,war) - ("NEXT" . ,war) - ("THEM" . ,aqua) - ("PROG" . ,blue) - ("OKAY" . ,blue) - ("DONT" . ,red) - ("FAIL" . ,red) - ("DONE" . ,suc) - ("NOTE" . ,yellow) - ("KLUDGE" . ,yellow) - ("HACK" . ,yellow) - ("TEMP" . ,yellow) - ("FIXME" . ,war) - ("XXX+" . ,war) - ("\\?\\?\\?+" . ,war))) - - -;;;;; pdf-tools - `(pdf-view-midnight-colors '(,base . ,bg1))) - )) - - -;;;###autoload -(when load-file-name - (add-to-list 'custom-theme-load-path - (file-name-as-directory (file-name-directory load-file-name)))) - -(provide 'spacemacs-common) - -;; Local Variables: -;; no-byte-compile: t -;; End: - -;;; spacemacs-common.el ends here diff --git a/elpa/spacemacs-theme-20200322.1408/spacemacs-dark-theme.el b/elpa/spacemacs-theme-20200322.1408/spacemacs-dark-theme.el deleted file mode 100644 index 7b5e33f3..00000000 --- a/elpa/spacemacs-theme-20200322.1408/spacemacs-dark-theme.el +++ /dev/null @@ -1,7 +0,0 @@ -(require 'spacemacs-common) - -(deftheme spacemacs-dark "Spacemacs theme, the dark version") - -(create-spacemacs-theme 'dark 'spacemacs-dark) - -(provide-theme 'spacemacs-dark) diff --git a/elpa/spacemacs-theme-20200322.1408/spacemacs-dark-theme.elc b/elpa/spacemacs-theme-20200322.1408/spacemacs-dark-theme.elc deleted file mode 100644 index f35e636c8f8cb27caaccdae03af0b5a007996064..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 647 zcmbtRu};G<5bc~FU_HVDQd6}Fv{ac;)u9qw*(k%+z7mVr4z^QNzMhL4pop=SPWIh< z_nv(&mye5!!C;V-WeE$b8xi88R%C_L=Rd1Vdc(@_zT4;3oFx(3?>rPU_}hW#js z;8UeM>{ta_PafpKpjHB;6+Sp+Uj2|!=L4XWB;m(pG9Tshe;U%VhOq&JH36C2hFx~g z6_Y)z7poPB3LT2TR~$xrG!nc8fd;k&wZ%Us{Zl*;x>}KgP%$wtj=nsCvsQP3b61ii z*V{v&Ojt>fZi?}kV{*C4C*2|EC^&98?ymacl#^Km(qko33+@@uQh0Xs-YQ4n8x++2 zC~IrYA1YcOtj;8f8XaY!B7Mq|=-y76y0qt{>u)I@AU6%W4I;mva09F# diff --git a/elpa/spacemacs-theme-20200322.1408/spacemacs-light-theme.el b/elpa/spacemacs-theme-20200322.1408/spacemacs-light-theme.el deleted file mode 100644 index 4b68588d..00000000 --- a/elpa/spacemacs-theme-20200322.1408/spacemacs-light-theme.el +++ /dev/null @@ -1,7 +0,0 @@ -(require 'spacemacs-common) - -(deftheme spacemacs-light "Spacemacs theme, the light version") - -(create-spacemacs-theme 'light 'spacemacs-light) - -(provide-theme 'spacemacs-light) diff --git a/elpa/spacemacs-theme-20200322.1408/spacemacs-light-theme.elc b/elpa/spacemacs-theme-20200322.1408/spacemacs-light-theme.elc deleted file mode 100644 index 06e314caf26c8186edff276508d9fb07b3bc97e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmbtRJ#WG=5M|CE=z2|;Rw4)z3PqVJ#DLU|Zl%LvAH-5@r?x{ye|;|>EmR$`bh7W> zyZ7vKzIs{S3U8#~}nU;o{k|g}POctYb@lQiq)-X1JuqGgr>#$Fr zxMGs$&2qg4QJ_N+_=>~U9*qQVL7;&hL22=iN&gfNgsxQNAQVhYv(A@CaMfxqaP5ks z=zez!ln5&c;%zn_b4+fx>7+TN92v)y