Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.emacs.help > #61072

Re: Howto modify syntax entry for "[" and "]" in elisp mode?

From steve g <Sgonedes1977@gmail.com>
Newsgroups gnu.emacs.help
Subject Re: Howto modify syntax entry for "[" and "]" in elisp mode?
References <6da9bf63-05c3-478f-b36b-39ee8734449fn@googlegroups.com>
Date 2026-06-24 23:29 -0400
Message-ID <87qzlvnvr5.fsf@gmail.com> (permalink)

Show all headers | View raw


gjlayde <georgjohann@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 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.
>
> So I have 2 problems to solve:
>
> 1) Tell emacs that "[" and "]" are brackets.
> 2) Tell emacs to indent according to some value like "2" or "3".
>

check out the book:

Let Over Lambda: 50 Years of Lisp
Book by Doug Hoyte

 . this shows how to build a forth processor using common-lisp. Oh yeah,
 you might want to check out common-lisp as emacs is not going to do
 what you want. Check out slime mode and get a lisp image. franz,
 lispworks, and of course sbcl.

Back to gnu.emacs.help | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Howto modify syntax entry for "[" and "]" in elisp mode? gjlayde <georgjohann@web.de> - 2023-05-04 10:17 -0700
  Re: Howto modify syntax entry for "[" and "]" in elisp mode? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-05-04 20:48 +0100
    Re: Howto modify syntax entry for "[" and "]" in elisp mode? gjlayde <georgjohann@web.de> - 2023-05-04 13:12 -0700
      Re: Howto modify syntax entry for "[" and "]" in elisp mode? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-05-05 00:44 +0100
  Re: Howto modify syntax entry for "[" and "]" in elisp mode? steve g <Sgonedes1977@gmail.com> - 2026-06-24 23:29 -0400

csiph-web