[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#66825: last-coding-system-used in basic-save-buffer
From: |
Eli Zaretskii |
Subject: |
bug#66825: last-coding-system-used in basic-save-buffer |
Date: |
Mon, 30 Oct 2023 14:15:08 +0200 |
> From: Juri Linkov <juri@linkov.net>
> Cc: 66825@debbugs.gnu.org
> Date: Mon, 30 Oct 2023 09:56:27 +0200
>
> I don't understand this alternative. The mode line updating
> that uses 'project-mode-line-format' that unintentionally
> changes 'last-coding-system-used' is called from this line
> in 'basic-save-buffer-2':
>
> (write-region nil nil
> buffer-file-name nil t buffer-file-truename)
>
> because this call in 'write_region' updates the mode line:
>
> message_with_string ((NUMBERP (append)
> ? "Updated %s"
> : ! NILP (append)
> ? "Added to %s"
> : "Wrote %s"),
> visit_file, 1);
How does message_with_string update the mode line?
And why does last-coding-system-used get set to raw-text-unix in this
scenario anyway?
> + ;; Preserve the original value of 'last-coding-system-used'
> + ;; that can break 'basic-save-buffer' (bug#66825)
> + (let ((last-coding-system-used nil))
> + (concat
> + " "
> + (propertize
> + (project-name project)
> + 'face project-mode-line-face
> + 'mouse-face 'mode-line-highlight
> + 'help-echo "mouse-1: Project menu"
> + 'local-map project-mode-line-map)))))
I'm confused how this avoids the problem, probably because I don't
understand the answers to the two questions above.