I am using emacs-lisp mode to edit RTL (Register Transfer Language)
files. I chose elistp because that's close to RTL.
Indentation works fine, except when I have to break very long
lines. Suppose the following example:
[(set (pc)
(if_then_else
(match_operator 0 "ordered_comparison_operator"
[(match_operand:PSI 1 "register_operand" "r,r,d ,r ,d,r")
(match_operand:PSI 2 "nonmemory_operand" "L,r,s ,s ,M,n")])
(label_ref (match_operand 3 "" ""))
(pc)))
(clobber (match_scratch:QI 4 "=X,X,&d,&d ,X,&d"))]
What I want is that "[" and "]" basically behave like "(" and ")".
In particular, it appears that indentation of the line starting with
"[" is far too much and aligns with the next space in the line above.
So "[" whould indent a fixed amout compared to the line above it.
gjlayde <georg...@web.de> writes:
I am using emacs-lisp mode to edit RTL (Register Transfer Language)
files. I chose elistp because that's close to RTL.
Indentation works fine, except when I have to break very long
lines. Suppose the following example:
[(set (pc)
(if_then_else
(match_operator 0 "ordered_comparison_operator"
[(match_operand:PSI 1 "register_operand" "r,r,d ,r ,d,r") (match_operand:PSI 2 "nonmemory_operand" "L,r,s ,s ,M,n")])
(label_ref (match_operand 3 "" ""))
(pc)))
(clobber (match_scratch:QI 4 "=X,X,&d,&d ,X,&d"))]
What I want is that "[" and "]" basically behave like "(" and ")".In my emacs-lisp-mode, [ and ] already behave like ( and ) because []s
are used for vectors and must nest correctly with ()s.
In particular, it appears that indentation of the line starting with( does this as well as [. The arguments in a form are lined up with
"[" is far too much and aligns with the next space in the line above.
each other:
Ben Bacarisse schrieb am Donnerstag, 4. Mai 2023 um 21:51:06 UTC+2:
gjlayde <georg...@web.de> writes:
I am using emacs-lisp mode to edit RTL (Register Transfer Language)In my emacs-lisp-mode, [ and ] already behave like ( and ) because []s
files. I chose elistp because that's close to RTL.
Indentation works fine, except when I have to break very long
lines. Suppose the following example:
[(set (pc)
(if_then_else
(match_operator 0 "ordered_comparison_operator"
[(match_operand:PSI 1 "register_operand" "r,r,d ,r ,d,r")
(match_operand:PSI 2 "nonmemory_operand" "L,r,s ,s ,M,n")])
(label_ref (match_operand 3 "" ""))
(pc)))
(clobber (match_scratch:QI 4 "=X,X,&d,&d ,X,&d"))]
What I want is that "[" and "]" basically behave like "(" and ")".
are used for vectors and must nest correctly with ()s.
In particular, it appears that indentation of the line starting with( does this as well as [. The arguments in a form are lined up with
"[" is far too much and aligns with the next space in the line above.
each other:
Your examples are indented fine.
But in a simple example like
(aaaaaaaaaaaaa b
[c d])
The "[" is aligned with "b", thus the indentation of the 2nd line is arbitrarily far to the right, and breaking lines does (almost) not
lead to shorter lines.
I'd like to indent "[" with the 1st or second letter of "aaaaaaaaaaa".
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 01:44:10 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
10 files (20,373K bytes) |
| Messages: | 264,188 |