all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#7279: 24.0.50; print-escape-multibyte not honored
@ 2010-10-25 11:39 Helmut Eller
  2010-10-25 18:02 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Helmut Eller @ 2010-10-25 11:39 UTC (permalink / raw)
  To: 7279


This code:

(with-temp-file "/tmp/x.x"
  (let ((print-escape-multibyte nil))
    (prin1 (string ?\x03bb) (current-buffer))))

writes "\x03bb" to the file, i.e. it seems to ignore the value
of print-escape-multibyte.



In GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.12.12)
 of 2010-10-23 on ix
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--with-gif=no''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: nil





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

* bug#7279: 24.0.50; print-escape-multibyte not honored
  2010-10-25 11:39 bug#7279: 24.0.50; print-escape-multibyte not honored Helmut Eller
@ 2010-10-25 18:02 ` Andreas Schwab
  2010-10-25 19:04   ` Helmut Eller
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2010-10-25 18:02 UTC (permalink / raw)
  To: Helmut Eller; +Cc: 7279

Helmut Eller <eller.helmut@gmail.com> writes:

> This code:
>
> (with-temp-file "/tmp/x.x"
>   (let ((print-escape-multibyte nil))
>     (prin1 (string ?\x03bb) (current-buffer))))
>
> writes "\x03bb" to the file, i.e. it seems to ignore the value
> of print-escape-multibyte.

I cannot reprodoce that.  I also tried setting print-escape-multibyte to
t and got the expected effect.  Note that print-escape-multibyte is nil
by default anyway.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#7279: 24.0.50; print-escape-multibyte not honored
  2010-10-25 18:02 ` Andreas Schwab
@ 2010-10-25 19:04   ` Helmut Eller
  2017-01-30  7:12     ` npostavs
  0 siblings, 1 reply; 4+ messages in thread
From: Helmut Eller @ 2010-10-25 19:04 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 7279

* Andreas Schwab [2010-10-25 18:02] writes:

> Helmut Eller <eller.helmut@gmail.com> writes:
>
>> This code:
>>
>> (with-temp-file "/tmp/x.x"
>>   (let ((print-escape-multibyte nil))
>>     (prin1 (string ?\x03bb) (current-buffer))))
>>
>> writes "\x03bb" to the file, i.e. it seems to ignore the value
>> of print-escape-multibyte.
>
> I cannot reprodoce that.  I also tried setting print-escape-multibyte to
> t and got the expected effect.  Note that print-escape-multibyte is nil
> by default anyway.

And this?

(with-temp-file "/tmp/x.x"
  (set-buffer-multibyte nil)
  (let ((print-escape-multibyte nil))
    (prin1 (string ?\x80) (current-buffer))))

Helmut





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

* bug#7279: 24.0.50; print-escape-multibyte not honored
  2010-10-25 19:04   ` Helmut Eller
@ 2017-01-30  7:12     ` npostavs
  0 siblings, 0 replies; 4+ messages in thread
From: npostavs @ 2017-01-30  7:12 UTC (permalink / raw)
  To: Helmut Eller; +Cc: 7279, Andreas Schwab

tags 7279 notabug
close 7279
quit

Helmut Eller <eller.helmut@gmail.com> writes:

> * Andreas Schwab [2010-10-25 18:02] writes:
>
>> Helmut Eller <eller.helmut@gmail.com> writes:
>>
>>> This code:
>>>
>>> (with-temp-file "/tmp/x.x"
>>>   (let ((print-escape-multibyte nil))
>>>     (prin1 (string ?\x03bb) (current-buffer))))
>>>
>>> writes "\x03bb" to the file, i.e. it seems to ignore the value
>>> of print-escape-multibyte.
>>
>> I cannot reprodoce that.  I also tried setting print-escape-multibyte to
>> t and got the expected effect.  Note that print-escape-multibyte is nil
>> by default anyway.
>
> And this?
>
> (with-temp-file "/tmp/x.x"
>   (set-buffer-multibyte nil)
>   (let ((print-escape-multibyte nil))
>     (prin1 (string ?\x80) (current-buffer))))
>

You can't print a multibyte string into a unibyte buffer, this works:

(with-temp-file "/tmp/x.x"
  (set-buffer-multibyte nil)
  (let ((print-escape-multibyte nil))
    (prin1 (unibyte-string ?\x80) (current-buffer))))

or if you want to handle unicode you must choose an encoding:

(with-temp-file "/tmp/x.x"
  (set-buffer-multibyte nil)
  (let ((print-escape-multibyte nil))
    (prin1 (encode-coding-string (string ?\x03bb) 'utf-8)
           (current-buffer))))





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

end of thread, other threads:[~2017-01-30  7:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-25 11:39 bug#7279: 24.0.50; print-escape-multibyte not honored Helmut Eller
2010-10-25 18:02 ` Andreas Schwab
2010-10-25 19:04   ` Helmut Eller
2017-01-30  7:12     ` npostavs

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.