guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] emacs: devel: Highlight 'modify-phases' keywords.


From: Alex Kost
Subject: Re: [PATCH] emacs: devel: Highlight 'modify-phases' keywords.
Date: Sat, 26 Sep 2015 22:48:59 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Ludovic Courtès (2015-09-25 22:22 +0300) wrote:

> Alex Kost <address@hidden> skribis:
>
>> From ed1c3871b81d4904d106a3ca5aadde2e1803d2a6 Mon Sep 17 00:00:00 2001
>> From: Alex Kost <address@hidden>
>> Date: Thu, 24 Sep 2015 20:10:29 +0300
>> Subject: [PATCH] emacs: devel: Highlight 'modify-phases' keywords.
>>
>> * emacs/guix-guile.el (guix-guile-keyword-regexp): New function.
>> * emacs/guix-devel.el (guix-devel-faces): New custom group.
>>   (guix-devel-modify-phases-keyword): New face.
>>   (guix-devel-modify-phases-keyword-regexp,
>>   guix-devel-font-lock-keywords): New variables.
>>   (guix-devel-modify-phases-font-lock-matcher,
>>   guix-devel-modify-phases-font-lock-pre): New functions.
>>   (guix-devel-mode): Adjust to add/remove font-lock-keywords.
>
> OK!

Thanks, I have pushed it.

> I also have this one that I find useful:
>
> ;; For Guix g-expressions.
> (font-lock-add-keywords 'scheme-mode
>                       '(("#~" . font-lock-keyword-face)
>                         ("#\\$" . font-lock-keyword-face)
>                         ("#\\+" . font-lock-keyword-face)))

Great, what about the attached patch for adding these ones?

> Similarly .dir-locals.el has ‘modify-syntax-entry’ stuff for gexps that
> could maybe go to guix-devel.el?

Yes, they could.  So as you mention it, there is another thing I would
like to add — complex indentation rules.  Specifically, inherited
packages are automatically indented like this:

(package (inherit foo)
         (name "foo")
         ...)

or this:

(package
  (inherit foo)
  (name "foo")
  ...)

while we want it to be:

(package (inherit foo)
  (name "foo")
  ...)

The following code may be used to handle this indentation:

Attachment: package-indent.el
Description: application/emacs-lisp

But it wouldn't work reliably because of ".dir-locals.el", as
'scheme-indent-function' property will be overridden every time a scheme
file from git repo is visited.  So my proposition is: what about moving
all indentation rules from ".dir-locals.el" to "emacs/guix-devel.el"?
So 'guix-devel-mode' will be responsible for all indenting, highlighting
and other guix-specific things.  WDYT?

Attachment: 0001-emacs-devel-Highlight-gexp-symbols.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]