[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/caml d75a12b 038/197: process ;; correctly
From: |
Stefan Monnier |
Subject: |
[nongnu] externals/caml d75a12b 038/197: process ;; correctly |
Date: |
Sat, 21 Nov 2020 01:19:33 -0500 (EST) |
branch: externals/caml
commit d75a12b70477b7918bd73e8747b4f617f3fc4f24
Author: Jacques Garrigue <garrigue at math.nagoya-u.ac.jp>
Commit: Jacques Garrigue <garrigue at math.nagoya-u.ac.jp>
process ;; correctly
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3968
f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
---
README | 4 ++++
caml.el | 18 ++++++++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/README b/README
index e7203f8..409dbe4 100644
--- a/README
+++ b/README
@@ -63,6 +63,10 @@ For other bindings, see C-h b.
Changes log:
-----------
+Version 3.03:
+-------------
+* process ;; properly
+
Version 3.00:
-------------
* adapt to new label syntax
diff --git a/caml.el b/caml.el
index 4759546..a24c1b6 100644
--- a/caml.el
+++ b/caml.el
@@ -988,7 +988,8 @@ Used to distinguish it from toplevel let construct.")
(aref caml-kwop-regexps caml-max-indent-priority)))
(cond
; special case for ;;
- ((and (= (preceding-char) ?\;) (= (following-char) ?\;)))
+ ((and (= (preceding-char) ?\;) (= (following-char) ?\;))
+ (setq in-expr nil))
((looking-at caml-before-expr-prefix)
(goto-char (match-end 0))
(skip-chars-forward " \t\n")
@@ -1083,7 +1084,8 @@ keywords."
("\[" t 8 caml-lb-indent)
("{" t 8 caml-lc-indent)
("\(" t 8 caml-lp-indent)
- ("|" nil 2 caml-no-indent))
+ ("|" nil 2 caml-no-indent)
+ (";;" nil 0 caml-no-indent))
; if-else and let-in are not keywords but idioms
; "|" is not in the regexps
; all these 3 values correspond to hard-coded names
@@ -1106,7 +1108,7 @@ the line where the governing keyword occurs.")
(aset caml-kwop-regexps 0
(concat
"\\<\\(begin\\|object\\|for\\|s\\(ig\\|truct\\)\\|while\\)\\>"
- "\\|:begin\\>\\|[[({]"))
+ "\\|:begin\\>\\|[[({]\\|;;"))
(aset caml-kwop-regexps 1
(concat (aref caml-kwop-regexps 0) "\\|\\<\\(class\\|module\\)\\>"))
(aset caml-kwop-regexps 2
@@ -1306,6 +1308,10 @@ the line where the governing keyword occurs.")
((not kwop) (setq done t))
((caml-at-sexp-close-p)
(caml-find-paren-match (following-char)))
+ ((and (string= kwop ";") (= (preceding-char) ?\;))
+ (backward-char)
+ (setq kwop ";;")
+ (setq done t))
((and (>= prio 2) (string= kwop "|")) (setq done t))
((string= kwop "end") (caml-find-end-match))
((string= kwop "done") (caml-find-done-match))
@@ -1384,7 +1390,7 @@ Does not preserve point."
(- (symbol-value (nth 3 kwop-info))
(if (looking-at "|") caml-|-extra-indent 0))))))
(extra (if in-expr caml-apply-extra-indent 0)))
- (+ indent-diff extra (current-column))))
+ (+ indent-diff extra (if (string= kwop ";;") 0 (current-column)))))
(defconst caml-leading-kwops-regexp
(concat
@@ -1419,8 +1425,8 @@ matching nodes to determine KEYWORD's final indentation.")
(save-excursion
(back-to-indentation)
(cond
- ((looking-at comment-start-skip)
- (current-column))
+ ((looking-at ";;") 0)
+ ((looking-at comment-start-skip) (current-column))
((caml-in-comment-p)
(let ((closing (looking-at "\\*)"))
(comment-mark (looking-at "\\*")))
- [nongnu] externals/caml 0a919f4 034/197: patch par Didier le Botlan pour les commentaires, (continued)
- [nongnu] externals/caml 0a919f4 034/197: patch par Didier le Botlan pour les commentaires, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 6af733d 036/197: passage aux labels stricts, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 2eeca2e 039/197: xemacs keybind (PR#631), Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 39cfb2e 049/197: define only if needed, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 9d5668c 051/197: fix caml-help, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml d2f1cc7 052/197: better interaction with toplevel, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 495ee65 053/197: caml-find-phrase, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 9b77f6d 054/197: spurious newline, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 28d1a1d 033/197: indentation of else, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 1652c4e 035/197: detabisation, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml d75a12b 038/197: process ;; correctly,
Stefan Monnier <=
- [nongnu] externals/caml 2f6c6ce 042/197: Changement du mode inf-caml, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml ff4b9e8 043/197: gestion des commentaires de doc, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml bf92fed 010/197: Creer EMACSDIR si non existant, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 8457cf2 019/197: Manque un quote, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 5a9f7c6 026/197: tabs -> spaces, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 8364471 027/197: changed label_pattern syntax, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 97c1bb7 037/197: highlight ignore, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 32f0f75 056/197: Updated caml-help.el, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 1a97395 057/197: detabisation, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 758702f 060/197: Several bug fixes and improvements in caml-help., Stefan Monnier, 2020/11/21