From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#71499: [PATCH] Make whitespace.el cleanup add missing final newline Date: Wed, 12 Jun 2024 12:38:57 +0000 Message-ID: References: <9453e7ef-dc31-4074-bba7-55a192313ccd@app.fastmail.com> <86tthy1u37.fsf@gnu.org> <86cyom1os2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7717"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71499@debbugs.gnu.org To: Eli Zaretskii , =?UTF-8?Q?Bj=C3=B6rn_?= =?UTF-8?Q?Lindstr=C3=B6m?= , Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 12 14:41:22 2024 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 1sHNI2-0001kb-Qh for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Jun 2024 14:41:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHNHl-0007wI-1X; Wed, 12 Jun 2024 08:41:05 -0400 Original-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 1sHNHj-0007vt-OX for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2024 08:41:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sHNHj-0004XV-Gc for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2024 08:41:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sHNHi-00016N-Aw for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2024 08:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Jun 2024 12:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71499 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71499-submit@debbugs.gnu.org id=B71499.17181960074145 (code B ref 71499); Wed, 12 Jun 2024 12:41:02 +0000 Original-Received: (at 71499) by debbugs.gnu.org; 12 Jun 2024 12:40:07 +0000 Original-Received: from localhost ([127.0.0.1]:37863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sHNGo-00014j-Ky for submit@debbugs.gnu.org; Wed, 12 Jun 2024 08:40:07 -0400 Original-Received: from mail-lj1-f177.google.com ([209.85.208.177]:57565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sHNGl-000147-TC for 71499@debbugs.gnu.org; Wed, 12 Jun 2024 08:40:05 -0400 Original-Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2ebec2f11b7so21842631fa.2 for <71499@debbugs.gnu.org>; Wed, 12 Jun 2024 05:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718195939; x=1718800739; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=UdFoZJ9owxooVv5834cE5la2qgsdkg+ekEcLnA7GjRc=; b=JdI93uXyWPSWElfE12UrZK3VlB1r6Pl+pcAnA+ZHPVRnzPQfX7tISqYpGE2iCnWZcV CmPKEMsS0MeqYTLbDDP6wPnavmO/gfbAK554DPVaA9jPotKidioG7EIZIqm3mpJKQ16r i3b1RpTqnvSJPef6xtFaQoA7yof1kUm0JLbeERpupcOfAoL0Npjf3W6Jj6I8urPe7iCt rP9T0Z8Y6F8rVRkylsqXmLBMpUhY3m3/8b5b1br6CCW4IU8T9CYC0n3uTWeVKHzn2C+P Dm7ZlM17YB/eFfv6x6E+lGGEPeI31JbBLjZ5a07YYjUE1r3a+/3nx99uyj9HIQTsE3bJ aJFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718195939; x=1718800739; h=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=UdFoZJ9owxooVv5834cE5la2qgsdkg+ekEcLnA7GjRc=; b=pnvryZBVbjlj3snkH77c7ax+/HOFgPdBRTkz9GZdCgK4kg98b754EvkEZnfDPeKmua bGGjGWE8oWP0s6cpUvD8MITLvbGN0/qz5UKKaGovwELUm8LJLS//qRIUr2h9RDXidzmI dlC2av9Jb0jjRRqLLZumSHPVn8ow1PAZPCFvogZy6NipcP1Krg13u+D04msYNNsZ7UEB vYmkhebXO9LRFaijp5aLcOW+gIqYnV41kFO3b4JESc6+dDJ6mT0TwQn/IDAC/JGhHnFg DCYSFwJrP8udXpv2c8j4R6sdHzAce28PjfAZq84kG+a6gQmvaAb2ViwUyqrpX5PKOVQZ DVZQ== X-Gm-Message-State: AOJu0YwWux6KrKuzmsZQ8TRsQyhUpsiBY7X/LChLk230m0CMMTqaP0Ki LxYvb/CHMFpGLkGR4TMxeuelkns+uTrbBiRgtd/1vtWHxNAzIzh416zwv5+mWIcWPUlkjkmW4B0 2jh2pvzZnolG1WeqzQsMB12qXVMg= X-Google-Smtp-Source: AGHT+IGRnkVvU+G9TmCB7ezwz0Kzlky0i+anpaZ9u8geSkOTzQL1sWLHOp5OXXeT72n5+D35zbyM50zaLS+HID/ujbA= X-Received: by 2002:a2e:9b88:0:b0:2eb:120c:1a59 with SMTP id 38308e7fff4ca-2ebfc9d0865mr9987981fa.16.1718195938640; Wed, 12 Jun 2024 05:38:58 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 12 Jun 2024 12:38:57 +0000 In-Reply-To: <86cyom1os2.fsf@gnu.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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287155 Archived-At: Eli Zaretskii writes: >> I thought about that, but since whitespace-cleanup generally applies >> clean-up according to white-space style, I thought it was simply an >> oversight that it doesn't apply a fix when it is set to highlight >> missing end-of-file newline. >> >> Adding a separate way to configure this removes the simplicity of >> configuring your preferred whitespace-style as a single option. >> >> However, If you still disagree I can make another patch somehow >> maintains the old behaviour as the default, so just let me know. > > Let's see what others think, and take it from there. > > Stefan, Andrea: WDYT about this change? AFAIU, the purpose of whitespace.el is to detect and eventually fix incorrect whitespace, and it has two ways of doing this: - Visual highlighting - Commands to fix problems (`whitespace-report` and `whitespace-cleanup). Since it is mostly configured in the centralized option, `whitespace-style`, it seems natural that if a user wants to detect `missing-newline-at-eof`, she would also want this to be fixed by `whitespace-cleanup`. This seems even more natural given that `whitespace-report` already considers that a problem worthy of reporting. IOW, I tend to agree that this not already being the case looks like an oversight. So I think the existing options are fine, and the patch could go in as-is, despite the fact that it is backwards-incompatible. If users really hate it, I guess we will hear about it and can react. If we want to be really cautious, we might want to consider waiting with this change until Emacs 31. That should provide ample time for people to notice the new behaviour and react. My two cents. BTW, note that we have `require-final-newline` as well, which is what I use here (in combination with `delete-trailing-whitespace` and the third-party package `ws-butler`).