Commit Graph

385 Commits

Author SHA1 Message Date
Bozhidar Batsov bfbe143ce1 Rename utop-is-running to utop-running-p
That's the Emacs convention for predicates.
2022-07-19 16:11:42 -05:00
Bozhidar Batsov 9c0a55f2c0 Fix the :active checks in the minor mode's menu
When there you need to retrieve the utop buffer first - you can't
check for the state directly.
2022-07-19 16:11:42 -05:00
Bozhidar Batsov 6658ca4c21 Fix some typos 2022-07-19 16:11:42 -05:00
Bozhidar Batsov 2bee980a9d Add C-c C-e as an alias for C-x C-e
That's the practice in most similar Emacs modes.
2022-07-19 16:11:42 -05:00
Bozhidar Batsov 5049cd9344 Add missing keybinding for utop-switch-to-recent-buffer 2022-07-19 16:11:42 -05:00
Etienne Millon 8c2039543b Handle Syntaxerr.Removed_string_set 2022-07-19 11:07:42 +02:00
Bozhidar Batsov e89802f24c Address a compilation warning 2022-07-18 15:34:13 -05:00
Bozhidar Batsov 8149df9132 Add a complication check GHA
It's based on Eldev.
2022-07-18 15:34:13 -05:00
Bozhidar Batsov 2a405226f2 Add commands to switch to and from a utop buffer
Those are extremely common in Emacs modes and allow people to
quickly jump to a REPL and back to the last source buffer they
were editing, while using the same keybinding.

