[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/forth-mode ccb14b4a47 136/153: Indentation rule for :nonam
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/forth-mode ccb14b4a47 136/153: Indentation rule for :noname |
Date: |
Sat, 29 Jan 2022 08:02:26 -0500 (EST) |
branch: elpa/forth-mode
commit ccb14b4a477e13353ced9658b8e7adfe90bbcd15
Author: Helmut Eller <eller.helmut@gmail.com>
Commit: Helmut Eller <eller.helmut@gmail.com>
Indentation rule for :noname
Indent "hanging" :noname like so:
foo bar :noname
baz
;
execute
* forth-smie.el (forth-smie--indentation-rules): Add rule for :noname.
* test/tests.el (forth-indent-noname): New test.
---
forth-smie.el | 7 +++++--
test/tests.el | 7 +++++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/forth-smie.el b/forth-smie.el
index 0d085983ac..72b1381f87 100644
--- a/forth-smie.el
+++ b/forth-smie.el
@@ -34,13 +34,16 @@
(`(:elem . args)
(cond ((smie-rule-prev-p ":" "begin-structure")
(- (+ (save-excursion
- (forth-smie--backward-token)
- (current-column))
+ (forth-smie--backward-token)
+ (current-column))
forth-smie-basic-indent)
(current-column)))
(t 0)))
(`(:after . ":") (* 2 forth-smie-basic-indent))
(`(:after . "begin-structure") (* 2 forth-smie-basic-indent))
+ (`(:before . ":noname") (cond ((smie-rule-hanging-p)
+ (current-column))
+ (t nil)))
(`(:list-intro . ":") nil)
(`(:list-intro . "begin-structure") nil)
(`(:list-intro . ,_) t)
diff --git a/test/tests.el b/test/tests.el
index 893731650f..e36100d223 100644
--- a/test/tests.el
+++ b/test/tests.el
@@ -278,6 +278,13 @@ The whitespace before and including \"|\" on each line is
removed."
| 1 CELLS +FIELD p.y
|END-STRUCTURE"))
+(ert-deftest forth-indent-noname ()
+ (forth-should-indent
+ "1 2 :noname
+ | swap
+ | ;
+ |execute"))
+
(ert-deftest forth-sexp-movements ()
(forth-assert-forward-sexp " ¹: foo bar ;² \ x")
(forth-assert-forward-sexp " ¹:noname foo bar ;² \ x")
- [nongnu] elpa/forth-mode ee0781f0a8 066/153: Add more functions for evaluating Forth expressions., (continued)
- [nongnu] elpa/forth-mode ee0781f0a8 066/153: Add more functions for evaluating Forth expressions., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 1ffc174c13 127/153: Pass Makefile variable FORTH as environment variable to build.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 9b0982e169 149/153: Fix CI, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 52d84393c0 141/153: Remove newlines to fix markdown formatting., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 2d30ca8eaa 142/153: Use add-to-list in installation instructions instead of pushnew., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 8c0e519c57 148/153: Add restart-forth to source window menu, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 5e99586c1e 065/153: Remove prompt from Forth output., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 6bc035fd90 040/153: Fix missing argument to define-key., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode fbd2c51cea 070/153: Initialize pseudo terminal window size, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 38f0ccbfc8 027/153: Rename to run-forth, forth-ensure, and forth-parse.el., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode ccb14b4a47 136/153: Indentation rule for :noname,
ELPA Syncer <=
- [nongnu] elpa/forth-mode d711fd5200 130/153: Remove tabs in wercker.yml, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode dd450e6a01 120/153: Remove debugging code, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode b3c1e62e5a 151/153: The Emacs 25 package can't coexist with Emacs-snapshot., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 157c14b18e 092/153: Include tab (\t) as whitespace delimiter for comments., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 93c90ebf97 129/153: Install gforth in wercker, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode eaeac02b6d 082/153: Disable warning about cl., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 3ef42c825a 101/153: Emacs 23: indenting doesn't work well., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 9440f2a5af 121/153: Add test for comment-dwim, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 66f7a2dc97 060/153: Add tests for various Forth block and non-block files., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 3fa933d556 123/153: Test comment-region, ELPA Syncer, 2022/01/29