From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#66317: Project mode-line Date: Wed, 18 Oct 2023 20:20:31 +0300 Organization: LINKOV.NET Message-ID: <86y1fzvp7c.fsf@mail.linkov.net> References: <86jzs4ntxb.fsf@mail.linkov.net> <87cyxfy0b8.fsf@catern.com> <39cff21a-e0af-9386-8d99-b98988348aba@gutov.dev> <86jzrmcxhr.fsf@mail.linkov.net> <83r0lunzzg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4968"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: dmitry@gutov.dev, 66317@debbugs.gnu.org, sbaugh@catern.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 18 19:37:17 2023 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 1qtATs-00017H-EA for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Oct 2023 19:37:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtATG-0001XC-K5; Wed, 18 Oct 2023 13:36:38 -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 1qtATE-0001Vh-VB for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2023 13:36:36 -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 1qtATE-0001vr-Md for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2023 13:36:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qtATe-0002vj-3w for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2023 13:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Oct 2023 17:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66317 X-GNU-PR-Package: emacs Original-Received: via spool by 66317-submit@debbugs.gnu.org id=B66317.169765059311224 (code B ref 66317); Wed, 18 Oct 2023 17:37:02 +0000 Original-Received: (at 66317) by debbugs.gnu.org; 18 Oct 2023 17:36:33 +0000 Original-Received: from localhost ([127.0.0.1]:34600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtATB-0002uv-61 for submit@debbugs.gnu.org; Wed, 18 Oct 2023 13:36:33 -0400 Original-Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]:51953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtAT8-0002ug-Jg for 66317@debbugs.gnu.org; Wed, 18 Oct 2023 13:36:31 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 97B0B1C0002; Wed, 18 Oct 2023 17:35:56 +0000 (UTC) In-Reply-To: <83r0lunzzg.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Oct 2023 22:12:19 +0300") X-GND-Sasl: juri@linkov.net 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:272671 Archived-At: >> There is another problem: calling 'project-name' while evaluating >> 'mode-line-format' often changes the coding system mode-line indicator >> from U (utf-8) to raw-text during saving the current buffer. >> >> Here is a backtrace: >> >> - project-name >> - project--value-in-dir (that uses with-temp-buffer) >> - hack-dir-local-variables-non-file-buffer >> - hack-local-variables-apply >> >> Then in the last function the coding system is broken >> in two different ways: >> >> 1. by 'hack-one-local-variable' in `emacs -Q` > > How and where? > >> 2. by (run-hooks 'hack-local-variables-hook) >> in buffers where flyspell-mode is enabled >> 'flyspell-hack-local-variables-hook' breaks >> the coding system too. > > Why? The bug occurs when multiple lines are displayed in the echo area. Then '(:eval (project-mode-line-format)) is called twice. At the end of the first call 'buffer-file-coding-system' is still correct: utf-8. But at the beginning of the second call it's already wrong: raw-text. I guess it was a mistake to allow specifying the project name in .dir-locals.el. A better place would be in ~/.emacs.d/projects.