unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: 66825@debbugs.gnu.org
Subject: bug#66825: last-coding-system-used in basic-save-buffer
Date: Mon, 30 Oct 2023 14:15:08 +0200	[thread overview]
Message-ID: <83wmv49uib.fsf@gnu.org> (raw)
In-Reply-To: <86bkcgy1oc.fsf@mail.linkov.net> (message from Juri Linkov on Mon, 30 Oct 2023 09:56:27 +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.





  reply	other threads:[~2023-10-30 12:15 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 [this message]
2023-10-30 17:20       ` Juri Linkov
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=83wmv49uib.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=66825@debbugs.gnu.org \
    --cc=juri@linkov.net \
    /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).