From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: Better indentation for elisp Date: Tue, 19 Feb 2013 07:55:26 +0100 Organization: Emacs Helm Message-ID: <87hal8hjxd.fsf@gmail.com> References: <1361217567226-278668.post@n5.nabble.com> <877gm5gxl5.fsf@gmail.com> <1361255021128-278696.post@n5.nabble.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1361256952 11313 80.91.229.3 (19 Feb 2013 06:55:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Feb 2013 06:55:52 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 19 07:56:15 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U7h7Z-00015Q-7n for ged-emacs-devel@m.gmane.org; Tue, 19 Feb 2013 07:56:09 +0100 Original-Received: from localhost ([::1]:53536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7h7F-0000wv-4U for ged-emacs-devel@m.gmane.org; Tue, 19 Feb 2013 01:55:49 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7h79-0000wf-IF for emacs-devel@gnu.org; Tue, 19 Feb 2013 01:55:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7h72-00083Z-QV for emacs-devel@gnu.org; Tue, 19 Feb 2013 01:55:43 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:47795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7h72-00083I-Jh for emacs-devel@gnu.org; Tue, 19 Feb 2013 01:55:36 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1U7h7L-0000xG-2j for emacs-devel@gnu.org; Tue, 19 Feb 2013 07:55:55 +0100 Original-Received: from lbe83-2-78-243-104-167.fbx.proxad.net ([78.243.104.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 19 Feb 2013 07:55:55 +0100 Original-Received: from thierry.volpiatto by lbe83-2-78-243-104-167.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 19 Feb 2013 07:55:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 61 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lbe83-2-78-243-104-167.fbx.proxad.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:iwiQtOpSflJw93wvkIPKGRcjSQc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157151 Archived-At: Sergey Mozgovoy writes: > Thierry Volpiatto-2 wrote >> See: >> >> http://article.gmane.org/gmane.emacs.devel/155910/match=lisp+indent+function > > Thank you for response and the link. > > I guess you're sure that Emacs Lisp indentation is not so bad as to be > worth the effort of introducing substantial changes. OK, I agree > that's probably my own censoriousness which bothers me, rather than > Elisp indentation. :) > > However, please do note that aside from *flet*, there were some other > examples. I guess they don't annoy pretty much anyone except for me, > too. > > Actually, what struck me the most was the indentation of constructs > like this: > * > (let-like-macro (a 10 > b 20 > c 30) > ... BODY ...) > * > Well, this is actually a let-like construct, but bindings are not > explicitly taken into additional parenthesis. They are "unrolled". > > What I would want here is /flat/ indentation, but present Elisp > indenting algorithm treats the binding list as a normal function call. > > Yeah, I agree that the easiest way to handle this would be to just > give up and live with default indentation, or use some more > conventional syntactic constructs. Here my settings, if that help: (eval-after-load "cl-indent.el" (let ((l '((flet ((&whole 4 &rest (&whole 1 &lambda &body)) &body)) (cl-flet* . flet) (labels . flet) (cl-flet . flet) (cl-labels . flet) (cl-macrolet . flet)))) (dolist (el l) (put (car el) 'common-lisp-indent-function (if (symbolp (cdr el)) (get (cdr el) 'common-lisp-indent-function) (car (cdr el))))))) (dolist (mode '(emacs-lisp-mode lisp-interaction-mode)) (font-lock-add-keywords mode '(("(\\<\\(cl-flet[*]?\\|cl-labels\\|cl-macrolet\\)\\>" 1 font-lock-keyword-face) ("(\\<\\(cl-loop\\|cl-dolist\\)\\>" 1 font-lock-keyword-face)))) -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997