From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#33301: 27.0.50; broken elisp indentation for non-definition symbols starting with "def.." Date: Sat, 22 Aug 2020 17:19:25 +0100 Message-ID: References: <87zhukh1ri.fsf@gmail.com> <87tvksv21u.fsf@web.de> <87efbvrj4c.fsf@gmail.com> <8736sbumzj.fsf@web.de> <87a7mjqdym.fsf@gmail.com> <877ehnowgy.fsf@web.de> <875zx6r5a3.fsf@gmail.com> <87efbumvd0.fsf@web.de> <87r2fuh1tm.fsf@gmail.com> <871s7uqbvf.fsf@gmail.com> <871rjyloc4.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000035312705ad79b849" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28676"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Heerdegen , 33301@debbugs.gnu.org, Noam Postavsky To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 22 18:20:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k9WFX-0007MJ-QO for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Aug 2020 18:20:11 +0200 Original-Received: from localhost ([::1]:39496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k9WFW-0003it-Q4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Aug 2020 12:20:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9WFO-0003gx-I0 for bug-gnu-emacs@gnu.org; Sat, 22 Aug 2020 12:20:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39639) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k9WFO-0001vr-8X for bug-gnu-emacs@gnu.org; Sat, 22 Aug 2020 12:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k9WFO-0000td-3T for bug-gnu-emacs@gnu.org; Sat, 22 Aug 2020 12:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Aug 2020 16:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33301 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 33301-submit@debbugs.gnu.org id=B33301.15981131853409 (code B ref 33301); Sat, 22 Aug 2020 16:20:02 +0000 Original-Received: (at 33301) by debbugs.gnu.org; 22 Aug 2020 16:19:45 +0000 Original-Received: from localhost ([127.0.0.1]:51184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9WF6-0000sv-UW for submit@debbugs.gnu.org; Sat, 22 Aug 2020 12:19:45 -0400 Original-Received: from mail-wm1-f65.google.com ([209.85.128.65]:39992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9WF4-0000sc-Ik for 33301@debbugs.gnu.org; Sat, 22 Aug 2020 12:19:43 -0400 Original-Received: by mail-wm1-f65.google.com with SMTP id k20so4492983wmi.5 for <33301@debbugs.gnu.org>; Sat, 22 Aug 2020 09:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jJXdOztR3upSFMGCuY4iT8fl/K5BRuRPAJIdZtdukZ4=; b=KXWnK5zprMhIV/bGlMYU+Wiu0oLGDTTtTeotwbvB3PvGg7dWdCQTXlSoKq9jKSzLeg dN4tczfcPDG3TzbGoyxHliPRt0zWumBIyDTlfI9mFBdtb75u54RSmVkdH2cNU+C0ctII Hvjk5nfPQ/2COhd/PYZMsTQuFuRNSAAYyaYeOvI7AXykyNU0U5uyQZ6lGNQiboRJvJwR rHx8HgHqVHrxm3Vlzzi0qB3p8xw4VhCByG2+jI73BX03pUVGbTHd2cQQXYRuKFy/Rt6J bfxeEBla9huTLlrM4dxr2S58CCnqh0yipMdayPpSbw2aVRPJyh0qZK7IkYEGh3Ayjj02 6LYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jJXdOztR3upSFMGCuY4iT8fl/K5BRuRPAJIdZtdukZ4=; b=T2sNkitnXwd18wZDf1TKG4PvlvtSlVjIqTLhj57/1mzpLWXlcfgXBtyzx8q4/7F1Lq hT01RveVZHYPq1G7EzJxRV7ALq+1FuDT7n316CwcpZD4VRaYVBbTmh4BXPZWIUtPFdlP lv+N9wYXRjwkpBH3574dDZvx7UiSEWtwWYV82loZdMrDRR/VftsecoewePmY2JSwjmvY M/kyw8gKsv8JBRuT0QCSv0oW9wbrmjDIWi5plpYBx4twFeiDiQEwyohID8xPYcvbmbYQ OJR125qgRchE0h3j6zYDu6whvdaxcbvMBDGqpN1dCizP73yQQOXMsu/PZ2dn68wrMbDj mPzg== X-Gm-Message-State: AOAM531HpQV7Z9OoYqfHNR//qL9YZ1v9cS5ombE5YAZL35VMVGrauHgp Hd/uudgNfVaVyibNf3IS6KM8N3oO6s0X93LzdDM= X-Google-Smtp-Source: ABdhPJw4vDgcbIgB57yNTIbPIYbcD8sh74m8jOY/HRgwjx4fzuLJqYABDdpv/5e5gYGhVt8Py3Z1bANNqZeaN2QRa00= X-Received: by 2002:a05:600c:c7:: with SMTP id u7mr8541890wmm.135.1598113176693; Sat, 22 Aug 2020 09:19:36 -0700 (PDT) In-Reply-To: <871rjyloc4.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185971 Archived-At: --00000000000035312705ad79b849 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Lars, thanks for your review of old bugs. I wouldn't count 34 as "oodles" and don't think a new line for each occurrence of what is essentially a breach of convention is a high price to pay. Even converting some of those to macros or "make-foo" could be worth it if it would enable non-surprising indentation. As for the problem of needing to load macros before indenting forms where they appears, that's already very much a thing. We wouldn't be creating new problems there, it's just the way it is. As for out-of-tree definitions, we could be lenient and have this saner indentation be controlled by a variable which we would default to 'insane, but to 'sane inside Emacs's source, via directory local variables. So I don't think we should throw in the towel on this one. Jo=C3=A3o On Sat, Aug 22, 2020, 15:58 Lars Ingebrigtsen wrote: > Jo=C3=A3o T=C3=A1vora writes: > > > - (string-match "\\`def" function))) > > + (string-match "\\`def" function) > > + (or (not (derived-mode-p 'emacs-lisp-mode)) > > + (macrop (intern function))))) > > As others noted, this means that indentation changes when you've > loaded/not loaded the file that defines the macro, which may be > awkward. But also, as your grep showed, there's oodles of functions in > Emacs the define stuff, and you'd have to add indentation specs to all > of them. And that doesn't take out-of-tree definitions into account. > > So I don't really see how this can be fixed in any sensible way -- > changing this heuristic will just annoy more than it fixes things, I > think. > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --00000000000035312705ad79b849 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Lars, thanks for your review of old bugs.

