summaryrefslogtreecommitdiff
path: root/debian/patches/brl-menu.diff
blob: 8a02db105c3bb8812b1386a70c9ea3a4e6d13646 (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
Index: ratpoison-1.4.1/ChangeLog
===================================================================
--- ratpoison-1.4.1.orig/ChangeLog	2007-04-16 18:33:33.000000000 +0200
+++ ratpoison-1.4.1/ChangeLog	2007-04-16 18:34:44.000000000 +0200
@@ -1,1 +1,7 @@
+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>
Index: ratpoison-1.4.1/src/main.c
===================================================================
--- ratpoison-1.4.1.orig/src/main.c	2007-04-16 18:33:29.000000000 +0200
+++ ratpoison-1.4.1/src/main.c	2007-04-16 18:34:44.000000000 +0200
@@ -458,7 +458,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);
 
@@ -467,27 +473,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.1/src/actions.c
===================================================================
--- ratpoison-1.4.1.orig/src/actions.c	2007-04-16 18:33:33.000000000 +0200
+++ ratpoison-1.4.1/src/actions.c	2007-04-16 18:34:44.000000000 +0200
@@ -684,6 +684,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);
@@ -768,6 +771,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.1/configure.in
===================================================================
--- ratpoison-1.4.1.orig/configure.in	2007-04-16 18:33:29.000000000 +0200
+++ ratpoison-1.4.1/configure.in	2007-04-16 18:34:44.000000000 +0200
@@ -45,6 +45,15 @@
 term_prog=$withval, term_prog="xterm")
 AC_DEFINE_UNQUOTED(TERM_PROG, "$term_prog", X terminal emulator to use)
 
+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.1/src/messages.h
===================================================================
--- ratpoison-1.4.1.orig/src/messages.h	2007-04-16 18:33:29.000000000 +0200
+++ ratpoison-1.4.1/src/messages.h	2007-04-16 18:34:44.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"