Gnus development mailing list
 help / color / mirror / Atom feed
* strange behavior in regexp matching
@ 2008-03-17 12:13 Katsumi Yamaoka
  2008-03-17 12:18 ` Christoph Conrad
  2008-03-17 12:20 ` Andreas Schwab
  0 siblings, 2 replies; 9+ messages in thread
From: Katsumi Yamaoka @ 2008-03-17 12:13 UTC (permalink / raw)
  To: emacs-devel; +Cc: ding

Hi,

Maybe due to the recent Emacs trunk change, I couldn't send a reply
to "Ville Skyttä" using Gnus.  When encoding that name in the message
header I got:

  (error "Multibyte character in QP encoding region")

This was issued by the `quoted-printable-encode-region' function
defined in qp.el:

(defun quoted-printable-encode-region (from to &optional fold class)
[...]
    (if (re-search-forward (mm-string-to-multibyte "[^\x0-\x7f\x80-\xff]")
			   to t)
	(error "Multibyte character in QP encoding region"))

An equivalent code that causes an error is:

(with-temp-buffer
  (set-buffer-multibyte nil)
  (insert (encode-coding-string "Ville Skyttä" 'iso-8859-1))
  (goto-char (point-min))
  (re-search-forward (string-to-multibyte "[^\x0-\x7f\x80-\xff]")
		     nil t))

While Emacs 22.1.92 returns nil for it, Emacs trunk returns a non-nil
value.  Is it an intended behavior?  If so, do you have an idea to
fix the problem?

Note: a buffer in which `quoted-printable-encode-region' is called
is multibyte or unibyte as the case may be.

Regards,




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: strange behavior in regexp matching
  2008-03-17 12:13 strange behavior in regexp matching Katsumi Yamaoka
@ 2008-03-17 12:18 ` Christoph Conrad
  2008-03-17 12:20 ` Andreas Schwab
  1 sibling, 0 replies; 9+ messages in thread
From: Christoph Conrad @ 2008-03-17 12:18 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: emacs-devel, ding

Hi Katsumi,

> Hi, Maybe due to the recent Emacs trunk change, I couldn't send a
> reply to "Ville Skyttä" using Gnus. When encoding that name in the
> message header I got:

>   (error "Multibyte character in QP encoding region")

Exactly the same symptoms here, since about one or two days.

With kind regards,
Christoph



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: strange behavior in regexp matching
  2008-03-17 12:13 strange behavior in regexp matching Katsumi Yamaoka
  2008-03-17 12:18 ` Christoph Conrad
@ 2008-03-17 12:20 ` Andreas Schwab
  2008-03-17 13:42   ` Reiner Steib
  1 sibling, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2008-03-17 12:20 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: ding, emacs-devel

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> While Emacs 22.1.92 returns nil for it, Emacs trunk returns a non-nil
> value.

How old is your Emacs checkout?  I have recently fixed a regex bug in
this area.

	* regex.c (re_match_2_internal): Correct matching of a charset
	against latin-1 characters.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: strange behavior in regexp matching
  2008-03-17 12:20 ` Andreas Schwab
@ 2008-03-17 13:42   ` Reiner Steib
  2008-03-17 14:02     ` Andreas Schwab
  0 siblings, 1 reply; 9+ messages in thread
From: Reiner Steib @ 2008-03-17 13:42 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: ding, emacs-devel

On Mon, Mar 17 2008, Andreas Schwab wrote:

> How old is your Emacs checkout?  I have recently fixed a regex bug in
> this area.
>
> 	* regex.c (re_match_2_internal): Correct matching of a charset
> 	against latin-1 characters.

Oops, I just reported the same problem, sorry for the duplicate:

