Lisp HUG Maillist Archive

micro character in LW editor

Hello,

If I write a "µ" character in a buffer and try to save it I get this error (LWw):

Error: In a call to seq::%set-access-array: #\µ is not of type base-char.
   1 (continue) Abort editor command.
   2 (abort) Return to event loop.


My Editor File encoding preferences are both Latin-1.

Thanks,
Francis



Re: micro character in LW editor


On May 9, 2006, at 6:38 AM, Francis Leboutte wrote:

> If I write a "µ" character in a buffer and try to save it I get  
> this error (LWw):
>
> Error: In a call to seq::%set-access-array: #\µ is not of type base- 
> char.
>   1 (continue) Abort editor command.
>   2 (abort) Return to event loop.
>
>
> My Editor File encoding preferences are both Latin-1.


What does (char-code #\µ) return for you in the listener? Even though  
this is a valid Latin-1 character (code 181), I'm wondering if  
something about your settings is inserting the unicode version of  
this character. If Latin-1 is not a specific requirement, you could  
set your external format to UTF-8.



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL







Re: micro character in LW editor

Le 9/05/2006 15:24, John DeSoi écrivait :


>On May 9, 2006, at 6:38 AM, Francis Leboutte wrote:
>
>>If I write a "µ" character in a buffer and try to save it I get
>>this error (LWw):
>>
>>Error: In a call to seq::%set-access-array: #\µ is not of type base- char.
>>   1 (continue) Abort editor command.
>>   2 (abort) Return to event loop.
>>
>>
>>My Editor File encoding preferences are both Latin-1.
>
>
>What does (char-code #\µ) return for you in the listener? Even though
>this is a valid Latin-1 character (code 181), I'm wondering if
>something about your settings is inserting the unicode version of
>this character.

You are right:

USER 3 > (char-code #\µ)    ; your
181

USER 4 > (char-code #\µ)    ; mine
956

USER 5 > (type-of #\µ)      ; your
base-char

USER 6 > (type-of #\µ)
simple-char


I should check my Dvorak-fr keyboard driver!


>If Latin-1 is not a specific requirement, you could
>set your external format to UTF-8.

The Editor tool's Preferences dialog doesn't 
offer UTF-8 (LWw). Maybe this not supported in LW for Windows ?

Thank you for your help,

Francis




>John DeSoi, Ph.D.
>http://pgedit.com/
>Power Tools for PostgreSQL
>
>
>
>
>
>
>



Re: micro character in LW editor

Le 9/05/2006 17:36, John DeSoi écrivait :

>On May 9, 2006, at 10:23 AM, Francis Leboutte wrote:
>
>>The Editor tool's Preferences dialog doesn't offer UTF-8 (LWw).
>>Maybe this not supported in LW for Windows ?
>
>Yes, I see now that the option is not in the popup menu on the Mac
>either. But I believe both Mac and Windows support UTF-8 and UTF-16.
>LispWorks refers to UTF-16 as "Unicode". Check out the value of
>*EXTERNAL-FORMATS* in the listener for a full list.

(... :utf-8 ... :unicode ... :latin-1)


>In the editor you can execute the "Set External Format" command to
>change the current buffer to UTF-8. To have your file always use this
>instead of the default setting, you can add a mode line to the top of
>the file:
>
> -*- mode: Lisp; encoding: utf-8; -*-

This doesn't work (according to the editor mode line).

The "Set External Format" command works: I can insert the unicode version
of the micro sign (char-code 956) and save the buffer.

>I'm sure there is a way to make UTF-8 the default by putting
>something in your init file, but it escapes me at the moment. If you
>can't find it, let me know and I'll dig further.

I have tried:
(setf (editor:variable-value "Output Format Default") '(:utf-8 :eol-style :lf))
(setf (editor:variable-value "Input Format Default") '(:utf-8 :eol-style :lf))

To make the change permanent, it had to:
- first eval these 2 forms
- save from the editor preference dialog
(putting the forms in the init file has no effect).

However, after restarting LW, I get this error when I try to open *any* lisp file :
  Error reading file g:\pe\bugs.lisp: Undefined external format nil.

A bug in the editor maybe?

Francis




>John DeSoi, Ph.D.
>http://pgedit.com/
>Power Tools for PostgreSQL
>
>



Re: [spam-di] Re: micro character in LW editor

Le 11/05/2006 06:06, John DeSoi écrivait :

>On May 10, 2006, at 4:54 AM, Francis Leboutte wrote:
>
>>> -*- mode: Lisp; encoding: utf-8; -*-
>>
>>This doesn't work (according to the editor mode line).
>
>
>Strange. It works for me on both Mac and Windows (LW 4.6.6).

I have checked it again, it doesn't work on my PC. LW 4.4.6 too :-) , Windows XP



>>I have tried:
>>(setf (editor:variable-value "Output Format Default") '(:utf-8 :eol- style :lf))
>>(setf (editor:variable-value "Input Format Default") '(:utf-8 :eol- style :lf))
>
>I have it like this (but I'm not loading it from an init file):
>
>(setf (editor:variable-value "Output Format Default" :global nil)
>'(:utf-8 :eol-style :lf))
>(setf (editor:variable-value "Input Format Default" :global nil)
>'(:utf-8 :eol-style :lf))

It doesn't make any difference. Idem with :global T.

Thanks,

Francis


>John
>
>
>
>
>John DeSoi, Ph.D.
>http://pgedit.com/
>Power Tools for PostgreSQL
>
>



Re: micro character in LW editor

Le 11/05/2006 19:36, Jukka Kakko écrivait :

>>> -*- mode: Lisp; encoding: utf-8; -*-
>>
>>This doesn't work (according to the editor mode line).
>I am certainly no expert on this but I had the same problems when I switched from
>Latin-1 to UTF-8. I had in the file characters 
>that are above ASCII-7, scandinavian letters.
>...
>
>>However, after restarting LW, I get this error when I try to open *any* lisp file :
>>  Error reading file g:\pe\bugs.lisp: Undefined external format nil.
>>
>>A bug in the editor maybe?
>I had the same error if I remember correctly. What i did was:
>
>I opened the file with Emacs (NT-emacs not the Lispworks-version.).
>Then I added the mode-line.
>Then I changed the coding system to utf-8 and saved the file
>(set-buffer-file-coding-system).
>After that everything works with LW-editor too.
>
>The error perhaps was caused because the upper-Ascii-letters were not valid
>UTF-8 letters when the file was read back as UTF-8 coded.

All this looks too weird to me.
I'll wait the next release of LW and try again at that time.

Thank you for your time,

Francis


>HTH,
>
>Jukka Kakko



Updated at: 2020-12-10 08:48 UTC