DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: How to modify/extend the trigger keyword of a plugin?  (Read 7,120 times)

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
How to modify/extend the trigger keyword of a plugin?
« on: June 13, 2008, 10:34 PM »
Can you help me out?
I'd like to 'modify' some plugins so that their behaviour suits me better.

As an example, I'd like to override the 'plist' (show printers) plugin,
so that when I enter 'plist' I actually get 'plist +sall'.

What's the best way? 

Chris

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: How to modify/extend the trigger keyword of a plugin?
« Reply #1 on: June 13, 2008, 10:53 PM »
This is a good question because i suspect people often want to change the way plugins are triggered.

you would need to do 2 things:
1) go to options,plugins, plugin manager, select the plist plugin and then override the trigger for printer list to something else, maybe like p2list.
2) then go to aliases, select myaliases file which you can edit:
and add a new alias named plist,
set regex to ^plist(.*)$
and in the results put
dosearch p2list$$1 +sall

i think that will do it.  it's off the top of my head so if it fails let me know.

there are other ways too -- nitrix is really good at coming up with stuff so maybe he will post a reply too.

but the basic idea of my method is to rename the original and then use a dosearch action to make one thing typed act like another.

Having said that:
We should ask taichi to make the printerlist plugin always display all results.  he can do that but probably just doesnt know how or it didn't occur to him.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: How to modify/extend the trigger keyword of a plugin?
« Reply #2 on: June 13, 2008, 10:58 PM »
Plugin writers, to force FARR into showing all results for your plugin call:
set_strval("setshowallmode","");

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
Re: How to modify/extend the trigger keyword of a plugin?
« Reply #3 on: June 14, 2008, 12:09 AM »
Thank you.

I have the principle.

Your example of "p2list" is a bit dodgy as the "2" immediately selects the second entry that matches "p".
That was a test, right?  ;)

Chris

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: How to modify/extend the trigger keyword of a plugin?
« Reply #4 on: June 14, 2008, 01:02 AM »
i should clarify:
you aren't meant to ever type p2list after this change.
you could have changed it to "jhgkljdhglkdjhg"

the only goal is to rename the real trigger to something you wont type
and then you type plist and only the alias will use the new keyword (p2list or jhgkljdhglkdjhg)

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
Re: How to modify/extend the trigger keyword of a plugin?
« Reply #5 on: June 14, 2008, 01:21 AM »
Quote from: mouser
you aren't meant to ever type p2list after this change.

Unless one wants to use the plugin also in its original form.
(I was using plist as an example of what I wanted)


Quote from: mouser
you could have changed it to "jhgkljdhglkdjhg"

Now you tell me!  I tried everything; "jhgkljdhglkdjg", "jhkljdhglkdjhg", "jhgkljhglkdjhg"...  :o

I might have a grasp on it this time, or not.

Chris

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: How to modify/extend the trigger keyword of a plugin?
« Reply #6 on: June 14, 2008, 01:33 AM »
:)

yes good point, if you want to also be able to use the original then you need to rename it to something more useful.

Original address: https://www.donationcoder.com/forum/index.php?topic=13672.0