[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get buffer byte length (not number of characters)?
From: |
Joseph Turner |
Subject: |
Re: How to get buffer byte length (not number of characters)? |
Date: |
Sun, 25 Aug 2024 23:37:49 -0700 |
Eli Zaretskii <eliz@gnu.org> writes:
> you need to consider the encoding process: Emacs always encodes the
> buffer text on output to the external world. If this is what you
> want, then you need to use bufferpos-to-filepos, and make sure you
> pass the correct coding-system argument to it.
Will the following code ever signal an error?
(bufferpos-to-filepos
(point-max) 'exact
(select-safe-coding-system (point-min) (point-max)))
The `bufferpos-to-filepos' docstring says, "It is an error to request
the ‘exact’ method when the buffer’s EOL format is not yet decided."
IOW, does `select-safe-coding-system' always return an encoding which
specifies EOL conversion?
Thank you!!
Joseph
- Re: How to get buffer byte length (not number of characters)?, (continued)
- Re: How to get buffer byte length (not number of characters)?, tomas, 2024/08/22
- Re: How to get buffer byte length (not number of characters)?, Adam Porter, 2024/08/23
- Re: How to get buffer byte length (not number of characters)?, Eli Zaretskii, 2024/08/22
- Re: How to get buffer byte length (not number of characters)?, Adam Porter, 2024/08/23
- Re: How to get buffer byte length (not number of characters)?, Eli Zaretskii, 2024/08/23
- Re: How to get buffer byte length (not number of characters)?, Joseph Turner, 2024/08/23
- Re: How to get buffer byte length (not number of characters)?, Joseph Turner, 2024/08/23
- Re: How to get buffer byte length (not number of characters)?, Andreas Schwab, 2024/08/22
- Re: How to get buffer byte length (not number of characters)?, Joseph Turner, 2024/08/22
- Re: How to get buffer byte length (not number of characters)?, Eli Zaretskii, 2024/08/22
- Re: How to get buffer byte length (not number of characters)?,
Joseph Turner <=
- Re: How to get buffer byte length (not number of characters)?, Andreas Schwab, 2024/08/20