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

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

[nongnu] elpa/caml 97211bf 07/10: Remove all mentions of XEmacs


From: ELPA Syncer
Subject: [nongnu] elpa/caml 97211bf 07/10: Remove all mentions of XEmacs
Date: Wed, 25 Aug 2021 02:57:19 -0400 (EDT)

branch: elpa/caml
commit 97211bf9d89b7153dc861c58f17df2f8c1d77736
Author: Christophe Troestler <Christophe.Troestler@umons.ac.be>
Commit: Christophe Troestler <Christophe.Troestler@umons.ac.be>

    Remove all mentions of XEmacs
---
 Makefile       |   5 +-
 caml-emacs.el  |  42 ----------------
 caml-help.el   |  12 ++---
 caml-types.el  |  68 +++++++++++++------------
 caml-xemacs.el |  53 --------------------
 caml.el        | 156 +++++++++++++++++++++------------------------------------
 6 files changed, 96 insertions(+), 240 deletions(-)

diff --git a/Makefile b/Makefile
index 8b44045..617d173 100644
--- a/Makefile
+++ b/Makefile
@@ -22,8 +22,7 @@ OPAM_FILE = packages/caml-mode/caml-mode.$(VERSION)/opam
 
 # Files to install
 FILES= caml-font.el caml.el camldebug.el      \
-       inf-caml.el caml-help.el caml-types.el \
-       caml-xemacs.el caml-emacs.el
+       inf-caml.el caml-help.el caml-types.el
 
 INSTALL_DIR ?= $(shell opam var share)/emacs/site-lisp
 INSTALL_BIN ?= $(shell opam var bin)
