by shigemk2

当面は技術的なことしか書かない

memo emacs insert

memo emacs insert

  • (insert "hoge") かんじでバッファに文字列/文字を入れる
  • inesrtする文字列がマルチバイトだとユニコードに変換される
    • カレントバッファがユニコードだったらマルチバイト文字列はユニコードに変換される
insert is a built-in function in ‘C source code’.

(insert &rest ARGS)

Insert the arguments, either strings or characters, at point.
Point and after-insertion markers move forward to end up
 after the inserted text.
Any other markers at the point of insertion remain before the text.

If the current buffer is multibyte, unibyte strings are converted
to multibyte for insertion (see ‘string-make-multibyte’).
If the current buffer is unibyte, multibyte strings are converted
to unibyte for insertion (see ‘string-make-unibyte’).

When operating on binary data, it may be necessary to preserve the
original bytes of a unibyte string when inserting it into a multibyte
buffer; to accomplish this, apply ‘string-as-multibyte’ to the string
and insert the result.

[back]