interactive list of packages now work in Emacs
Ignore-this: f5beeb274d704e63b8520b91ad33b39b darcs-hash:20120303175448-33bd9-2fca1cf41d9a66bfcbd75262b64bc41a25774fc7
This commit is contained in:
parent
01263d3532
commit
023e72933d
|
@ -652,15 +652,12 @@ module Emacs(M : sig end) = struct
|
||||||
| Some ("save-history", code) ->
|
| Some ("save-history", code) ->
|
||||||
Lwt_main.run (save_history ());
|
Lwt_main.run (save_history ());
|
||||||
loop_commands history_prev history_next
|
loop_commands history_prev history_next
|
||||||
| Some ("require", arg) ->
|
| Some ("require", package) -> begin
|
||||||
begin
|
try
|
||||||
let input = read_data () in
|
Topfind.load_deeply [package]
|
||||||
send "accept" "";
|
with Fl_package_base.No_such_package(pkg, reason) ->
|
||||||
try
|
send "no-such-package" pkg
|
||||||
Topfind.load_deeply [input]
|
end;
|
||||||
with Fl_package_base.No_such_package(pkg, reason) ->
|
|
||||||
send "no-such-package" ""
|
|
||||||
end;
|
|
||||||
loop_commands history_prev history_next
|
loop_commands history_prev history_next
|
||||||
| Some (command, _) ->
|
| Some (command, _) ->
|
||||||
Printf.ksprintf (send "stderr") "unrecognized command %S!" command;
|
Printf.ksprintf (send "stderr") "unrecognized command %S!" command;
|
||||||
|
|
|
@ -187,6 +187,13 @@ to add the newline character if it is not accepted).")
|
||||||
(inhibit-read-only t))
|
(inhibit-read-only t))
|
||||||
(progn ,@actions)))
|
(progn ,@actions)))
|
||||||
|
|
||||||
|
(defun utop-send-string (str)
|
||||||
|
(if (not (bufferp utop-buffer-name))
|
||||||
|
(utop)
|
||||||
|
(when (eq utop-state 'done) (utop-restart)))
|
||||||
|
(with-current-buffer utop-buffer-name
|
||||||
|
(process-send-string utop-process str)))
|
||||||
|
|
||||||
(defun utop-insert (&rest args)
|
(defun utop-insert (&rest args)
|
||||||
"Insert text with checks inhibited."
|
"Insert text with checks inhibited."
|
||||||
(utop-perform (apply 'insert args)))
|
(utop-perform (apply 'insert args)))
|
||||||
|
@ -801,7 +808,8 @@ defaults to 0."
|
||||||
(let ((package (button-label button)))
|
(let ((package (button-label button)))
|
||||||
(when (y-or-n-p (format "Load package `%s'? " package))
|
(when (y-or-n-p (format "Load package `%s'? " package))
|
||||||
;; Handle loading of packages
|
;; Handle loading of packages
|
||||||
nil)))
|
(utop-send-string (format "require:%s\n" package))
|
||||||
|
)))
|
||||||
|
|
||||||
(defun utop-list-ocaml-packages (&optional buffer)
|
(defun utop-list-ocaml-packages (&optional buffer)
|
||||||
"Display a list of all ocaml findlib packages"
|
"Display a list of all ocaml findlib packages"
|
||||||
|
|
Loading…
Reference in New Issue