From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.bugs Subject: a suggestion for lisp-indent-function Date: 22 Oct 2003 05:05:10 +0200 Organization: informatimago.com Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87llrec6qh.fsf@thalassa.informatimago.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1066792124 18446 80.91.224.253 (22 Oct 2003 03:08:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 22 Oct 2003 03:08:44 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 22 05:08:42 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AC9MY-0003Fr-00 for ; Wed, 22 Oct 2003 05:08:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AC9K3-000846-Di for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Oct 2003 23:06:07 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AC9K1-00083t-D1 for bug-gnu-emacs@prep.ai.mit.edu; Tue, 21 Oct 2003 23:06:05 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AC9JV-00080R-Mm for bug-gnu-emacs@prep.ai.mit.edu; Tue, 21 Oct 2003 23:06:04 -0400 Original-Received: from [130.59.10.2] (helo=chx400.switch.ch) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AC9JV-0007zD-Ci for bug-gnu-emacs@prep.ai.mit.edu; Tue, 21 Oct 2003 23:05:33 -0400 Original-Received: from mail.fu-berlin.de ([160.45.11.165]) by chx400.switch.ch with esmtp (Exim 3.20 #1) id 1AC9JH-00030M-00 for gnu-emacs-bug@moderators.isc.org; Wed, 22 Oct 2003 05:05:19 +0200 Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Wed, 22 Oct 2003 05:05:16 +0200 (MEST) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Wed, 22 Oct 2003 05:05:14 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: thalassa.informatimago.COM!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 49 X-Orig-NNTP-Posting-Host: thalassa.informatimago.com (195.114.85.198) X-Orig-X-Trace: news.uni-berlin.de 1066791914 30699081 195.114.85.198 (16 [41911]) User-Agent: Gnus/5.09 (Gnus v5.9.0) 21.3.50.pjb1.1 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:6015 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:6015 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/