summaryrefslogtreecommitdiff
path: root/debian/patches/brl-menu.diff
blob: 8a4b61f0e9ce3ed7ece8f98136c215f2f8bf0f89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
This patch adds an --with-menu that allows to specify a menu command
that will be available with :menu and with "C-t ."

Index: ratpoison-1.4.4/ChangeLog
===================================================================
--- ratpoison-1.4.4.orig/ChangeLog	2009-04-27 14:43:28.000000000 +0200
+++ ratpoison-1.4.4/ChangeLog	2009-04-27 14:47:28.000000000 +0200
@@ -1,3 +1,9 @@
+2005-01-15  Bernhard R. Link  <brlink@debian.org>
+
+	* configure.in: add --with-menu to specify a menu program
+	* src/action.c: add menu alias and binding if menu specified
+	* src/main.c:   tell menu command if menu specified
+
 2005-06-28  Bernhard R. Link <brlink@debian.org>
 
 	* src/split.c: new functions enlarge_frame_{left,up,right,down}
Index: ratpoison-1.4.4/src/main.c
===================================================================
--- ratpoison-1.4.4.orig/src/main.c	2009-04-13 11:15:46.000000000 +0200
+++ ratpoison-1.4.4/src/main.c	2009-04-27 14:47:28.000000000 +0200
@@ -467,7 +467,13 @@
 {
   rp_action *help_action;
   char *prefix, *help;
+  const char *help_show;
   rp_keymap *map;
+#ifdef MENU_PROG
+  rp_action *menu_action;
+  char *menu;
+  const char *menu_show;
+#endif
 
   prefix = keysym_to_string (prefix_key.sym, prefix_key.state);
 
@@ -476,27 +482,44 @@
   /* Find the help key binding. */
   help_action = find_keybinding_by_action ("help " ROOT_KEYMAP, map);
   if (help_action)
-    help = keysym_to_string (help_action->key, help_action->state);
-  else
-    help = NULL;
-
-
-  if (help)
     {
+      help = keysym_to_string (help_action->key, help_action->state);
       /* A little kludge to use ? instead of `question' for the help
          key. */
       if (!strcmp (help, "question"))
-        marked_message_printf (0, 0, MESSAGE_WELCOME, prefix, "?");
+        help_show = "?";
       else
-        marked_message_printf (0, 0, MESSAGE_WELCOME, prefix, help);
-
-      free (help);
+	help_show = help;
+    }
+  else
+    {
+      help = NULL;
+      help_show = ":help";
+    }
+#ifdef MENU_PROG
+  /* Find the menu key binding. */
+  menu_action = find_keybinding_by_action ("menu", map);
+  if (menu_action)
+    {
+      menu = keysym_to_string (menu_action->key, menu_action->state);
+      if (!strcmp (menu, "period"))
+	menu_show = ".";
+      else
+	menu_show = menu;
     }
   else
     {
-      marked_message_printf (0, 0, MESSAGE_WELCOME, prefix, ":help");
+      menu = NULL;
+      menu_show = ":menu";
     }
 
+  marked_message_printf (0, 0, MESSAGE_WELCOME_MENU, prefix, help_show,
+			 prefix, menu_show);
+  free(menu);
+#else
+  marked_message_printf (0, 0, MESSAGE_WELCOME, prefix, help_show);
+#endif
+  free(help);
   free (prefix);
 }
 
Index: ratpoison-1.4.4/src/actions.c
===================================================================
--- ratpoison-1.4.4.orig/src/actions.c	2009-04-27 14:43:28.000000000 +0200
+++ ratpoison-1.4.4/src/actions.c	2009-04-27 14:47:28.000000000 +0200
@@ -725,6 +725,9 @@
   add_keybinding (prefix_key.sym, prefix_key.state, "other", map);
   add_keybinding (prefix_key.sym, 0, "meta", map);
   add_keybinding (XK_g, RP_CONTROL_MASK, "abort", map);
+#ifdef MENU_PROG
+  add_keybinding (XK_period, 0, "menu", map);
+#endif
   add_keybinding (XK_0, 0, "select 0", map);
   add_keybinding (XK_1, 0, "select 1", map);
   add_keybinding (XK_2, 0, "select 2", map);
@@ -811,6 +814,10 @@
   add_alias ("unbind", "undefinekey " ROOT_KEYMAP);
   add_alias ("bind", "definekey " ROOT_KEYMAP);
   add_alias ("split", "vsplit");
+
+#ifdef MENU_PROG
+  add_alias ("menu", "exec " MENU_PROG );
+#endif
 }
 
 cmdret *
Index: ratpoison-1.4.4/configure.in
===================================================================
--- ratpoison-1.4.4.orig/configure.in	2009-04-27 03:55:10.000000000 +0200
+++ ratpoison-1.4.4/configure.in	2009-04-27 14:47:28.000000000 +0200
@@ -72,6 +72,15 @@
 AC_SUBST(XFT_CFLAGS)
 AC_SUBST(XFT_LIBS)
 
+AC_ARG_WITH(menu, [ --with-menu=PROG        set a external menu program to be advertised ],
+menu_prog="$withval", menu_prog="")
+
+if test "$menu_prog" != "no" && ! test -z "$menu_prog" ; then
+AC_DEFINE_UNQUOTED(MENU_PROG, "$menu_prog", external menu program to advertise)
+AC_MSG_CHECKING(external menu program)
+AC_MSG_RESULT($menu_prog)
+fi
+
 dnl Checks for programs.
 AC_CHECK_TOOL(CC, gcc)
 AC_PROG_CC
Index: ratpoison-1.4.4/src/messages.h
===================================================================
--- ratpoison-1.4.4.orig/src/messages.h	2009-04-13 03:52:16.000000000 +0200
+++ ratpoison-1.4.4/src/messages.h	2009-04-27 14:47:28.000000000 +0200
@@ -50,6 +50,7 @@
 #define MESSAGE_PROMPT_VAR_VALUE  "Value: "
 
 #define MESSAGE_WELCOME "Welcome to ratpoison! Hit `%s %s' for help."
+#define MESSAGE_WELCOME_MENU 	"Welcome to ratpoison! Hit `%s %s' for help. `%s %s' for menu."
 
 #define EMPTY_FRAME_MESSAGE "Current Frame"