all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* a suggestion for lisp-indent-function
@ 2003-10-22  3:05 Pascal Bourguignon
  0 siblings, 0 replies; only message in thread
From: Pascal Bourguignon @ 2003-10-22  3:05 UTC (permalink / raw)




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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-22  3:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-22  3:05 a suggestion for lisp-indent-function Pascal Bourguignon

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.