- added file caml-xemacs.el for XEmacs compatibility.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5751 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
59661392ed
commit
f9d0ac0c87
|
@ -27,6 +27,9 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
(if (and (boundp 'running-xemacs) running-xemacs)
|
||||
(require 'caml-xemacs))
|
||||
|
||||
;; Loading or building databases.
|
||||
;;
|
||||
|
||||
|
@ -217,7 +220,7 @@
|
|||
When call interactively, make completion over known modules."
|
||||
(interactive "P")
|
||||
(if (not (stringp arg))
|
||||
(let ((modules (ocaml-module-alist)) module)
|
||||
(let ((modules (ocaml-module-alist)))
|
||||
(setq arg
|
||||
(completing-read "Open module: " modules))))
|
||||
(if (and (stringp arg) (not (equal arg "")))
|
||||
|
@ -236,7 +239,7 @@ Otherwise if ARG is true, close all modules and reset to default. "
|
|||
(interactive "P")
|
||||
(if (= (prefix-numeric-value arg) 4)
|
||||
(setq ocaml-visible-modules 'lazy)
|
||||
(let* ((modules (ocaml-visible-modules)) default)
|
||||
(let* ((modules (ocaml-visible-modules)))
|
||||
(if (null modules) (error "No visible module to close"))
|
||||
(unless (stringp arg)
|
||||
(setq arg
|
||||
|
@ -325,9 +328,8 @@ If Module is undefined, it does completion in visible modules.
|
|||
Then, if completion fails, it does completion among all modules
|
||||
where identifier is defined."
|
||||
(interactive "p")
|
||||
(let* ((module-entry (ocaml-qualified-identifier))
|
||||
(let* ((module-entry (ocaml-qualified-identifier)) (entry)
|
||||
(module)
|
||||
(entry (cdr module-entry))
|
||||
(beg) (end) (pattern))
|
||||
(if (car module-entry)
|
||||
(progn
|
||||
|
@ -360,8 +362,7 @@ where identifier is defined."
|
|||
(error "Did not find anything to complete around point")
|
||||
|
||||
(setq pattern (buffer-substring beg end))
|
||||
(let* ((table 'ocaml-completion)
|
||||
(all-completions (ocaml-completion pattern module))
|
||||
(let* ((all-completions (ocaml-completion pattern module))
|
||||
(completion
|
||||
(try-completion pattern (mapcar 'list all-completions))))
|
||||
(cond ((eq completion t))
|
||||
|
@ -382,7 +383,7 @@ where identifier is defined."
|
|||
(t
|
||||
(setq hist (mapcar 'car modules))
|
||||
(completing-read "Module: " modules nil t
|
||||
"" (cons 'hist 0)))
|
||||
"" (cons hist 0)))
|
||||
)))
|
||||
(if (null module)
|
||||
(error "Can't find completion for \"%s\"" pattern)
|
||||
|
@ -556,6 +557,7 @@ command. An entry may be an info module or a complete file name."
|
|||
|
||||
;; Help function.
|
||||
|
||||
|
||||
(defun ocaml-goto-help (&optional module entry)
|
||||
"Searches info manual for MODULE and ENTRY in MODULE.
|
||||
If unspecified, MODULE and ENTRY are inferred from the position in the
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
|
||||
; An emacs-lisp complement to the "-dtypes" option of ocamlc and ocamlopt.
|
||||
|
||||
;; XEmacs compatibility
|
||||
(if (and (boundp 'running-xemacs) running-xemacs)
|
||||
(require 'caml-xemacs))
|
||||
|
||||
|
||||
(defvar caml-types-location-re nil "Regexp to parse *.annot files.
|
||||
|
||||
|
@ -95,6 +99,9 @@ For the moment, the only possible keyword is \"type\"."
|
|||
. Even if type checking fails, you can still look at the types
|
||||
in the file, up to where the type checker failed.
|
||||
|
||||
Types are also diplayed in the buffer *caml-types*, which buffer is
|
||||
display when the commande is called with Prefix argument 4.
|
||||
|
||||
See also `caml-types-explore' for exploration by mouse dragging.
|
||||
See `caml-types-location-re' for annotation file format.
|
||||
"
|
||||
|
@ -169,7 +176,6 @@ See `caml-types-location-re' for annotation file format.
|
|||
|
||||
(defun caml-types-hcons (elem table)
|
||||
(or (cl-gethash elem table) (cl-puthash elem elem table) elem))
|
||||
|
||||
|
||||
(defun caml-types-build-tree (target-file)
|
||||
(let ((stack ())
|
||||
|
@ -349,6 +355,7 @@ See `caml-types-location-re' for annotation file format.
|
|||
)
|
||||
buf))
|
||||
|
||||
|
||||
(defun caml-types-explore (event)
|
||||
"Explore type annotations by mouse dragging.
|
||||
|
||||
|
@ -377,7 +384,8 @@ and its type is displayed in the minibuffer, until the move is released."
|
|||
(if (and limits (>= cnum (car limits)) (< cnum (cdr limits)))
|
||||
(message mes)
|
||||
(setq target-bol
|
||||
(save-excursion (goto-char cnum) (line-beginning-position)))
|
||||
(save-excursion (goto-char cnum)
|
||||
(line-beginning-position)))
|
||||
(setq target-line
|
||||
(1+ (count-lines (point-min) target-bol)))
|
||||
(setq target-pos (vector target-file target-line target-bol cnum))
|
||||
|
|
|
@ -259,8 +259,8 @@ have caml-electric-indent on, which see.")
|
|||
(defvar caml-shell-active nil
|
||||
"Non nil when a subshell is running.")
|
||||
|
||||
(defvar running-xemacs nil
|
||||
"Non nil when using xemacs.")
|
||||
(defvar running-xemacs (string-match "XEmacs" emacs-version)
|
||||
"Non-nil if we are running in the XEmacs environment.")
|
||||
|
||||
(defvar caml-mode-map nil
|
||||
"Keymap used in Caml mode.")
|
||||
|
|
Loading…
Reference in New Issue