help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Replacement for string-as-unibyte-function


From: Joe Riel
Subject: Re: Replacement for string-as-unibyte-function
Date: Mon, 1 Feb 2021 15:43:22 -0800

On Mon, 01 Feb 2021 19:05:06 +0200
Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Mon, 1 Feb 2021 08:33:52 -0800
> > From: Joe Riel <jriel@maplesoft.com>
> > CC: <help-gnu-emacs@gnu.org>
> > 
> >  (make-network-process
> >               :name "mds"
> >               :family 'ipv4
> >               :service mds-port
> >               :sentinel 'mds-sentinel
> >               :filter 'mds-filter
> >               :server 't)
> > 
> > That is done because the server handles multiple clients, so the filter
> > function routes the data to the appropriate buffer.  It isn't clear to
> > me whether using :coding then has an effect; I haven't seen it.
> > 
> > I tried setting up each client buffer with
> > 
> >     (with-current-buffer buf (set-buffer-multibyte nil))
> > 
> > and, in the filter function, just calling
> > 
> >     (insert string)  
> 
> With or without the :coding attribute?  I guess without, which is why
> it didn't work.

I tried it with :coding 'binary (and with other changes mentioned).
Didn't work.  That is, it worked fine if the strings being sent
were ascii.  But when they contained unicode, the count would no 
longer match.

> Also, make sure the above is run before the filter function is called
> the first time.

Ah, that's the trick.  Thanks.  When I do that it works fine with both 
unicode and ascii source.  How does the function (or its usage)
change?  



-- 
Joe Riel




reply via email to

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