TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Macro definitions not being killed.

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
louipc



Joined: 16 Jul 2006
Posts: 65

PostPosted: Tue Aug 01, 2006 8:59 pm    Post subject: Macro definitions not being killed. Reply with quote

Starting the client without an initial command file I can define a macro, #killall, and the macro will still be 'alive' but not list itself.

I noticed this when I had killed one command file and loaded another, but the macros from the previous file were still applied.

Log.
Quote:
#config convert on
#CONFIG {CONVERT META} HAS BEEN SET TO {ON}.

#mac \ej {#showme jump}
#OK. {\ej} MACROS {#showme jump}.
#config convert off
#CONFIG {CONVERT META} HAS BEEN SET TO {OFF}.
jump
#killall
#OK: #KILL - ALL LISTS CLEARED.
jump
#kill macro
#OK: #MACRO LIST CLEARED.
jump
#mac \ej
#MACRO: NO MATCH(ES) FOUND FOR {\ej}.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Wed Aug 02, 2006 6:28 am    Post subject: Reply with quote

It's a known bug in readline I can do nothing about.
Back to top
View user's profile Send private message Send e-mail
louipc



Joined: 16 Jul 2006
Posts: 65

PostPosted: Mon Aug 21, 2006 6:00 pm    Post subject: Reply with quote

I think that's related:
http://tintin.sourceforge.net/bb/viewtopic.php?t=56

I tried to use #unmac {\\ej} to no avail.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Mon Aug 21, 2006 7:21 pm    Post subject: Reply with quote

The problem with macros is that tintin heavily relies on readline for input handling. While readline allows to create macros it can't delete them. So #unmacro is mainly there to get rid of macros you don't want to be written to file with #write.

I'll probably sit down one day and get rid of readline and write something custom, but till then macros are permanent once created.
Back to top
View user's profile Send private message Send e-mail
louipc



Joined: 16 Jul 2006
Posts: 65

PostPosted: Tue Aug 22, 2006 4:01 pm    Post subject: Reply with quote

Yeah. Odd that readline isn't able to clear the keybindings, but can still redefine them.

A temporary fix is to redefine the macro as
#MACRO {\ej} {#nop}

It won't prevent the macro from being written by #write, but at least it'll disable it from doing anything undesired.
Back to top
View user's profile Send private message
davevnj



Joined: 22 Nov 2006
Posts: 55

PostPosted: Wed Nov 22, 2006 4:15 pm    Post subject: Reply with quote

Unfortunately, this is only a partial solution too. I'd like to have my keyboard setup to use move and other commands similar to nethack, as one mode of operation, and the switch back to a regular keyboard input mode for typing commands.

If I were to do something like
Code:
#macro {j} {down}

#macro {j} {#nop}
#unmacro {j}
to set and unset the j key, I can no longer use the j key to type. Anyone know of a way to make the j character appear at the insert cursor like it does on startup?
Back to top
View user's profile Send private message Visit poster's website
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Thu Nov 23, 2006 9:08 am    Post subject: Reply with quote

Won't be possible until I add custom input support.
Back to top
View user's profile Send private message Send e-mail
louipc



Joined: 16 Jul 2006
Posts: 65

PostPosted: Mon Dec 11, 2006 7:12 pm    Post subject: Reply with quote

davevnj wrote:
Unfortunately, this is only a partial solution too. I'd like to have my keyboard setup to use move and other commands similar to nethack, as one mode of operation, and the switch back to a regular keyboard input mode for typing commands.

If I were to do something like
Code:
#macro {j} {down}

#macro {j} {#nop}
#unmacro {j}
to set and unset the j key, I can no longer use the j key to type. Anyone know of a way to make the j character appear at the insert cursor like it does on startup?


That could be one use of writing to the command line. -grin-
http://tintin.sourceforge.net/bb/viewtopic.php?t=152
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Mon Dec 11, 2006 7:44 pm    Post subject: Reply with quote

