Commit Graph

85 Commits

Author SHA1 Message Date
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
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
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
Mitchell Plamann 7bd35e08ae Remove now-broken elisp that depends on utop-ocaml-preprocessor 2019-07-15 14:36:03 -04:00
Anton Kochkov ca00ce6146 Remove camlp4 remnants 2019-07-09 11:55:13 -04:00
Mario Rodas ea38850e60 Company backend only complete on utop buffers 2018-10-10 17:55:03 -04:00
Wilfred Hughes 2d358b2d9c Fix utop-eval-phrase on recent tuareg-mode
tuareg-next-phrase was moved to tuareg_indent.el in
ocaml/tuareg@b40e733c1 and removed entirely in
ocaml/tuareg@b2ad75f3d5 (September 2017).

As a result, utop-eval-phrase crashes due to the missing function.

Instead, write a small function to move to the next phrase, similar to
the movement logic in tuareg-eval-phrase.
2018-07-06 21:02:29 +01:00
Rudi Grinberg 90bd622f85 Don't discard line if the protocol-version isn't matched 2018-02-28 16:59:04 +07:00
Rudi Grinberg e65468882b Add version detection based on utop printing protocol-version 2018-02-28 16:28:35 +07:00
Rudi Grinberg 27ae188261 Replace while loops with dolist 2018-02-27 01:38:12 +07:00
Rudi Grinberg 49de3344f7 Make company completion conditional 2018-02-27 00:50:42 +07:00
Rudi Grinberg 1f295f49da Add support for detecting utop version 2018-02-27 00:42:01 +07:00
Rudi Grinberg 1f3a5d66ef Company backend for utop completion 2018-02-26 22:30:00 +07:00
Rudi Grinberg fe8b2b8aae Prefix unused argument with _ 2018-02-26 22:23:00 +07:00
Rudi Grinberg e1e589b5ea fix cond default clause 2018-02-26 22:23:00 +07:00
Rudi Grinberg f54d1291b1 enable lexical scoping 2018-02-26 22:23:00 +07:00
Rudi Grinberg 4aafcfbbe7 remove tabuluated-list compatibility
the package already requires emacs 24, there's no need for this shim.
2018-02-26 22:23:00 +07:00
Rudi Grinberg afca031099 refactor utop-set-state, utop-cannot-edit, utop-process-line
Make them all use pcase and and gets rid of some duplicate code in the process
2018-02-26 22:23:00 +07:00
Rudi Grinberg e838896e53 Use pcase in utop-compat-resolve
Simpler than cond (and pcase is available since emacs 24)
2018-02-26 22:23:00 +07:00
Rudi Grinberg 14c2282449 fix indentation
no semantic changes here
2018-02-26 22:23:00 +07:00
Rudi Grinberg b46cf690a7 fix docstring of utop-compat-resolve
It forgot to mention the recently supported reason mode
2018-02-26 22:23:00 +07:00
Andrea Richiardi ea49d8e947 Add support for Reason
Include the necessary hooks for phrase detection in Reason.
2017-05-09 07:43:46 +01:00
Andrea Richiardi d9f198899b Refactor hooks for better handling of phrase eval, closes #201.
The patch tries to improve on the current way of evaluating a phrase and
skipping to the next. It removes both `utop-skip-to-end-of-phrase` and
`utop-skip-blank-and-comments`, but adds `utop-next-phrase-beginning`.
We assume `utop-discover-phrase` is always returning the end position as
at end of a `;;`. Thereafter we use `utop-next-phrase-beginning` to skip
to the next phase if `utop-skip-after-eval-phrase` is non-nil.
2017-04-24 07:54:13 +01:00
Syohei YOSHIDA 5c58afb3de Fix non-exist function
Emacs does not have 'replace-in-string' function.
2015-11-05 19:32:03 +09:00
Jeremie Dimino a721d13082 update error message for utop-setup-ocaml-buffer 2015-08-06 10:58:42 +01:00
Jeremie Dimino 0a386c3fb8 use simpler emacs features for utop-compat-resolve
Some people have complained about this in the past IIRC.
2015-01-12 09:56:50 +00:00
Jeremie Dimino 1fa1b1f0b3 simplify utop-compat-resolve
No need to try loading one of the major mode as utop-mode is now a
minor mode and has to be used in conjunction with the current major
mode of the buffer.
2015-01-12 09:36:54 +00:00
Mads Hartmann Jensen 6e7314861e Code review by @diml
- Changed default key-binding for utop to C-c C-s to match tuareg
  default
