From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!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: Fri, 09 Nov 2018 09:04:04 +0000 Message-ID: <875zx6r5a3.fsf@gmail.com> 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1541754190 23590 195.159.176.226 (9 Nov 2018 09:03:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Nov 2018 09:03:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 33301@debbugs.gnu.org, Noam Postavsky To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 09 10:03:06 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gL2gz-0005z1-Ea for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Nov 2018 10:03:05 +0100 Original-Received: from localhost ([::1]:60990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL2j5-0007v8-QK for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Nov 2018 04:05:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL2ix-0007rB-Ik for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2018 04:05:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gL2it-0008L2-7q for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2018 04:05:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37932) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gL2is-0008KI-3o for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2018 04:05:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gL2ir-0002ZG-N9 for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2018 04:05:01 -0500 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: Fri, 09 Nov 2018 09:05:01 +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.15417542599821 (code B ref 33301); Fri, 09 Nov 2018 09:05:01 +0000 Original-Received: (at 33301) by debbugs.gnu.org; 9 Nov 2018 09:04:19 +0000 Original-Received: from localhost ([127.0.0.1]:42190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gL2iB-0002YL-1k for submit@debbugs.gnu.org; Fri, 09 Nov 2018 04:04:19 -0500 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:42639) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gL2i6-0002Y5-II for 33301@debbugs.gnu.org; Fri, 09 Nov 2018 04:04:17 -0500 Original-Received: by mail-wr1-f41.google.com with SMTP id y15-v6so1032694wru.9 for <33301@debbugs.gnu.org>; Fri, 09 Nov 2018 01:04:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=iODe6YO8YQCYvEiDS4RztIEqmFqkIqgFim/NPkxsGZc=; b=JlmKqwWbWaYSZjuNU7pDSU1GBeu3RZgRLkzXzIf08YdOiN7o9jSCEIBadHzHhyLCVQ NZcSdiRjWJ/FCHsvHas/y8mDjUakVfEg9qzqo3dKgN+Fwld+qagbcuKTz1txqGATgfPs rLPY67Q1RyDUf9DSY7hlRyNUEhOIvYRgHouvOcW+3qnse1NFUHr2APWqNxav4tpAqMNj jeGyCqDSECqf5EZT063/zt/T2R2PXVaHscubfHgj4vENHxBtNzRzcsVYOjCa4SpceJdl 7/5Qkvib2dsgGbbqzN+uEEV4+KWkBpNUtj2f3qmyA8tjHBckxNxagq+pRSi7U+fLTkKs lWLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=iODe6YO8YQCYvEiDS4RztIEqmFqkIqgFim/NPkxsGZc=; b=TkR9dqc0NigqB9L5F3h5E/RzuRz0x/JGGb9357GpnjiXgxKmqP+hsTQftUTrCJdMap 1O6gwfZsCQKSCljLvP4tMiFferWqfl7YSIkD9/pmHQSQzFk+1eSmPtQnd/qAOIg5rbgm ot0kFwN+1LXyoadesURMuGT3WaZTcCUpU+Y3J07ElqwteOfXCM2V+5zg54au1mc9x7hn dp5vP2eB5CI12TeGlP15HnWFSfaPNPSV+mSu3f1Vdq2yGDASz6fDhI4Vi4Jqybw4vLci l5pYIuXuFjExQKp5AlaubKZX3L2qhuONndaf65OqL8MtIQduYN76r4VdN3bjMI9a1VrI zPnA== X-Gm-Message-State: AGRZ1gKljDlPqLAlcPxPIQCsmxPR9ndnTuCSMTJHCeGr0fGtTvrTDyOs RdXiWjzXohH52kAtz7mZ/q7Naz/J X-Google-Smtp-Source: AJdET5e/eiiH7DBn8hIivPxZUlQQb6KQOoppfK9DnYtR5p7OERNDp114MozTx1ieDaB1yz3fbwBujg== X-Received: by 2002:a5d:6105:: with SMTP id v5-v6mr7166505wrt.69.1541754247778; Fri, 09 Nov 2018 01:04:07 -0800 (PST) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id j40-v6sm4534928wre.48.2018.11.09.01.04.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Nov 2018 01:04:06 -0800 (PST) In-Reply-To: <877ehnowgy.fsf@web.de> (Michael Heerdegen's message of "Fri, 09 Nov 2018 02:45:01 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152199 Archived-At: Michael Heerdegen writes: > Jo=C3=A3o T=C3=A1vora writes: > >> This may explain the string-match hack in the first place. I don't know >> the exact motivation of the hack, but it's been there since the initial >> 2001 revision of the file. Possibly before declare/indent existed? > > But wait, this is in lisp-mode.el which I remember is used not only for > Elisp but also for other Lisps, right? Well it's lisp/emacs-lisp/... ;-) > So your patch could make things worse for editing Common Lisp, for > example. OK, just add (derived-mode-p 'emacs-lisp-mode), as is done elsewhere in that file. Or I would suggest (setq-local lisp-indent-function 'common-lisp-indent-function) in you hypothetical fancy-lisp-mode hook and has much better heuristics that don't cause the bug I've described. (But, as someone who writes CL for a living, if you're indenting CL with these heuristics, you've already lost. You should use SLY/SLIME which looks at the macroexpansion to understand what you're trying to indent.) > For Elisp the heuristic doesn't make much sense, though, if the edited > file is not loaded, it also prevents false negatives for macro uses of > macros defined in that file. I don't fully understand the "it also" part, but here's my take on this: If you're not loading the code, all things being equal, it's better to incorrectly re-indent existing "def"-macros (not defmacro) than to incorrectly indent new arbitrary "def"-forms anywhere in the AST. That's because it's a bad idea to re-indent code anyway, but indent new code happens all the time. Also, it's not a very good idea to indent without some form of evaluation anyway. Because of the indentation declaration, that ship has sailed long ago (and bon voyage). Jo=C3=A3o