Commit Graph

669 Commits

Author SHA1 Message Date
Leandro Ostera 4a97c4c2e9
feat: make it work on ocaml 5.2 (#470)
Co-authored-by: Rashid Al Muhairi <r.muhairi@pm.me>
2024-02-06 12:51:52 +01:00
Etienne Millon 232a8ffab3
Add a contributing guide (#479)
Co-authored-by: Leandro Ostera <leandro@abstractmachines.dev>
2024-02-06 11:28:51 +01:00
Juergen Hoetzel 8cc5632825 Use "opam var" instead "opam config var"
"opam config var" was deprecared in version 2.1 and generates an error message in the process output:

[WARNING] var was deprecated in version 2.1 of the opam CLI. Use opam var instead or set OPAMCLI environment variable to 2.0.
2024-01-16 18:01:18 -05:00
G-J fcb7903603
Bring utop(1) man page up to date with README (#462)
* Fixed some minor typos in the README and man pages

* Adapted utop(1) man page to closer follow the README

* Fixed changes to dates
2023-09-11 14:38:13 +02:00
G-J 3e45a6e98f
Fixed some minor typos in the README and man pages (#461) 2023-09-08 11:05:52 +02:00
ShalokShalom 464cdcbaf7
Make installation instructions run as shown (#457)
The $ prevented the lines from being copied and run as they are
This is fixed now.
2023-09-04 13:49:44 +02:00
Etienne Millon 5b98d2845b Prepare 2.13.1 2023-07-07 17:35:08 +02:00
jonahbeckford f8affb8cfb
Fix unavailable expunge on Windows (#447)
Fix unavailable expunge on Windows

Without this commit, get:

```
File "src/top/dune", line 33, characters 0-131:
33 | (rule
34 |  (targets utop-expunged.bc)
35 |  (action
36 |   (run %{ocaml_where}/expunge %{dep:utop.bc} %{targets}
37 |     %{read-lines:modules.txt})))
Error: File unavailable:
Z:/source/dkml/build/pkg/bump/.ci/o/PR/lib/ocaml/expunge
```

Co-authored-by: Etienne Millon <me@emillon.org>
2023-07-07 17:34:13 +02:00
Etienne Millon 8da707283f Add missing issue 2023-07-03 16:06:25 +02:00
Etienne Millon 97e7ecfb4f Prepare 2.13.0 2023-07-03 16:03:29 +02:00
Etienne Millon e73b1f0131 Add missing changelog entries 2023-07-03 16:03:01 +02:00
Skye Soss 972996374a
XDG Base Directory Compliance (#431)
This uses xdg to load files in the right place.
2023-07-03 11:43:57 +02:00
Etienne Millon 21439f537e
Bump compatibility to 4.11+ (#444) 2023-07-03 11:29:30 +02:00
Riku Silvola 40c1b32a7c
Adopt the OCaml Code of Conduct (#436) 2023-07-03 11:08:07 +02:00
Etienne Millon 4e6aae168c
Remove deprecated values (#427)
Follow-up to #415: we remove these values.
2023-06-23 17:16:36 +02:00
Thibaut Mattio 351741b820
Check Zed.next_error index value is within the string length (#442)
This fixes Zed.Out_of_bound errors

Co-authored-by: Etienne Millon <me@emillon.org>
2023-06-23 15:09:05 +02:00
Etienne Millon 87871f442e
Add test for fix_string (#443) 2023-06-23 14:28:14 +02:00
Etienne Millon e885c5ee93
expunge: move system code to dune (#439)
The logic to create utop from utop-full is as follows:

- use ocamlobjinfo on utop-full to determine which modules are used
- use ocamlobjinfo on ocamlcommon, ocamlbytecomp, and ocamltoplevel to
  determine which modules to exclude (a priori)
- compute the set used - (exclude - {Topmain,Toploop,Topdirs})
- call expunge with this set of modules

Previously, this was all done in expunge/expunge.ml, meaning core logic
+ process handling.
What this PR does is offload the process handling to dune: calling
ocamlobjinfo and expunge is done instead in dune rules, and
expunge/modules.ml is just about reading sets of module names and
outputing the result.

Besides simplicity and portability, the other advantage is that the
intermediate modules.txt can be inspected directly.
2023-06-23 13:56:38 +02:00
Etienne Millon bfabaacf2a
use lang 2.0 and format dune files (#440) 2023-06-23 11:37:09 +02:00
Etienne Millon fc32fa37a1
Generate opam file (#441)
* Use opam file generation

* autogenerate dune

* Do not use {build}

* do not hard wrap description
2023-06-23 10:37:01 +02:00
Garth Tuohy f2f2aef137 More compatible fix 2023-06-12 11:38:04 +02:00
Etienne Millon ba0e2c7fff 2.12.1 2023-04-21 12:19:08 +02:00
Etienne Millon a922be057f fix regression with unit qualification
Fixes #428

The change in #418 introduced a regression if a `Unit` module in scope
does not have a `()` constructor in it.

This switches to the more explicit `Stdlib.Unit.()` path.
2023-04-21 12:18:30 +02:00
Jake Shilling 0e9f0c6893 emacs: implement completion-at-point
Fixes #261
2023-04-19 16:14:59 +02:00
Etienne Millon c50173caf9 2.12.0 2023-04-17 13:37:45 +02:00
Etienne Millon ed895283db Qualify () constructor
We are building a hidden expression that contains "()" but it is not
qualified. So it will pick the constructor in scope. This can cause
problems if `()` has been redefined. The correct fix is to qualify it as
part of the `Unit` module.

(additionally, this removes an unused ident)

Fixes #417
2023-04-17 13:36:23 +02:00
Etienne Millon 1a70e0fb85 Do not pass -safe-string explicitly
Strings are safe now.
2023-04-17 13:34:23 +02:00
Etienne Millon 78349cc4b8 Fix add_let 2023-04-12 10:23:15 +02:00
Etienne Millon 846af28b3c OCaml 5.1 support 2023-04-12 10:23:15 +02:00
Vu Ngoc San 4eba6f132b use M-down instead of M-tab 2023-03-07 14:31:54 +01:00
Etienne Millon 13011b0d45 Move compat functions to their module
The utop code base is full of #if OCAML_VERSION to adapt to the changes
in compiler-libs. This has some issues - for example the corresponding
logic is harder to recognize, and some logic is duplicated in several
places. Also, this prevents using a formatter.

One medium-term goal is to move most of the compat functions to a new
Utop_compat module which would be the only place we use cppo.

This contains the "easy" cases - moving existing functions, etc. It is a
bit more difficult (and controversial) to convert pattern matching to
this pattern so it'll be done separately.
2023-02-22 11:51:32 +01:00
Etienne Millon ace481388a Mark deprecated values with attribute
They have been deprecated in 2012 and most of them are ignored.
2023-02-02 16:39:37 +01:00
Etienne Millon 595002e6f0 Release 2.11.0 2023-01-05 15:30:54 +01:00
Etienne Millon 5aae06f007 Do not display a backtrace when exiting normally
Exiting normally here refers to the `Exit_with_status` exception.
It is in particular triggered by `#quit;;` so we want to exit quietly
in that case.

Closes #398
2023-01-05 15:21:51 +01:00
Brian Leung c596ac7b88
Shut up Emacs 29's byte-compiler (#404)
* Shut up Emacs 29's byte-compiler

* Fix docstring to comply with checkdoc
2022-11-03 08:46:06 -06:00
Brian Leung 263428053b
Recommend `opam exec` instead of deprecated `opam config exec` (#403) 2022-11-02 21:37:01 -06:00
Brian Leung 0cb4ffe584
utop.el: always insert phrase terminator at the end-ish of input (#402)
* utop.el: always insert phrase terminator at the end-ish of input

When point is at the letter "n" in

utop[1]> let thi[n]g = 42

or in

utop[2]> let thi[n]g = 8734;

and the user presses C-j, it is always because they want to terminate
the expression at the end-ish of the input.

The unpatched behavior did not move point, and inserted two semicolons
in the middle of the expression.
2022-11-02 18:27:07 -06:00
metanivek bbd9a6ed45 feature: Add toplevel_printer support for functors 2022-07-27 11:10:32 -05:00
Etienne Millon f9b5ec7266
Merge pull request #393 from emillon/408
Bump the compat to 4.08+
2022-07-21 10:15:10 +02:00
Etienne Millon 7a1d87e2da Update changelog 2022-07-20 14:20:01 +02:00
Bozhidar Batsov ebca87c7a3 Try to appease checkdoc
Things like 'done are not allowed in docstrings.
2022-07-19 16:11:42 -05:00
Bozhidar Batsov c850fd9927 Fix an anchor 2022-07-19 16:11:42 -05:00
Bozhidar Batsov 62cb68c817 Mention reason-mode in the README 2022-07-19 16:11:42 -05:00
Bozhidar Batsov 036eac86b0 Remove a deprecated function
I think we can safely assume 7 years are enough time for most people
to have learned about `utop-minor-mode`.
2022-07-19 16:11:42 -05:00
Bozhidar Batsov b8b8dd6d8d Remove some dead code
Seems 9 years ago someone tried to extract types from the evaluation
results but never got this working. I think it's time for this code to
go away, given that we have much better options today (e.g. Merlin).
2022-07-19 16:11:42 -05:00
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