I am referring the documentation for truncate-string-to-width from here.

It says,

(truncate-string-to-width "\tab\t" 12 4)

will output,


But what i get in my machine (emacs versioned is one tab character with no alphabets printed. And similarly, when i do

(message "%s"
                 (truncate-string-to-width "\tab\t" 12 4 ?\s))

my mac shows, one tab character plus six space chars. But the documentation quotes,

⇒ " ab "

Why does truncate-string-to-width truncate the alphabets in my machine?

  • What Emacs version is it? – npostavs Sep 14 '16 at 18:13
  • (emacs versioned – Madhavan Sep 14 '16 at 18:19
  • Same on GNU Emacs 26.1 (build 1, x86_64-apple-darwin18.0.0, Carbon Version 158 AppKit 1671) of 2018-10-01 – Edityouprofile Oct 1 '18 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.