[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/caml f6cd0b9 078/197: petit nettoyage
From: |
Stefan Monnier |
Subject: |
[nongnu] externals/caml f6cd0b9 078/197: petit nettoyage |
Date: |
Sat, 21 Nov 2020 01:19:42 -0500 (EST) |
branch: externals/caml
commit f6cd0b97dc8f1fb334ad15f4cf8673d74558e0e8
Author: Damien Doligez <damien.doligez-inria.fr>
Commit: Damien Doligez <damien.doligez-inria.fr>
petit nettoyage
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5734
f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
---
caml-types.el | 55 +++++++++++++------------------------------------------
1 file changed, 13 insertions(+), 42 deletions(-)
diff --git a/caml-types.el b/caml-types.el
index 4f86bf8..26b59d1 100644
--- a/caml-types.el
+++ b/caml-types.el
@@ -54,13 +54,18 @@ For the moment, the only possible keyword is \"type\"."
caml-types-number-re " "
caml-types-number-re " "
caml-types-number-re)))
- (setq caml-types-location-re
- (concat "^" caml-types-position-re " " caml-types-position-re)
- ))
+ (setq caml-types-location-re
+ (concat "^" caml-types-position-re " " caml-types-position-re)))
+
(defvar caml-types-expr-ovl (make-overlay 1 1))
-(overlay-put caml-types-expr-ovl 'face 'region)
-(defvar caml-types-type-ovl (make-overlay 1 1))
-(overlay-put caml-types-type-ovl 'face 'region)
+
+(make-face 'caml-types-face)
+(set-face-doc-string 'caml-types-face
+ "face for hilighting expressions and types")
+(if (not (face-differs-from-default-p 'caml-types-face))
+ (set-face-background 'caml-types-face "#88FF44"))
+
+(overlay-put caml-types-expr-ovl 'face 'caml-types-face)
(defun caml-types-show-type (arg)
"Show the type of expression or pattern at point.
@@ -104,11 +109,9 @@ See `caml-types-location-re' for annotation file format.
(if (null loc)
(progn
(delete-overlay caml-types-expr-ovl)
- (delete-overlay caml-types-type-ovl)
(message
"Point is not within a typechecked expression or pattern.")
- (narrow-to-region 1 1)
- )
+ (narrow-to-region 1 1))
(let ((left (caml-types-get-pos target-buf (nth 0 loc) (nth 1
loc)))
(right (caml-types-get-pos target-buf
(nth 2 loc) (nth 3 loc))))
@@ -116,24 +119,11 @@ See `caml-types-location-re' for annotation file format.
;; not strictly correct
(re-search-forward
"^type(\n \\(\\([^\n)]\\|.)\\|\n[^)]\\)*\\)\n)")
- ;; (move-overlay caml-types-type-ovl
- ;; (match-beginning 1) (match-end 1)
- ;; type-buf)
(message (format "type: %s" (match-string 1)))
- (narrow-to-region (match-beginning 0) (match-end 0))
- ; (set-mark (match-beginning 1))
- )))
+ (narrow-to-region (match-beginning 1) (match-end 1)))))
(if (and (= arg 4)
(not (window-live-p (get-buffer-window type-buf))))
(display-buffer type-buf))
- ; (let
- ; ((window (get-buffer-window type-buf))
- ; (this-window (selected-window)))
- ; (if window
- ; (progn
- ; (select-window window)
- ; (goto-char (mark))
- ; (select-window this-window))))
(unwind-protect
(sit-for 60)
(delete-overlay caml-types-expr-ovl)))))
@@ -320,23 +310,4 @@ and its type is displayed in the minibuffer, until the
move is released."
(delete-overlay caml-types-expr-ovl))
))
-
-
-;; bindings
-
-;; now in caml.el
-; (and
-; (boundp 'caml-mode-map)
-; (keymapp caml-mode-map)
-; (progn
-; (define-key caml-mode-map [?\C-c?\C-t] 'caml-types-show-type)
-; (define-key caml-mode-map [down-mouse-2] 'caml-types-explore)
-; (let ((map (lookup-key caml-mode-map [menu-bar caml])))
-; (and
-; (keymapp map)
-; (progn
-; (define-key map [separator-types] '("---"))
-; (define-key map [show-type]
-; '("Show type at point" . caml-types-show-type )))))))
-
(provide 'caml-types)
- [nongnu] externals/caml d7a872b 170/197: caml.el: update authors list, (continued)
- [nongnu] externals/caml d7a872b 170/197: caml.el: update authors list, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml ae92bb1 173/197: Fix emacs mode (raise/failwith/invalid_arg regexp)., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml d8a2f7d 165/197: caml-types.el: Fix missing format argument, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml f828046 172/197: caml.el: use conventional permission statement, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 5569e23 189/197: Handle identifiers in comments, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml b2b6657 135/197: fix whitespace, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 072b0e0 142/197: add some missing copyright headers, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 71d36c5 143/197: PR#4994: ocaml-mode doesn't work with xemacs21, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 3190d71 145/197: PR#5070, continued: also parse backtrace locations, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml f6a12d8 149/197: merge patch by Stefan Monnier from PR#5884, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml f6cd0b9 078/197: petit nettoyage,
Stefan Monnier <=
- [nongnu] externals/caml 474e6ee 102/197: only set type faces where needed, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml b1eaaab 115/197: merge changes 3.10.0 -> 3.10.1, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 43a83dc 118/197: bug string-to-number, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml c525bf8 121/197: clean up spaces and tabs, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 73599dd 129/197: uniform .ignore system, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml eec3351 144/197: do byte-compile file caml-font.el, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml b1139bc 146/197: merge version/4.00 at revision 12866, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml b5bf207 160/197: update caml-font.el to deal with the quoted string syntax, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml d3bc724 167/197: caml.el: Pass the `system` flag when defining abbrevs, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml c0b7050 163/197: caml-types.el: Cosmetic changes., Stefan Monnier, 2020/11/21