Menu

#369 "type" does not work in macros

v4.5
closed-fixed
None
v4.3
5
2017-09-25
2017-04-28
No

(Applies to version 4.4 but I can select only 4.3.)

The "type" command does not work in macros.
When I write in .joerc:
type @
Then hitting the @ key successfully enters an @ sign into the text.
When I write in .joerc:
type,ltarw @
Then hitting the @ key enters not an @ sign but an ASCII NUL byte into the text before moving to the left.

Discussion

  • Joe Allen

    Joe Allen - 2017-05-01

    'type' should not be used in macros. Instead us double-quotes:
    "@",ltarw @

    The macro parser translates every character inside the double-quotes into a call to type with the argument set to the character.

    On the other hand passing the character which invoked the macro to each step is a good enhancement.. I'm trying it out.

     
  • Joe Allen

    Joe Allen - 2017-05-01

    So I've checked in this enhancement. Now can say things like:

    type,type,type   @
    

    You get three @s when you type @. Also the invoking character is passed to sub-macros:

    :def foo type,type,type
    
    "<",foo,">"      @
    

    Gives

    <@@@>
    

    When you type @.

     
  • Rainer Perske

    Rainer Perske - 2017-05-01

    Thank you very, very much for your quick response and enhancement!

    (Background info: I detected the missing feature when I was trying to design a macro that - for any U+80 TO U+10FFFF - does not enter the character itself but a numeric HTML entity. with the help of the "char" function of the math mode. So that I type the € (Euro sign) key and get € written into the text - for any of the more than a million Unicode code points beyond US-ASCII. And I do not like to enter a million lines into .joerc for each possible character :-) ...)

     
  • Rainer Perske

    Rainer Perske - 2017-05-01

    again the form submission changed my writing; I wrote:

    ... and get " ampersand hash letter-x digit-2 digit-0 letter-A letter-C semicolon " written into the text ...

     
  • John J. Jordan

    John J. Jordan - 2017-09-25
    • status: open --> closed-fixed
    • assigned_to: Joe Allen
    • Group: Unknown --> v4.5
     
  • John J. Jordan

    John J. Jordan - 2017-09-25

    Fixed in 4.5

     

Log in to post a comment.