@@ -57,8 +56,6 @@ INSTALL_RM_R = $(RM) -r
 # Command for byte-compiling the files
 COMPILECMD=(progn \
              (setq load-path (cons "." load-path)) \
-             (byte-compile-file "caml-xemacs.el") \
-             (byte-compile-file "caml-emacs.el") \
              (byte-compile-file "caml.el") \
              (byte-compile-file "inf-caml.el") \
              (byte-compile-file "caml-help.el") \
diff --git a/caml-emacs.el b/caml-emacs.el
deleted file mode 100644
index bad4ff5..0000000
--- a/caml-emacs.el
+++ /dev/null
@@ -1,42 +0,0 @@
-;**************************************************************************
-;*                                                                        *
-;*                                 OCaml                                  *
-;*                                                                        *
-;*             Didier Remy, projet Cristal, INRIA Rocquencourt            *
-;*                                                                        *
-;*   Copyright 2003 Institut National de Recherche en Informatique et     *
-;*     en Automatique.                                                    *
-;*                                                                        *
-;*   All rights reserved.  This file is distributed under the terms of    *
-;*   the GNU General Public License.                                      *
-;*                                                                        *
-;**************************************************************************
-
-;; for caml-help.el
-(defalias 'caml-info-other-window 'info-other-window)
-
-;; for caml-types.el
-
-(defalias 'caml-line-beginning-position 'line-beginning-position)
-
-(defalias 'caml-read-event 'read-event)
-(defalias 'caml-window-edges 'window-edges)
-(defun caml-mouse-vertical-position ()
-  (cddr (mouse-position)))
-(defalias 'caml-ignore-event-p 'integer-or-marker-p)
-(defalias 'caml-mouse-movement-p 'mouse-movement-p)
-(defalias 'caml-sit-for 'sit-for)
-
-(defalias 'caml-track-mouse 'track-mouse)
-
-(defun caml-event-window (e) (posn-window (event-start e)))
-(defun caml-event-point-start (e) (posn-point (event-start e)))
-(defun caml-event-point-end (e) (posn-point (event-end e)))
-
-(defun caml-release-event-p (original event)
-  (and (equal (event-basic-type original) (event-basic-type event))
-       (let ((modifiers  (event-modifiers event)))
-         (or (member 'drag modifiers)
-             (member 'click modifiers)))))
-
-(provide 'caml-emacs)
diff --git a/caml-help.el b/caml-help.el
index 63fc1d2..8451963 100644
--- a/caml-help.el
+++ b/caml-help.el
@@ -43,11 +43,6 @@
 
 ;;; Code:
 
-(eval-and-compile
-  (if (featurep 'xemacs)
-      (require 'caml-xemacs)
-    (require 'caml-emacs)))
-
 (require 'info)
 (require 'view)
 
@@ -593,7 +588,7 @@ current buffer using \\[ocaml-qualified-identifier]."
   (let ((window (selected-window))
         (info-section (assoc module (ocaml-info-alist))))
     (if info-section
-        (caml-info-other-window (cdr info-section))
+        (info-other-window (cdr info-section))
       (ocaml-visible-modules)
       (let* ((module-info
               (or (assoc module (ocaml-module-alist))
@@ -777,8 +772,9 @@ buffer positions."
 (defun ocaml-link-goto (click)
   "Follow link at point."
   (interactive "e")
-  (let* ((pos (caml-event-point-start click))
-         (win (caml-event-window click))
+  (let* ((pos-click (event-start click))
+         (pos (posn-point pos-click))
+         (win (posn-window pos-click))
          (buf (window-buffer win))
          (window (selected-window))
          (link))
diff --git a/caml-types.el b/caml-types.el
index d0eab5a..c7c91a0 100644
--- a/caml-types.el
+++ b/caml-types.el
@@ -14,13 +14,6 @@
 
 ; An emacs-lisp complement to the "-annot" option of ocamlc and ocamlopt.
 
-;; XEmacs compatibility
-
-(eval-and-compile
-  (if (featurep 'xemacs)
-      (require 'caml-xemacs)
-    (require 'caml-emacs)))
-
 (defvar caml-types-buffer)              ;Forward declaration.
 
 (defun caml-types-feedback (info format)
@@ -167,8 +160,8 @@ See `caml-types-location-re' for annotation file format."
   (let* ((target-buf (current-buffer))
          (target-file (file-name-nondirectory (buffer-file-name)))
          (target-line (1+ (count-lines (point-min)
-                                       (caml-line-beginning-position))))
-         (target-bol (caml-line-beginning-position))
+                                       (line-beginning-position))))
+         (target-bol (line-beginning-position))
          (target-cnum (point)))
     (caml-types-preprocess (buffer-file-name))
     (setq caml-types-buffer (get-buffer-create caml-types-buffer-name))
@@ -189,7 +182,7 @@ See `caml-types-location-re' for annotation file format."
              (not (window-live-p (get-buffer-window caml-types-buffer))))
         (display-buffer caml-types-buffer))
     (unwind-protect
-        (caml-sit-for 60)
+        (sit-for 60)
       (delete-overlay caml-types-expr-ovl))))
 
 (defun caml-types-show-call (arg)
@@ -208,8 +201,8 @@ See `caml-types-location-re' for annotation file format."
   (let* ((target-buf (current-buffer))
          (target-file (file-name-nondirectory (buffer-file-name)))
          (target-line (1+ (count-lines (point-min)
-                                       (caml-line-beginning-position))))
-         (target-bol (caml-line-beginning-position))
+                                       (line-beginning-position))))
+         (target-bol (line-beginning-position))
          (target-cnum (point)))
     (caml-types-preprocess (buffer-file-name))
     (setq caml-types-buffer (get-buffer-create caml-types-buffer-name))
@@ -230,7 +223,7 @@ See `caml-types-location-re' for annotation file format."
              (not (window-live-p (get-buffer-window caml-types-buffer))))
         (display-buffer caml-types-buffer))
     (unwind-protect
-        (caml-sit-for 60)
+        (sit-for 60)
       (delete-overlay caml-types-expr-ovl))))
 
 (defun caml-types-show-ident (arg)
@@ -249,8 +242,8 @@ See `caml-types-location-re' for annotation file format."
   (let* ((target-buf (current-buffer))
          (target-file (file-name-nondirectory (buffer-file-name)))
          (target-line (1+ (count-lines (point-min)
-                                       (caml-line-beginning-position))))
-         (target-bol (caml-line-beginning-position))
+                                       (line-beginning-position))))
+         (target-bol (line-beginning-position))
          (target-cnum (point)))
     (caml-types-preprocess (buffer-file-name))
     (setq caml-types-buffer (get-buffer-create caml-types-buffer-name))
@@ -325,7 +318,7 @@ See `caml-types-location-re' for annotation file format."
              (not (window-live-p (get-buffer-window caml-types-buffer))))
         (display-buffer caml-types-buffer))
     (unwind-protect
-        (caml-sit-for 60)
+        (sit-for 60)
       (delete-overlay caml-types-expr-ovl)
       (delete-overlay caml-types-def-ovl)
       (delete-overlay caml-types-scope-ovl))))
@@ -606,6 +599,15 @@ corresponding .annot file."
      (+ (* (mod (cadr time) 1000) 1000)
                   (/ (cadr (cdr time)) 1000))))
 
+(defun caml--release-event-p (original event)
+  (and (equal (event-basic-type original) (event-basic-type event))
+       (let ((modifiers  (event-modifiers event)))
+         (or (member 'drag modifiers)
+             (member 'click modifiers)))))
+
+(defun caml--event-point-end (e) (posn-point (event-end e)))
+(defun caml--event-window (e) (posn-window (event-start e)))
+
 (defun caml-types-explore (event)
   "Explore type annotations by mouse dragging.
 
@@ -618,14 +620,14 @@ The function uses two overlays.
  . Another overlay delimits the current node under the mouse (whose type
    annotation is being displayed)."
   (interactive "e")
-  (set-buffer (window-buffer (caml-event-window event)))
+  (set-buffer (window-buffer (caml--event-window event)))
   (let* ((target-buf (current-buffer))
          (target-file (file-name-nondirectory (buffer-file-name)))
          (target-line) (target-bol)
          target-pos
          limits cnum node mes type
          region
-         (window (caml-event-window event))
+         (window (caml--event-window event))
          target-tree
          (speed 100)
          (last-time (caml-types-time))
@@ -638,29 +640,29 @@ The function uses two overlays.
           (setq caml-types-buffer (get-buffer-create caml-types-buffer-name))
           ;; (message "Drag the mouse to explore types")
           (unwind-protect
-              (caml-track-mouse
+              (track-mouse
                (while event
                  (cond
                   ;; we ignore non mouse events
-                  ((caml-ignore-event-p event))
+                  ((integer-or-marker-p event))
                   ;; we stop when the original button is released
-                  ((caml-release-event-p original-event event)
+                  ((caml--release-event-p original-event event)
                    (setq event nil))
                   ;; we scroll when the motion is outside the window
-                  ((and (caml-mouse-movement-p event)
-                        (not (and (equal window (caml-event-window event))
+                  ((and (mouse-movement-p event)
+                        (not (and (equal window (caml--event-window event))
                                   (integer-or-marker-p
-                                   (caml-event-point-end event)))))
-                   (let* ((win (caml-window-edges window))
+                                   (caml--event-point-end event)))))
+                   (let* ((win (window-edges window))
                           (top (nth 1 win))
                           (bottom (- (nth 3 win) 1))
                           mouse
                           time)
                      (while (and
-                             (caml-sit-for 0 (/ 500 speed))
+                             (sit-for 0 (/ 500 speed))
                              (setq time (caml-types-time))
                              (> (- time last-time) (/ 500 speed))
-                             (setq mouse (caml-mouse-vertical-position))
+                             (setq mouse (cddr (mouse-position)))
                              (or (< mouse top) (>= mouse bottom)))
                        (setq last-time time)
                        (cond
@@ -677,9 +679,9 @@ The function uses two overlays.
                        (setq speed (* speed speed)))))
                   ;; main action, when the motion is inside the window
                   ;; or on original button down event
-                  ((or (caml-mouse-movement-p event)
+                  ((or (mouse-movement-p event)
                        (equal original-event event))
-                   (setq cnum (caml-event-point-end event))
+                   (setq cnum (caml--event-point-end event))
                    (if (and region
                             (<= (car region) cnum) (< cnum (cdr region)))
                        ;; mouse remains in outer region
@@ -687,7 +689,7 @@ The function uses two overlays.
                      ;; otherwise, reset the outer region
                      (setq region
                            (caml-types-typed-make-overlay
-                            target-buf (caml-event-point-start event))))
+                            target-buf (posn-point (event-start event)))))
                    (if
                        (and limits
                             (>= cnum (car limits)) (< cnum (cdr limits)))
@@ -696,7 +698,7 @@ The function uses two overlays.
                      ;; recompute the inner region and type annotation
                      (setq target-bol
                            (save-excursion
-                             (goto-char cnum) (caml-line-beginning-position))
+                             (goto-char cnum) (line-beginning-position))
                            target-line (1+ (count-lines (point-min)
                                                         target-bol))
                            target-pos
@@ -728,7 +730,7 @@ The function uses two overlays.
                        (insert type)))
                    (message mes)))
                  ;; we read next event, unless it is nil, and loop back.
-                 (if event (setq event (caml-read-event)))))
+                 (if event (setq event (read-event)))))
             ;; delete overlays at end of exploration
             (delete-overlay caml-types-expr-ovl)
             (delete-overlay caml-types-typed-ovl)))
@@ -741,7 +743,7 @@ The function uses two overlays.
       ;; Not sure it is robust to loop for mouse release after an error
       ;; occurred, as is done for exploration.
       ;; So far, we just ignore next event. (Next line also be uncommenting.)
-      (if event (caml-read-event)))))
+      (if event (read-event)))))
 
 (defun caml-types-typed-make-overlay (target-buf pos)
   (interactive "p")
diff --git a/caml-xemacs.el b/caml-xemacs.el
deleted file mode 100644
index 12dc484..0000000
--- a/caml-xemacs.el
+++ /dev/null
@@ -1,53 +0,0 @@
-;**************************************************************************
-;*                                                                        *
-;*                                 OCaml                                  *
-;*                                                                        *
-;*             Didier Remy, projet Cristal, INRIA Rocquencourt            *
-;*                                                                        *
-;*   Copyright 2003 Institut National de Recherche en Informatique et     *
-;*     en Automatique.                                                    *
-;*                                                                        *
-;*   All rights reserved.  This file is distributed under the terms of    *
-;*   the GNU General Public License.                                      *
-;*                                                                        *
-;**************************************************************************
-
-(require 'overlay)
-
-;; for caml-help.el
-(defun caml-info-other-window (arg)
-  (save-excursion (info arg))
-  (view-buffer-other-window "*info*"))
-
-;; for caml-types.el
-(defun caml-line-beginning-position ()
-  (save-excursion (beginning-of-line) (point)))
-
-(defalias 'caml-read-event 'next-event)
-(defalias 'caml-window-edges 'window-pixel-edges)
-(defun caml-mouse-vertical-position ()
-  (let ((e  (mouse-position-as-motion-event)))
-    (and e (event-y-pixel e))))
-(defalias 'caml-mouse-movement-p 'motion-event-p)
-(defun caml-event-window (e)
-  (and (mouse-event-p e) (event-window e)))
-(defun caml-event-point-start (e) (event-closest-point e))
-(defun caml-event-point-end (e) (event-closest-point e))
-(defun caml-ignore-event-p (e)
-  (if (and (key-press-event-p e) (equal (key-binding e) 'keyboard-quit))
-      (keyboard-quit))
-  (not (mouse-event-p e)))
-
-
-(defun caml-sit-for (sec &optional mili)
-  (sit-for (+ sec (if mili (* 0.001 mili) 0))))
-
-
-
-(defmacro caml-track-mouse (&rest body) (cons 'progn body))
-
-(defun caml-release-event-p (original event)
-  (and (button-release-event-p event)
-       (equal (event-button original) (event-button event))))
-
-(provide 'caml-xemacs)
diff --git a/caml.el b/caml.el
index 30451e6..9a5dd8e 100644
--- a/caml.el
+++ b/caml.el
@@ -1,4 +1,4 @@
-;;; caml.el --- Caml mode for GNU Emacs and XEmacs -*- lexical-binding: t; -*-
+;;; caml.el --- Caml mode for GNU Emacs -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1997-2017 Institut National de Recherche en Informatique et 
en Automatique.
 
@@ -7,7 +7,7 @@
 ;;         Damien Doligez <damien.doligez@inria.fr>
 ;; Maintainer: Christophe Troestler <Christophe.Troestler@umons.ac.be>
 ;; Created: July 1993
-;; Package-Requires: ((emacs "24.3") (cl-lib "0.5"))
+;; Package-Requires: ((emacs "24.3"))
 ;; Version: 4.8
 ;; Keywords: OCaml
 ;; Homepage: https://github.com/ocaml/caml-mode
@@ -305,9 +305,6 @@ have `caml-electric-indent' on, which see.")
     ;;that way we get out effect even when we do \C-x` in compilation buffer
     ;;  (define-key map "\C-x`" 'caml-next-error)
 
-    (define-key map (if (featurep 'xemacs) 'backspace "\177")
-      'backward-delete-char-untabify)
-
     ;; caml-types
     (define-key map [?\C-c?\C-t] 'caml-types-show-type)  ; "type"
     (define-key map [?\C-c?\C-f] 'caml-types-show-call)  ; "function"
@@ -341,93 +338,61 @@ have `caml-electric-indent' on, which see.")
     (define-key map "\M-\C-q" 'caml-indent-phrase)
     (define-key map "\M-\C-x" 'caml-eval-phrase)
 
-    (if (featurep 'xemacs) nil
-      (let ((menu (make-sparse-keymap "Caml"))
-            (forms (make-sparse-keymap "Forms")))
-        (define-key map "\C-c\C-d" 'caml-show-imenu)
-        (define-key map [menu-bar] (make-sparse-keymap))
-        (define-key map [menu-bar caml] (cons "Caml" menu))
-        ;; caml-help
-
-        (define-key menu [open] '("Open add path" . ocaml-add-path ))
-        (define-key menu [close]
-          '("Close module for help" . ocaml-close-module))
-        (define-key menu [open] '("Open module for help" . ocaml-open-module))
-        (define-key menu [help] '("Help for identifier" . caml-help))
-        (define-key menu [complete] '("Complete identifier" . caml-complete))
-        (define-key menu [separator-help] '("---"))
-
-        ;; caml-types
-        (define-key menu [show-type]
-          '("Show type at point" . caml-types-show-type ))
-        (define-key menu [separator-types] '("---"))
-
-        ;; others
-        (define-key menu [camldebug] '("Call debugger..." . camldebug))
-        (define-key menu [run-caml] '("Start subshell..." . run-caml))
-        (define-key menu [compile] '("Compile..." . compile))
-        (define-key menu [switch-view]
-          '("Switch view" . caml-find-alternate-file))
-        (define-key menu [separator-format] '("--"))
-        (define-key menu [forms] (cons "Forms" forms))
-        (define-key menu [show-imenu] '("Show index" . caml-show-imenu))
-        (put 'caml-show-imenu 'menu-enable '(not caml-imenu-shown))
-        (define-key menu [show-subshell] '("Show subshell" . 
caml-show-subshell))
-        (put 'caml-show-subshell 'menu-enable 'caml-shell-active)
-        (define-key menu [eval-phrase] '("Eval phrase" . caml-eval-phrase))
-        (put 'caml-eval-phrase 'menu-enable 'caml-shell-active)
-        (define-key menu [indent-phrase] '("Indent phrase" . 
caml-indent-phrase))
-        (define-key forms [while]
-          '("while .. do .. done" . caml-insert-while-form))
-        (define-key forms [try] '("try .. with .." . caml-insert-try-form))
-        (define-key forms [match] '("match .. with .." . 
caml-insert-match-form))
-        (define-key forms [let] '("let .. in .." . caml-insert-let-form))
-        (define-key forms [if] '("if .. then .. else .." . 
caml-insert-if-form))
-        (define-key forms [begin] '("for .. do .. done" . 
caml-insert-for-form))
-        (define-key forms [begin] '("begin .. end" . caml-insert-begin-form))))
+    (let ((menu (make-sparse-keymap "Caml"))
+          (forms (make-sparse-keymap "Forms")))
+      (define-key map "\C-c\C-d" 'caml-show-imenu)
+      (define-key map [menu-bar] (make-sparse-keymap))
+      (define-key map [menu-bar caml] (cons "Caml" menu))
+      ;; caml-help
+
+      (define-key menu [open] '("Open add path" . ocaml-add-path ))
+      (define-key menu [close]
+        '("Close module for help" . ocaml-close-module))
+      (define-key menu [open] '("Open module for help" . ocaml-open-module))
+      (define-key menu [help] '("Help for identifier" . caml-help))
+      (define-key menu [complete] '("Complete identifier" . caml-complete))
+      (define-key menu [separator-help] '("---"))
+
+      ;; caml-types
+      (define-key menu [show-type]
+        '("Show type at point" . caml-types-show-type ))
+      (define-key menu [separator-types] '("---"))
+
+      ;; others
+      (define-key menu [camldebug] '("Call debugger..." . camldebug))
+      (define-key menu [run-caml] '("Start subshell..." . run-caml))
+      (define-key menu [compile] '("Compile..." . compile))
+      (define-key menu [switch-view]
+        '("Switch view" . caml-find-alternate-file))
+      (define-key menu [separator-format] '("--"))
+      (define-key menu [forms] (cons "Forms" forms))
+      (define-key menu [show-imenu] '("Show index" . caml-show-imenu))
+      (put 'caml-show-imenu 'menu-enable '(not caml-imenu-shown))
+      (define-key menu [show-subshell] '("Show subshell" . caml-show-subshell))
+      (put 'caml-show-subshell 'menu-enable 'caml-shell-active)
+      (define-key menu [eval-phrase] '("Eval phrase" . caml-eval-phrase))
+      (put 'caml-eval-phrase 'menu-enable 'caml-shell-active)
+      (define-key menu [indent-phrase] '("Indent phrase" . caml-indent-phrase))
+      (define-key forms [while]
+        '("while .. do .. done" . caml-insert-while-form))
+      (define-key forms [try] '("try .. with .." . caml-insert-try-form))
+      (define-key forms [match] '("match .. with .." . caml-insert-match-form))
+      (define-key forms [let] '("let .. in .." . caml-insert-let-form))
+      (define-key forms [if] '("if .. then .. else .." . caml-insert-if-form))
+      (define-key forms [begin] '("for .. do .. done" . caml-insert-for-form))
+      (define-key forms [begin] '("begin .. end" . caml-insert-begin-form)))
     map)
   "Keymap used in Caml mode.")
 
-(defvar caml-mode-xemacs-menu
-  (if (featurep 'xemacs)
-      '("Caml"
-        [ "Indent phrase" caml-indent-phrase :keys "C-M-q" ]
-        [ "Eval phrase" caml-eval-phrase
-          :active caml-shell-active :keys "C-M-x" ]
-        [ "Show subshell" caml-show-subshell caml-shell-active ]
-        ("Forms"
-         [ "while .. do .. done" caml-insert-while-form t]
-         [ "try .. with .." caml-insert-try-form t ]
-         [ "match .. with .." caml-insert-match-form t ]
-         [ "let .. in .." caml-insert-let-form t ]
-         [ "if .. then .. else .." caml-insert-if-form t ]
-         [ "for .. do .. done" caml-insert-for-form t ]
-         [ "begin .. end" caml-insert-begin-form t ])
-        "---"
-        [ "Switch view" caml-find-alternate-file t ]
-        [ "Compile..." compile t ]
-        [ "Start subshell..." run-caml t ]
-        "---"
-        [ "Show type at point" caml-types-show-type t ]
-        "---"
-        [ "Complete identifier" caml-complete t ]
-        [ "Help for identifier" caml-help t ]
-        [ "Add path for documentation" ocaml-add-path t ]
-        [ "Open module for documentation" ocaml-open t ]
-        [ "Close module for documentation" ocaml-close t ]
-        ))
-  "Menu to add to the menubar when running Xemacs.")
-
 (defvar caml-mode-syntax-table
-  (let ((st (make-syntax-table))
-        (n (if (featurep 'xemacs) "" "n")))
+  (let ((st (make-syntax-table)))
     ;; backslash is an escape sequence
     (modify-syntax-entry ?\\ "\\" st)
     ;; ( is first character of comment start
-    (modify-syntax-entry ?\( (concat "()1" n) st)
+    (modify-syntax-entry ?\( "()1n" st)
     ;; * is second character of comment start,
     ;; and first character of comment end
-    (modify-syntax-entry ?*  (concat ". 23" n) st)
+    (modify-syntax-entry ?* ". 23n" st)
     ;; ) is last character of comment end
     (modify-syntax-entry ?\) ")(4" st)
     ;; backquote was a string-like delimiter (for character literals)
@@ -467,8 +432,7 @@ have `caml-electric-indent' on, which see.")
 
 ;;; The major mode
 (eval-when-compile
-  (if (featurep 'xemacs) nil
-    (require 'imenu)))
+  (require 'imenu))
 
 ;;
 (defvar caml-mode-hook nil
@@ -503,21 +467,13 @@ have `caml-electric-indent' on, which see.")
   ;garrigue 27-11-96
   (setq case-fold-search nil)
   ;garrigue july 97
-  (if (featurep 'xemacs)
-      (if (and (featurep 'menubar)
-               current-menubar)
-          (progn
-            ;; make a local copy of the menubar, so our modes don't
-            ;; change the global menubar
-            (set-buffer-menubar current-menubar)
-            (add-submenu nil caml-mode-xemacs-menu)))
-    ;imenu support (not for Xemacs)
-    (make-local-variable 'imenu-create-index-function)
-    (setq imenu-create-index-function #'caml-create-index-function)
-    (make-local-variable 'imenu-generic-expression)
-    (setq imenu-generic-expression caml-imenu-search-regexp)
-    (if (and caml-imenu-enable (< (buffer-size) 10000))
-        (caml-show-imenu))))
+  ;; imenu support
+  (make-local-variable 'imenu-create-index-function)
+  (setq imenu-create-index-function #'caml-create-index-function)
+  (make-local-variable 'imenu-generic-expression)
+  (setq imenu-generic-expression caml-imenu-search-regexp)
+  (if (and caml-imenu-enable (< (buffer-size) 10000))
+      (caml-show-imenu)))
 
 
 ;; Disabled because it assumes make and does not play well with ocamlbuild.



reply via email to

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