From unknown Sat Jun 14 14:26:00 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#78579 <78579@debbugs.gnu.org> To: bug#78579 <78579@debbugs.gnu.org> Subject: Status: 30.0.92; Global variant of delete-trailing-whitespace-mode Reply-To: bug#78579 <78579@debbugs.gnu.org> Date: Sat, 14 Jun 2025 21:26:00 +0000 retitle 78579 30.0.92; Global variant of delete-trailing-whitespace-mode reassign 78579 emacs submitter 78579 Jake severity 78579 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat May 24 09:49:09 2025 Received: (at submit) by debbugs.gnu.org; 24 May 2025 13:49:10 +0000 Received: from localhost ([127.0.0.1]:59256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIpFN-0008Oz-JK for submit@debbugs.gnu.org; Sat, 24 May 2025 09:49:09 -0400 Received: from lists.gnu.org ([2001:470:142::17]:41204) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uIpFK-0008OF-OL for submit@debbugs.gnu.org; Sat, 24 May 2025 09:49:07 -0400 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 1uIpFD-0006NI-Ha for bug-gnu-emacs@gnu.org; Sat, 24 May 2025 09:49:01 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIpFC-0002aW-1r for bug-gnu-emacs@gnu.org; Sat, 24 May 2025 09:48:59 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-441d1ed82faso4905635e9.0 for ; Sat, 24 May 2025 06:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748094535; x=1748699335; darn=gnu.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=YhboW6jBk8L0oO2HgEIqbJ10ytp6OdfYD9QZY8ATj+g=; b=C7dmCTFUvdV4qqH3+rXstyjgO22T820zK9ghPOWuuPysn2RMO4S9RbvOV4P2u98qoy yDzcwVJE+jnfusEk/J/yVefKAvxoYJw3tflcSticJVXDOX58daFSl3C6iHK0N6f9C6Kz WeOTivNJqtLsKju0NWaXzoI/gxyT5ceNiSaFmvIQzOFUeTjJV+Viwwsa300GVx1r9T2/ XBZl7Fz+aCV9+dS82k5rG+7TICa2g98sZ8gcFgKSmHwLR4prFQ3p+Ky8DcZZUF+cpc4l +iwKm3GXncaY5udp/Yj1OhmLBlT2aSoqDHjw5m7OBj7L2v1GkaXUKmOhn7sdaIiMXyIl Wjmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748094535; x=1748699335; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=YhboW6jBk8L0oO2HgEIqbJ10ytp6OdfYD9QZY8ATj+g=; b=gp/oDUnlA2KxEGFvXp1+XToFy9x7Yt2FWMcR9EopNYvdpltvRpyQbIl2Ig08jdLPry R0hC7uVNmX/sK/3s/rjAKkt0hkiuhfSJtroWyEDLyyQU5mKNyqGiFG0fz5QkNEdQde1L ScwqVyRe0VFoxLr34gppn1wd+EJNQq5ZY0H6enwqBZUUTEMytnlGFtOCdyfeEi4LYYnX cW/EbV/W2LiAO3TC5DJd4FNIsqqdYoPuL9PFkmsFYARpqjtqUTidUvpeqWshoxR6NVC5 l/WMI3xdbqpQUz6vCAhumOLPGGUKTWPnIyztFZoFULwbDS5ntzzj8mwps5rSlO5YYkXI Ukkg== X-Gm-Message-State: AOJu0YyHdQijlWvTbLERUaXPbytGUybP5uBLfwjeXsWzixWq6jtuO5Bv Io1bvGE8BV3upzdkQT2ie9FXoTOjz9ClC+tSTGkXeav/6om/LrScwV3RJgsainlBj4/9eDRLKFR 3wmmAEqBETJyjViK6/3WmlwD1EvqsErax/v/t X-Gm-Gg: ASbGncsOgsEvAVobE42SWhZQz42A1LmLuh/aHsN1zLti+ZWK09yJbl8G9LT2jCWPhAu EXu1Zbl9pxw/OIHv5N9Z19DYwAvSXbYY6tVbP/JDizv4gPVNsQUpwoGxAqdI/cLQeui/UdSl1CP 25j/HPnuuIsPrR/4NFrvbpcle3gYPFwYDu X-Google-Smtp-Source: AGHT+IGOxbRw6owWrv4hSkOOehOsAk7X5I56qACENDAzAkdGDlyJZK1lNHNw/AJxEdaVZG3Plewaq9ldq+tao7PbhBw= X-Received: by 2002:a05:600c:3c8f:b0:441:b3f0:e5f6 with SMTP id 5b1f17b1804b1-44c9493e723mr23157215e9.25.1748094534539; Sat, 24 May 2025 06:48:54 -0700 (PDT) MIME-Version: 1.0 From: Jake Date: Sat, 24 May 2025 13:48:44 +0000 X-Gm-Features: AX0GCFvfxXp9RxMG9_JmwmeISSjJshHqN61J65Rym9MubV76pJgSiVheYN0RugM Message-ID: Subject: 30.0.92; Global variant of delete-trailing-whitespace-mode To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000c3dc660635e1f983" Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=jforst.mailman@gmail.com; helo=mail-wm1-x334.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 Cc: 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: -0.0 (/) --000000000000c3dc660635e1f983 Content-Type: text/plain; charset="UTF-8" `delete-trailing-whitespace-mode` was introduced in commit 8a19c249f81. Should there also be a `global-delete-trailing-whitespace-mode`? This would allow (global-delete-trailing-whitespace-mode 1) and turning it off in an individual buffer with (delete-trailing-whitespace-mode -1) Thanks Jake --000000000000c3dc660635e1f983 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
`delete-trailing-whitespace-mode` was introduced in c= ommit 8a19c249f81.=C2=A0 Should there also be a `global-delete-trailing-whi= tespace-mode`?
This would allow
=C2=A0 (global-delete-trailing-whites= pace-mode 1)
and turning it off in an individual buffer with
=C2=A0 (= delete-trailing-whitespace-mode -1)

