[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/caml 9d045e4 009/197: Corrections de Jacques sur sa v
From: |
Stefan Monnier |
Subject: |
[nongnu] externals/caml 9d045e4 009/197: Corrections de Jacques sur sa version 1.05 |
Date: |
Sat, 21 Nov 2020 01:19:27 -0500 (EST) |
branch: externals/caml
commit 9d045e44cbeb14e7a9d42911eb70fc7dd95db326
Author: Xavier Leroy <xavier.leroy@inria.fr>
Commit: Xavier Leroy <xavier.leroy@inria.fr>
Corrections de Jacques sur sa version 1.05
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1648
f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
---
README | 3 ++-
caml.el | 92 ++++++++++++++++++++++++++++++++++++++++++++---------------------
2 files changed, 65 insertions(+), 30 deletions(-)
diff --git a/README b/README
index 15c501e..b5f388a 100644
--- a/README
+++ b/README
@@ -59,7 +59,8 @@ Version 1.05:
correctly even when you write them at the beginning of a line.
* added a Caml menu, and Imenu support. Imenu menu can be disabled
- by setting the variable caml-imenu-disable to t.
+ by setting the variable caml-imenu-disable to t.
+ Xemacs support for the Menu, but no Imenu.
* key bindings closer to lisp-mode.
diff --git a/caml.el b/caml.el
index 1e81a45..628ca97 100644
--- a/caml.el
+++ b/caml.el
@@ -246,6 +246,9 @@ have caml-electric-indent on, which see.")
(defvar caml-shell-active nil
"*Non nil when a subshell is running.")
+;; is it really ok ? Conform to Xemacs definition
+(if (not (boundp 'running-xemacs)) (setq running-xemacs nil))
+
(defvar caml-mode-map nil
"Keymap used in Caml mode.")
(if caml-mode-map
@@ -280,29 +283,51 @@ have caml-electric-indent on, which see.")
(define-key caml-mode-map "\M-\C-h" 'caml-mark-phrase)
(define-key caml-mode-map "\M-\C-q" 'caml-indent-phrase)
(define-key caml-mode-map "\M-\C-x" 'caml-eval-phrase)
- (let ((map (make-sparse-keymap "Caml"))
- (forms (make-sparse-keymap "Forms")))
- (define-key caml-mode-map [menu-bar] (make-sparse-keymap))
- (define-key caml-mode-map [menu-bar caml] (cons "Caml" map))
- (define-key map [run-caml] '("Start subshell..." . run-caml))
- (define-key map [compile] '("Compile..." . compile))
- (define-key map [switch-view] '("Switch view" . caml-find-alternate-file))
- (define-key map [separator-format] '("--"))
- (define-key map [forms] (cons "Forms" forms))
- (define-key map [show-subshell] '("Show subshell" . caml-show-subshell))
- (put 'caml-show-subshell 'menu-enable 'caml-shell-active)
- (define-key map [eval-phrase] '("Eval phrase" . caml-eval-phrase))
- (put 'caml-eval-phrase 'menu-enable 'caml-shell-active)
- (define-key map [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))))
-
+ (if running-xemacs nil ; if not running xemacs
+ (let ((map (make-sparse-keymap "Caml"))
+ (forms (make-sparse-keymap "Forms")))
+ (define-key caml-mode-map [menu-bar] (make-sparse-keymap))
+ (define-key caml-mode-map [menu-bar caml] (cons "Caml" map))
+ (define-key map [run-caml] '("Start subshell..." . run-caml))
+ (define-key map [compile] '("Compile..." . compile))
+ (define-key map [switch-view]
+ '("Switch view" . caml-find-alternate-file))
+ (define-key map [separator-format] '("--"))
+ (define-key map [forms] (cons "Forms" forms))
+ (define-key map [show-subshell] '("Show subshell" . caml-show-subshell))
+ (put 'caml-show-subshell 'menu-enable 'caml-shell-active)
+ (define-key map [eval-phrase] '("Eval phrase" . caml-eval-phrase))
+ (put 'caml-eval-phrase 'menu-enable 'caml-shell-active)
+ (define-key map [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)))))
+
+(defvar caml-mode-xemacs-menu
+ (if running-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 t ]
+ [ "Compile..." compile t ]
+ [ "Start subshell..." run-caml t ]))
+ "Menu to add to the menubar when running Xemacs")
(defvar caml-mode-syntax-table nil
"Syntax table in use in Caml mode buffers.")
@@ -386,12 +411,21 @@ have caml-electric-indent on, which see.")
(setq caml-last-comment-end (make-marker))
;garrigue 27-11-96
(setq case-fold-search nil)
- ;imenu support
- (make-local-variable 'imenu-create-index-function)
- (setq imenu-create-index-function 'caml-create-index-function)
- (if caml-imenu-disable nil
- (require 'imenu)
- (imenu-add-to-menubar "Defs"))
+ ;garrigue july 97
+ (if running-xemacs ; from Xemacs lisp mode
+ (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)
+ (if caml-imenu-disable nil
+ (require 'imenu)
+ (imenu-add-to-menubar "Defs")))
(run-hooks 'caml-mode-hook))
;;; Auxiliary function. Garrigue 96-11-01.
- [nongnu] branch externals/caml created (now 38ebde1), Stefan Monnier, 2020/11/21
- [nongnu] externals/caml bf4ed0f 001/197: Mode OCaml Garrigue/Zimmerman, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 087fca8 003/197: Fichier oublie., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 8ef19e2 002/197: Makefile d'installation, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml ad4f8bf 007/197: Nouveau module Marshal dans stdlib, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 9d045e4 009/197: Corrections de Jacques sur sa version 1.05,
Stefan Monnier <=
- [nongnu] externals/caml 78f81bc 004/197: Corrections diverses, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 6ce04bf 006/197: Donne a ocamldebug le chemin complet du programme a lancer, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml fc4b394 017/197: some changes due to ITZ, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml a0f8f81 008/197: Mise a jour avec la version 1.05 de Jacques Garrigue, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 6186a9f 013/197: Patch d'Erwan David, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 98bd08b 011/197: Bug de l'affichage des evenements after., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml e9a1d67 022/197: ITZ patch, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 4060fd2 005/197: Fix: ne pas ecraser EMACSDIR qui est donne par la ligne de commande de make., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml aa800fa 018/197: Snapshot 99/01/29, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 9aa847d 020/197: intelligent indentation of parenthesis, Stefan Monnier, 2020/11/21