- Add some compatibility functions to make the transition easier for
  existing users
2015-01-11 13:20:03 +01:00
Mads Hartmann Jensen ff3a379c5b Use autoload cookies 2015-01-02 13:06:48 +01:00
Mads Hartmann Jensen 1290b09521 A step closer to not relying on other major mode's variables 2015-01-02 12:11:02 +01:00
Mads Hartmann Jensen 3c958ebf2e Use minor mode rather than overriding variables at runtime 2015-01-02 11:44:08 +01:00
Mads Hartmann Jensen 137151cca9 #108 Enable utop-command to be buffer-local 2014-11-04 17:44:28 +01:00
Mads Hartmann Jensen 064d874e61 Prettier fix for closing completion buffer 2014-08-21 22:35:26 +02:00
Mads Hartmann Jensen 081a10dadd Close *Completions* buffer after evaluation
This is a quick fix for #84. There might be a better place in the
code for the fix but this certainly does the trick.
2014-08-21 19:06:08 +02:00
Martin Trojer 3fdec164a8 better boiler plate 2014-03-07 21:47:37 +00:00
Martin Trojer 7290a63513 some boilerplate so utop.el can go up on melpa (http://melpa.milkbox.net/) 2014-03-07 14:59:29 +00:00
Jeremie Dimino cb2711067f emacs-mode: [tab] --> (kbd "TAB")
fixes #54
2014-01-17 09:17:53 +00:00
Matthias Andreas Benkard c9e89f0079 Emacs: Enable the use of multi-phrase input on startup. 2013-04-14 14:01:40 +02:00
Matthias Andreas Benkard 9deca3da21 `input-multi`: Fix error highlighting. 2013-04-03 22:53:12 +02:00
Matthias Andreas Benkard 3c10f874bc Support the `input-multi` command on the Emacs side. 2013-04-03 22:03:18 +02:00
wojciech.meyer ee65d72abd Showing type of an identifier at point
Ignore-this: 40b69923375d0ccdf6b1a98891b1bca6

darcs-hash:20120801020653-33bd9-7e0a38b19718bfe0965d9570388f9f5cb74dda48
2012-08-01 04:06:53 +02:00
wojciech.meyer 354b6d774a Allow C-j to eval with auto-end
Ignore-this: 8cd09eabbc6b9d5483a5aa380e2cb278

darcs-hash:20120801001337-33bd9-a5d76dab972820c41fc2beb40818a98013f111c6
2012-08-01 02:13:37 +02:00
wojciech.meyer 718fb69db1 Print only OCaml preprocessor message loaded if it was really loaded
Ignore-this: b96ea788d929cf7dbb853adfa59e4213

darcs-hash:20120731235343-33bd9-711df107c2b3b4580c0c37fe8271e732a4caeada
2012-08-01 01:53:43 +02:00
wojciech.meyer e4796c8e51 car $ cdr -> cadr
Ignore-this: 2b5aa46e42282ee30710daaf8d735116

darcs-hash:20120731235124-33bd9-9fd2bf3a358e2ed54eac23aaa56df50ece816004
2012-08-01 01:51:24 +02:00
wojciech.meyer 272f6f5c29 utop-ocaml-preprocessor - allow loading also pre-procesor from local file variables
Ignore-this: 50e32972f422612675d47fd9ce33fc43

darcs-hash:20120731234941-33bd9-16a892de7fff014771091a9a138380d665bdadd9
2012-08-01 01:49:41 +02:00
wojciech.meyer 5a47685bfb Factor out code to utop-eval-string
Ignore-this: 42d0ac92ee18eb0a7865743fe5058a5c

darcs-hash:20120731234841-33bd9-68f9230ddc9e8f41b48efa62dd9d048f2ae506d4
2012-08-01 01:48:41 +02:00
wojciech.meyer 82cccd480a Improvements for loading packages from the file local variables
Ignore-this: 8795ff387135ceb2b99ff8ae7f322875

darcs-hash:20120731231800-33bd9-adf29b40d61f7f63be893a8473edb6e77863b930
2012-08-01 01:18:00 +02:00