I've modeled the implementation here after that of inf-clojure (a similar
mode written by me). I've also implemented a mode menu for
utop-minor-mode, so it's easier for the users to discover its
functionality.
2022-07-18 14:29:54 -05:00
Bozhidar Batsov 09d26a7509 Use defvar-local where appropriate 2022-07-18 10:04:04 -05:00
Bozhidar Batsov ba18d8ad38 Group the major mode code more tightly 2022-07-18 10:04:04 -05:00
Bozhidar Batsov f91c126afb [Fix #389] Require Emacs 26 in utop.el 2022-07-18 10:04:04 -05:00
Bozhidar Batsov e7b1ff36d1 [Fix #358] Fix code completion for module identifiers in utop.el
Without those changes you won't get any completion for things like
"List.m". I'm not very familiar with the code, but it seems that the
backend returns the completion candidates without the module prefix
which caused the problem.

I've opted to fix this by handling prefixes with a "." in them specially
and this works fine in the limited testing I conducted locally.
2022-07-16 13:32:11 -05:00
Bozhidar Batsov 1a7c112a71 Add :safe properties to defcustoms 2022-07-16 11:32:15 -05:00
Bozhidar Batsov a84d499301 Remove redundant :group properties
Those are auto-inferred from the :prefix set in defgroup.
2022-07-16 11:32:15 -05:00
Bozhidar Batsov 2c08182649 Add some package description
package.el repos typically extract and show this info.
2022-07-16 11:32:15 -05:00
Bozhidar Batsov ec1f09420d Reformat a couple of let bindings
This makes it easier to see the definitions they introduce.
2022-07-16 11:32:15 -05:00
Bozhidar Batsov c117c6cf57 Use #' for function references where appropriate 2022-07-16 11:32:15 -05:00
Bozhidar Batsov dee6a8752a Use the kbd macro for all keybindings
This makes more complex keybindings easier to read and write.
2022-07-16 11:32:15 -05:00
Bozhidar Batsov b24f94243f Update a few URL references 2022-07-16 11:32:15 -05:00
Etienne Millon 6c55ea7996 Use logs.lwt instead of lwt_logs
The latter is deprecated and incompatible with OCaml 5.0.
2022-07-05 17:20:22 +02:00
Etienne Millon 2569162157 Compatibility with zed 3.2.0
This updates utop to use the uu packages instead of camomile, following
ocaml-community/zed#46 and ocaml-community/lambda-term#109.
2022-07-05 15:41:25 +01:00
David Allsopp fbbaec6be8 Support new Load_path.init API 2022-06-09 10:35:44 +01:00
David Allsopp 42614160c2 Adapt to new mechanism for loading topdirs.cmi 2022-04-16 10:36:40 -05:00
favonia df448e9ccd Remove -safe-string for OCaml 5. See ocaml/ocaml#10893 2022-03-27 22:11:51 -05:00
Kate 560617c64f Add support for OCaml 4.14 2021-11-18 10:10:53 -05:00
Christian Pellegrin ec469bb839 Fix emacs completion returning bogus candidates.
In standalone mode, utop returns all the possible completions when no
one matches what the user has typed. This is surprising in emacs
because of the different UI/UX. For this reason, we keep a list of
prefixes for which completion has started and return only the
candidates which match the prefixes.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
2021-06-07 12:40:48 -07:00
Kate 82fe82dad0 Update the OCaml 4.13 compatibility after the merge of ocaml/ocaml#10252 2021-06-02 19:20:59 +01:00
Kate 9fe8b5d838 Get rid of deprecated functions in OCaml 4.13 2021-05-25 21:00:33 +01:00
Kate 300dd7e562 Add support for OCaml 4.13 2021-05-25 20:24:59 +01:00
Rudi Grinberg 711c24661c
Merge pull request #338 from hyphenrf/patch-1 2021-04-08 08:00:44 -07:00
Christian Pellegrin 243f7a1536 Fix color highlight for errors.
The output from the compiler changed and now mentions the line number
(non only the charters, which actually becomes columns). This patch
introduces the idea of a range of lines spanned by an error and
correctly marks the faulty region.

I think a better solution would be to introduce a "point" record of
the form {line:int;column:int}. However, such a change would
reverberate through all the source code and so it is much more
invasive. I can prepare such a patch if desired, after this one, which
fixes the regression.
2021-04-05 08:56:50 +01:00
Rudi Grinberg 1660e5989a
Merge pull request #347 from dansanduleac/patch-1
Utop correctly restarts when (not utop-edit-command)
2021-04-03 20:18:13 -07:00
Rudi Grinberg b2f15bff67
Merge pull request #340 from leungbk/byte-comp
utop.el: Placate byte-compiler
2021-04-03 20:13:38 -07:00
Brian Leung e5059d2e2f utop.el: Fix utop-tuareg-next-phrase for newer tuareg.el
tuareg--after-double-colon no longer exists in the latest rev of
Tuareg, which has received 110 additional commits since the last
release version on OPAM, so inline the old definition, which was
removed in commit 91ba1d6143558092a3920e9b5c49755c0c86caed of Tuareg.

tuareg--skip-double-colon was renamed to
tuareg--skip-double-semicolon, and also received a slight change.
Inline that as well since it's a private function.
2021-04-03 21:24:20 -04:00
Florian Angeletti ac9c21cfcf exit with the right exit status
With OCaml 4.12.0 and later, the toplevel use the Compenv.Exit_with_status
exception to communicate when and with which status we should exit.
2021-04-03 14:38:14 -04:00
Haz ee030bab0b
Use lambdaterm resources for home path instead of sys
Co-authored-by: Fabian <copy@copy.sh>
2021-03-31 09:47:39 +02:00
Dan Sănduleac ba44fc9cc2
Utop correctly restarts when (not utop-edit-command)
## Problem

If `utop-edit-command` is nil, then `utop-query-arguments` returns nil.
This breaks `utop-restart` which relies upon it returning the right arguments.

## Solution

`utop-query-arguments` always returns `(utop-arguments)` whether it sets the utop-command or not.
2021-03-18 11:31:49 +00:00
Brian Leung 71faa5fb62 utop.el: Placate byte-compiler 2020-11-08 11:36:12 -08:00
Etienne Millon e31656e725 Fix build on 4.12
On 4.12, `Typemod.type_structure` does not take a location argument
anymore (see ocaml/ocaml#9974). This fixes the build with the 4.12
branch.
2020-10-30 16:22:14 +01:00
Haz 251228d677
Make sure we're not at $HOME before sourcing local .ocamlinit
(fixes: Github #333)
2020-09-21 22:23:36 +00:00
ZAN DoYe c0109a6da6 Vi edit mode: cross phrase register support 2020-05-30 09:27:14 +08:00
ZAN DoYe 952f97a460 compatible with 4.11
* use the exposed parser to parse longident
2020-05-12 08:45:24 +08:00
Kate 1da1f64765 Fix warnings with OCaml 4.11 2020-05-09 09:38:47 +08:00
ZAN DoYe cea5509294 add #edit_mode_default #edit_mode_vi directives 2020-04-25 23:40:41 +08:00
ZAN DoYe fd5bd4f665 UTop_main: support lambda-term 3.0 2020-04-25 23:40:41 +08:00
ZAN DoYe 692b92794d make the #use_output directive compatible with ocaml >= 4.02 2020-03-25 19:38:17 +08:00
Jeremie Dimino 3f735497d9 Backport the #use_output directive from OCaml 4.11
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2020-03-25 19:38:17 +08:00
Fabian 712678f959 Update docs to refer to .config/utop/init.ml 2020-03-18 11:01:23 +08:00
Fabian 53813ef663 Load init file from .config/utop/init.ml as per XDG conventions (fix #144) 2020-03-18 11:01:23 +08:00