all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Don't change "+" syntax in guix/.dir-locals.el
Date: Wed, 30 May 2018 11:36:05 +0300	[thread overview]
Message-ID: <871sdtv8ui.fsf@gmail.com> (raw)
In-Reply-To: <87vab6uul1.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 29 May 2018 21:31:54 +0200")

Ludovic Courtès (2018-05-29 21:31 +0200) wrote:

> Alex Kost <alezost@gmail.com> skribis:
>
>> Ludovic Courtès (2018-05-28 11:34 +0200) wrote:
[...]
>>> Basically if you don’t have it, when you type “#$(foo)”, Paredit inserts
>>> a space before the opening parenthesis.
>>
>> OK, I see now.  Paredit inserts a space ('paredit-space-for-delimiter-p'
>> does it) if the point is placed on a symbol.  So by fixing this gexp
>> stuff, you also break the default behavior of Paredit:
>>
>> - the default paredit inserts a space after ‘foo+’ symbol: foo+ ()
>>
>> - and with this dir-locals setting, it doesn't: foo+()
>
> To me that’s a feature

A feature of "dir-locals"?

> , because in Scheme ‘+’ is acceptable within
> identifiers, so there’s no reason to automatically insert a space after
> ‘+’.

So do you think that inserting a space after ‘+’ is a Paredit
misfeature?  Then maybe it should be reported upstream.

Anyway, I just want to say, ".dir-locals.el" should not modify the
default syntax table, because all emacs packages and Emacs itself can
rely on it.  For example, evaluate the following 2 definitions with
Geiser:

(define foo 1)
(define foo+ 2)

Now if you put the point on ‘foo’, the minibuffer will show you
“(guile-user):foo => 1”.  And it shows the similar message for ‘foo+’,
but if you use "dir-locals", you will not see “(guile-user):foo+ => 2”.

So if the intention is to fix paredit, I think "dir-locals" should
change paredit, not scheme-mode.

>> Now I understand why this problem should be fixed, but my opinion is
>> that ".dir-locals.el" *should not* break the default syntax table of
>> scheme-mode just to make one emacs package work as desired.
>
> Do you think .dir-locals.el could perform this change in a buffer-local
> fashion?

The only other way I see, is to set
‘paredit-space-for-delimiter-predicates’ variable.  The easy way is to
replace those 3 ‘modify-syntax-entry’ lines in "dir-locals" with:

  (paredit-space-for-delimiter-predicates ignore)

But ‘ignore’ predicate is too strict: the space will never be inserted
not only for ‘foo+’ but also for ‘foo’.  Maybe, a better predicate can
be chosen, but I don't have a wish to think about it more, sorry :-)

-- 
Alex

      reply	other threads:[~2018-05-30  8:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-20 19:57 Don't change "+" syntax in guix/.dir-locals.el Pierre Neidhardt
2018-05-21 18:31 ` Alex Kost
2018-05-23 12:33   ` Ludovic Courtès
2018-05-23 17:21     ` Alex Kost
2018-05-28  9:34       ` Ludovic Courtès
2018-05-29  9:16         ` Alex Kost
2018-05-29  9:20           ` Pierre Neidhardt
2018-05-29 19:31           ` Ludovic Courtès
2018-05-30  8:36             ` Alex Kost [this message]

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=871sdtv8ui.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@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.