emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] externals/caml e1a8649 084/197: - added file caml-xemacs.el for


From: Stefan Monnier
Subject: [nongnu] externals/caml e1a8649 084/197: - added file caml-xemacs.el for XEmacs compatibility.
Date: Sat, 21 Nov 2020 01:19:43 -0500 (EST)

branch: externals/caml
commit e1a86495ca97779ad5023d006d9c936dec978dbe
Author: Didier Rémy <Didier.Remy@inria.fr>
Commit: Didier Rémy <Didier.Remy@inria.fr>

     - added file caml-xemacs.el for XEmacs compatibility.
    
    
    git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5751 
f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
---
 caml-help.el  | 16 +++++++++-------
 caml-types.el | 12 ++++++++++--
 caml.el       |  4 ++--
 3 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/caml-help.el b/caml-help.el
index 5902abf..f67ed1a 100644
--- a/caml-help.el
+++ b/caml-help.el
@@ -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
diff --git a/caml-types.el b/caml-types.el
index 3bb8e0f..9cf3490 100644
--- a/caml-types.el
+++ b/caml-types.el
@@ -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))
diff --git a/caml.el b/caml.el
index d6791b6..68b4ee4 100644
--- a/caml.el
+++ b/caml.el
@@ -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.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]