Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: reverse-menu-complete



Bart wrote:
> }  reversemenucomplete(char **args)
> }  {
> }      wouldinstab = 0;
> } +    zmult = -zmult;
> } +    menucomplete(args);
> }  
> }      runhookdef(REVERSEMENUHOOK, NULL);
> }      return 0;
> 
> So what does the REVERSEMENUHOOK do, now that the reverse_menu function
> is gone?

Essentially nothing.

As the development guide says, "Modules can also define function hooks.
Other modules can then add functions to these hooks to make the first
module call these functions instead of the default."

The fact that even complist didn't need to add a function to
REVERSEMENUHOOK is perhaps good evidence that it isn't useful.

So shall I bin it?

Oliver

diff --git a/Src/Zle/zle.h b/Src/Zle/zle.h
index 3c65290..ab2428e 100644
--- a/Src/Zle/zle.h
+++ b/Src/Zle/zle.h
@@ -352,8 +352,7 @@ struct brinfo {
 #define BEFORECOMPLETEHOOK (zlehooks + 2)
 #define AFTERCOMPLETEHOOK  (zlehooks + 3)
 #define ACCEPTCOMPHOOK     (zlehooks + 4)
-#define REVERSEMENUHOOK    (zlehooks + 5)
-#define INVALIDATELISTHOOK (zlehooks + 6)
+#define INVALIDATELISTHOOK (zlehooks + 5)
 
 /* complete hook data struct */
 
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 7ccfb68..fe561fc 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1992,8 +1992,6 @@ mod_export struct hookdef zlehooks[] = {
     HOOKDEF("after_complete", NULL, 0),
     /* ACCEPTCOMPHOOK */
     HOOKDEF("accept_completion", NULL, 0),
-    /* REVERSEMENUHOOK */
-    HOOKDEF("reverse_menu", NULL, 0),
     /* INVALIDATELISTHOOK */
     HOOKDEF("invalidate_list", NULL, 0),
 };
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 81a2395..937b910 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -346,10 +346,7 @@ reversemenucomplete(char **args)
 {
     wouldinstab = 0;
     zmult = -zmult;
-    menucomplete(args);
-
-    runhookdef(REVERSEMENUHOOK, NULL);
-    return 0;
+    return menucomplete(args);
 }
 
 /**/



Messages sorted by: Reverse Date, Date, Thread, Author