From unknown Sun Jun 15 07:59:39 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#76498 <76498@debbugs.gnu.org> To: bug#76498 <76498@debbugs.gnu.org> Subject: Status: (ert-deftest) has indentation of 13 by default Reply-To: bug#76498 <76498@debbugs.gnu.org> Date: Sun, 15 Jun 2025 14:59:39 +0000 retitle 76498 (ert-deftest) has indentation of 13 by default reassign 76498 emacs submitter 76498 Konstantin Kharlamov severity 76498 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 23 05:03:47 2025 Received: (at submit) by debbugs.gnu.org; 23 Feb 2025 10:03:47 +0000 Received: from localhost ([127.0.0.1]:59409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tm8pv-0001k8-04 for submit@debbugs.gnu.org; Sun, 23 Feb 2025 05:03:47 -0500 Received: from lists.gnu.org ([2001:470:142::17]:34542) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tm8pj-0001ja-Lw for submit@debbugs.gnu.org; Sun, 23 Feb 2025 05:03:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tm8pR-0005r0-5i for bug-gnu-emacs@gnu.org; Sun, 23 Feb 2025 05:03:22 -0500 Received: from forward100b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d100]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tm8pI-00038C-Kq for bug-gnu-emacs@gnu.org; Sun, 23 Feb 2025 05:03:13 -0500 Received: from mail-nwsmtp-smtp-production-main-57.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-57.sas.yp-c.yandex.net [IPv6:2a02:6b8:c1c:2eaa:0:640:ad48:0]) by forward100b.mail.yandex.net (Yandex) with ESMTPS id 218E360ADD for ; Sun, 23 Feb 2025 13:03:00 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-57.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id x2XwKEDLZ0U0-c9vnk6Jm; Sun, 23 Feb 2025 13:02:59 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1740304979; bh=qcxRhXut6fvV8i8idENgA0W9nJLMqudYVpHDLjHGviM=; h=Date:To:From:Subject:Message-ID; b=fJkjB3Phpl6DDigj9PeP+YEziEVqb+TCbv0PM0vdg8fat9aemAms5hck80y4ZzFEP R5kYX3TSOa0R/kkZtaya7f+eODP5R/SOR2SccHiNsNvZSrrARj+JLQhYlf3LGumf4N UIeyoBrlPWDKlMZJ0tRGPEaRPOttJoAv//6V6eV8= Authentication-Results: mail-nwsmtp-smtp-production-main-57.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: Subject: (ert-deftest) has indentation of 13 by default From: Konstantin Kharlamov To: bug-gnu-emacs@gnu.org Date: Sun, 23 Feb 2025 13:02:59 +0300 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 MIME-Version: 1.0 Received-SPF: pass client-ip=2a02:6b8:c02:900:1:45:d181:d100; envelope-from=Hi-Angel@yandex.ru; helo=forward100b.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) I'm writing tests for purescript-mode package, and I stumbled upon odd behavior: `ert-deftest` is spuriously indented to either 2 (expected) or 13 (unexpected). After digging into it, I found that if you `emacs -Q some-file-with- tests.el` and try to indent the second line after `ert-deftest`, you'll get size of 13. But if you `(require 'ert)` and try again you'll get 2. This is because, even though `ert-deftest` keyword is declared inside `lisp-mode.el`, but *indentation size* for it resides instead in `ert.el`, as part of "declare" statement of `ert-deftest` macro. This is definitely not expected. First of all, there's no reason for user to evaluate `(require 'ert)` while working with tests =E2=80=94 you wouldn't want to experiment with tests in your working Emacs anyway. Which means you get incorrect indentation and left wondering what's happening. Second of all, `ert-deftest` as a keyword resides inside `lisp-mode.el` anyway, so what's the point of having the indentation set in a different place. Could we move the indentation size to `lisp-mode.el`, please? From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 24 16:50:51 2025 Received: (at control) by debbugs.gnu.org; 24 Feb 2025 21:50:51 +0000 Received: from localhost ([127.0.0.1]:43134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tmgLj-0002WE-2k for submit@debbugs.gnu.org; Mon, 24 Feb 2025 16:50:51 -0500 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:55425) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tmgLg-0002Vw-Fu for control@debbugs.gnu.org; Mon, 24 Feb 2025 16:50:48 -0500 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5ded1395213so8270358a12.2 for ; Mon, 24 Feb 2025 13:50:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740433842; x=1741038642; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=HpjBBBhm3U1MoF7v4FB1PtY/qbHJ65+zUdVgXJczvlM=; b=APZ/uWdtYZJo/ORp2fwZpHBZe1L3QERP/gLl/oDZ1z/CATZFUQFmqFhX/eO4qdHNM3 l5uVtznpZzy1RIJhVzbCoqTeYXgAfXcpYEFuJfgTqPvAdqifn0Ik2y1/jmD8MWyh0/QV BdgZGcHAzge5JTZwyL72WuVD2n3jYa8LJ54/EFzYBeokLEHUlINzY3waF1aHVu2JD57G lsPth6SyZ8uuLVrzTE/dM27TOHkEeS47W06GTWzu3M6dGk9YG8w8t8BAhEnQMOfZOg9r 98ZwkqF8/MFrodVhlujyf1nH5SikuTY7fiFlzhPYAb2wVThyiIkuPTMM5wSkQMN442zt slyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740433842; x=1741038642; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=HpjBBBhm3U1MoF7v4FB1PtY/qbHJ65+zUdVgXJczvlM=; b=iQAw6it6t+GhMkDlYMDakX4a8HAuX2xuX2cfXFsDFeYOKuoiJD/dk2AinOKBVhWb1t bgojnyze5KZCvQh3nmhT4drJy8wP7QCNuYJEyazu0QgPZP6YAYXlQFwfd3HtGp3iSv2l 3gcl5NXl/6wo0LNDF29XRjH/pognd+Q9DU1nSPHPDbFBXiRaOeVeoyQlVzDjJ95F5Ami cwWvuSRmMszy/62K/Ubz9E26Q+cSjmdQDJGPBjmRNzbXScexzP+2SOcTdkRVms2oeXCg pS/EiG3KMfx4pl69bmHCHpgsP+CZCEjZ6eIbi30IHv8T65ss4Nmo07wRwNvzGE+A6qwP DekQ== X-Gm-Message-State: AOJu0YwA/8z0VUTHFcFRbfn8duaiitR8CBJuDtXOP3ygWx/xYJwt0DQA 3MeFAdKfo+trWUl+kQbyYSBAergeCH/rKHTWQe4qYFV2yDaOGXirte6Le/qDsEJ3SBcCLHRUFpY LDtnJZEMYPunYYN0eBM1AwLqG+jj/HqGvVGE= X-Gm-Gg: ASbGncv/c6Fj7SBixaf5cAdOfyw0rP6mSZNCJyX2wzsUahSLjO/oJK+ztaXB/ohTGVy wyG0AAK2EoQILKPjWy31KJNLH+lgyIs8GhIM10C7C6NJ2QNbF3s5wHR5Isu/IG8oTV3Zw6ZYDLm sWb5IcoKJrXg== X-Google-Smtp-Source: AGHT+IHhuk/yeyJykfwyDdGnqN2TSMeulzJR1JghmIYH29ewaYCJC0aD5PDP2V5DyG9yIca2kIUmUij4OE+iKydOPUY= X-Received: by 2002:a05:6402:430d:b0:5e1:9725:bb3e with SMTP id 4fb4d7f45d1cf-5e44ba3fdc4mr758095a12.28.1740433842147; Mon, 24 Feb 2025 13:50:42 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 24 Feb 2025 21:50:40 +0000 From: Stefan Kangas MIME-Version: 1.0 Date: Mon, 24 Feb 2025 21:50:40 +0000 X-Gm-Features: AWEUYZkmyBZi2BIXzUlhMkSfeKufOMj_PQEYpA8oKsPoiyafEUOztL0wC31TYNI Message-ID: Subject: control message for bug #76498 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 76498 minor quit From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 02 07:45:44 2025 Received: (at 76498) by debbugs.gnu.org; 2 Mar 2025 12:45:44 +0000 Received: from localhost ([127.0.0.1]:55407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1toihU-0005z0-GJ for submit@debbugs.gnu.org; Sun, 02 Mar 2025 07:45:44 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:50287) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1toihP-0005yP-Dk for 76498@debbugs.gnu.org; Sun, 02 Mar 2025 07:45:41 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5e04064af07so6437489a12.0 for <76498@debbugs.gnu.org>; Sun, 02 Mar 2025 04:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740919533; x=1741524333; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=OTb6KA+u73LCbzhBdYBLs8OBhP5hDHyZxCIXxoPtWYQ=; b=JwPnwtqFHnifVAc/GpHi4PK8MWY4hi03IkEHl/qci+sfGUxkphwd8da87/uYg89p8G sHn1p6icuIaKBdSgVvIbfqfhEJAQ2QpvR0Lu/CklL6ci6fsRAgcpwO72ESFFC6Rhycg9 iH5oyktxQczlVUwDYvJR2xtZXOHoIiwfaNLhm9tDZxP6YMC9ofpS7jnLo26dpXercn2c VXCHtio37b1LIqIEbrW8Qj+XyRjxrDcL25UeWjv5uPQV3ezQYBmw7YJAyE1KIcV6yxdi 0PmWkehWeoF+Q3TTGFZkNL5F/dMJ3uNz0uaE76X1uZLM9jCM6E2IsymXeEVP0DeROAJM 4g/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740919533; x=1741524333; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=OTb6KA+u73LCbzhBdYBLs8OBhP5hDHyZxCIXxoPtWYQ=; b=bKWXwAcWQ384jqq73RrO+HzM27EkFilptzzp6hSKo21j5Nd4FmxoE3jZVytY79J20r 1qm5Er0W54FRsqaasb5xFbVbx8CyfkXOKxNnS0m4Bo9YJazu/L0WZdbOiAalNax39Hdm nha8VHsbpMebWmhd+6WEVkkWZ2vaRe+Q9bxMd7wQ793TuhrClzLGQWnIPWmc6ZSxkafh AUaiQ5Nx89oPMK6nnzd+aBuN8gIqPAQyrrZ1jzCfRccqiDHJCUCHr/asdo7/EK/kdAjk llOivKvfrb6Sccoty1IYeKar1vn5KN48jBEsNT7UM+CiuadHM3OcgFrRUKSGvyNkehGQ ukCA== X-Gm-Message-State: AOJu0Yw3/4dbP3UmyiyW7T8lCbJBjvnbLVkSegNxFGiQoUnVVnSF1a5b kVyO7nk4zxmMDdr6MWjKZ7yuVysYw7g+5fDH03WyIWUqz1G9vGzK+pLh/aOG3LgNMGLz0Xv3QUx 61s1qfVsZQ8wzJGcrlCYR7LNI2vc= X-Gm-Gg: ASbGncuv0Y6snzzTavdPyawj+2ohiJI9JIBmhYab9nT36ERyqZXDW9tA40udbMaeZ9v CP/76S4KbSE/nq73GQYDtQSkPqh6BfGCAZlgY8HJW5TMuenIxprk+ZA3tEBoagptHZQekPKUVzX 4todKZbF1OCl3F0tZjiU53u6Qwff8= X-Google-Smtp-Source: AGHT+IHghRtDk1v8s56xhgdiTL/+1CEc8if5do4BWLFtPSji0CDmAteLX8eNoq3HG8nz61sUtjvJTvByq2GrDdtagLE= X-Received: by 2002:a05:6402:524a:b0:5e5:35e6:72de with SMTP id 4fb4d7f45d1cf-5e535e6745amr4596259a12.28.1740919533255; Sun, 02 Mar 2025 04:45:33 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 2 Mar 2025 04:45:32 -0800 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Sun, 2 Mar 2025 04:45:32 -0800 X-Gm-Features: AQ5f1JoBm8Y4yT7e6EG5RjWZGfDYy7C0yuX7zNJv1g0sLXCrlrcoW8dEIwxTyDc Message-ID: Subject: Re: bug#76498: (ert-deftest) has indentation of 13 by default To: Konstantin Kharlamov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76498 Cc: Eli Zaretskii , 76498@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Konstantin Kharlamov writes: > I'm writing tests for purescript-mode package, and I stumbled upon odd > behavior: `ert-deftest` is spuriously indented to either 2 (expected) > or 13 (unexpected). > > After digging into it, I found that if you `emacs -Q some-file-with- > tests.el` and try to indent the second line after `ert-deftest`, you'll > get size of 13. But if you `(require 'ert)` and try again you'll get 2. > > This is because, even though `ert-deftest` keyword is declared inside > `lisp-mode.el`, but *indentation size* for it resides instead in > `ert.el`, as part of "declare" statement of `ert-deftest` macro. > > This is definitely not expected. First of all, there's no reason for > user to evaluate `(require 'ert)` while working with tests =E2=80=94 you > wouldn't want to experiment with tests in your working Emacs anyway. > Which means you get incorrect indentation and left wondering what's > happening. Second of all, `ert-deftest` as a keyword resides inside > `lisp-mode.el` anyway, so what's the point of having the indentation > set in a different place. > > Could we move the indentation size to `lisp-mode.el`, please? I think this is a more general problem that applies to basically any macro. Instead of fixing this locally just for that one macro, maybe we should make autoload pick up on that automatically (for autoloaded macros)? Eli, Stefan, WDYT? From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 02 08:43:53 2025 Received: (at 76498) by debbugs.gnu.org; 2 Mar 2025 13:43:53 +0000 Received: from localhost ([127.0.0.1]:56067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tojbk-0002zv-Uv for submit@debbugs.gnu.org; Sun, 02 Mar 2025 08:43:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57192) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tojbi-0002zR-59 for 76498@debbugs.gnu.org; Sun, 02 Mar 2025 08:43:51 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tojbc-0006bk-CR; Sun, 02 Mar 2025 08:43:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=LDQvG8Twj9hrqjGftJY38rxZCwvZcxs/XOWt/LUmLhc=; b=sgsA1vxEdVC8/BLvl5oB CkSuTs1wE+poxdmnUNPe+H/fZTi2NHoepLrQBy6emqKI8asG2iQkpmhIgv7nxKaVRP+xzwdmtZFZ3 KserVFdJYAl1XFOLSc7T/5FfcHZmYEFwPnoqDHdvh995Epv2K3f27JrtE7i11I21gTCKLJ7N7oler RzfJ7et7A73ryD2dQRm2CdIlSUN2gNY4TqzeXTdhK/eqJEdEaVzn9zLB5HCUURWjDk2fmT0ty+h/w jpHBVZFGj7fJ/8F312NKFQVEaPhWVcX4AODxjF+Uav5Mmx3yFAx6Yl0sCv1ET2olG+94eaIHSO/ja WpQGkchnoMNcww==; Date: Sun, 02 Mar 2025 15:43:42 +0200 Message-Id: <864j0bo8dt.fsf@gnu.org> From: Eli Zaretskii To: Stefan Kangas In-Reply-To: (message from Stefan Kangas on Sun, 2 Mar 2025 04:45:32 -0800) Subject: Re: bug#76498: (ert-deftest) has indentation of 13 by default References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76498 Cc: 76498@debbugs.gnu.org, monnier@iro.umontreal.ca, Hi-Angel@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Kangas > Date: Sun, 2 Mar 2025 04:45:32 -0800 > Cc: 76498@debbugs.gnu.org, Eli Zaretskii , > Stefan Monnier > > Konstantin Kharlamov writes: > > > I'm writing tests for purescript-mode package, and I stumbled upon odd > > behavior: `ert-deftest` is spuriously indented to either 2 (expected) > > or 13 (unexpected). > > > > After digging into it, I found that if you `emacs -Q some-file-with- > > tests.el` and try to indent the second line after `ert-deftest`, you'll > > get size of 13. But if you `(require 'ert)` and try again you'll get 2. > > > > This is because, even though `ert-deftest` keyword is declared inside > > `lisp-mode.el`, but *indentation size* for it resides instead in > > `ert.el`, as part of "declare" statement of `ert-deftest` macro. > > > > This is definitely not expected. First of all, there's no reason for > > user to evaluate `(require 'ert)` while working with tests — you > > wouldn't want to experiment with tests in your working Emacs anyway. > > Which means you get incorrect indentation and left wondering what's > > happening. Second of all, `ert-deftest` as a keyword resides inside > > `lisp-mode.el` anyway, so what's the point of having the indentation > > set in a different place. > > > > Could we move the indentation size to `lisp-mode.el`, please? > > I think this is a more general problem that applies to basically any > macro. Instead of fixing this locally just for that one macro, maybe we > should make autoload pick up on that automatically (for autoloaded > macros)? > > Eli, Stefan, WDYT? I have no opinion on this (and don't understand the OP's use case in the first place: does he want Emacs to know about ERT-sepcific macros without loading ert??), sorry. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 02 08:49:05 2025 Received: (at 76498) by debbugs.gnu.org; 2 Mar 2025 13:49:05 +0000 Received: from localhost ([127.0.0.1]:56126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tojgn-0006V2-7M for submit@debbugs.gnu.org; Sun, 02 Mar 2025 08:49:05 -0500 Received: from forward502b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d502]:48266) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tojgk-0006UC-Up for 76498@debbugs.gnu.org; Sun, 02 Mar 2025 08:49:04 -0500 Received: from mail-nwsmtp-smtp-production-main-70.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-70.sas.yp-c.yandex.net [IPv6:2a02:6b8:c23:2129:0:640:f8ac:0]) by forward502b.mail.yandex.net (Yandex) with ESMTPS id A88D660EFC; Sun, 2 Mar 2025 16:48:54 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-70.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id qmhvNvKLZeA0-tB3i1AHT; Sun, 02 Mar 2025 16:48:54 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1740923334; bh=GjWY1Q1ESGwe8tLzYi5K4IhRMKWIoGJb/qHXjaW42DQ=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=uhbOgM+meg9S/N8pzqGHHgeo94wraQ3bBX/cAkstzhFLCEvpTo21E1Do2nerHphrc xYApilYLs62hrF5Zu9sjwrh0+Qx5AomddAutZl2czak0az139wDyYQB7vFLOKowHc0 qDdLPUEqfQ3af4fo6doKWL2RMMY8iMQs3BCoYrLQ= Authentication-Results: mail-nwsmtp-smtp-production-main-70.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <10ceecc3904d8f63acef77be184a22fca3377acd.camel@yandex.ru> Subject: Re: bug#76498: (ert-deftest) has indentation of 13 by default From: Konstantin Kharlamov To: Eli Zaretskii , Stefan Kangas Date: Sun, 02 Mar 2025 16:48:52 +0300 In-Reply-To: <864j0bo8dt.fsf@gnu.org> References: <864j0bo8dt.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76498 Cc: 76498@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sun, 2025-03-02 at 15:43 +0200, Eli Zaretskii wrote: > > From: Stefan Kangas > > Date: Sun, 2 Mar 2025 04:45:32 -0800 > > Cc: 76498@debbugs.gnu.org, Eli Zaretskii ,=20 > > Stefan Monnier > >=20 > > Konstantin Kharlamov writes: > >=20 > > > I'm writing tests for purescript-mode package, and I stumbled > > > upon odd > > > behavior: `ert-deftest` is spuriously indented to either 2 > > > (expected) > > > or 13 (unexpected). > > >=20 > > > After digging into it, I found that if you `emacs -Q some-file- > > > with- > > > tests.el` and try to indent the second line after `ert-deftest`, > > > you'll > > > get size of 13. But if you `(require 'ert)` and try again you'll > > > get 2. > > >=20 > > > This is because, even though `ert-deftest` keyword is declared > > > inside > > > `lisp-mode.el`, but *indentation size* for it resides instead in > > > `ert.el`, as part of "declare" statement of `ert-deftest` macro. > > >=20 > > > This is definitely not expected. First of all, there's no reason > > > for > > > user to evaluate `(require 'ert)` while working with tests =E2=80=94 = you > > > wouldn't want to experiment with tests in your working Emacs > > > anyway. > > > Which means you get incorrect indentation and left wondering > > > what's > > > happening. Second of all, `ert-deftest` as a keyword resides > > > inside > > > `lisp-mode.el` anyway, so what's the point of having the > > > indentation > > > set in a different place. > > >=20 > > > Could we move the indentation size to `lisp-mode.el`, please? > >=20 > > I think this is a more general problem that applies to basically > > any > > macro.=C2=A0 Instead of fixing this locally just for that one macro, > > maybe we > > should make autoload pick up on that automatically (for autoloaded > > macros)? > >=20 > > Eli, Stefan, WDYT? >=20 > I have no opinion on this (and don't understand the OP's use case in > the first place: does he want Emacs to know about ERT-sepcific macros > without loading ert??), sorry. Yes. You see, Emacs already knows about them even without loading `ert`, because it highlights them. So we're in a situation where it half-works half-doesn't. It probably either shouldn't work completely or work fully. And since we're dealing with Emacs built-in library and not some 3rd-party code, I see no reason, why couldn't indentation work OOTB. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 02 09:26:54 2025 Received: (at 76498) by debbugs.gnu.org; 2 Mar 2025 14:26:54 +0000 Received: from localhost ([127.0.0.1]:56522 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tokHO-0001li-61 for submit@debbugs.gnu.org; Sun, 02 Mar 2025 09:26:54 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:14659) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tokHL-0001l7-9g for 76498@debbugs.gnu.org; Sun, 02 Mar 2025 09:26:51 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8DCB94409D8; Sun, 2 Mar 2025 09:26:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1740925604; bh=SvfAeNXumprkD6/5a/pJbdf5Qw4rAUewVfAtRPEFfeE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=lqw+RtvQBDuDOy7mVXAp4UsmuW8hakDZdzJ52XCRG1Vf6twRbwdTj/DE66QIhUWl8 4/7OiHKhMh0tkxluWSWAXh9QEgxFfgbast0kG5MpXGgr+4hFkejz6cXbnQ508RWoni 2Qeo0pB6SS9Hwsws2Eo8MbNykxd57UsabxGumHAHdKg1C7EHJbwNinF4maF2ayVm6c cxTV0O3M1blNwHRDn+C56HW012k36XPVsoDr16XbAIFkNuf8FTkkAOE3316RIN7mCb pTuVO1wpKPVq6Ra5lxkEbAZ+yEeSZCR0ELLM/uBpBD0z/nec89Sggtx7izrHpGfolz xh3VNLtvg4uEg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9BEE4440951; Sun, 2 Mar 2025 09:26:44 -0500 (EST) Received: from alfajor (unknown [104.247.242.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5CA5612021C; Sun, 2 Mar 2025 09:26:44 -0500 (EST) From: Stefan Monnier To: Stefan Kangas Subject: Re: bug#76498: (ert-deftest) has indentation of 13 by default In-Reply-To: Message-ID: References: Date: Sun, 02 Mar 2025 09:26:43 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.371 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76498 Cc: Eli Zaretskii , 76498@debbugs.gnu.org, Konstantin Kharlamov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I think this is a more general problem that applies to basically any > macro. Instead of fixing this locally just for that one macro, maybe we > should make autoload pick up on that automatically (for autoloaded > macros)? > > Eli, Stefan, WDYT? I guess the indentation could `autoload-do-load` before checking the symbol's `lisp-indent-function`. Stefan