louipc wrote:
davevnj wrote:
Unfortunately, this is only a partial solution too. I'd like to have my keyboard setup to use move and other commands similar to nethack, as one mode of operation, and the switch back to a regular keyboard input mode for typing commands.

If I were to do something like
Code:
#macro {j} {down}

#macro {j} {#nop}
#unmacro {j}
to set and unset the j key, I can no longer use the j key to type. Anyone know of a way to make the j character appear at the insert cursor like it does on startup?


That could be one use of writing to the command line. -grin-
http://tintin.sourceforge.net/bb/viewtopic.php?t=152


With the new beta it'd be better to use:
Code:

#class nethack open

#macro {j} {down}

<all other macros>

#macro {\C-x} {#class nethack kill;#macro \C-x #class nethack read nethack.tin}

#class nethack close
Back to top
View user's profile Send private message Send e-mail
Ron



Joined: 08 Aug 2007
Posts: 6

PostPosted: Mon Oct 08, 2007 9:06 am    Post subject: Reply with quote

Now that TinTin++ is readline free, "#kill macro" works fine. But how to unset only one macro? Is this still not possible?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Mon Oct 08, 2007 9:16 am    Post subject: Reply with quote

#unmacro should do the trick Smile
Back to top
View user's profile Send private message Send e-mail
Ron



Joined: 08 Aug 2007
Posts: 6

PostPosted: Tue Oct 09, 2007 2:26 am    Post subject: Reply with quote

Unfortunately, it doesn't. Nope The macro is triggered as soon as I type the key.
Code:
#macro {j} {#showme Jump}
#OK. MACRO {j} HAS BEEN SET TO {#showme Jump}.
#unmacro {jump
}
#MACRO: NO MATCH(ES) FOUND FOR {}.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Tue Oct 09, 2007 7:50 am    Post subject: Reply with quote

There's little I can do about that since you are binding a primary keys.

You could bind F1 and F2 to bind and unbind the macro though.

#macro {\e[11~} {#macro j jump}
#macro {\e[12~} {#unmacro j}
Back to top
View user's profile Send private message Send e-mail
Ron



Joined: 08 Aug 2007
Posts: 6

PostPosted: Mon Oct 15, 2007 2:31 pm    Post subject: Reply with quote

Scandum wrote:
There's little I can do about that since you are binding a primary keys.
There could be a setting like "verbatim" but to (de)activate macro only.

Scandum wrote:
You could bind F1 and F2 to bind and unbind the macro though.

#macro {\e[11~} {#macro j jump}
#macro {\e[12~} {#unmacro j}
It's really not viable to bind 2 more keys for each macro to create!
I wrote a small #macro wrapper which keep track of each macro created, in order to be able to delete them all later (waiting for a better solution).
Code:
#list keys clr

#alias yamacro
{
  #macro %0;
  #list keys ins 1 %1
}

#variable yaunmacro_usage SYNTAX: yaunmacro {key binding index (see #variable keys)}
#alias yaunmacro
{
  #if {%1>=1}
  {
    #list keys len nb_keys;
    #if {%1<=$nb_keys}
    {
      #list keys get %1 key;
      #unmacro key;
      #list keys del %1
    }
    {#showme "$yaunmacro_usage"}
  }
  {#showme "$yaunmacro_usage"}
}

#alias yaunmacroall
{
  #forall {$keys} {#unmacro &0};
  #list keys clr
}

#tab {yamacro }
#tab {yaunmacro }
#tab {yaunmacroall}

#nop For example, bind F1 to delete all other macros:
#macro {\e[11~} {yaunmacroall}
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Tue Oct 16, 2007 1:46 am    Post subject: Reply with quote

Guess I could disable macros with config {convert meta} enabled.
Back to top
View user's profile Send private message Send e-mail
Ron



Joined: 08 Aug 2007
Posts: 6

PostPosted: Mon Oct 22, 2007 1:22 pm    Post subject: Reply with quote

Thanks for having fixed this in TinTin++ 1.97.7. Thumbs Up
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Mon Oct 22, 2007 3:20 pm    Post subject: Reply with quote

Welcome Coffee
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group