[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/forth-mode 350638bb0c 106/153: Make indentation case-insen
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/forth-mode 350638bb0c 106/153: Make indentation case-insensitive |
Date: |
Sat, 29 Jan 2022 08:02:22 -0500 (EST) |
branch: elpa/forth-mode
commit 350638bb0c96a5ee9f554c9df68e821c4589bf09
Author: Helmut Eller <eller.helmut@gmail.com>
Commit: Lars Brinkhoff <lars@nocrew.org>
Make indentation case-insensitive
* forth-smie.el (forth-smie--forward-token)
(forth-smie--forward-token, forth-smie-setup): Use custom tokenizer
to downcase all tokens.
* test/tests.el (forth-indent-if-then-else): Add tests case.
---
forth-smie.el | 18 +++++++++++++++++-
test/tests.el | 8 +++++++-
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/forth-smie.el b/forth-smie.el
index 3bc14fb139..ae44364ca7 100644
--- a/forth-smie.el
+++ b/forth-smie.el
@@ -33,7 +33,23 @@
(`(:elem . args) 0)
(`(:list-intro . ,_) forth-smie--basic-indent)))
+(defun forth-smie--forward-token ()
+ (forward-comment (point-max))
+ (downcase (buffer-substring-no-properties
+ (point)
+ (progn (skip-syntax-forward "w_")
+ (point)))))
+
+(defun forth-smie--backward-token ()
+ (forward-comment (- (point)))
+ (downcase (buffer-substring-no-properties
+ (point)
+ (progn (skip-syntax-backward "w_")
+ (point)))))
+
(defun forth-smie-setup ()
- (smie-setup forth-smie--grammar #'forth-smie--indentation-rules))
+ (smie-setup forth-smie--grammar #'forth-smie--indentation-rules
+ :forward-token #'forth-smie--forward-token
+ :backward-token #'forth-smie--backward-token))
(provide 'forth-smie)
diff --git a/test/tests.el b/test/tests.el
index 7087ecab0e..e9460de9cc 100644
--- a/test/tests.el
+++ b/test/tests.el
@@ -117,7 +117,13 @@ The whitespace before and including \"|\" on each line is
removed."
| 3 +
|else
| 1+
- |then"))
+ |then")
+ (forth-should-indent
+ "x IF
+ | 3 +
+ |ELSE
+ | 1+
+ |THEN"))
(ert-deftest forth-indent-begin-while-repeat ()
(forth-should-indent
- [nongnu] elpa/forth-mode 44dd013096 059/153: Remove terminal escape sequences from strings returned from Forth., (continued)
- [nongnu] elpa/forth-mode 44dd013096 059/153: Remove terminal escape sequences from strings returned from Forth., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 399fd00921 055/153: Fix killing interactive Forth., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 56bbc06a16 079/153: Error out if byte compilation fails in Emacs 23., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 531c9e11e2 023/153: Add autoload cookie to extension configuration, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 847481f866 061/153: Tweak window handling., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 5a08c82adb 111/153: Improve word movement commands inside symbols., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 50a7eb4bf1 094/153: Handle indentation of : and with smie instead of syntax-table., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 45f3f20f18 104/153: Make indentation case-insensitive, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode b8024ac331 088/153: Loading a Forth file provides some feedback., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 9eb3550cdc 045/153: Add imenu items to autocomplete candidates., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 350638bb0c 106/153: Make indentation case-insensitive,
ELPA Syncer <=
- [nongnu] elpa/forth-mode 039bf122ee 067/153: Document key bindings in the manual., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 1a05d27d82 077/153: Fix loading backend file., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode b95f1b8a02 146/153: Fix typos in doc, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 2e75fb156f 081/153: Fix warning about defvar ignored., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 96c20f03f5 128/153: Make completion-at-point test work with Emacs23, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 867922d61e 112/153: Handle string literals more correctly, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 16f359442e 109/153: Add tests for word movement commands, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 45650c28a2 140/153: Check if forth interactive buffer is live, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode ab790fdac8 091/153: Don't kill *forth* buffer when there's a fatal error., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode be0272be3a 076/153: Inhibut Gforth terminal attribute output., ELPA Syncer, 2022/01/29