,----[ http://thread.gmane.org/v9prttmq19.fsf@marauder.physik.uni-ulm.de ]
| From: Reiner Steib <reinersteib+gmane@imap.cc>
| To: emacs-pretest-bug@gnu.org
| Cc: ding@gnus.org
| Subject: 23.0.60; error: Multibyte character in QP encoding region
| Date: Mon, 17 Mar 2008 14:35:46 +0100
| Message-ID: <v9prttmq19.fsf@marauder.physik.uni-ulm.de>
`----

It happens with a fresh checkout of the trunk which includes the
change above.  The problem doesn't happen with a build from 2008-03-14
09:20 CET.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: strange behavior in regexp matching
  2008-03-17 13:42   ` Reiner Steib
@ 2008-03-17 14:02     ` Andreas Schwab
  2008-03-17 14:26       ` Reiner Steib
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2008-03-17 14:02 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> On Mon, Mar 17 2008, Andreas Schwab wrote:
>
>> How old is your Emacs checkout?  I have recently fixed a regex bug in
>> this area.
>>
>> 	* regex.c (re_match_2_internal): Correct matching of a charset
>> 	against latin-1 characters.
>
> Oops, I just reported the same problem, sorry for the duplicate:
>
> ,----[ http://thread.gmane.org/v9prttmq19.fsf@marauder.physik.uni-ulm.de ]
> | From: Reiner Steib <reinersteib+gmane@imap.cc>
> | To: emacs-pretest-bug@gnu.org
> | Cc: ding@gnus.org
> | Subject: 23.0.60; error: Multibyte character in QP encoding region
> | Date: Mon, 17 Mar 2008 14:35:46 +0100
> | Message-ID: <v9prttmq19.fsf@marauder.physik.uni-ulm.de>
> `----
>
> It happens with a fresh checkout of the trunk which includes the
> change above.  The problem doesn't happen with a build from 2008-03-14
> 09:20 CET.

Does it help to change the test to (re-search-forward "[[:multibyte:]]" to t)?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: strange behavior in regexp matching
  2008-03-17 14:02     ` Andreas Schwab
@ 2008-03-17 14:26       ` Reiner Steib
  2008-03-17 14:52         ` Andreas Schwab
  0 siblings, 1 reply; 9+ messages in thread
From: Reiner Steib @ 2008-03-17 14:26 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: ding, emacs-devel

On Mon, Mar 17 2008, Andreas Schwab wrote:

> Does it help to change the test to
> (re-search-forward "[[:multibyte:]]" to t)?

No, it[1] doesn't help:

,----
| Debugger entered--Lisp error: (error "Multibyte character in QP encoding region")
|   signal(error ("Multibyte character in QP encoding region"))
|   error("Multibyte character in QP encoding region")
|   (if (re-search-forward "[[:multibyte:]]" to t) (error "Multibyte character in QP encoding region"))
|   (save-excursion (goto-char from) (if (re-search-forward "[[:multibyte:]]" to t) (error "Multibyte character in QP encoding region")) (save-restriction (narrow-to-region from to) (goto-char ...) (while ... ...) (goto-char ...) (while ... ... ...) (let ... ...)))
|   quoted-printable-encode-region(1 4 nil "-\b\n\f !#-'*+0-9A-Z\\^`-~\x7f")
|   rfc2047-q-encode-string("Bä")
|   rfc2047-encode-1(9 "B\x00e4r" utf-8 rfc2047-q-encode-string "=?utf-8?Q?" " " "")
|   rfc2047-encode(71 74)
|   rfc2047-encode-region(71 75)
|   mail-encode-encoded-word-buffer()
|   mml-to-mime()
|   mml-preview((4))
|   call-interactively(mml-preview t nil)
|   execute-extended-command((4))
|   call-interactively(execute-extended-command nil nil)
`----

Bye, Reiner.

[1]
--8<---------------cut here---------------start------------->8---
--- qp.el.~1.28.~	2008-01-09 20:36:04.000000000 +0100
+++ qp.el	2008-03-17 15:22:06.000000000 +0100
@@ -107,8 +107,7 @@
     (setq class "\010-\012\014\040-\074\076-\177"))
   (save-excursion
     (goto-char from)
-    (if (re-search-forward (mm-string-to-multibyte "[^\x0-\x7f\x80-\xff]")
-			   to t)
+    (if (re-search-forward "[[:multibyte:]]" to t)
 	(error "Multibyte character in QP encoding region"))
     (save-restriction
       (narrow-to-region from to)
--8<---------------cut here---------------end--------------->8---

-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: strange behavior in regexp matching
  2008-03-17 14:26       ` Reiner Steib
@ 2008-03-17 14:52         ` Andreas Schwab
  2008-03-17 19:42           ` Reiner Steib
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2008-03-17 14:52 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> On Mon, Mar 17 2008, Andreas Schwab wrote:
>
>> Does it help to change the test to
>> (re-search-forward "[[:multibyte:]]" to t)?
>
> No, it[1] doesn't help:

Should be fixed again.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: strange behavior in regexp matching
  2008-03-17 14:52         ` Andreas Schwab
@ 2008-03-17 19:42           ` Reiner Steib
  2008-03-17 22:45             ` Kätsumi Yämäokä
  0 siblings, 1 reply; 9+ messages in thread
From: Reiner Steib @ 2008-03-17 19:42 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: ding, emacs-devel

On Mon, Mar 17 2008, Andreas Schwab wrote:

> Should be fixed again.

Yes, thanks.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: strange behavior in regexp matching
  2008-03-17 19:42           ` Reiner Steib
@ 2008-03-17 22:45             ` Kätsumi Yämäokä
  0 siblings, 0 replies; 9+ messages in thread
From: Kätsumi Yämäokä @ 2008-03-17 22:45 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: ding, emacs-devel

>>>>> Reiner Steib wrote:
> On Mon, Mar 17 2008, Andreas Schwab wrote:

>> Should be fixed again.

> Yes, thanks.

Thanks for fixing it.




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-03-17 22:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-17 12:13 strange behavior in regexp matching Katsumi Yamaoka
2008-03-17 12:18 ` Christoph Conrad
2008-03-17 12:20 ` Andreas Schwab
2008-03-17 13:42   ` Reiner Steib
2008-03-17 14:02     ` Andreas Schwab
2008-03-17 14:26       ` Reiner Steib
2008-03-17 14:52         ` Andreas Schwab
2008-03-17 19:42           ` Reiner Steib
2008-03-17 22:45             ` Kätsumi Yämäokä

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 NNTP newsgroup(s).