[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/caml 64cecd3 128/197: merge changes from 3.12.0 to 3.
From: |
Stefan Monnier |
Subject: |
[nongnu] externals/caml 64cecd3 128/197: merge changes from 3.12.0 to 3.12.1 |
Date: |
Sat, 21 Nov 2020 01:19:52 -0500 (EST) |
branch: externals/caml
commit 64cecd3643a5497b6435996aaf4503fb7343bf5a
Author: Damien Doligez <damien.doligez-inria.fr>
Commit: Damien Doligez <damien.doligez-inria.fr>
merge changes from 3.12.0 to 3.12.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11123
f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
---
Makefile | 6 +++++-
caml-emacs.el | 3 +++
caml-font.el | 2 +-
caml-types.el | 49 +++++++++++++++++++++++++------------------------
caml-xemacs.el | 4 ++++
caml.el | 11 +++++++----
camldebug.el | 20 ++++++++++----------
inf-caml.el | 10 +++++-----
8 files changed, 60 insertions(+), 45 deletions(-)
diff --git a/Makefile b/Makefile
index 9519b39..077770c 100644
--- a/Makefile
+++ b/Makefile
@@ -72,5 +72,9 @@ ocamltags: ocamltags.in
install-ocamltags: ocamltags
cp ocamltags $(SCRIPTDIR)/ocamltags
+# This is for testing purposes
+compile-only:
+ $(EMACS) --batch --eval '$(COMPILECMD)'
+
clean:
- rm -f ocamltags *~ #*#
+ rm -f ocamltags *~ #*# *.elc
diff --git a/caml-emacs.el b/caml-emacs.el
index d034ff3..d0a2c86 100644
--- a/caml-emacs.el
+++ b/caml-emacs.el
@@ -39,5 +39,8 @@
(or (member 'drag modifiers)
(member 'click modifiers)))))
+(if (fboundp 'string-to-number)
+ (defalias 'caml-string-to-int 'string-to-number)
+ (defalias 'caml-string-to-int 'string-to-int))
(provide 'caml-emacs)
diff --git a/caml-font.el b/caml-font.el
index f287ffa..9562254 100644
--- a/caml-font.el
+++ b/caml-font.el
@@ -59,7 +59,7 @@
. font-lock-builtin-face)
;control
(,(concat "[|#&]\\|->\\|"
- (regexp-opt '("do" "done" "dowto" "else" "for" "if" "ignore"
+ (regexp-opt '("do" "done" "downto" "else" "for" "if" "ignore"
"lazy" "match" "new" "or" "then" "to" "try"
"when" "while" "with")
'words))
diff --git a/caml-types.el b/caml-types.el
index 05b1a2c..3c7433a 100644
--- a/caml-types.el
+++ b/caml-types.el
@@ -264,13 +264,13 @@ See `caml-types-location-re' for annotation file format.
((string-match def-re kind)
(let ((var-name (match-string 1 kind))
(l-file (file-name-nondirectory (match-string 2 kind)))
- (l-line (string-to-int (match-string 4 kind)))
- (l-bol (string-to-int (match-string 5 kind)))
- (l-cnum (string-to-int (match-string 6 kind)))
+ (l-line (caml-string-to-int (match-string 4 kind)))
+ (l-bol (caml-string-to-int (match-string 5 kind)))
+ (l-cnum (caml-string-to-int (match-string 6 kind)))
(r-file (file-name-nondirectory (match-string 7 kind)))
- (r-line (string-to-int (match-string 9 kind)))
- (r-bol (string-to-int (match-string 10 kind)))
- (r-cnum (string-to-int (match-string 11 kind))))
+ (r-line (caml-string-to-int (match-string 9 kind)))
+ (r-bol (caml-string-to-int (match-string 10 kind)))
+ (r-cnum (caml-string-to-int (match-string 11 kind))))
(let* ((lpos (vector l-file l-line l-bol l-cnum))
(rpos (vector r-file r-line r-bol r-cnum))
(left (caml-types-get-pos target-buf lpos))
@@ -280,9 +280,9 @@ See `caml-types-location-re' for annotation file format.
((string-match def-end-re kind)
(let ((var-name (match-string 1 kind))
(l-file (file-name-nondirectory (match-string 2 kind)))
- (l-line (string-to-int (match-string 4 kind)))
- (l-bol (string-to-int (match-string 5 kind)))
- (l-cnum (string-to-int (match-string 6 kind))))
+ (l-line (caml-string-to-int (match-string 4 kind)))
+ (l-bol (caml-string-to-int (match-string 5 kind)))
+ (l-cnum (caml-string-to-int (match-string 6 kind))))
(let* ((lpos (vector l-file l-line l-bol l-cnum))
(left (caml-types-get-pos target-buf lpos))
(right (buffer-size target-buf)))
@@ -291,13 +291,13 @@ See `caml-types-location-re' for annotation file format.
((string-match internal-re kind)
(let ((var-name (match-string 1 kind))
(l-file (file-name-nondirectory (match-string 2 kind)))
- (l-line (string-to-int (match-string 4 kind)))
- (l-bol (string-to-int (match-string 5 kind)))
- (l-cnum (string-to-int (match-string 6 kind)))
+ (l-line (caml-string-to-int (match-string 4 kind)))
+ (l-bol (caml-string-to-int (match-string 5 kind)))
+ (l-cnum (caml-string-to-int (match-string 6 kind)))
(r-file (file-name-nondirectory (match-string 7 kind)))
- (r-line (string-to-int (match-string 9 kind)))
- (r-bol (string-to-int (match-string 10 kind)))
- (r-cnum (string-to-int (match-string 11 kind))))
+ (r-line (caml-string-to-int (match-string 9 kind)))
+ (r-bol (caml-string-to-int (match-string 10 kind)))
+ (r-cnum (caml-string-to-int (match-string 11 kind))))
(let* ((lpos (vector l-file l-line l-bol l-cnum))
(rpos (vector r-file r-line r-bol r-cnum))
(left (caml-types-get-pos target-buf lpos))
@@ -345,11 +345,12 @@ See `caml-types-location-re' for annotation file format.
(message "done"))
)))
+(defun caml-types-parent-dir (d) (file-name-directory (directory-file-name d)))
+
(defun caml-types-locate-type-file (target-path)
(let ((sibling (concat (file-name-sans-extension target-path) ".annot")))
(if (file-exists-p sibling)
sibling
- (defun parent-dir (d) (file-name-directory (directory-file-name d)))
(let ((project-dir (file-name-directory sibling))
type-path)
(while (not (file-exists-p
@@ -357,10 +358,10 @@ See `caml-types-location-re' for annotation file format.
(expand-file-name
(file-relative-name sibling project-dir)
(expand-file-name "_build" project-dir)))))
- (if (equal project-dir (parent-dir project-dir))
+ (if (equal project-dir (caml-types-parent-dir project-dir))
(error (concat "No annotation file. "
"You should compile with option \"-annot\".")))
- (setq project-dir (parent-dir project-dir)))
+ (setq project-dir (caml-types-parent-dir project-dir)))
type-path))))
(defun caml-types-date< (date1 date2)
@@ -400,13 +401,13 @@ See `caml-types-location-re' for annotation file format.
(annotation ()))
(while (re-search-forward caml-types-location-re () t)
(let ((l-file (file-name-nondirectory (match-string 1)))
- (l-line (string-to-int (match-string 3)))
- (l-bol (string-to-int (match-string 4)))
- (l-cnum (string-to-int (match-string 5)))
+ (l-line (caml-string-to-int (match-string 3)))
+ (l-bol (caml-string-to-int (match-string 4)))
+ (l-cnum (caml-string-to-int (match-string 5)))
(r-file (file-name-nondirectory (match-string 6)))
- (r-line (string-to-int (match-string 8)))
- (r-bol (string-to-int (match-string 9)))
- (r-cnum (string-to-int (match-string 10))))
+ (r-line (caml-string-to-int (match-string 8)))
+ (r-bol (caml-string-to-int (match-string 9)))
+ (r-cnum (caml-string-to-int (match-string 10))))
(unless (caml-types-not-in-file l-file r-file target-file)
(setq annotation ())
(while (next-annotation)
diff --git a/caml-xemacs.el b/caml-xemacs.el
index fe141c5..45d670c 100644
--- a/caml-xemacs.el
+++ b/caml-xemacs.el
@@ -50,4 +50,8 @@
(and (button-release-event-p event)
(equal (event-button original) (event-button event))))
+(if (fboundp 'string-to-number)
+ (defalias 'caml-string-to-int 'string-to-number)
+ (defalias 'caml-string-to-int 'string-to-int))
+
(provide 'caml-xemacs)
diff --git a/caml.el b/caml.el
index 4f03b5a..2e37bff 100644
--- a/caml.el
+++ b/caml.el
@@ -813,8 +813,9 @@ from an error message produced by camlc.")
(defvar caml-error-overlay nil)
(defvar caml-next-error-skip-warnings-flag nil)
-(defun caml-string-to-int (x)
- (if (fboundp 'string-to-number) (string-to-number x) (string-to-int x)))
+(if (fboundp 'string-to-number)
+ (defalias 'caml-string-to-int 'string-to-number)
+ (defalias 'caml-string-to-int 'string-to-int))
;;itz 04-21-96 somebody didn't get the documentation for next-error
;;right. When the optional argument is a number n, it should move
@@ -1160,7 +1161,7 @@ Used to distinguish it from toplevel let construct.")
(defconst caml-matching-kw-regexp
(concat
- "\\<\\(and\\|do\\(ne\\)?\\|e\\(lse\\|nd\\)\\|in\\|t\\(hen\\|o\\)"
+ "\\<\\(and\\|do\\(ne\\|wnto\\)?\\|e\\(lse\\|nd\\)\\|in\\|t\\(hen\\|o\\)"
"\\|with\\)\\>\\|[^[|]|")
"Regexp used in caml mode for skipping back over nested blocks.")
@@ -1175,6 +1176,7 @@ Used to distinguish it from toplevel let construct.")
("else" . caml-find-else-match)
("then" . caml-find-then-match)
("to" . caml-find-done-match)
+ ("downto" . caml-find-done-match)
("do" . caml-find-done-match)
("and" . caml-find-and-match))
@@ -1581,7 +1583,7 @@ Does not preserve point."
(defconst caml-leading-kwops-regexp
(concat
- "\\<\\(and\\|do\\(ne\\)?\\|e\\(lse\\|nd\\)\\|in"
+ "\\<\\(and\\|do\\(ne\\|wnto\\)?\\|e\\(lse\\|nd\\)\\|in"
"\\|t\\(hen\\|o\\)\\|with\\)\\>\\|[]|})]")
"Regexp matching caml keywords which need special indentation.")
@@ -1595,6 +1597,7 @@ Does not preserve point."
("in" caml-in-extra-indent 2)
("then" caml-then-extra-indent 3)
("to" caml-to-extra-indent 0)
+ ("downto" caml-to-extra-indent 0)
("with" caml-with-extra-indent 2)
("|" caml-|-extra-indent 2)
("]" caml-rb-extra-indent 0)
diff --git a/camldebug.el b/camldebug.el
index d5ba599..57a9870 100644
--- a/camldebug.el
+++ b/camldebug.el
@@ -302,8 +302,8 @@ buffer, then try to obtain the time from context around
point."
((save-excursion
(beginning-of-line 1)
(looking-at "^Time : \\([0-9]+\\) - pc : [0-9]+ "))
- (string-to-int (match-string 1)))
- ((string-to-int (camldebug-format-command "%e"))))))
+ (caml-string-to-int (match-string 1)))
+ ((caml-string-to-int (camldebug-format-command "%e"))))))
(camldebug-call "goto" nil time)))
(t
(let ((module (camldebug-module-name (buffer-file-name)))
@@ -325,7 +325,7 @@ buffer, then try to obtain the time from context around
point."
" - module "
module "$") nil t)
(match-string 1)))))
- (if address (camldebug-call "goto" nil (string-to-int address))
+ (if address (camldebug-call "goto" nil (caml-string-to-int address))
(error "No time at %s at %s" module camldebug-goto-position))))))
@@ -383,12 +383,12 @@ around point."
(arg (cond
((eobp)
(save-excursion (re-search-backward bpline nil t))
- (string-to-int (match-string 1)))
+ (caml-string-to-int (match-string 1)))
((save-excursion
(beginning-of-line 1)
(looking-at bpline))
- (string-to-int (match-string 1)))
- ((string-to-int (camldebug-format-command "%e"))))))
+ (caml-string-to-int (match-string 1)))
+ ((caml-string-to-int (camldebug-format-command "%e"))))))
(camldebug-call "delete" nil arg)))
(t
(let ((camldebug-delete-file
@@ -409,7 +409,7 @@ around point."
camldebug-delete-file
camldebug-delete-position)
(camldebug-call "delete" nil
- (string-to-int camldebug-delete-output)))))))))
+ (caml-string-to-int
camldebug-delete-output)))))))))
(defun camldebug-complete-filter (string)
(setq camldebug-filter-accumulator
@@ -529,9 +529,9 @@ the camldebug commands `cd DIR' and `directory'."
(let ((isbefore
(string= "before"
(match-string 5 camldebug-filter-accumulator)))
- (startpos (string-to-int
+ (startpos (caml-string-to-int
(match-string 3 camldebug-filter-accumulator)))
- (endpos (string-to-int
+ (endpos (caml-string-to-int
(match-string 4 camldebug-filter-accumulator))))
(list (match-string 2 camldebug-filter-accumulator)
(if isbefore startpos endpos)
@@ -704,7 +704,7 @@ Obeying it means displaying in another window the specified
file and line."
(move-overlay camldebug-overlay-under spos (- epos 1) buffer))
(save-excursion
(set-buffer buffer)
- (goto-char pos)
+ (goto-char spos)
(beginning-of-line)
(move-marker camldebug-event-marker (point))
(setq overlay-arrow-position camldebug-event-marker))))
diff --git a/inf-caml.el b/inf-caml.el
index ba2eb03..f3e4c48 100644
--- a/inf-caml.el
+++ b/inf-caml.el
@@ -163,7 +163,7 @@ Input and output via buffer `*inferior-caml*'."
(setq count (+ count 1)))
(if (equal (buffer-name (current-buffer))
inferior-caml-buffer-name)
- (end-of-buffer))
+ (goto-char (point-max)))
(while
(> count 0)
(previous-multiframe-window)
@@ -201,7 +201,7 @@ Input and output via buffer `*inferior-caml*'."
(re-search-backward
(concat comint-prompt-regexp
"[ \t]*Characters[ \t]+\\([0-9]+\\)-[0-9]+:$"))
- (string-to-int (match-string 1))))))
+ (caml-string-to-int (match-string 1))))))
(goto-char loc)))
@@ -265,8 +265,8 @@ should lies."
(cond ((re-search-forward
" *Characters \\([01-9][01-9]*\\)-\\([1-9][01-9]*\\):\n[^W]"
(point-max) t)
- (setq beg (string-to-int (caml-match-string 1)))
- (setq end (string-to-int (caml-match-string 2)))
+ (setq beg (caml-string-to-int (caml-match-string 1)))
+ (setq end (caml-string-to-int (caml-match-string 2)))
(switch-to-buffer buf)
(goto-char orig)
(forward-byte end)
@@ -330,7 +330,7 @@ should lies."
(beep) (if wait (read-event) (caml-sit-for 60)))
(delete-overlay caml-error-overlay)))))
-;; wait some amount for ouput, that is, until inferior-caml-output is set
+;; wait some amount for output, that is, until inferior-caml-output is set
;; to true. Hence, interleaves sitting for shorts delays and checking the
;; flag. Give up after some time. Typing into the source buffer will cancel
;; waiting, i.e. may report 'No result yet'
- [nongnu] externals/caml cd1142f 187/197: Change camlc → ocamlc, (continued)
- [nongnu] externals/caml cd1142f 187/197: Change camlc → ocamlc, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 3fb0de6 188/197: Add octal character literals, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 6e0e050 134/197: PR#5455: .emacs instructions, add lines to recognize ocaml scripts, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 56e93b6 151/197: fix a few problems with whitespace and over-long lines, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml f4c7308 168/197: caml.el: Reduce byte-compilation warnings, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml a0d389f 058/197: skip structs in let module ... in, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 442bd24 059/197: prepare snapshot, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml ac2a0b2 064/197: ajout option -stypes; depend, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml faa1c81 065/197: ajout choses a faire, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 76f4e2b 116/197: amelioration des annotations, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 64cecd3 128/197: merge changes from 3.12.0 to 3.12.1,
Stefan Monnier <=
- [nongnu] externals/caml 64a3c02 166/197: Fixing some Emacs startup warnings., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml bce861f 181/197: Emacs: Use built-in detection of comments, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml ac5d007 047/197: caml-indent-phrase, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 3d7f47c 066/197: amelioration .mly .mll, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 099dbf5 067/197: -stypes -> -dtypes; meilleur mode emacs, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 1991236 046/197: improve indentation, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 5ac4447 133/197: correct syntax highlighting in emacs (continued), Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 6084272 137/197: PR#5176: caml-types.el: large types trigger stack overflow in regexp matcher, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 0ca1e97 155/197: Merge branch 4.01 from branching point to 4.01.0+rc1, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml d7a872b 170/197: caml.el: update authors list, Stefan Monnier, 2020/11/21