unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu>
Cc: monnier+gnu/emacs@RUM.cs.yale.edu, eliz@is.elta.co.il,
	storm@cua.dk, emacs-devel@gnu.org
Subject: Re: struct.el -- a package to encode/decode binary data
Date: Thu, 21 Mar 2002 20:27:47 -0500	[thread overview]
Message-ID: <200203220127.g2M1RmM20142@rum.cs.yale.edu> (raw)
In-Reply-To: 200203220125.KAA09137@etlken.m17n.org

> "Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu> writes:
> > But now that I think about it, if 160-255 can be an eight-bit-graphic
> > character, how does the code does with "backward-char" ?
> > Looking at DEC_POS in charset.h I see that we do
> 
> > 	while (p > p_min && !CHAR_HEAD_P (*p)) p--;
> 
> Please don't skip the following four lines:
> 
> 	len = pend + 1 - p;						\
> 	PARSE_MULTIBYTE_SEQ (p, len, bytes);				\
> 	if (bytes == len)						\
> 	  pos_byte -= len - 1;						\
> 
> which handles the above case.  When we at last reach a
> char-head, PARSE_MULTIBYTE_SEQ checks how long the byte
> sequence should be.  We update pos_byte only if the length
> is the same as what we decreased.

Yes, I saw that, so indeed the code is correct.  But it seems
that going back over the whole buffer (potentially) only
to discover that a single byte was needed is kind of silly.
Hence my suggestion to set p_min to max (p_min, p - MAX_MULTIBYTE_LENGTH)


	Stefan


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


  reply	other threads:[~2002-03-22  1:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-22  1:25 struct.el -- a package to encode/decode binary data Kenichi Handa
2002-03-22  1:27 ` Stefan Monnier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-03-22  1:30 Kenichi Handa
     [not found] <Pine.SUN.3.91.1020319133840.17982G-100000@is>
2002-03-19 14:34 ` Kim F. Storm
2002-03-19 21:27   ` Thien-Thi Nguyen
2002-03-21  9:04   ` Richard Stallman
2002-03-21 11:15     ` Eli Zaretskii
2002-03-21 13:31       ` Kim F. Storm
2002-03-21 14:56         ` Eli Zaretskii
2002-03-21 15:36           ` Kim F. Storm
2002-03-21 16:58             ` Stefan Monnier
2002-03-21 19:45               ` Eli Zaretskii
2002-03-22  1:05                 ` Stefan Monnier
2002-03-22 11:04                   ` Eli Zaretskii
2002-03-22  0:37           ` Miles Bader
2002-03-23  2:35           ` Richard Stallman
2002-03-21 16:53         ` Stefan Monnier
2002-03-23  2:36       ` Richard Stallman
2002-03-18 23:12 Kim F. Storm
2002-03-19  0:25 ` Miles Bader
2002-03-19  7:02 ` Eli Zaretskii
2002-03-19 12:34   ` Stefan Monnier
2002-03-19 14:38     ` Eli Zaretskii
2002-03-19 14:33 ` Luke Gorrie

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=200203220127.g2M1RmM20142@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=eliz@is.elta.co.il \
    --cc=emacs-devel@gnu.org \
    --cc=storm@cua.dk \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).