Lisp HUG Maillist Archive

Using BUFFERS

Hi,

Does someone have some experience with using buffers for manipulating  
texts ?

I would like to create and manipulate buffers with basic operations  
i.e. creating, deleting buffers, inserting deleting text in/from  
these buffers, etc.
The documentation in the LW Editor User Guide seems not to include  
all of these operations.

My buffers need to be edited by programming with these operations, or  
manually when associated with an editor-pane.

Moreover, the following simple preliminary test crashes :

(let ((ed (editor::make-buffer "mybuffer")))
   (editor::use-buffer ed
     (editor::insert-string 0 "hello")))


==> Error: Bus error(10) [code 0] at 20A132AF
      {Offset 21 inside #<Function EDITOR::IN-INSERT-STRING 20A1329A>}
eax       56 ; ebx 80000066 ; ecx      600 ; edx 22E22131
esp 22E220F0 ; ebp 22E22108 ; esi        0 ; edi 204F2207
   1 (abort) Return to level 0.
   2 Return to top loop level 0.


Thanks for any help !


Jean Bresson


Re: Using BUFFERS

On Sat, 9 Feb 2008 19:51:15 +0100, Jean Bresson <Jean.Bresson@ircam.fr> wrote:

> Moreover, the following simple preliminary test crashes :
>
> (let ((ed (editor::make-buffer "mybuffer")))
>    (editor::use-buffer ed
>      (editor::insert-string 0 "hello")))

0 is not a point.

Edi.


Re: Using BUFFERS

On Feb 9, 2008, at 1:51 PM, Jean Bresson wrote:

> Does someone have some experience with using buffers for  
> manipulating texts ?
>
> I would like to create and manipulate buffers with basic operations  
> i.e. creating, deleting buffers, inserting deleting text in/from  
> these buffers, etc.
> The documentation in the LW Editor User Guide seems not to include  
> all of these operations.

The editor source provided with LispWorks is a good source of examples.


>
>
> My buffers need to be edited by programming with these operations,  
> or manually when associated with an editor-pane.
>
> Moreover, the following simple preliminary test crashes :
>
> (let ((ed (editor::make-buffer "mybuffer")))
>  (editor::use-buffer ed
>    (editor::insert-string 0 "hello")))


You have to handle calls to editor process in a special way. See  
capi:call-editor. If you want to call arbitrary functions, use  
editor:process-character. See this thread for more hints:

http://thread.gmane.org/gmane.lisp.lispworks.general/2915/focus=2916

John


John DeSoi, Ph.D.





Updated at: 2020-12-10 08:44 UTC