I wouldn't count 34 as &quo= t;oodles" and don't think a new line for each occurrence of what i= s essentially a breach of convention is a high price to pay. Even convertin= g some of those to macros or "make-foo" could be worth it if it w= ould enable non-surprising indentation.

As for the problem of needing to load macros before indenti= ng forms where they appears, that's already very much a thing. We would= n't be creating new problems there, it's just the way it is.<= div dir=3D"auto">
As for out-of-tree definitions= , we could be lenient and have this saner indentation be controlled by a va= riable which we would default to 'insane, but to=C2=A0 'sane inside= Emacs's source, via directory local variables.
=
So I don't think we should throw in the tow= el on this one.

Jo=C3=A3= o

On Sat, Aug 22, 2020, 15:58 Lars Ingebrigtsen <larsi@gnus.org> wrote:
Jo=C3=A3o T=C3=A1vora <joaotavora@gmail.com> wr= ites:

> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0(string-match "\\`def" function)))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0(string-match "\\`def" function)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 (or (not (derived-mode-p 'emacs-lisp-mode))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 (macrop (intern function)))))

As others noted, this means that indentation changes when you've
loaded/not loaded the file that defines the macro, which may be
awkward.=C2=A0 But also, as your grep showed, there's oodles of functio= ns in
Emacs the define stuff, and you'd have to add indentation specs to all<= br> of them.=C2=A0 And that doesn't take out-of-tree definitions into accou= nt.

So I don't really see how this can be fixed in any sensible way --
changing this heuristic will just annoy more than it fixes things, I
think.

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--00000000000035312705ad79b849--