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: Thu, 19 Oct 2023 09:40:23 +0300 Organization: LINKOV.NET Message-ID: <86mswfxgh6.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> <86y1fzvp7c.fsf@mail.linkov.net> <86e34144-5ac6-2819-b242-fa9bc8fef098@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13133"; 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: sbaugh@catern.com, Eli Zaretskii , 66317@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 19 08:59:44 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 1qtN0S-0003HS-8y for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Oct 2023 08:59:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtN0O-0002L4-HI; Thu, 19 Oct 2023 02:59:40 -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 1qtN0M-0002Jf-Dc for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 02:59:38 -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 1qtN0M-00064B-50 for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 02:59:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qtN0m-0003Mm-1s for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 03:00:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Oct 2023 07:00:03 +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.169769875612692 (code B ref 66317); Thu, 19 Oct 2023 07:00:03 +0000 Original-Received: (at 66317) by debbugs.gnu.org; 19 Oct 2023 06:59:16 +0000 Original-Received: from localhost ([127.0.0.1]:35716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtMzz-0003Id-Vw for submit@debbugs.gnu.org; Thu, 19 Oct 2023 02:59:16 -0400 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:47655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtMzx-0003IJ-R0 for 66317@debbugs.gnu.org; Thu, 19 Oct 2023 02:59:14 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id A74731BF209; Thu, 19 Oct 2023 06:58:39 +0000 (UTC) In-Reply-To: <86e34144-5ac6-2819-b242-fa9bc8fef098@gutov.dev> (Dmitry Gutov's message of "Wed, 18 Oct 2023 21:41:53 +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:272705 Archived-At: > FWIW, I haven't been able to reproduce this so far. Unfortunately it's not easily reproducible. >> 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. > > But project-name uses project--value-in-dir which uses a temporary buffer > to apply all variables in. So it does this extensive work several times per second every time when the mode-line is updated? Then maybe better to cache the project name somewhere? > Does that affect the original buffer somehow? Actually it doesn't affect the original buffer directly. When saving a buffer and the message is multi-line during saving, then '(project-mode-line-format)' is called twice, and the buffer coding is changed between these calls. I don't know where is this code that decides to evaluate mode-line-format twice in a row, and how this code is affected by temporary buffers used by project--value-in-dir.