From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 66825@debbugs.gnu.org
Subject: bug#66825: last-coding-system-used in basic-save-buffer
Date: Mon, 30 Oct 2023 19:20:19 +0200 [thread overview]
Message-ID: <86pm0wb47g.fsf@mail.linkov.net> (raw)
In-Reply-To: <83wmv49uib.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 30 Oct 2023 14:15:08 +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?
I'm not know, some deeper function needs to update the mode line
when the multi-line message resizes the echo area.
> And why does last-coding-system-used get set to raw-text-unix in this
> scenario anyway?
Because send_process needs to set it to raw-text-unix for ispell:
send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, Lisp_Object object)
{
Vlast_coding_system_used = CODING_ID_NAME (coding->id);
Here is a backtrace:
send_process
process-send-string
ispell-send-string
ispell-buffer-local-parsing
ispell-accept-buffer-local-defs
flyspell-accept-buffer-local-defs
flyspell--mode-on
flyspell-mode
hack-one-local-variable(mode flyspell)
hack-local-variables-apply
hack-dir-local-variables-non-file-buffer
project--value-in-dir
project-name
project-mode-line-format
eval((project-mode-line-format))
write-region
basic-save-buffer-2
basic-save-buffer-1
basic-save-buffer
save-buffer
next prev parent reply other threads:[~2023-10-30 17:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-29 18:40 bug#66825: last-coding-system-used in basic-save-buffer Juri Linkov
2023-10-29 19:27 ` Eli Zaretskii
2023-10-30 7:56 ` Juri Linkov
2023-10-30 12:15 ` Eli Zaretskii
2023-10-30 17:20 ` Juri Linkov [this message]
2023-10-30 17:45 ` Eli Zaretskii
2023-10-31 7:23 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86pm0wb47g.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=66825@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).