From: ludo@gnu.org (Ludovic Courtès)
To: Alex Kost <alezost@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] emacs: devel: Highlight 'modify-phases' keywords.
Date: Sun, 27 Sep 2015 22:29:13 +0200 [thread overview]
Message-ID: <87si5zwqqu.fsf@gnu.org> (raw)
In-Reply-To: <87d1x57yhg.fsf@gmail.com> (Alex Kost's message of "Sat, 26 Sep 2015 22:48:59 +0300")
Alex Kost <alezost@gmail.com> skribis:
>> ;; 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?
Looks good.
>> 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:
>
> (defun guix-devel-package-indent (state indent-point normal-indent)
> (let ((count (if (and (ignore-errors (down-list) t)
> (looking-at "inherit\\>"))
> 1
> 0)))
> (lisp-indent-specform count state indent-point normal-indent)))
>
> (put 'package 'scheme-indent-function 'guix-devel-package-indent)
Nice! I like it, I think it would be a nice addition.
At the same time I wonder if defining sophisticated indentation rules is
a good idea in general. (Though this one was already defined anyway.)
> 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?
Good question. .dir-locals.el includes a bunch of internal rules that
do not make sense outside.
For those who do make sense outside, such as rules for ‘package’, I
think having them in .dir-locals.el has the advantage that Emacs users
cannot escape them inadvertently. With guix-devel.el, there’s a greater
chance of people not loading it.
Unless .dir-locals.el has something like:
(eval . (load "emacs/guix-devel.el")) ;…
?
Thoughts?
> From 13ebd00178d1f6139da4c1f76a2e358935ce16f0 Mon Sep 17 00:00:00 2001
> From: Alex Kost <alezost@gmail.com>
> Date: Sat, 26 Sep 2015 22:42:07 +0300
> Subject: [PATCH] emacs: devel: Highlight gexp symbols.
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> Suggested by Ludovic Courtès <ludo@gnu.org>.
>
> * emacs/guix-devel.el (guix-devel-gexp-symbol): New face.
> (guix-devel-font-lock-keywords): Adjust to handle gexp symbols.
OK.
Thanks,
Ludo’.
next prev parent reply other threads:[~2015-09-27 20:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-25 8:05 [PATCH] emacs: devel: Highlight 'modify-phases' keywords Alex Kost
2015-09-25 19:22 ` Ludovic Courtès
2015-09-26 19:48 ` Alex Kost
2015-09-27 20:29 ` Ludovic Courtès [this message]
2015-09-28 12:26 ` .dir-locals.el vs. guix-devel-mode Alex Kost
2015-09-28 20:05 ` Taylan Ulrich Bayırlı/Kammer
2015-09-29 11:06 ` Alex Kost
2015-09-29 11:22 ` Taylan Ulrich Bayırlı/Kammer
2015-09-29 19:16 ` Ludovic Courtès
2015-10-01 21:10 ` Alex Kost
2015-10-01 21:34 ` Ludovic Courtès
2015-10-02 12:46 ` Alex Kost
2015-10-02 12:51 ` Ludovic Courtès
2015-10-02 17:25 ` Alex Kost
2015-10-12 9:33 ` [PATCH] emacs: devel: Add indentation rules Alex Kost
2015-10-13 9:45 ` Ludovic Courtès
2015-10-13 17:50 ` Alex Kost
2015-10-14 20:00 ` Ludovic Courtès
2015-10-15 17:42 ` Alex Kost
2015-10-01 21:39 ` .dir-locals.el vs. guix-devel-mode Mathieu Lirzin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87si5zwqqu.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=alezost@gmail.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.