Loading ...
Sorry, an error occurred while loading the content.

[jasspa] Re: ISO accent weirdness (and fix)

Expand Messages
  • bill@jasspa.freeserve.co.uk
    Okay, I knew this would bite one day! Please note the following, it will help in understanding the explanation of whats going on: * Internally ME uses ISO,
    Message 1 of 2 , Oct 7, 1999
    • 0 Attachment
      Okay, I knew this would bite one day!

      Please note the following, it will help in understanding the explanation of
      whats going on:

      * Internally ME uses ISO, i.e. for spelling.
      * ME knows that your display font is not (OEM say).
      * For spelling and word operations etc ME does an ISO to OEM conversion.

      It appears that Thomas is perverting this, that is to say you are setting the
      display font to OEM and then using ANSI text, hence the solid boxes etc. A
      simple example of a problem this causes is word movement. Because you set your
      display to OEM ME knows that OEM accented letters are word characters but not
      ISO, net effect is that when moving forward a word it will stop in the middle
      at the solid box (which is obvious not a letter).

      ME tries to help users with this problem by providing two translation commands
      user-to-latin-font and latin-to-user-font (probably very similar to your
      S-f3 command).

      The iso-accents-mode tries to be smart, it knows that "o translates to ISO
      0246 but thats no use to the user (or so I thought) if they're using an OEM
      font so it translates it to OEM and if the font doesn't support o umlaute then
      it 'should' translate to a simple 'o' char (best that can be done). The idea
      here is that the user writes in their displayed font and then when finished
      uses user-to-latin-font to convert it to ISO.

      As far as a solution to Thomas' problem, I think the enclosed fix will cause
      as many problems as its solves for the reasons outlined above. So if any one
      has any ideas I'm all ears. The only suggestion I have is introducing a flag
      to disable the conversion, but I'd like other opinions.

      I hope that clears up MEs weirdness!

      Steve

      > Subject: [jasspa] ISO accent weirdness (and fix)
      > From: Thomas Hundt <thundt@...>
      > Date: Thu, 07 Oct 1999 12:04:08 -0700
      > To: "JASSPA MicroEmacs Mailing List" <jasspa@egroups.com>
      >
      > ME exhibits some strange behavior surrounding iso-accents-mode.
      >
      > Displaying
      > ----------
      > We all know that not all the ISO (international) characters can be displayed
      > in all the fonts. The TrueType fonts (e.g., Lucida Console) tend to have all
      > the characters; the older system fonts (e.g., Fixedsys) do not. If the ISO
      > characters are in your file, they'll usually appear as solid boxes. That's
      > fine, as long as I know the character is there, I can hit Shift-F3 a couple of
      > times (which I have mapped to a macro that switches fonts) and I'll be able to
      > view it.
      >
      > Entry
      > -----
      > You can, at all times, enter these characters from the keyboard using the
      > Windows keypad codes, e.g., an � (umlauted o) is typed as Alt-0246 (the
      > numbers must be typed on the numeric keypad, not the top of the keyboard). �
      > (sz) is typed as Alt-0223.
      >
      > ME has nifty features to make it easier to type these characters:
      >
      > ; Make accents available. "-a-esc-esc makes an �
      > iso-accents-mode
      > !force global-bind-key iso-accents-expand "esc esc"
      >
      > This enables typing of the above characters as " o esc esc for the � and s z
      > esc esc for the �. (The spaces I put in there for clarity. You're really
      > typing "o and then hitting esc twice.)
      >
      > Problem
      > -------
      > Most of these shortcuts just plain don't work. For example, sz *never* works.
      > "o *always* works. The ones that don't work put in some other strange-valued
      > character.
      >
      > The code is in abbrev.emf (not in langutl -- docsbug!). The tables look right
      > to me (lists of the abbreviations and of the replacement characters).
      > Something in the guts of the program is failing to map the proper character.
      >
      > After some messing around, I found that you have to comment out the line
      > ;; 0 set-char-mask "L" ; FIX
      > and everything becomes groovy.
      >
      > Perhaps I'm doing something wrong (char-mask? not sure what that is) when I
      > switch fonts. That code is below, after the routine that has the line above.
      >
      > These lists could stand to be augmented to include characters like the German
      > quotes that look like << and >> (I'm too lazy to look up the code right now).
      > I'll probably get around to this one of these days.
      >
      >
      > -Th
      >
      >
      > [from abbrevs.emf]
      > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      > ; iso-accents-expand routines
      >
      > define-macro iso-accents-expand
      > !if ¬ &set #l0 &lfind
      > "|+-|12|14|34|ae|AE|`a|^a|'a|\"a|~a|.a|co|`e|^e|'e|\"e|`i|^i|'i|\"i|~n|oe|`o|^o|'o|\"o|~o|/o|rg|sz|tm|`u|^u|'u|\"u|\"y|'y|`A|^A
      > &mid @wl &sub $window-col 2 2
      > !abort
      > !endif
      > ;; ml-write &spr "found %s at %s" &mid @wl &sub $window-col 2 2 #l0
      > backward-delete-char
      > backward-delete-char
      > set-variable #l0 &lget
      > "|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�
      > #l0
      > ;; ml-write &spr "the new char is %d %s" #l0 #l0
      > ;; 0 set-char-mask "L" ; FIX
      > !if &set #l1 &sin #l0 $result
      > 0 set-char-mask "U"
      > set-variable #l0 &mid $result #l1 1
      > !endif
      > insert-string #l0
      > !emacro
      >
      >
      >
      >
      > Here is my code to switch fonts: [thundt.emf]
      > ;------------------------------------------------------------
      > ; cycle-font: cycles through font sizes
      > ;------------------------------------------------------------
      > define-macro cycle-font
      > !if &seq %os "mswin"
      > ; change-font "name" charSet weight width height
      > set-variable %font-number &mod &add %font-number 1 7
      > !if &equ %font-number 1
      > 1 change-font "Lucida Console" 1 0 0 15
      > ml-write "[font Lucida Console 15]"
      > !elif &equ %font-number 2
      > 1 change-font "Lucida Console" 1 0 0 12
      > ml-write "[font Lucida Console 12]"
      > !elif &equ %font-number 3
      > 1 change-font "Lucida Console" 1 0 0 11
      > ml-write "[font Lucida Console 11]"
      > !elif &equ %font-number 4
      > 1 change-font "vt100" 1 0 0 16
      > ml-write "[font vt100 16]"
      > !elif &equ %font-number 5
      > 1 change-font "vt100" 1 0 0 10
      > ml-write "[font vt100 14]"
      > !elif &equ %font-number 6
      > 1 change-font "vt100" 1 0 0 12
      > ml-write "[font vt100 12]"
      > !else
      > 1 change-font "Fixedsys" 1 0 0 15 ; used in my mewin
      > ml-write "[font Fixedsys]"
      > !endif
      > !elif &seq %os "unix"
      > set-variable %font-number &mod &add %font-number 1 6
      > !if &equ %font-number 1
      > 1 change-font "6x10"
      > ml-write "[font 6x10]"
      > !elif &equ %font-number 2
      > 1 change-font "7x13"
      > ml-write "[font 7x13]"
      > !elif &equ %font-number 3
      > 1 change-font "8x13"
      > ml-write "[font 8x13]"
      > !elif &equ %font-number 4
      > 1 change-font "9x15"
      > ml-write "[font 9x15]"
      > !elif &equ %font-number 5
      > 1 change-font "10x20"
      > ml-write "[font 10x20]"
      > !else
      > 1 change-font "-b&h-*-bold-r-*-*-14-*-72-72-m-*-*-*"
      > ml-write "[font -b&h-*-bold-r-*-*-14-*-72-72-m-*-*-*]"
      > !endif
      > !else
      > ml-write "[No fonts available for this platform]"
      > !endif ; unix
      >
      >
      > !emacro
      > global-bind-key cycle-font S-f3
      >
      >
      >
      >
      > ------------------------------------------------------------------------
      > __________________________________________________________________________
      >
      >
      >
      > This is an unmoderated list. JASSPA is not responsible for the content of
      >
      > any material posted to this list.
      >
      >
      >
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.