[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing character ch to make-string
From: |
jai-bholeki |
Subject: |
Re: Passing character ch to make-string |
Date: |
Sun, 01 Nov 2020 18:20:30 +0000 |
I did not understand the documentation. Now I got more confused.
Is there a function I can use that would not require me to hard code
the number?
Sent with ProtonMail Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Sunday, 1 November 2020 18:55, Jean Louis <bugs@gnu.support> wrote:
> - jai-bholeki via Users list for the GNU Emacs text editor
> help-gnu-emacs@gnu.org [2020-11-01 20:48]:
>
> > How can I pass a character ch to make-string
> > (make-string 8 ?ch)
>
> You would always read function documentation by using: C-h f
>
> C-h f make-string RET
>
> it would give:
>
> make-string is a built-in function in ‘C source code’.
>
> (make-string LENGTH INIT &optional MULTIBYTE)
>
> Other relevant functions are documented in the string group.
> Probably introduced at or before Emacs version 1.12.
> This function does not change global state, including the match data.
>
> Return a newly created string of length LENGTH, with INIT in each element.
> LENGTH must be an integer.
> INIT must be an integer that represents a character.
> If optional argument MULTIBYTE is non-nil, the result will be
> a multibyte string even if INIT is an ASCII character.
>
> So now we see that INIT is integer that represents a character.
>
> If character is = you may place cursor on character and do: M-x
> describe-char and you would see the integer for character like
> codepoint 61.
>
> Then you apply character in (make-string 8 61) to get string like
>
> =========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
>
> --
>
> There are 50 messages yet in my incoming mailbox.
- Passing character ch to make-string, jai-bholeki, 2020/11/01
- Re: Passing character ch to make-string, Jean Louis, 2020/11/01
- Re: Passing character ch to make-string,
jai-bholeki <=
- Re: Passing character ch to make-string, Jean Louis, 2020/11/01
- Re: Passing character ch to make-string, Stefan Kangas, 2020/11/01
- Re: Passing character ch to make-string, Jean Louis, 2020/11/01
- Re: Passing character ch to make-string, jai-bholeki, 2020/11/01
- RE: Passing character ch to make-string, Drew Adams, 2020/11/01
- RE: Passing character ch to make-string, Drew Adams, 2020/11/01
- RE: Passing character ch to make-string, jai-bholeki, 2020/11/01