[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing character ch to make-string

From: Jean Louis
Subject: Re: Passing character ch to make-string
Date: Sun, 1 Nov 2020 20:55:13 +0300
User-agent: Mutt/+ (1036f0e) (2020-10-18)

* jai-bholeki via Users list for the GNU Emacs text editor 
<> [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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]