bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a suggestion for lisp-indent-function


From: Pascal Bourguignon
Subject: a suggestion for lisp-indent-function
Date: 22 Oct 2003 05:05:10 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) 21.3.50.pjb1.1


As provided, lisp-indent-function (lisp-mode.el) indents the following
forms as:

(test ((hello) tralala
       titi tutu
       tata toto))

(test (:key1 tralala
             :key2 tutu
             :key3 titi))

(test (fun tralala
           :key2 tutu
           :key3 titi))


Obviously, a list beginning with a  keyword is not a function call but
still starts with a symbol...

So I would suggest to replace

    (if (and (elt state 2)
             (not (looking-at "\\sw\\|\\s_")))

with:

    (if (and (elt state 2)
             (or (looking-at ":") (not (looking-at "\\sw\\|\\s_"))))

to get these indentations:

(test ((hello) tralala
       titi tutu
       tata toto))

(test (:key1 tralala
       :key2 tutu
       :key3 titi))

(test (fun tralala
           :key2 tutu
           :key3 titi))


-- 
__Pascal_Bourguignon__
http://www.informatimago.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]