[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inserting some text in a working buffer
From: |
Eli Zaretskii |
Subject: |
Re: Inserting some text in a working buffer |
Date: |
Sun, 09 May 2021 10:12:31 +0300 |
> Date: Sun, 09 May 2021 06:11:21 +0200
> From: Emanuel Berg via Users list for the GNU Emacs text editor
> <help-gnu-emacs@gnu.org>
>
> (defun insert-char-to-col (char col)
> "Insert CHAR to COL."
> (interactive "cchar: \nncol: ")
> (let*((len (- col (current-column)))
> (str (make-string len char)) )
> (insert str) ))
This seems to assume that each character takes just one column. But
some characters, called "double-width characters", take 2 columns, not
1. So using make-string here is not TRT, because its LENGTH argument
counts characters, not columns.