Thanks
Jake
--000000000000c3dc660635e1f983-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 24 11:14:37 2025 Received: (at 78579) by debbugs.gnu.org; 24 May 2025 15:14:37 +0000 Received: from localhost ([127.0.0.1]:33677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIqa4-0002ta-QE for submit@debbugs.gnu.org; Sat, 24 May 2025 11:14:37 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13670) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uIqa1-0002t9-HY for 78579@debbugs.gnu.org; Sat, 24 May 2025 11:14:34 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DD1A64412ED; Sat, 24 May 2025 11:14:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1748099665; bh=972BsvGorskc2m5nhMreNoXPw9nm0+V8IxZDI8GxUX4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=dQHFerqgQHVIcOHOcIC0Rr1IWucHSku95C2ZYTQXrCm1pAQdEDeqjwtNYJrr5H10N q9ScXfhi2qt7OXYd/1CPp/bznxv0GzoYn/JU1KkqdrCBjERSd2SbpC5J9yFSKXVS/u 6I1OMTe4GT5JuzSdUIjm+q96V3xWFuu9+sh2vfBe0+ndzOzLiaOUCR5zuil9Vyb4EU gmSlsp3o2w9HxsolXvg0sg/7jxlA6odfhm0QsF3egRuBYyt9kKmXUup+LNqizF2vJy RmGNDqXQHM/nnLfaXb6wvM4BpaSSEyJuGZDGq5FeKl+LCh3H4xjfU88nJPRsdcv/Nu zBRscH/G2IotA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B7CFC4412F5; Sat, 24 May 2025 11:14:25 -0400 (EDT) Received: from alfajor (unknown [104.247.225.139]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8F0F712049C; Sat, 24 May 2025 11:14:25 -0400 (EDT) From: Stefan Monnier To: Jake Subject: Re: 30.0.92; Global variant of delete-trailing-whitespace-mode In-Reply-To: Message-ID: References: Date: Sat, 24 May 2025 11:14:24 -0400 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.355 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: 78579 Cc: 78579@debbugs.gnu.org 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 (---) > `delete-trailing-whitespace-mode` was introduced in commit 8a19c249f81. > Should there also be a `global-delete-trailing-whitespace-mode`? > This would allow > (global-delete-trailing-whitespace-mode 1) > and turning it off in an individual buffer with > (delete-trailing-whitespace-mode -1) To define such a mode, we'll need to know when to enable it and when not: I'd be surprised if adding `delete-trailing-whitespace` globally to `before-save-hook` doesn't cause problems in various circumstances. I don't have enough experience with that, so I'll let others decide if and how to do it. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat May 24 11:23:33 2025 Received: (at 78579) by debbugs.gnu.org; 24 May 2025 15:23:34 +0000 Received: from localhost ([127.0.0.1]:33781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIqij-00040k-Fi for submit@debbugs.gnu.org; Sat, 24 May 2025 11:23:33 -0400 Received: from mail-vk1-xa2b.google.com ([2607:f8b0:4864:20::a2b]:57505) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uIqig-0003zl-JX for 78579@debbugs.gnu.org; Sat, 24 May 2025 11:23:31 -0400 Received: by mail-vk1-xa2b.google.com with SMTP id 71dfb90a1353d-52e0d047d31so560995e0c.2 for <78579@debbugs.gnu.org>; Sat, 24 May 2025 08:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748100205; x=1748705005; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tVk4qrTeRYERHIvhNlssHblZtHxCuGlQ+/fi/ZrV3e4=; b=Kyzy28fy/mwtPjjD3oX3VTGcU29ttnDYBqoHYf9/UYOWLDeMrPHz6nCZnEuGDz/84d NLTT/G++GM/RraQJj2abthtkzUGqQjzsyfR1hFFN7HPy5qCJ3hZcPLSP9/8R8ARrD/af HTbiRC/8e+/VKWDHSksS8F/+v0wKctWsBji7IBGtRiC92ol9hPTZDeSaT+O8+V6/ugju g6jU1r8bkRXC7emKFoDiAWvm3bQ+rfhq2R1hQQmUiMsbFCXCi/y+P4mKRKshTsRyv3C6 x2JMt35ilxi6K2ClyGAPovaWuM24DctKQM9n+zv/TvGEuuPKYm5NFn/94qVZtGKl1NFO BE0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748100205; x=1748705005; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tVk4qrTeRYERHIvhNlssHblZtHxCuGlQ+/fi/ZrV3e4=; b=dlrL7aGIcZyprM8XvLAr1sgMgwnvzAVm+yxRDjHqOCskvLAle/D74qRVaP9omzCzT2 /lze+A6afVMIrn8kVvQFIVi2ZvAHaTgiajqDxKQ5ZI0G4hLixrCPtnXZpLj4HYRWRJ3i vROgT+13u2gNX5b3c4CHfq6UePvc4r1AQn696o8ex6w78nRXVHtxIzybeHKxhE6xJUdU ExArhpFvZ89xriyT6pbpe7OX0zv0S/gNezqIFqJOrYGEggLxL4uUrx20az4q0ZnflzrJ ghjqz44dUPzavD5E7Pc9kzvXiInYw5vew4ovEVOOGgjYthhAoGPli0wrDFz1WRAbsdxA buig== X-Forwarded-Encrypted: i=1; AJvYcCXzN3FNfg6y+fhQGAiO5fB0J8bJ8hBOXAfdArMtTuQ4YN7TGmYQJTjW9R9Xhwx85vnyAiz2yw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxSQexpQ3CB8my/E52E96bm5cwKuD2BF+w+NRpK2nvM41AOrdLN lAt8wXiK+3A1qxcRcXN7lT/QK02EPmw00O4s6Ov8jTXuq2pXnL5DiNbdBDg8ID6tD0IZzbgqUJx XF352oDvYYuIvnvClJwB/1bHm914FYWo= X-Gm-Gg: ASbGncsThuR8rUKhDRyuJMGTPLlokhwLlN8lmqzkPq2Kpan5Jr/CfnHd03WfR2ffLT6 Njr9Lu8ugEh9KV7pIPMY3g7Z0MzyTNLIxCA3eXWR47VPK6Dmx3zS98a5WzYQPWG+Vi/0TsJmR2w B/MHVX3gk07/gUVGO5+dfWCufBmdv+BnkX2+Y= X-Google-Smtp-Source: AGHT+IH6JYLoNXhqn1Ln68knbxLFj2Wk9yw8/AlsdA+mhB3zVnpTjSXBZE2ThLvSarzmA+8PYhDrbn/HN3Qz2L4yCTk= X-Received: by 2002:a05:6122:8cf:b0:52a:79fd:34bd with SMTP id 71dfb90a1353d-52f2c4d8f4emr3099186e0c.4.1748100204730; Sat, 24 May 2025 08:23:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ship Mints Date: Sat, 24 May 2025 11:23:13 -0400 X-Gm-Features: AX0GCFt6rw6R0Y_onKLh6Wp6St31Cr5dVR920JjTE2-U1rny-bt4hOcyj_b7Oes Message-ID: Subject: Re: bug#78579: 30.0.92; Global variant of delete-trailing-whitespace-mode To: Stefan Monnier Content-Type: multipart/alternative; boundary="000000000000bc1f460635e34b8e" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78579 Cc: Jake , 78579@debbugs.gnu.org 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 (-) --000000000000bc1f460635e34b8e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, May 24, 2025 at 11:15=E2=80=AFAM Stefan Monnier via Bug reports for= GNU Emacs, the Swiss army knife of text editors wrote: > > `delete-trailing-whitespace-mode` was introduced in commit 8a19c249f81. > > Should there also be a `global-delete-trailing-whitespace-mode`? > > This would allow > > (global-delete-trailing-whitespace-mode 1) > > and turning it off in an individual buffer with > > (delete-trailing-whitespace-mode -1) > > To define such a mode, we'll need to know when to enable it and when > not: I'd be surprised if adding `delete-trailing-whitespace` globally > to `before-save-hook` doesn't cause problems in various circumstances. > > I don't have enough experience with that, so I'll let others decide if > and how to do it. > FWIW, this is how I manage that and even then I might enable it for markdown mode: (defun my/before-save-hook () "Delete trailing white space before saving a buffer, except `markdown-mode'." (unless (derived-mode-p 'markdown-mode) (delete-trailing-whitespace))) (add-hook 'before-save-hook #'my/before-save-hook) I suppose an exclusion mode list or some other conditionals could be baked into the mode. --000000000000bc1f460635e34b8e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
= On Sat, May 24, 2025 at 11:15=E2=80=AFAM Stefan Monnier via Bug reports for= GNU Emacs, the Swiss army knife of text editors <bug-gnu-emacs@gnu.org> wrote:
<= div class=3D"gmail_quote gmail_quote_container">
> `delete-trailing-whitespace-mode` was introduce= d in commit 8a19c249f81.
> Should there also be a `global-delete-trailing-whitespace-mode`?
> This would allow
>=C2=A0 =C2=A0(global-delete-trailing-whitespace-mode 1)
> and turning it off in an individual buffer with
>=C2=A0 =C2=A0(delete-trailing-whitespace-mode -1)

To define such a mode, we'll need to know when to enable it and when not: I'd be surprised if adding `delete-trailing-whitespace` globally to `before-save-hook` doesn't cause problems in various circumstances.<= br>
I don't have enough experience with that, so I'll let others decide= if
and how to do it.

FWIW, this is how I manage that and even= then I might enable it for markdown mode:

(defun my/before-save-hook ()
=C2=A0 "= ;Delete trailing white space before saving a buffer, except `markdown-mode&= #39;."
=C2=A0 (unless (derived-mode-p 'markdown-mode)
=C2=A0= =C2=A0 (delete-trailing-whitespace)))
(add-hook 'before-save-hook #= 'my/before-save-hook)

I suppose an exclusion mode list or some other conditional= s could be baked into the mode.
--000000000000bc1f460635e34b8e-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 24 11:50:27 2025 Received: (at 78579) by debbugs.gnu.org; 24 May 2025 15:50:27 +0000 Received: from localhost ([127.0.0.1]:34026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIr8l-0007Fv-9h for submit@debbugs.gnu.org; Sat, 24 May 2025 11:50:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41456) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uIr8i-0007Cp-FA for 78579@debbugs.gnu.org; Sat, 24 May 2025 11:50:25 -0400 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 1uIr8c-0006Q9-O0; Sat, 24 May 2025 11:50:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=FeYTCXG/TmCX2mDkR1FFhAm7mE57k8ZgxJdeqH97mbs=; b=DizlVr7+VSmg iWRr3lIGGDjvkfu+txLVia1XVPaISTNT5/X0u/MbtKvFKygNE5fYtmKfsr5XzXai45enxqCSK6NYO gevn9tHbSVrM0dhYl1KAOuNu0FMymL0LJD4VUGXvRq8ZQPHyMm8s0ydycMmjofwlndDUvzgCGeCBS l4TuMy1zpJ/F6JQIxqarMA4dOBzQxcvUdM9QWOcvwRuXq7WLNd16X0SSPsQynKwBcbFO1klh7M2W7 ThjWY4LqOfSdvJODzMR+V4GUZXgubAkxpEbZ9QsgK5zD1Kqk3cIAC4c80QzwMHDho96nn++zc3+Vt Msz44BIpFTzsCEeeCLtTvQ==; Date: Sat, 24 May 2025 18:50:16 +0300 Message-Id: <86v7pqypmv.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#78579: 30.0.92; Global variant of delete-trailing-whitespace-mode References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78579 Cc: jforst.mailman@gmail.com, 78579@debbugs.gnu.org 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 (---) > Cc: 78579@debbugs.gnu.org > Date: Sat, 24 May 2025 11:14:24 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > `delete-trailing-whitespace-mode` was introduced in commit 8a19c249f81. > > Should there also be a `global-delete-trailing-whitespace-mode`? > > This would allow > > (global-delete-trailing-whitespace-mode 1) > > and turning it off in an individual buffer with > > (delete-trailing-whitespace-mode -1) > > To define such a mode, we'll need to know when to enable it and when > not: I'd be surprised if adding `delete-trailing-whitespace` globally > to `before-save-hook` doesn't cause problems in various circumstances. > > I don't have enough experience with that, so I'll let others decide if > and how to do it. I share the fears expressed by Stefan. I think that such a global mode would be more dangerous than it's useful. After all, it's easy to add the activation of the local minor mode to mode-hook of any modes one wants. From debbugs-submit-bounces@debbugs.gnu.org Sun May 25 06:07:50 2025 Received: (at 78579-done) by debbugs.gnu.org; 25 May 2025 10:07:50 +0000 Received: from localhost ([127.0.0.1]:42906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uJ8Gk-0001a6-4Q for submit@debbugs.gnu.org; Sun, 25 May 2025 06:07:50 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:60425) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uJ8Gg-0001Zp-Ul for 78579-done@debbugs.gnu.org; Sun, 25 May 2025 06:07:47 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3a375d758a0so1182094f8f.0 for <78579-done@debbugs.gnu.org>; Sun, 25 May 2025 03:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748167661; x=1748772461; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=LoiIcum66UEZEInyez8+zWSzt1Gqlbg4GXD5vG8q/2Y=; b=R7k6CFAUnWhdsc/NZOd/+eRLdD6C51i7ER2FnDZY61icp/7s3lwpxOnPAsl6hF8mec 8v7BSgqhm1P3Y8+9uGzqDHm1rUBoZWdbMU4wTaOvwIgNTojBdMvjKQGvltUEMf3nJKt9 hDz7tYlrx8+S8ardTLGwWimEWijggFt58hFOp2jMJvSMWA5T1lon/OAIsnf9Q6Soe1F6 KOB7ysu9nbAzszpk/1+PjmH2k/uQdStRcx9g2C7sG36bo3fZAtYcpRHmHW422EL7awdf PhVb8OfwysDpZx2PKP3qPqEJWX7Q3RFt7t41kl6p7nN724E26l3IlbLa63VXhMNw99M9 ptow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748167661; x=1748772461; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LoiIcum66UEZEInyez8+zWSzt1Gqlbg4GXD5vG8q/2Y=; b=EBkR4ThfXTDatBM4GthMUnhELYMvzb0+4arspOJxusn+KLUxPoltiGVMrEhaPegslK j+BlXLvt/9UaWkGbqnQUSabAHO1e5LRT1qF1HGliUZuj1mvGZGvsA2FYCGzWN6dPxkcl utqFq98VVtBaxKeKCUAAjtG01oYQ4KACvMicjWvi3HfKHeSGJaZSfrfXZJMR6y1U7jxh gV3aKpHkFHt/y0qfnS5KbGPRdAjawGOr7QiX1NJg+u2dzOb5LpZVqlyMmCvAcXVX532L sdgi3NPfEIZNrx52GTPhVpaUTJovy2pemOaeIfSwj8r2IFdpoos7elNC51PBIpNnxKfK RcRA== X-Forwarded-Encrypted: i=1; AJvYcCWF6iV6ef7jEzBARfoi85tbW65XHTJfbCsL/0Cf27zGScLklXa+y/+3GAINyVcPONv0uKqk4o4+yVzZ@debbugs.gnu.org X-Gm-Message-State: AOJu0YxokqMFzlF3RK6+tDPfKfA/poJSc3k2AbnnqzfKXzOi0ckc2r54 vFPTnx1/Lyk/6CHCdgM2GOpr/qEbtVN9q1vu4aNNCq5GTkqVp4wRrYt02DzlmUH6tJ3Jo2gUPOd TuPGGrM0kOjiDSkv6Eu4wv0RE97Sa4xYQ8pBq X-Gm-Gg: ASbGncutB45B3KLGvt5XWtB7MUOyMRWXlIjpNvxNU9GlvB2Ct1KSxU9X/QyaRnmd8MD 2bRypdwVWgZUc243VsmWK49OiEjH9eRTWUYcZgGAA/1Rq6PpMpdl4O+HMnNRmpjECFaYMgw13cU CaXuyJGv6aLpywzqo1xHt3FtoiuzZfvlX5 X-Google-Smtp-Source: AGHT+IEGVb0qU0lOvmzkKh1spS126G0uGGqPoBwZoEUC1OzJnj66RnwLHThMc8+s+N1/ZcUAsr5clDTnv4kVZfV0ims= X-Received: by 2002:a05:6000:4024:b0:3a3:7593:81a1 with SMTP id ffacd0b85a97d-3a4cb4b83f3mr3543913f8f.43.1748167660723; Sun, 25 May 2025 03:07:40 -0700 (PDT) MIME-Version: 1.0 References: <86v7pqypmv.fsf@gnu.org> In-Reply-To: <86v7pqypmv.fsf@gnu.org> From: Jake Date: Sun, 25 May 2025 19:37:29 +0930 X-Gm-Features: AX0GCFtcodZXLlYWWBgwH9gIe_VtP8xEVH61DKyFv2lm98kVjEU8KXi_G6jNwaI Message-ID: Subject: Re: bug#78579: 30.0.92; Global variant of delete-trailing-whitespace-mode To: Eli Zaretskii , 78579-done@debbugs.gnu.org Content-Type: multipart/alternative; boundary="0000000000006ce3f30635f30090" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78579-done Cc: 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 (-) --0000000000006ce3f30635f30090 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for explaining. Closing On Sun, 25 May 2025 at 1:20=E2=80=AFam, Eli Zaretskii wrote: > > Cc: 78579@debbugs.gnu.org > > Date: Sat, 24 May 2025 11:14:24 -0400 > > From: Stefan Monnier via "Bug reports for GNU Emacs, > > the Swiss army knife of text editors" > > > > > `delete-trailing-whitespace-mode` was introduced in commit 8a19c249f8= 1. > > > Should there also be a `global-delete-trailing-whitespace-mode`? > > > This would allow > > > (global-delete-trailing-whitespace-mode 1) > > > and turning it off in an individual buffer with > > > (delete-trailing-whitespace-mode -1) > > > > To define such a mode, we'll need to know when to enable it and when > > not: I'd be surprised if adding `delete-trailing-whitespace` globally > > to `before-save-hook` doesn't cause problems in various circumstances. > > > > I don't have enough experience with that, so I'll let others decide if > > and how to do it. > > I share the fears expressed by Stefan. I think that such a global > mode would be more dangerous than it's useful. After all, it's easy > to add the activation of the local minor mode to mode-hook of any > modes one wants. > --0000000000006ce3f30635f30090 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for explaining.=C2=A0 Closing

On Sun, 25 May 2025 at 1:20=E2=80=AFam, Eli Zaretskii <eliz@gnu.org> wrote:
> Cc: 78579@debbugs.gnu.org
> Date: Sat, 24 May 2025 11:14:24 -0400
> From:=C2=A0 Stefan Monnier via "Bug reports for GNU Emacs,
>=C2=A0 the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> > `delete-trailing-whitespace-mode` was introduced in commit 8a19c2= 49f81.
> > Should there also be a `global-delete-trailing-whitespace-mode`?<= br> > > This would allow
> >=C2=A0 =C2=A0(global-delete-trailing-whitespace-mode 1)
> > and turning it off in an individual buffer with
> >=C2=A0 =C2=A0(delete-trailing-whitespace-mode -1)
>
> To define such a mode, we'll need to know when to enable it and wh= en
> not: I'd be surprised if adding `delete-trailing-whitespace` globa= lly
> to `before-save-hook` doesn't cause problems in various circumstan= ces.
>
> I don't have enough experience with that, so I'll let others d= ecide if
> and how to do it.

I share the fears expressed by Stefan.=C2=A0 I think that such a global
mode would be more dangerous than it's useful.=C2=A0 After all, it'= s easy
to add the activation of the local minor mode to mode-hook of any
modes one wants.
--0000000000006ce3f30635f30090--