Re: `read-from-minibuffer' seems to always return a multibyte string, but why?
Eli Zaretskii <[email protected]>
| Newsgroups | gmane.emacs.devel |
|---|---|
| Message-ID | <[email protected]> |
> From: Nickolai Dobrynin <[email protected]> > Date: Tue, 25 Aug 2026 05:47:52 +0200 > > I ran M-x ielm, executed > > (set-buffer-multibyte nil) > (read-from-minibuffer "Input: ") > > and got a multibyte string back. Please show exactly what you did. If I do this: emacs -Q M-: (set-buffer-multibyte nil) RET M-: (multibyte-string-p (read-from-minibuffer "? " nil nil nil nil nil t)) RET and type "foo RET" at the prompt, I get nil as the result, as expected. > The manual merely says that either a STRING (which one? Uni- or multi-?) > or a Lisp object is returned. No, it says this: This function is the most general way to get input from the minibuffer. By default, it accepts arbitrary text and returns it as a string; however, if READ is non-‘nil’, then it uses ‘read’ to convert the text into a Lisp object (*note Input Functions::). [...] If the argument INHERIT-INPUT-METHOD is non-‘nil’, then the minibuffer inherits the current input method (*note Input Methods::) and the setting of ‘enable-multibyte-characters’ (*note Text Representations::) from whichever buffer was current before entering the minibuffer. So if the return value is a string, its multi-byteness is according to the value of enable-multibyte-characters of the minibuffer. > By the way, a multibyte string was really what I wanted out of this. I > just want to be sure that this behavior is not accidental. Why do you care, may I ask?