From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Don't change "+" syntax in guix/.dir-locals.el Date: Wed, 30 May 2018 11:36:05 +0300 Message-ID: <871sdtv8ui.fsf@gmail.com> References: <87y3geksl6.fsf@gmail.com> <87k1rwvp0x.fsf@gmail.com> <87k1ruzh4v.fsf@gnu.org> <87a7sqgudq.fsf@gmail.com> <87wovo2kf0.fsf@gnu.org> <87o9gybz3v.fsf@gmail.com> <87vab6uul1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNwaX-00018V-JP for guix-devel@gnu.org; Wed, 30 May 2018 04:36:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNwaU-0002UC-FN for guix-devel@gnu.org; Wed, 30 May 2018 04:36:09 -0400 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") 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 Ludovic Court=C3=A8s (2018-05-29 21:31 +0200) wrote: > Alex Kost skribis: > >> Ludovic Court=C3=A8s (2018-05-28 11:34 +0200) wrote: [...] >>> Basically if you don=E2=80=99t have it, when you type =E2=80=9C#$(foo)= =E2=80=9D, 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 =E2=80=98foo+=E2=80=99 symbo= l: foo+ () >> >> - and with this dir-locals setting, it doesn't: foo+() > > To me that=E2=80=99s a feature A feature of "dir-locals"? > , because in Scheme =E2=80=98+=E2=80=99 is acceptable within > identifiers, so there=E2=80=99s no reason to automatically insert a space= after > =E2=80=98+=E2=80=99. So do you think that inserting a space after =E2=80=98+=E2=80=99 is a Pared= it 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 =E2=80=98foo=E2=80=99, the minibuffer will show= you =E2=80=9C(guile-user):foo =3D> 1=E2=80=9D. And it shows the similar messag= e for =E2=80=98foo+=E2=80=99, but if you use "dir-locals", you will not see =E2=80=9C(guile-user):foo+ = =3D> 2=E2=80=9D. 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 =E2=80=98paredit-space-for-delimiter-predicates=E2=80=99 variable. The eas= y way is to replace those 3 =E2=80=98modify-syntax-entry=E2=80=99 lines in "dir-locals"= with: (paredit-space-for-delimiter-predicates ignore) But =E2=80=98ignore=E2=80=99 predicate is too strict: the space will never = be inserted not only for =E2=80=98foo+=E2=80=99 but also for =E2=80=98foo=E2=80=99. Ma= ybe, a better predicate can be chosen, but I don't have a wish to think about it more, sorry :-) --=20 Alex