all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How can I use fuction "append-to-buffer"?
@ 2002-08-19 17:00 Wu XiaoGuang
  0 siblings, 0 replies; 2+ messages in thread
From: Wu XiaoGuang @ 2002-08-19 17:00 UTC (permalink / raw)


Hi,all:
  I am reading Emacs Lisp Intro.
  There is one fuction:

(defun append-to-buffer (buffer start end)
       "Append to specified buffer the text of the region.
     It is inserted into that buffer before its point.

     When calling from a program, give three arguments:
     a buffer or the name of one, and two character numbers
     specifying the portion of the current buffer to be copied."
       (interactive "BAppend to buffer: \nr")
       (let ((oldbuf (current-buffer)))
         (save-excursion
           (set-buffer (get-buffer-create buffer))
           (insert-buffer-substring oldbuf start end))))

  I want to know how can I use it?
  Thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How can I use fuction "append-to-buffer"?
       [not found] <ABC3DD304107D511B4D40002B32C1CF539A29A@brkmail01.adirtech.com>
@ 2002-08-19 20:33 ` Wu XiaoGuang
  0 siblings, 0 replies; 2+ messages in thread
From: Wu XiaoGuang @ 2002-08-19 20:33 UTC (permalink / raw)


I just didn't know how to pass the two number argument(START and END) 
after "<ALT> x".
With your advice, I understand, just use mouse to "create" the "active 
mask" in oldbuf, then do "<ALT> x append-to-buffer buffer".
It works now.
Thank you!

Douglas Lewan wrote:
> Wu,
> 
> To use "append-to-buffer" interactively simply type "M-x 
> append-to-buffer" (where M-x is "<ESC> x" or possibly "<ALT> x").
> 
> To use it in another Emacs Lisp program:
> 1. Determine the BUFFER that you want to append to.
> 2. Calculate the START and END locations in the current buffer
>    that define the text to be appended.
> 3. In your defun simply write:
>        (append-to-buffer BUFFER START END)
> 
> I hope this helps.
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-19 20:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <ABC3DD304107D511B4D40002B32C1CF539A29A@brkmail01.adirtech.com>
2002-08-19 20:33 ` How can I use fuction "append-to-buffer"? Wu XiaoGuang
2002-08-19 17:00 Wu XiaoGuang

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.