문제

I've defined a few read-macros in Common Lisp with square bracket delimiters, and I'd like to make Emacs indent those square brackets in the exactly same way as with parentheses.

For example, from this:

(mapcar [if (flag)
        :t 
        :f]
        my-list)

To this:

(mapcar [if (flag)
            :t
            :f]
        my-list)    

...which is what Emacs would do if the square brackets were parentheses.

How can I achieve that?

도움이 되었습니까?

해결책

You need to tell Emacs that [ and ] are matching parentheses:

(modify-syntax-entry ?\[ "(]" lisp-mode-syntax-table)
(modify-syntax-entry ?\] ")[" lisp-mode-syntax-table)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top