[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/caml 02303ea 147/197: PR#5727: emacs caml-mode indent
From: |
Stefan Monnier |
Subject: |
[nongnu] externals/caml 02303ea 147/197: PR#5727: emacs caml-mode indents shebang line in toplevel scripts |
Date: |
Sat, 21 Nov 2020 01:19:56 -0500 (EST) |
branch: externals/caml
commit 02303eadd6ae9b92a19b4e220e096f29c8e4bce3
Author: Damien Doligez <damien.doligez-inria.fr>
Commit: Damien Doligez <damien.doligez-inria.fr>
PR#5727: emacs caml-mode indents shebang line in toplevel scripts
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12974
f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
---
caml.el | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/caml.el b/caml.el
index a203584..5eda10b 100644
--- a/caml.el
+++ b/caml.el
@@ -1199,6 +1199,11 @@ Used to distinguish it from toplevel let construct.")
(defconst caml-kwop-regexps (make-vector 9 nil)
"Array of regexps representing caml keywords of different priorities.")
+(defun caml-in-shebang-line ()
+ (save-excursion
+ (beginning-of-line)
+ (and (= 1 (point)) (looking-at "#!"))))
+
(defun caml-in-expr-p ()
(let ((pos (point)) (in-expr t))
(caml-find-kwop
@@ -1206,6 +1211,8 @@ Used to distinguish it from toplevel let construct.")
caml-matching-kw-regexp "\\|"
(aref caml-kwop-regexps caml-max-indent-priority)))
(cond
+ ; special case for #! at beginning of file
+ ((caml-in-shebang-line) (setq in-expr nil))
; special case for ;;
((and (> (point) 1) (= (preceding-char) ?\;) (= (following-char) ?\;))
(setq in-expr nil))
- [nongnu] externals/caml eec3351 144/197: do byte-compile file caml-font.el, (continued)
- [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
- [nongnu] externals/caml f9a4fd4 177/197: makefiles: turn the 'install' command into a variable, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 2bc0b92 178/197: factorize common makefile definitions in Makefile.common, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 78b3169 182/197: Move config/Makefile to Makefile.config, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 9288416 183/197: Introduce and use ROOTDIR in more makefiles, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 1756296 140/197: PR#5137: caml-types-explore does not work, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 02303ea 147/197: PR#5727: emacs caml-mode indents shebang line in toplevel scripts,
Stefan Monnier <=
- [nongnu] externals/caml 2c3dbdb 157/197: merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205), Stefan Monnier, 2020/11/21
- [nongnu] externals/caml ed94de1 159/197: simplify .gitignore; remove .ignore files and tools/setignore; adjust tools/check-typo, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 66c8274 050/197: run caml directly, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 6b7bd5d 073/197: changement .types -> .annot + format, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml eb43a39 074/197: - compile-command in caml.le, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 5732aaa 077/197: Changes to caml-types.el:, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml e913a93 090/197: compatibilite emacs 20 + fichiers read-only, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml d17e3c1 094/197: caml-types: mouse track + little things, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml eb696b8 098/197: commentaires, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 2c4bb06 100/197: - Fixes in caml-help:, Stefan Monnier, 2020/11/21