From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Fixing scheme-indent-function. Date: Thu, 26 May 2016 12:19:48 +0300 Message-ID: <87twhlnpl7.fsf@gmail.com> References: <87d1onafmy.fsf@drakenvlieg.flower> <87eg90wgj1.fsf@gnu.org> <87lh358zye.fsf@drakenvlieg.flower> <87a8jlkupo.fsf@T420.taylan> <87d1oh7yxl.fsf@drakenvlieg.flower> <87iny78yov.fsf@gmail.com> <87bn3zt96y.fsf@gnu.org> <87r3crhlxd.fsf_-_@gmail.com> <87iny195bj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5rSP-0001cK-3W for guix-devel@gnu.org; Thu, 26 May 2016 05:19:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5rSJ-0007Q7-BR for guix-devel@gnu.org; Thu, 26 May 2016 05:19:56 -0400 In-Reply-To: <87iny195bj.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 25 May 2016 23:49:04 +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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s (2016-05-26 00:49 +0300) wrote: > Alex Kost skribis: > >> Ludovic Court=C3=A8s (2016-05-22 00:03 +0300) wrote: >> >>> Alex Kost skribis: > > [...] > >>>> The source is here: >>>> . >>>> >>>> This is a usual problem (I would say an Emacs bug) that people face >>>> with, and those who know about it, use the mentioned modified version >>>> 'scheme-indent-function'. >>>> >>>> So what about patching our emacs package to fix scheme-indent-function? >>>> I can make a patch if it's reasonable. >>> >>> I think we should submit it to bug-emacs@gnu.org first. Thoughts? >> >> I also think so. IIUC it's Mark and you who found this bug and came up >> with this fix, so I hope one of you will submit it :-) > > Aha, well done! Mark? :-) > >> But as it may take a long time until this fix will go to emacs, I think >> it would be good to patch our emacs package now. > > Okay, let=E2=80=99s make an exception for this one. Would you like to ta= ke care > of it? Yes, the patch is attached. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-emacs-Fix-indentation-of-scheme-keyword-lists.patch >From 1044ea4ba6e1549dbdaeaca58d321c02ca70d1e6 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Thu, 26 May 2016 11:45:16 +0300 Subject: [PATCH] gnu: emacs: Fix indentation of scheme keyword lists. * gnu/packages/patches/emacs-fix-scheme-indent-function.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/emacs.scm (emacs)[source]: Use it. --- gnu/local.mk | 1 + gnu/packages/emacs.scm | 1 + .../patches/emacs-fix-scheme-indent-function.patch | 29 ++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 gnu/packages/patches/emacs-fix-scheme-indent-function.patch diff --git a/gnu/local.mk b/gnu/local.mk index 9cd9699..75702cd 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -468,6 +468,7 @@ dist_patch_DATA = \ %D%/packages/patches/elfutils-tests-ptrace.patch \ %D%/packages/patches/einstein-build.patch \ %D%/packages/patches/emacs-exec-path.patch \ + %D%/packages/patches/emacs-fix-scheme-indent-function.patch \ %D%/packages/patches/emacs-scheme-complete-scheme-r5rs-info.patch \ %D%/packages/patches/emacs-source-date-epoch.patch \ %D%/packages/patches/eudev-rules-directory.patch \ diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 967f583..0674255 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -80,6 +80,7 @@ (base32 "0kn3rzm91qiswi0cql89kbv6mqn27rwsyjfb8xmwy9m5s8fxfiyx")) (patches (search-patches "emacs-exec-path.patch" + "emacs-fix-scheme-indent-function.patch" "emacs-source-date-epoch.patch")) (modules '((guix build utils))) (snippet diff --git a/gnu/packages/patches/emacs-fix-scheme-indent-function.patch b/gnu/packages/patches/emacs-fix-scheme-indent-function.patch new file mode 100644 index 0000000..c5a4268 --- /dev/null +++ b/gnu/packages/patches/emacs-fix-scheme-indent-function.patch @@ -0,0 +1,29 @@ +Fix 'scheme-indent-function' to indent s-expressions starting with a keyword +properly, like this: + +(#:foo 1 + #:bar 2) + +instead of like this: + +(#:foo 1 + #:bar 2) + +The fix is made by Mark H Weaver : + + +--- a/lisp/progmodes/scheme.el ++++ b/lisp/progmodes/scheme.el +@@ -482,6 +482,12 @@ + (> (length function) 3) + (string-match "\\`def" function))) + (lisp-indent-defform state indent-point)) ++ ((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)) -- 2.7.3 --=-=-=--