emacs-pretest-bug
[Top][All Lists]
Advanced

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

insert-buffer vs insert-buffer-substring


From: Juri Linkov
Subject: insert-buffer vs insert-buffer-substring
Date: Tue, 09 Aug 2005 12:00:22 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

`insert-buffer-substring' is not equivalent to `insert-buffer' in regard
to the point position after calling these functions.  `insert-buffer' leaves
point before inserted text, but `insert-buffer-substring' - after it.

I just fixed a bug in info.el caused by replacing `insert-buffer' with
`insert-buffer-substring'.  Instead of `(insert-buffer-substring buffer)',
I added the following construct:

  (goto-char (prog1 (point) (insert-buffer-substring buffer)))

Is it the right replacement?  Shouldn't it be documented in the
docstring of `insert-buffer' which currently says:

  This function is meant for the user to run interactively.
  Don't call it from programs: use `insert-buffer-substring' instead!

which gives the impression that `insert-buffer-substring' is
a complete equivalent of `insert-buffer'.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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