all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joe Riel <jriel@maplesoft.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Replacement for string-as-unibyte-function
Date: Mon, 1 Feb 2021 15:43:22 -0800	[thread overview]
Message-ID: <20210201154322.16f6955e@gauss> (raw)
In-Reply-To: <83zh0n67nh.fsf@gnu.org>

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	other threads:[~2021-02-01 23:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-31 23:01 Replacement for string-as-unibyte-function Joe Riel
2021-02-01  3:03 ` Stefan Monnier
2021-02-01  5:55   ` Joe Riel
2021-02-01 14:53     ` Eli Zaretskii
2021-02-01 16:33       ` Joe Riel
2021-02-01 17:05         ` Eli Zaretskii
2021-02-01 23:43           ` Joe Riel [this message]
2021-02-02  3:30             ` Eli Zaretskii
2021-02-02  3:51               ` Joe Riel
2021-02-02 14:58                 ` Eli Zaretskii
2021-02-01 15:01     ` Stefan Monnier
2021-02-01 16:05       ` <somecodingsystem> (was: Re: Replacement for string-as-unibyte-function) moasenwood--- via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210201154322.16f6955e@gauss \
    --to=jriel@maplesoft.com \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.