From unknown Sat Aug 16 13:40:56 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#12673 <12673@debbugs.gnu.org> To: bug#12673 <12673@debbugs.gnu.org> Subject: Status: 24.2; makefile-mode whitespace-cleanup Reply-To: bug#12673 <12673@debbugs.gnu.org> Date: Sat, 16 Aug 2025 20:40:56 +0000 retitle 12673 24.2; makefile-mode whitespace-cleanup reassign 12673 emacs submitter 12673 Arthur Azevedo de Amorim severity 12673 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 18 11:47:29 2012 Received: (at submit) by debbugs.gnu.org; 18 Oct 2012 15:47:29 +0000 Received: from localhost ([127.0.0.1]:50095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TOsJi-00030f-Fg for submit@debbugs.gnu.org; Thu, 18 Oct 2012 11:47:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55771) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TOsBq-0002pC-VG for submit@debbugs.gnu.org; Thu, 18 Oct 2012 11:39:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOsAK-0006dd-9s for submit@debbugs.gnu.org; Thu, 18 Oct 2012 11:37:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:44402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOsAK-0006dN-6F for submit@debbugs.gnu.org; Thu, 18 Oct 2012 11:37:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOsAJ-0007SG-0P for bug-gnu-emacs@gnu.org; Thu, 18 Oct 2012 11:37:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOsAB-0006a6-W7 for bug-gnu-emacs@gnu.org; Thu, 18 Oct 2012 11:37:42 -0400 Received: from mail-vc0-f169.google.com ([209.85.220.169]:59435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOsAB-0006Zr-SW for bug-gnu-emacs@gnu.org; Thu, 18 Oct 2012 11:37:35 -0400 Received: by mail-vc0-f169.google.com with SMTP id fl17so11257713vcb.0 for ; Thu, 18 Oct 2012 08:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=u1xMhnyB3tbeVZGXvD2p91q8NZllONSC2QQ9WZDelRY=; b=tYcGFC3K/EKXRJrieEXHs6eTWsUe7A+qK90vsc4qap7c7hkh0saVFChLp2H+ynI4Mj o9bb5X3y3ep4rQZIUT+Fe+CkC4p+YX3WrCEJ/1nWFZkiV7Q6HNDBQgHwU4Q3w+20ueyE a7h58TvoV3kDQwEsvF6cp2/rUOWUiyLJi4laJZbLiU3lBK51vWy21a1KXTA0BUnkLzyR xyc8scx5+iwuRZrJIXUO5ZJ2u2Hi2O0VkppaaJSApawEnoa8H9iTjGuvK30zXBhtfqr1 dfBCoKv31bfa44IKgx//W5XdseZojeS7vMiFqdUzX0bodHaGytXaO4WaxQjVuxzcujrm U8kw== MIME-Version: 1.0 Received: by 10.58.132.239 with SMTP id ox15mr16058497veb.59.1350574655166; Thu, 18 Oct 2012 08:37:35 -0700 (PDT) Received: by 10.221.11.10 with HTTP; Thu, 18 Oct 2012 08:37:35 -0700 (PDT) Date: Thu, 18 Oct 2012 11:37:35 -0400 Message-ID: Subject: 24.2; makefile-mode whitespace-cleanup From: Arthur Azevedo de Amorim To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 18 Oct 2012 11:47:25 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) Hello, I found a subtle bug while editing Makefiles using whitespace-cleanup in my after-save-hook. I'm using emacs-24.2. Suppose that I have the following in .emacs: (setq-default indent-tabs-mode nil) (add-hook 'after-save-hook 'whitespace-cleanup) I open up emacs, visit a text file, and then save it. whitespace-cleanup gets triggered. After that, I visit a Makefile. Now, if I save the file, whitespace-cleanup converts tabs to 8 spaces. Conversely, if I open first the Makefile, and then any other file, whitespace-cleanup will convert 8 spaces in the text file to tabs. I think I know where the problem is. whitespace.el has the following line (defvar whitespace-indent-tabs-mode indent-tabs-mode) When whitespace-cleanup is called for the first time on the text file, the value of indent-tabs-mode is nil, because that is the default value and text mode doesn't override it. When the Makefile is visited, whitespace-indent-tabs-mode has already been defined, and so will still be nil. A way to fix the problem (I think) would be to remove whitespace-indent-tabs-mode and simply use indent-tabs-mode instead. I believe that functionality related to other buffer-local variables would suffer from the same problem. For instance, the line below defines whitespace-tab-width similarly. -- Arthur Azevedo de Amorim From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 07 12:05:06 2020 Received: (at 12673) by debbugs.gnu.org; 7 Dec 2020 17:05:06 +0000 Received: from localhost ([127.0.0.1]:55326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmJwf-0002O8-GR for submit@debbugs.gnu.org; Mon, 07 Dec 2020 12:05:06 -0500 Received: from quimby.gnus.org ([95.216.78.240]:39604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmJwa-0002NN-J8 for 12673@debbugs.gnu.org; Mon, 07 Dec 2020 12:05:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=oJwpiPsZbn+s83iH9BkmFK7LxvAKN9KV319sf/08Zx8=; b=C18geedSpNuRIBNXJC6zEIatLP 2BPk5DdQhZ/kJRFMqLQKLuKSsKGSKBjykmnm1FkaPiUVOA5QAKXBylvdxKgX6cdEHscbHWPqByqzS UTfWC6U+ZtGK5lJy/3aQWUGJmlBQyZDRchZVuWk2s+D/9NRdsSxEuu2Y8sion5xyOuG8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmJwR-0007ys-Ii; Mon, 07 Dec 2020 18:04:54 +0100 From: Lars Ingebrigtsen To: Arthur Azevedo de Amorim Subject: Re: bug#12673: 24.2; makefile-mode whitespace-cleanup References: X-Now-Playing: Sylvan Esso's _WITH_: "Dress" Date: Mon, 07 Dec 2020 18:04:50 +0100 In-Reply-To: (Arthur Azevedo de Amorim's message of "Thu, 18 Oct 2012 11:37:35 -0400") Message-ID: <871rg1eedp.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Arthur Azevedo de Amorim writes: > Suppose that I have the following in .emacs: > > (setq-default indent-tabs-mode nil) > (add-hook 'after-save-hook 'whitespace-cleanup) [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 12673 Cc: 12673@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 (-) Arthur Azevedo de Amorim writes: > Suppose that I have the following in .emacs: > > (setq-default indent-tabs-mode nil) > (add-hook 'after-save-hook 'whitespace-cleanup) [...] > I think I know where the problem is. whitespace.el has the following line > > (defvar whitespace-indent-tabs-mode indent-tabs-mode) > > When whitespace-cleanup is called for the first time on the text file, > the value of indent-tabs-mode is nil, because that is the default > value and text mode doesn't override it. When the Makefile is visited, > whitespace-indent-tabs-mode has already been defined, and so will > still be nil. (This bug report unfortunately got no response at the time.) whitespace-indent-tabs-mode was removed at some point after this bug report, so I'm going to go ahead and guess that this bug has been fixed over the years, and I'm closing this bug report. If this is still an issue, please respond to the debbugs address and we'll reopen. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 07 12:05:08 2020 Received: (at control) by debbugs.gnu.org; 7 Dec 2020 17:05:08 +0000 Received: from localhost ([127.0.0.1]:55329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmJwi-0002OO-8l for submit@debbugs.gnu.org; Mon, 07 Dec 2020 12:05:08 -0500 Received: from quimby.gnus.org ([95.216.78.240]:39618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmJwf-0002NU-NC for control@debbugs.gnu.org; Mon, 07 Dec 2020 12:05:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+yXG458+WkJDxWCm1nBRHa3GUeEoZVsaYbMMLmK363U=; b=cOkpEujWFXEZYtLqWuRm5+qFuT GpugmvUDBipVess6Fj+/hU5wSgFEmJ714EEzljVqMwoqjEGc57ojEsWgG+Z4HrnF6JYKEaWkC/ZvB 7EtOlKNw/Lp/9ps/RGFBpIw8siOWmXU9KS8GGuoA5bkfSc3TDBe91PiO6najfMsDOtSM=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmJwY-0007z4-4F for control@debbugs.gnu.org; Mon, 07 Dec 2020 18:05:00 +0100 Date: Mon, 07 Dec 2020 18:04:57 +0100 Message-Id: <87zh2pczt2.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #12673 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 12673 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 (-) close 12673 quit From unknown Sat Aug 16 13:40:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 05 Jan 2021 12:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator