From mboxrd@z Thu Jan 1 00:00:00 1970 From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) Subject: Re: [PATCH] gnu: Add sicp. Date: Fri, 20 May 2016 10:19:15 +0200 Message-ID: <87a8jlkupo.fsf@T420.taylan> References: <87d1onafmy.fsf@drakenvlieg.flower> <87eg90wgj1.fsf@gnu.org> <87lh358zye.fsf@drakenvlieg.flower> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3feT-0003OO-1y for guix-devel@gnu.org; Fri, 20 May 2016 04:19:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3feR-0003a2-4E for guix-devel@gnu.org; Fri, 20 May 2016 04:19:19 -0400 In-Reply-To: <87lh358zye.fsf@drakenvlieg.flower> (Jan Nieuwenhuizen's message of "Fri, 20 May 2016 00:06:49 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Jan Nieuwenhuizen Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain Jan Nieuwenhuizen writes: >>> + (arguments >>> + `(#:modules ((guix build utils) >>> + (srfi srfi-1) >>> + (srfi srfi-26)) >>> + #:builder >> >> #:builder should be aligned with #:modules. > > Sure, missed this. Edited by hand for now. > > I've been fighting with this (i.e.: manually changing Emacs' > indentation, something that feels just so wrong), and wondering > about it. Isn't .dir-locals.el supposed to handle this > automagically...what am I missing? > > I'm used to run indent-region on the whole file, but that often changes > things in most files I ran it in. This modified `scheme-indent-function' by Mark Weaver fixes that: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=scheme-indent-function.el Content-Transfer-Encoding: quoted-printable ;; Slightly modified scheme-indent-function (starting from the one in ;; Emacs 24.2) that properly indents s-exprs starting with a keyword ;; like this: ;; ;; (#:foo 1 ;; #:bar 2) ;; ;; instead of like this: ;; ;; (#:foo 1 ;; #:bar 2) ;; ;; NOTE: These modifications are probably a bit hacky, as I was too ;; lazy to fully understand the lisp indent code, and am not very ;; familiar with elisp. (defun scheme-indent-function (indent-point state) "Scheme mode function for the value of the variable `lisp-indent-function= '. This behaves like the function `lisp-indent-function', except that: i) it checks for a non-nil value of the property `scheme-indent-function' \(or the deprecated `scheme-indent-hook'), rather than `lisp-indent-functio= n'. ii) if that property specifies a function, it is called with three arguments (not two), the third argument being the default (i.e., current) indentation." (let ((normal-indent (current-column))) (goto-char (1+ (elt state 1))) (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t) (if (and (elt state 2) (not (looking-at "\\sw\\|\\s_"))) ;; car of form doesn't seem to be a symbol (progn (if (not (> (save-excursion (forward-line 1) (point)) calculate-lisp-indent-last-sexp)) (progn (goto-char calculate-lisp-indent-last-sexp) (beginning-of-line) (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t))) ;; Indent under the list or under the first sexp on the same ;; line as calculate-lisp-indent-last-sexp. Note that first ;; thing on that line has to be complete sexp since we are ;; inside the innermost containing sexp. (backward-prefix-chars) (current-column)) (let ((function (buffer-substring (point) (progn (forward-sexp 1) (point)))) method) (setq method (or (get (intern-soft function) 'scheme-indent-function) (get (intern-soft function) 'scheme-indent-hook))) (cond ((or (eq method 'defun) (and (null method) (> (length function) 3) (string-match "\\`def" function))) (lisp-indent-defform state indent-point)) ;; This next cond clause is the only change -mhw ((and (null method) (> (length function) 1) ; The '#' in '#:' seems to get lost, not sure why (string-match "\\`:" function)) (let ((lisp-body-indent 1)) (lisp-indent-defform state indent-point))) ((integerp method) (lisp-indent-specform method state indent-point normal-indent)) (method (funcall method state indent-point normal-indent))))))) --=-=-= Content-Type: text/plain Taylan --=-=-=--