unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eduardo Ochs <eduardoochs@gmail.com>
Cc: emacs-pretest-bug@gnu.org, 1215@emacsbugs.donarmstrong.com
Subject: bug#1215: 23.0.60; unibyte->multibyte conversion problem (in search-forward and friends)
Date: Wed, 22 Oct 2008 10:51:29 -0400	[thread overview]
Message-ID: <jwvhc74ofe3.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <d46ca6c20810210900k2d57589dwfb122ce3f3fb31b6@mail.gmail.com> (Eduardo Ochs's message of "Tue, 21 Oct 2008 12:00:58 -0400")

> Let me refer to strings like "<<tag>>" - where the "<<" and ">>" stand
> for guillemets, i.e., the characters that we type with `C-x 8 <' and
> `C-x 8 >' - as "anchors". So: if I produce an anchor string in a
> unibyte buffer and then I search for an occurrence of that string in
> multibyte buffer, the search fails.

There are no guillemets in unibyte buffers.

> ;;--------snip,snip--------
> ;; -*- coding: raw-text-unix -*-
> ;; (save-this-block-as "/tmp/1.txt")
> (progn
>   (find-file "/tmp/2.txt")
>   (goto-char (point-min))
>   (setq anchorstr "«foo»")
>   (message (if (multibyte-string-p anchorstr) "multi" "uni"))
>   (search-forward anchorstr))

There's a bug here, indeed: Emacs should refuse to save such a file,
because raw-text-unix (to which I prefer to refer as `binary') cannot
encode « and ».


        Stefan






  reply	other threads:[~2008-10-22 14:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21 16:00 bug#1215: 23.0.60; unibyte->multibyte conversion problem (in search-forward and friends) Eduardo Ochs
2008-10-22 14:51 ` Stefan Monnier [this message]
2009-01-16  0:19   ` Juanma Barranquero
2009-01-16  2:47     ` bug#1215: 23.0.60; unibyte->multibyte conversion problem (in Stefan Monnier
2009-01-16  2:59       ` Juanma Barranquero
2009-01-16  3:37         ` Stefan Monnier
2009-01-16 11:08           ` Juanma Barranquero
2009-01-16 20:56             ` Stefan Monnier
2009-01-17 10:10               ` Eli Zaretskii

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=jwvhc74ofe3.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=1215@emacsbugs.donarmstrong.com \
    --cc=eduardoochs@gmail.com \
    --cc=emacs-pretest-bug@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 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).