[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/caml 91865b8 055/197: simplify electric
From: |
Stefan Monnier |
Subject: |
[nongnu] externals/caml 91865b8 055/197: simplify electric |
Date: |
Sat, 21 Nov 2020 01:19:37 -0500 (EST) |
branch: externals/caml
commit 91865b8ca19dee9683c54c0f2e9c17cef54a4fd6
Author: Jacques Garrigue <garrigue at math.nagoya-u.ac.jp>
Commit: Jacques Garrigue <garrigue at math.nagoya-u.ac.jp>
simplify electric
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4913
f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
---
caml.el | 54 ++++++++++++++++--------------------------------------
1 file changed, 16 insertions(+), 38 deletions(-)
diff --git a/caml.el b/caml.el
index 1d31316..bfe1b59 100644
--- a/caml.el
+++ b/caml.el
@@ -1565,17 +1565,7 @@ followed by |."
(caml-in-indentation)
(not (caml-in-comment-p)))))
(self-insert-command 1)
- (if electric
- (let ((indent
- (save-excursion
- (backward-char 1)
- (caml-indent-command)
- (current-column))))
- (indent-to (- indent
- (symbol-value
- (nth 1 (assoc
- (char-to-string last-command-char)
- caml-leading-kwops-alist)))))))))
+ (if electric (save-excursion (caml-indent-command)))))
(defun caml-electric-rb ()
"If inserting a ] operator at beginning of line, reindent the line.
@@ -1585,38 +1575,26 @@ by |, insert one."
(interactive "*")
(let* ((prec (preceding-char))
- (look-pipe (and caml-electric-close-vector
- (not (caml-in-comment-p))
- (not (caml-in-literal-p))
- (or (not (numberp prec))
- (not (char-equal ?| prec)))
- (set-marker (make-marker) (point))))
+ (use-pipe (and caml-electric-close-vector
+ (not (caml-in-comment-p))
+ (not (caml-in-literal-p))
+ (or (not (numberp prec))
+ (not (char-equal ?| prec)))))
(electric (and caml-electric-indent
(caml-in-indentation)
(not (caml-in-comment-p)))))
(self-insert-command 1)
- (if electric
- (let ((indent
- (save-excursion
- (backward-char 1)
- (caml-indent-command)
- (current-column))))
- (indent-to (- indent
- (symbol-value
- (nth 1 (assoc
- (char-to-string last-command-char)
- caml-leading-kwops-alist)))))))
- (if look-pipe
- (save-excursion
- (let ((insert-pipe
- (condition-case nil
- (prog2
+ (if electric (save-excursion (caml-indent-command)))
+ (if (and use-pipe
+ (save-excursion
+ (condition-case nil
+ (prog2
(backward-list 1)
- (if (looking-at "\\[|") "|" ""))
- (error ""))))
- (goto-char look-pipe)
- (insert insert-pipe))
- (set-marker look-pipe nil)))))
+ (looking-at "\\[|"))
+ (error ""))))
+ (save-excursion
+ (backward-char 1)
+ (insert "|")))))
(defun caml-abbrev-hook ()
"If inserting a leading keyword at beginning of line, reindent the line."
- [nongnu] externals/caml eddf5e0 099/197: camldebug-command-name should be user-settable, (continued)
- [nongnu] externals/caml eddf5e0 099/197: camldebug-command-name should be user-settable, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 901e8dd 103/197: Fusion des modifs de la branche release308 entre 3.08.0 et 3.08.1, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml afff6d2 040/197: Adding file caml-help.el, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml b060e59 041/197: indentation autour de "; ; ", Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 4759555 044/197: Amelioration de caml-help, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 05d89fc 061/197: added menu entries for caml-help and caml-complete, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml bf460c2 062/197: interactions bizarres de with, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml f45af82 063/197: - Fixed bugs + improved caml-help.el, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 5e6f8b6 071/197: value obsolete, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 9ece2ad 045/197: Remise au mode info HeVeA par default., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 91865b8 055/197: simplify electric,
Stefan Monnier <=
- [nongnu] externals/caml 5b4e4bc 068/197: verifier que le buffer est a jour, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 7c426ee 070/197: ajout -dtypes, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml bb1103a 075/197: Scrolling .annot, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml c834fac 085/197: caml-xemacs.el, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml dbaedc7 086/197: added caml-emacs.el, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 2a6dc28 087/197: changed defmacro -> defalias, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml f751b4c 091/197: NOCOMPILE pour installer sans compiler (suggestion de Sven Luther), Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 0a4f815 093/197: Fix hilitghting of largest well-typed expr surrounding point., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml b19dc86 092/197: pour que ca marche avec camlp4, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 6f9f060 096/197: caml-types:, Stefan Monnier, 2020/11/21