]>
Commit | Line | Data |
---|---|---|
05f0d82a | 1 | written by Nicolas Rachinsky <nr@rachinsky.de> |
2 | http://www.rachinsky.de | |
3 | ||
4 | This program is free software; you can redistribute it and/or modify | |
5 | it under the terms of the GNU General Public License as published | |
6 | by the Free Software Foundation; version 2 of the License. | |
7 | ||
8 | This program is distributed in the hope that it will be useful, | |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
11 | General Public License for more details. | |
12 | ||
13 | --- curs_lib.c.orig Thu Nov 15 23:56:51 2001 | |
14 | +++ curs_lib.c Thu Nov 15 23:57:02 2001 | |
15 | @@ -39,7 +39,7 @@ | |
16 | * is impossible to unget function keys in SLang, so roll our own input | |
17 | * buffering routines. | |
18 | */ | |
19 | -static size_t UngetCount = 0; | |
20 | +size_t UngetCount = 0; | |
21 | static size_t UngetBufLen = 0; | |
22 | static event_t *KeyEvent; | |
23 | ||
24 | --- PATCHES~ Tue Nov 6 19:59:33 2001 | |
25 | +++ PATCHES Tue Nov 6 19:59:42 2001 | |
26 | @@ -1,0 +1 @@ | |
27 | +1.3.23.2.nr.tag_prefix_cond | |
28 | --- OPS.orig Tue Sep 11 12:50:50 2001 | |
29 | +++ OPS Sun Dec 2 01:52:49 2001 | |
30 | @@ -1,4 +1,5 @@ | |
31 | OP_NULL "null operation" | |
32 | +OP_SPECIAL "special operation (does nothing)" | |
33 | OP_ATTACH_VIEW_MAILCAP "force viewing of attachment using mailcap" | |
34 | OP_ATTACH_VIEW_TEXT "view attachment as text" | |
35 | OP_ATTACH_COLLAPSE "Toggle display of subparts" | |
36 | @@ -153,6 +154,7 @@ | |
37 | OP_SORT_REVERSE "sort messages in reverse order" | |
38 | OP_TAG "tag the current entry" | |
39 | OP_TAG_PREFIX "apply next function to tagged messages" | |
40 | +OP_TAG_PREFIX_COND "apply next function ONLY to tagged messages" | |
41 | OP_TAG_SUBTHREAD "tag the current subthread" | |
42 | OP_TAG_THREAD "tag the current thread" | |
43 | OP_TOGGLE_NEW "toggle a message's 'new' flag" | |
44 | --- curs_main.c.orig Sun Dec 2 01:50:43 2001 | |
45 | +++ curs_main.c Sun Dec 2 01:59:14 2001 | |
46 | @@ -43,7 +43,7 @@ | |
47 | ||
48 | ||
49 | ||
50 | - | |
51 | +extern size_t UngetCount; | |
52 | ||
53 | ||
54 | ||
55 | @@ -621,6 +621,40 @@ | |
56 | else if (option (OPTAUTOTAG) && Context && Context->tagged) | |
57 | tag = 1; | |
58 | ||
59 | + if (op == OP_TAG_PREFIX_COND) | |
60 | + { | |
61 | + if (!Context) | |
62 | + { | |
63 | + mutt_error _("No mailbox is open."); | |
64 | + continue; | |
65 | + } | |
66 | + | |
67 | + if (!Context->tagged) | |
68 | + { | |
69 | + event_t tmp; | |
70 | + while(UngetCount>0) | |
71 | + { | |
72 | + tmp=mutt_getch(); | |
73 | + if(tmp.op==OP_SPECIAL)break; | |
74 | + } | |
75 | + mutt_message _("Nothing todo."); | |
76 | + continue; | |
77 | + } | |
78 | + tag = 1; | |
79 | + | |
80 | + /* give visual indication that the next command is a tag- command */ | |
81 | + mvaddstr (LINES - 1, 0, "tag-"); | |
82 | + clrtoeol (); | |
83 | + | |
84 | + /* get the real command */ | |
85 | + if ((op = km_dokey (MENU_MAIN)) == OP_TAG_PREFIX) | |
86 | + { | |
87 | + /* abort tag sequence */ | |
88 | + CLEARLINE (LINES-1); | |
89 | + continue; | |
90 | + } | |
91 | + } | |
92 | + | |
93 | mutt_clear_error (); | |
94 | } | |
95 | else | |
96 | @@ -1964,6 +1998,9 @@ | |
97 | if (CURHDR->attach_del) | |
98 | Context->changed = 1; | |
99 | menu->redraw = REDRAW_FULL; | |
100 | + break; | |
101 | + | |
102 | + case OP_SPECIAL: | |
103 | break; | |
104 | ||
105 | default: | |
106 | --- functions.h.orig Tue Sep 11 12:51:39 2001 | |
107 | +++ functions.h Sun Dec 2 01:53:51 2001 | |
108 | @@ -51,6 +51,8 @@ | |
109 | { "half-down", OP_HALF_DOWN, "]" }, | |
110 | { "help", OP_HELP, "?" }, | |
111 | { "tag-prefix", OP_TAG_PREFIX, ";" }, | |
112 | + { "tag-prefix-cond", OP_TAG_PREFIX_COND, NULL }, | |
113 | + { "special", OP_SPECIAL, NULL }, | |
114 | { "shell-escape", OP_SHELL_ESCAPE, "!" }, | |
115 | { "select-entry", OP_GENERIC_SELECT_ENTRY,M_ENTER_S }, | |
116 | { "search", OP_SEARCH, "/" }, | |
117 | --- menu.c.orig Tue Nov 6 21:36:57 2001 | |
118 | +++ menu.c Sun Dec 2 02:02:30 2001 | |
119 | @@ -30,6 +30,8 @@ | |
120 | ||
121 | extern int Charset_is_utf8; /* FIXME: bad modularisation */ | |
122 | ||
123 | +extern size_t UngetCount; | |
124 | + | |
125 | static void print_enriched_string (int attr, unsigned char *s, int do_color) | |
126 | { | |
127 | wchar_t wc; | |
128 | @@ -866,6 +868,28 @@ | |
129 | i = -1; | |
130 | } | |
131 | } | |
132 | + if (i == OP_TAG_PREFIX_COND) | |
133 | + { | |
134 | + if (menu->tagged) | |
135 | + { | |
136 | + mvaddstr (LINES - 1, 0, "Tag-"); | |
137 | + clrtoeol (); | |
138 | + i = km_dokey (menu->menu); | |
139 | + menu->tagprefix = 1; | |
140 | + CLEARLINE (LINES - 1); | |
141 | + } | |
142 | + else | |
143 | + { | |
144 | + event_t tmp; | |
145 | + while(UngetCount>0) | |
146 | + { | |
147 | + tmp=mutt_getch(); | |
148 | + if(tmp.op==OP_SPECIAL)break; | |
149 | + } | |
150 | + mutt_message _("Nothing todo."); | |
151 | + i = -1; | |
152 | + } | |
153 | + } | |
154 | else if (menu->tagged && option (OPTAUTOTAG)) | |
155 | menu->tagprefix = 1; | |
156 | else | |
157 | @@ -1021,6 +1045,9 @@ | |
158 | ||
159 | case OP_NULL: | |
160 | km_error_key (menu->menu); | |
161 | + break; | |
162 | + | |
163 | + case OP_SPECIAL: | |
164 | break; | |
165 | ||
166 | default: |