From unknown Thu Aug 14 21:50:08 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#57441 <57441@debbugs.gnu.org> To: bug#57441 <57441@debbugs.gnu.org> Subject: Status: indent-according-to-mode indents incorrectly if previous line is blank Reply-To: bug#57441 <57441@debbugs.gnu.org> Date: Fri, 15 Aug 2025 04:50:08 +0000 retitle 57441 indent-according-to-mode indents incorrectly if previous line= is blank reassign 57441 emacs submitter 57441 Lojze Ga=C4=8Dnik severity 57441 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 26 19:25:10 2022 Received: (at submit) by debbugs.gnu.org; 26 Aug 2022 23:25:10 +0000 Received: from localhost ([127.0.0.1]:54796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRihK-0007GY-86 for submit@debbugs.gnu.org; Fri, 26 Aug 2022 19:25:10 -0400 Received: from lists.gnu.org ([209.51.188.17]:57300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRiHx-0006cl-1K for submit@debbugs.gnu.org; Fri, 26 Aug 2022 18:58:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRiHw-00048j-Om for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 18:58:56 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:44553) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oRiHv-0005ep-68 for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 18:58:56 -0400 Received: by mail-ej1-x630.google.com with SMTP id kk26so5660610ejc.11 for ; Fri, 26 Aug 2022 15:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc; bh=D7ygUO0GQfrOx9Wt7XCQiyoW0jEu9odFnVdx9dbekZ8=; b=SoIJXkZqrZpyv1SCyjxo9y2LZ28kWuI9dDM5oYpK6wJOFuuGBdivyNVpmBELzvRbHc jr1x+47qTXCQ7wAJy8g1Q41OFYxc4dw2xiXkvHmABItF1ZkyWcGcmuRjsVh4iaLyCzCe ELyIz3R2PdlHqSaWyJsuybfG4GISHN8r4+1I7mIYxrsai92ljj4VNPWV8c01dsqpWQTx mLSIjmuKWAn50+5D5GbG+UO5cs7l8xXQQf0rbbaRjCRzCmOaU5iciLvej6DwmcmymDwf hSAZ8EjdJD9x/uKQ2Cn0aCmmPvCcr50w+270SyT597nImqKclmkBjReByIwGsCTtmThL Ax/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc; bh=D7ygUO0GQfrOx9Wt7XCQiyoW0jEu9odFnVdx9dbekZ8=; b=O13QVZTz+HUOyxMy4mNvS7SB/Ro4mYjE3hEqZvaHEu14q9dI7zov36mz//wVUYcmzY 81ifEeLNGmJhWpj2Kew8jmqXnYicR1fI6YHBmqgDholGabmGLk7Xdww9ca6cEGIoNsiX W7IIpeKlr0V2G9ts4ApZoh9RDUDOlzxVhDLf9tJUP1bszXtUDdckBGA5alX0fI/Js3KO noPtyQwhoxKEGOiymQcDtMJfdltOs1zmdUPgQq934VGSkOP0se2kW3D3kCxV9lZrz0pD wTfroE/9f0zw695jgpmSlnTUwhWOrExr87EbTXrPtD5jWxVe1wKPtIaKHdNj3t6ryNfL VKUw== X-Gm-Message-State: ACgBeo2juNIG9PbWfRM5lnkfT45IPsPOuuP1cv/raNOfGFmjKI6w7/Gj cyvi7r74dEEUEPOT78grBF2VqZWo67ypTQ/plEiCgMCUrMU= X-Google-Smtp-Source: AA6agR5yf/AWpz9iitHEy0anfjLejmb2/uldDgAU2FvvNis3Vy62Pcx105bkGVDVbdUMMyfAHcNcdGMAo82Waq1evu4= X-Received: by 2002:a17:907:2cea:b0:73d:a431:6b6c with SMTP id hz10-20020a1709072cea00b0073da4316b6cmr6849211ejc.423.1661554733041; Fri, 26 Aug 2022 15:58:53 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?Lojze_Ga=C4=8Dnik?= Date: Fri, 26 Aug 2022 22:58:41 +0000 Message-ID: Subject: indent-according-to-mode indents incorrectly if previous line is blank To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=megalojze@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 26 Aug 2022 19:25:09 -0400 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: -2.3 (--) The documentation of indent-according-to-mode claims that, if indent-line-function is set to indent-relative-first-indent-point, it will indent the line the same as the previous non-blank line. But this is not the case - it only works if the immediately preceding line is non-blank. If line 1 is indented 4 spaces, and line 2 is blank, then indent-according-to-mode on line 3 will indent 0 spaces, instead of the expected 4. Calling indent-according-to-line on line 2, or calling indent-relative-first-indent-point directly on line 2 or 3, behaves correctly. I reproduced this issue on emacs 29.0.50, using the following init.el file: (electric-indent-mode -1) (defun my/plain-indent () (setq indent-line-function 'indent-relative-first-indent-point)) ; Have to set it in a hook, otherwise it gets overrriden. (add-hook 'prog-mode-hook 'my/plain-indent) (add-hook 'text-mode-hook 'my/plain-indent) From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 13 09:47:35 2022 Received: (at control) by debbugs.gnu.org; 13 Oct 2022 13:47:35 +0000 Received: from localhost ([127.0.0.1]:60012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiyYh-0005C6-2H for submit@debbugs.gnu.org; Thu, 13 Oct 2022 09:47:35 -0400 Received: from mail-oi1-f181.google.com ([209.85.167.181]:37603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiyYe-0005BU-AT for control@debbugs.gnu.org; Thu, 13 Oct 2022 09:47:32 -0400 Received: by mail-oi1-f181.google.com with SMTP id j188so1774867oih.4 for ; Thu, 13 Oct 2022 06:47:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=IDFlwtUxIuu2b7JEkhstK5vXiQv7wMBF0dNf/qq21wM=; b=H7rWnc303+BdxTP+4pX6EJ1L6uZFVdJfB25Pe5r0H+XNW8zLBIGuzgqwuWzaRM+I2P CWvTpV1mYFyTXeD+EyIJBSQY9KPMDwpPXqze5/qQdl0YpQICrfIOeIGskz8Ym98xAiQY heCDBE9KhAE1v2sn/PZjsMwjIjECZqXBCyvBc72a8V/v0IudDRzrbRxfzntqizlLLWs6 CHN6kcXIXnP3TA4B0S31n280i8p9JwpoN1dkANmULoQqLWSaeuCQf7Q+H2GVlDVS1zry 2dQNZpkcHX0n1B/N9iji5DjSJYVEYV34c3fvp1r8ZctcSAzyiOLMHnWu6vjzQ8akZ/GH +GgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=IDFlwtUxIuu2b7JEkhstK5vXiQv7wMBF0dNf/qq21wM=; b=gAc3DSa2/Wfx/uOeXHF5rsaOqX0M6qP6b5r7CjPuFFAfMGY+gcWa/GTZKbTnRtxKRH NRWkTBrMFy9mXyHyrK+o3fs+PcIGzpJDtBfBkVONZwxs+CciicN0lgUNAyf0yx5EQ1Z2 T+yISOJzgBXiiTr64W4U3seDn7ue3bn+mpj1WKBmaf/8DoSXbJvgE8nET93AVJP1QYeM zr5eX0xBDKj7DDkOk1UfByUk/xmq9fccpUJ32nReKV9bypjHCP4p/FBBvS+F8/6xQJye 4dzrUHJa6x51V7P61S5W91MjEN6rCGdK+p0LjuTO8zmaMk5328nI7vidcEG3AjsQlpQ4 6OtA== X-Gm-Message-State: ACrzQf25DKP8MfQh9UrONODyPxn3Acltb4f3w1glQaqUF5+0pgoyc5m6 GZJoz7OrxsW3JlFhEQtV+Kv3Fud7eccmB/7ZeSrQ98PT X-Google-Smtp-Source: AMsMyM5t+8i7nSdT4n2wI55wYYgksvOxECIOlV1AU9gfhs0COAngyyn4j3HvFwdkjvXTlY7ov43qVQUSYX+AVF5YFF8= X-Received: by 2002:a05:6808:d51:b0:354:fecd:6d11 with SMTP id w17-20020a0568080d5100b00354fecd6d11mr1465125oik.92.1665668846913; Thu, 13 Oct 2022 06:47:26 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 13 Oct 2022 15:47:26 +0200 From: Stefan Kangas X-Hashcash: 1:20:221013:control@debbugs.gnu.org::Q/WHvJi2h2SrQqgm:6pVY MIME-Version: 1.0 Date: Thu, 13 Oct 2022 15:47:26 +0200 Message-ID: Subject: control message for bug #57441 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 57441 minor quit