GNU bug report logs -
#66825
last-coding-system-used in basic-save-buffer
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Sun, 29 Oct 2023 18:44:02 UTC
Severity: normal
Fixed in version 30.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 66825 <at> debbugs.gnu.org (full text, mbox):
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 66825 <at> 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.
This bug report was last modified 1 year and 265 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.