]> code.delx.au - gnu-emacs-elpa/blob - packages/gnorb/gnorb.org
Merge commit '0cda39255827f283e7578cd469ae42daad9556a2' from js2-mode
[gnu-emacs-elpa] / packages / gnorb / gnorb.org
1 #+TEXINFO_CLASS: info
2 #+TEXINFO_HEADER: @syncodeindex pg cp
3 #+TITLE: Gnorb Manual
4 #+SUBTITLE: for version 1, updated 3 October, 2014
5 #+TEXINFO_DIR_CATEGORY: Emacs
6 #+TEXINFO_DIR_TITLE: Gnorb: (gnorb)
7 #+TEXINFO_DIR_DESC: Glue code for Gnus, Org, and BBDB
8 #+OPTIONS: *:nil num:t toc:nil
9 * Introduction
10
11 Gnorb provides glue code between the Gnus, Org, and BBDB packages.
12 It's aimed at supporting email-based project management, and generally
13 making it easier to keep track of email communication.
14
15 Much of the code consists of single-use convenience functions, but
16 tracking email conversations with Org requires is more complicated,
17 and requires a bit of setup.
18
19 Gnorb can be used in a modular fashion, by selectively loading the
20 files "gnorb-org", "gnorb-gnus" or "gnorb-bbdb" instead of plain old
21 "gnorb". The package as a whole is rather Org-centric, though, and it
22 won't do much of interest without "gnorb-org".
23
24 This means that Gnorb doesn't have hard requirements to any of the
25 three base libraries. For the libraries you are using, however, you'll
26 get best results from using the most recent stable version (yes, that
27 means BBDB 3). Some of the features in Gnorb only work with
28 development versions of these libraries (those cases are noted below).
29 * Installation
30 Gnorb is best installed via the Elpa package manager -- look for it in
31 `list-packages'.
32
33 You can also clone the source code from
34 https://github.com/girzel/gnorb, and put the "gnorb" directory on your
35 load-path. The Github site is also a good place to report bugs and
36 other issues.
37 * Setup
38 :PROPERTIES:
39 :ID: 9da59609-bb3c-4970-88f6-bddca18d2ad4
40 :END:
41 Loading "gnorb" will make the basic functions available. Using Gnorb
42 for email tracking takes a bit more setup, however:
43
44 1. Email tracking is done via the Gnus registry, so that must be
45 activated with 'gnus-registry-initialize'.
46 2. It also requires the org-id package to be loaded, and
47 `org-id-track-globally' set to t (that's the default value, so
48 simply loading the package should be enough).
49 3. Add a nngnorb entry to your `gnus-secondary-select-methods'
50 variable. It will look like (nngnorb "Server name"). This does
51 nothing but provide a place to hang nnir searches.
52 4. Then put a call to `gnorb-tracking-initialize' in your init files,
53 at some point after the Gnus registry is initialized.
54 5. If you're not using a local archive method for saving your sent
55 messages (ie you're using IMAP), you'll also need to tell Gnorb
56 where to find your sent messages. Set the variable
57 `gnorb-gnus-sent-groups' to a list of strings; each string should
58 indicate a fully-qualified group name, eg "nnimap+SERVER:GROUP".
59
60 Lastly, Gnorb doesn't bind any keys by default; see the [[id:de1b2579-86c2-4bb1-b77e-3467a3d2b3c7][Suggested
61 Keybindings]] section below for possibilities.
62 * Email Tracking
63 The most interesting thing Gnorb does is using Org headings to track
64 email conversations. This can mean anything from reminding yourself to
65 write to your mother, to conducting delicate business negotiations
66 over email, to running an email-based bug tracker.
67
68 Gnorb assists in this process by using the Gnus registry to track
69 correspondences between emails and Org headings -- specifically,
70 message IDs are associated with Org heading ids. As a conversation
71 develops, messages are collected on a heading (and/or its children).
72 You can compose new messages directly from the Org heading, and Gnorb
73 will automatically associate your sent message with the conversation.
74 You can open Gnus *Summary* buffers holding all the messages
75 associated with an Org subtree, and reply from there -- these groups
76 can be made persistent, if you like. When you receive new messages
77 relevant to a conversation, Gnorb will notice them and prompt you to
78 associate them with the appropriate Org heading. Attachments on
79 incoming messages can be automatically saved as attachments on Org
80 headings, using org-attach.
81
82 In general, the goal is to keep track of whole conversations, reduce
83 friction when moving between Gnus and Org, and keep you in the Org
84 agenda rather than in Gnus.
85 ** Basic Usage
86 The following sections might be a bit confusing to read if you haven't
87 actually tried using Gnorb. If you don't want to dive in all the way
88 just yet, you can just dabble your toes. First set up email tracking
89 as specified in [[id:9da59609-bb3c-4970-88f6-bddca18d2ad4][Setup]], then do the following:
90
91 1. Add "%ug" somewhere appropriate in your `gnus-summary-line-format'
92 variable.
93 2. If you don't use a local archive method, add your sent message
94 groups to `gnorb-gnus-sent-groups' (see the docstring).
95 3. Use Org capture from Gnus summary buffers to create reminders for
96 emails you need to reply to.
97 4. Reply to those emails by pressing "C-c t" on the TODO heading in
98 either the Agenda, or in regular Org files.
99 5. If you ever get confused about what's associated with an Org
100 heading, press "C-c v" on the heading (works in either the Agenda,
101 or regular Org files).
102
103 That should be enough to get started.
104 ** Email-Related Commands
105 Email tracking starts in one of three ways:
106
107 1. With an Org heading that represents an email TODO. Call
108 `gnorb-org-handle-mail' (see below) on the heading to compose a new
109 message, and start the tracking process.
110 2. By calling org-capture on a received message. Any heading captured
111 from a message will automatically be associated with that message.
112 3. By calling `gnorb-gnus-outgoing-do-todo' in a message composition
113 buffer -- see below.
114
115 There are three main email-related commands:
116
117 1. `gnorb-org-handle-mail' is called on an Org heading to compose a
118 new message. By default, this will begin a reply to the most recent
119 message in the conversation. If there are no associated messages to
120 reply to (or you call the function with a single prefix arg), Gnorb
121 will look for mailto: or bbdb: links in the heading, and compose a
122 new message to them.
123
124 Calling the function with a double prefix arg will ignore all
125 associated messages and links, and compose a blank message.
126
127 Once sent, the message will be associated with the Org heading, and
128 you'll be brought back to the heading and asked to trigger an
129 action on it.
130
131 `gnorb-email-subtree' is an alternative entry-point to
132 `gnorb-org-handle-mail'. It does the same thing as the latter, but
133 first exports the body of the subtree as either text or a file,
134 then inserts the text into the message body, or attaches the file
135 to the message, respectively.
136 2. `gnorb-gnus-incoming-do-todo' is called on a message in a Gnus
137 *Summary* buffer. You'll be prompted for an Org heading, taken to
138 that heading, and asked to trigger an action on it.
139 3. `gnorb-gnus-outgoing-do-todo' is called in message mode, while
140 composing a new message.
141
142 If called without a prefix arg, a new Org heading will be created
143 after the message is sent, and the sent message associated with it.
144 The new heading will be created as a capture heading, using the
145 template specified by the `gnorb-gnus-new-todo-capture-key' option.
146
147 If you call this function with a single prefix arg, you'll be
148 prompted to choose an existing Org heading instead. After the the
149 message is sent, you'll be taken to that heading and prompted to
150 trigger an action on it.
151
152 If you've called this function, and then realize you've associated
153 the message with the wrong TODO, call it again with a double prefix
154 to clear all associations.
155
156 It's also possible to call this function *after* a message is sent,
157 in case you forgot. Gnorb saves information about the most recently
158 sent message for this purpose.
159
160 Because these three commands all express a similar intent, but are
161 called in different modes, it can make sense to give each of them the
162 same keybinding in the keymaps for Org mode, Gnus summary mode, and
163 Message mode.
164
165 An additional convenience command is available for use in Gnus summary
166 buffers: `gnorb-gnus-quick-reply'. If you don't want to go through the
167 whole round trip of triggering an action and then starting a new
168 reply, call this command on an incoming message to associate it with a
169 heading, start a reply, and associate your reply with the same
170 heading.
171 ** Trigger Actions
172 After calling `gnorb-gnus-incoming-do-todo' on a message, or after
173 sending a message associated with an Org heading, you'll be taken to
174 the heading and asked to "trigger an action" on it. At the moment
175 there are six different possibilities: triggering a TODO state-change
176 on the heading, taking a note on the heading (both these options will
177 associate the message with the heading), associating the message but
178 doing nothing else, capturing a new Org heading as a sibling to the
179 tracked heading, capturing a new Org heading as a child, and lastly,
180 doing nothing at all.
181
182 More actions may be added in the future; it's also possible to
183 rearrange or delete existing actions, and add your own: see the
184 docstring of `gnorb-org-trigger-actions'.
185 ** Viewing Tracked Messages in *Summary* Buffers
186 :PROPERTIES:
187 :END:
188 Call `gnorb-org-view' on an Org heading to open an nnir summary buffer
189 showing all the messages associated with that heading and child
190 headings (this requires you to have added an nngnorb server to your
191 Gnus backends). A minor mode is in effect, ensuring that any replies
192 you send to messages in this buffer will automatically be associated
193 with the original Org heading. You can also invoke
194 `gnorb-summary-disassociate-message' ("C-c d") to disassociate the
195 message with the Org heading.
196
197 If you call `gnorb-org-view' with a prefix argument, the search group
198 will be made persistent across Gnus sessions. You can re-run the
199 search and update the group contents by hitting "M-g" on the group in
200 the Gnus *Group* buffer.
201
202 As a bonus, it's possible to go into Gnus' *Server* buffer, find the
203 line specifying your nngnorb server, and hit "G" (aka
204 `gnus-group-make-nnir-group'). At the query prompt, enter an Org-style
205 tags-todo Agenda query string (eg "+work-computer", or what have you).
206 Gnorb will find all headings matching this query, scan their subtrees
207 for gnus links, and then give you a Summary buffer containing all the
208 linked messages. This is dog-slow at the moment; it will get faster.
209
210 ** Hinting in Gnus
211 :PROPERTIES:
212 :END:
213 When you receive new mails that might be relevant to existing Org
214 TODOs, Gnorb can alert you to that fact. When
215 `gnorb-gnus-hint-relevant-article' is t (the default), Gnorb will
216 display a message in the minibuffer when opening potentially relevant
217 messages. You can then use `gnorb-gnus-incoming-to-todo' to trigger an
218 action on the relevant TODO.
219
220 This hinting can happen in the Gnus summary buffer as well. If you use
221 the escape indicated by `gnorb-gnus-summary-mark-format-letter" as
222 part of your `gnus-summary-line-format', articles that may be relevant
223 to TODOs will be marked with a special character in the Summary
224 buffer, as determined by `gnorb-gnus-summary-mark'. By default, the
225 format letter is "g" (meaning it is used as "%ug" in the format line),
226 and the mark is "&" for messages that are already tracked, and "¡" for
227 messages that may be relevant.
228 ** Message Attachments
229 :PROPERTIES:
230 :END:
231 Gnorb simplifies the handling of attachments that you receive in
232 emails. When you call `gnorb-gnus-incoming-do-todo' on a message,
233 you'll be prompted to re-attach the email's attachments onto the Org
234 heading, using the org-attach library.
235
236 You can also do this as part of the capture process. Set the
237 new :gnus-attachments key to "t" in a capture template that you use on
238 mail messages, and you'll be queried to re-attach the message's
239 attachments onto the newly-captured heading. Or set
240 `gnorb-gnus-capture-always-attach' to "t" to have Gnorb do this for
241 all capture templates.
242
243 You can also do this using the regular system of MIME commands,
244 without invoking the email tracking process. See [[id:de1b2579-86c2-4bb1-b77e-3467a3d2b3c7][Suggested
245 Keybindings]], below.
246
247 The same process works in reverse: when you send a message from an Org
248 heading using `gnorb-org-handle-mail', Gnorb will ask if you want to
249 attach the files in the heading's org-attach directory to the outgoing
250 message.
251 ** Registry Usage
252 You can see how many associations you've got stored in the registry by
253 calling `gnorb-report-tracking-usage'. This will pop up a buffer
254 showing how much of the registry you're using, and offering
255 keybindings for `gnorb-flush-dead-associations', to help Gnorb clean
256 up after itself.
257 ** Likely Workflow
258 You receive an email from Jimmy, who wants to rent a room in your
259 house. "I'll respond to this later," you think.
260
261 You capture an Org TODO from the email, call it "Jimmy renting a
262 room", and give it a REPLY keyword. Gnorb quietly records the
263 correspondence between the email and the TODO, using the Gnus
264 registry.
265
266 The next day, looking at your Agenda, you see the TODO and decide to
267 respond to the email. You call `gnorb-org-handle-mail' on the heading,
268 and Gnorb opens Jimmy's email and starts a reply to it.
269
270 You tell Jimmy the room's available in March, and send the message.
271 Gnorb takes you back to the heading, and asks you to trigger an action
272 on it. You choose "todo state", and change the heading keyword to
273 WAIT.
274
275 Two days later, Jimmy replies to your message, saying that March is
276 perfect. When you open his response, Gnorb politely reminds you that
277 the message is relevant to an existing TODO. You call
278 `gnorb-gnus-incoming-do-todo' on the message, and are again taken to
279 the TODO and asked to trigger an action. Again you choose "todo
280 state", and change the heading keyword back to REPLY.
281
282 You get another email, from Samantha, warning you not to rent the room
283 to Jimmy. She even attaches a picture of a room in her house, as it
284 looked after Jimmy had stayed there for six months. It's bad. You call
285 `gnorb-gnus-incoming-do-todo' on her message, and pick the "Jimmy
286 renting a room" heading. This time, you choose "take note" as the
287 trigger action, and make a brief note about how bad that room looked.
288 Gnorb asks if you'd like to attach the picture to the Org heading. You
289 decide you will.
290
291 Now it's time to write to Jimmy and say something noncommittal.
292 Calling `gnorb-org-handle-mail' on the heading would respond to
293 Samantha's email, the most recent of the associated messages, which
294 isn't what you want. Instead you call `gnorb-org-view' on the heading,
295 which opens up a Gnus *Summary* buffer containing all four messages:
296 Jimmy's first, your response, his response to that, and Samantha's
297 message. You pick Jimmy's second email, and reply to it normally.
298 Gnorb asks if you'd like to send the picture of the room as an
299 attachment. You would not. When you send the reply Gnorb tracks that
300 as well, and does the "trigger an action" trick again.
301
302 In this way Gnorb helps you manage an entire conversation, possibly
303 with multiple threads and multiple participants. Mostly all you need
304 to do is call `gnorb-gnus-incoming-do-todo' on newly-received
305 messages, and `gnorb-org-handle-mail' on the heading when it's time to
306 compose a new reply.
307 * Restoring Window Layout
308 Many Gnorb functions alter the window layout and value of point. In
309 most of these cases, you can restore the previous layout using the
310 interactive function `gnorb-restore-layout'.
311
312 * Recent Mails From BBDB Contacts
313 :PROPERTIES:
314 :END:
315 If you're using a recent git version of BBDB (circa mid-May 2014 or
316 later), you can give your BBDB contacts a special field which will
317 collect links to recent emails from that contact. The default name of
318 the field is "messages", but you can customize that name using the
319 `gnorb-bbdb-messages-field' option.
320
321 Gnorb will not collect links by default: you need to call
322 `gnorb-bbdb-open-link' on a contact once to start the process.
323 Thereafter, opening mails from that contact will store a link to the
324 message.
325
326 Once some links are stored, `gnorb-bbdb-open-link' will open them: Use
327 a prefix arg to the function call to select particular messages to
328 open. There are several options controlling how all this works; see
329 the gnorb-bbdb user options section below for details.
330 * BBDB posting styles
331 :PROPERTIES:
332 :END:
333 Gnorb comes with a BBDB posting-style system, inspired by (copied
334 from) gnus-posting-styles. You can specify how messages are composed
335 to specific contacts, by matching on contact field values (the same
336 way gnus-posting-styles matches on group names). See the docstring of
337 `gnorb-bbdb-posting-styles' for details.
338
339 In order not to be too intrusive, Gnorb doesn't alter the behavior of
340 `bbdb-mail', the usual mail-composition function. Instead it provides
341 an alternate `gnorb-bbdb-mail', which does exactly the same thing, but
342 first processes the new mail according to `gnorb-bbdb-posting-styles'.
343 If you want to use this feature regularly, you can remap `bbdb-mail'
344 to `gnorb-bbdb-mail' in the `bbdb-mode-map'.
345 * BBDB Org tagging
346 BBDB contacts can be tagged with the same tags you use in your Org
347 files. This allows you to pop up a *BBDB* buffer alongside your Org
348 Agenda when searching for certain tags. This can happen automatically
349 for all Org tags-todo searches, if you set the option
350 `gnorb-org-agenda-popup-bbdb' to t. Or you can do it manually, by
351 calling the command of the same name. This command only shows TODOs by
352 default: use a prefix argument to show all tagged headings.
353
354 Tags are stored in an xfield named org-tags, by default. You can
355 customize the name of this field using `gnorb-bbdb-org-tag-field'.
356 * Misc BBDB
357 ** Searching for messages from BBDB contacts
358 :PROPERTIES:
359 :END:
360 Call `gnorb-bbdb-mail-search' to search for all mail messages from the
361 record(s) displayed. Currently supports the notmuch, mairix, and
362 namazu search backends; set `gnorb-gnus-mail-search-backend' to one of
363 those symbol values.
364 ** Citing BBDB contacts
365 :PROPERTIES:
366 :END:
367 Calling `gnorb-bbdb-cite-contact' will prompt for a BBDB record and
368 insert a string of the type "Bob Smith <bob@smith.com>".
369 ** User Options
370 - `gnorb-bbdb-org-tag-field :: The name of the BBDB xfield, as a
371 symbol, that holds Org-related tags. Specified as a string with
372 the ":" separator between tags, same as for Org headings.
373 Defaults to org-tag.
374 - `gnorb-bbdb-messages-field' :: The name of the BBDB xfield that
375 holds links to recently-received messages from this contact.
376 Defaults to 'messages.
377 - `gnorb-bbdb-collect-N-messages' :: Collect at most this many links
378 to messages from this contact. Defaults to 5.
379 - `gnorb-bbdb-define-recent' :: What does "recently-received" mean?
380 Possible values are the symbols seen and received. When set to
381 seen, the most recently-opened messages are collected. When set
382 to received, the most recently-received (by Date header) messages
383 are collected. Defaults to seen.
384 - `gnorb-bbdb-message-link-format-multi' :: How is a single message's
385 link formatted in the multi-line BBDB layout format? Defaults to
386 "%:count. %D: %:subject" (see the docstring for details).
387 - ` gnorb-bbdb-message-link-format-one' :: How is a single message's
388 link formatted in the one-line BBDB layout format? Defaults to
389 nil (see the docstring for details).
390 - `gnorb-bbdb-posting-styles' :: Styles to use for influencing the
391 format of mails composed to the BBDB record(s) under point (see
392 the docstring for details).
393 * Misc Org
394 ** Inserting BBDB links
395 :PROPERTIES:
396 :END:
397 Calling `gnorb-org-contact-link' will prompt for a BBDB record and
398 insert an Org link to that record at point.
399 ** User Options
400 - `gnorb-org-after-message-setup-hook' :: Hook run in a message buffer
401 after setting up the message, from `gnorb-org-handle-mail' or
402 `gnorb-org-email-subtree'.
403 - `gnorb-org-trigger-actions' :: List of potential actions that can be
404 taken on headings after a message is sent. See docstring for
405 details.
406 - `gnorb-org-mail-scan-scope' :: The number of paragraphs to scan for
407 mail-related links. This comes into play when calling
408 `gnorb-org-handle-mail' on a heading with no associated messages,
409 or when `gnorb-org-handle-mail' is called with a prefix arg.
410 - `gnorb-org-find-candidates-match' :: When searching all Org files
411 for headings to collect messages from, this option can limit
412 which headings are searched. It is used as the second argument to
413 a call to `org-map-entries', and has the same syntax as that used
414 in an agenda tags view.
415 - `gnorb-org-email-subtree-text-parameters' :: A plist of export
416 parameters corresponding to the EXT-PLIST argument to the export
417 functions, for use when exporting to text.
418 - `gnorb-org-email-subtree-file-parameters' :: A plist of export
419 parameters corresponding to the EXT-PLIST argument to the export
420 functions, for use when exporting to a file.
421 - `gnorb-org-email-subtree-text-options' :: A list of ts and nils
422 corresponding to Org's export options, to be used when exporting
423 to text. The options, in order, are async, subtreep,
424 visible-only, and body-only.
425 - `gnorb-org-email-subtree-file-options' :: A list of ts and nils
426 corresponding to Org's export options, to be used when exporting
427 to a file. The options, in order, are async, subtreep,
428 visible-only, and body-only.
429 - `gnorb-org-export-extensions' :: Correspondence between export
430 backends and their respective (usual) file extensions.
431 - `gnorb-org-capture-collect-link-p' :: When this is set to t, the
432 capture process will always store a link to the Gnus message or
433 BBDB record under point, even when the link isn't part of the
434 capture template. It can then be added to the captured heading
435 with org-insert-link, as usual.
436 - `gnorb-org-agenda-popup-bbdb' :: Set to "t" to automatically pop up
437 the BBDB buffer displaying records corresponding to the Org
438 Agenda tags search underway. If this is nil you can always do it
439 manually with the command of the same name.
440 - `gnorb-org-bbdb-popup-layout' :: Controls the layout of the
441 Agenda-related BBDB popup, takes the same values as
442 bbdb-pop-up-layout.
443 * Misc Gnus
444 ** Viewing Org headlines relevant to a message
445 :PROPERTIES:
446 :END:
447 Call `gnorb-gnus-view' on a message that is associated with an Org
448 heading to jump to that heading.
449 ** User Options
450 - `gnorb-gnus-mail-search-backend' :: Specifies the search backend
451 that you use for searching mails. Currently supports notmuch,
452 mairix, and namazu: set this option to one of those symbols.
453 - `gnorb-gnus-capture-always-attach' :: Treat all capture templates as
454 if they had the :gnus-attachments key set to "t". This only has
455 any effect if you're capturing from a Gnus summary or article
456 buffer.
457 - `gnorb-trigger-todo-default' :: Set to either 'note or 'todo to tell
458 `gnorb-gnus-incoming-do-todo' what to do by default. You can
459 reach the non-default behavior by calling that function with a
460 prefix argument. Alternately, set to 'prompt to always prompt for
461 the appropriate action.
462 - `gnorb-gnus-trigger-refile-targets' :: If you use
463 `gnorb-gnus-incoming-do-todo' on an incoming message, Gnorb will
464 try to locate a TODO heading that's relevant to that message. If
465 it can't, it will prompt you for one, using the refile interface.
466 This option will be used as the value of `org-refile-targets'
467 during that process: see the docstring of `org-refile-targets'
468 for the appropriate syntax.
469 - `gnorb-gnus-new-todo-capture-key' :: Set this to a single-character
470 string pointing at an Org capture template to use when creating
471 TODOs from outgoing messages. The template is a regular capture
472 template, with a few exceptions. If Gnus helps you archive
473 outgoing messages (ie you have `gnus-message-archive-group' set
474 to something, and your outgoing messages have a "Fcc" header), a
475 link to that message will be made, and you'll be able to use all
476 the escapes related to gnus messages. If you don't archive
477 outgoing messages, you'll still be able to use the %:subject,
478 %:to, %:toname, %:toaddress, and %:date escapes in the capture
479 template.
480 - `gnorb-gnus-hint-relevant-article' :: Set to "t" (the default) to
481 have Gnorb give you a hint in the minibuffer when opening
482 messages that might be relevant to existing Org TODOs.
483 - `gnorb-gnus-summary-mark-format-letter' :: The formatting letter to
484 use as part of your `gnus-summary-line-format', to indicate
485 messages which might be relevant to Org TODOs. Defaults to "g",
486 meaning it should be used as "%ug" in the format line.
487 - `gnorb-gnus-summary-mark' :: The mark used to indicate potentially
488 relevant messages in the Summary buffer, when
489 `gnorb-gnus-summary-mark-format-letter' is present in the format
490 line. Defaults to "¡".
491 - `gnorb-gnus-summary-tracked-mark' :: The mark used to indicate
492 already-tracked messages in the Summary buffer, when
493 `gnorb-gnus-summary-mark-format-letter' is present in the format
494 line. Defaults to "&".
495 * Suggested Keybindings
496 :PROPERTIES:
497 :ID: de1b2579-86c2-4bb1-b77e-3467a3d2b3c7
498 :END:
499 #+BEGIN_SRC emacs-lisp
500 (eval-after-load "gnorb-bbdb"
501 '(progn
502 (define-key bbdb-mode-map (kbd "O") 'gnorb-bbdb-tag-agenda)
503 (define-key bbdb-mode-map (kbd "S") 'gnorb-bbdb-mail-search)
504 (define-key bbdb-mode-map [remap bbdb-mail] 'gnorb-bbdb-mail)
505 (define-key bbdb-mode-map (kbd "l") 'gnorb-bbdb-open-link)
506 (global-set-key (kbd "C-c C") 'gnorb-bbdb-cite-contact)))
507
508 (eval-after-load "gnorb-org"
509 '(progn
510 (org-defkey org-mode-map (kbd "C-c C") 'gnorb-org-contact-link)
511 (org-defkey org-mode-map (kbd "C-c t") 'gnorb-org-handle-mail)
512 (org-defkey org-mode-map (kbd "C-c e") 'gnorb-org-view)
513 (org-defkey org-mode-map (kbd "C-c E") 'gnorb-org-email-subtree)
514 (org-defkey org-mode-map (kbd "C-c V") 'gnorb-org-popup-bbdb)
515 (setq gnorb-org-agenda-popup-bbdb t)
516 (eval-after-load "org-agenda"
517 '(progn (org-defkey org-agenda-mode-map (kbd "C-c t") 'gnorb-org-handle-mail)
518 (org-defkey org-agenda-mode-map (kbd "C-c v") 'gnorb-org-popup-bbdb)
519 (org-defkey org-agenda-mode-map (kbd "V") 'gnorb-org-view)))))
520
521 (eval-after-load "gnorb-gnus"
522 '(progn
523 (define-key gnus-summary-mime-map "a" 'gnorb-gnus-article-org-attach)
524 (define-key gnus-summary-mode-map (kbd "C-c t") 'gnorb-gnus-incoming-do-todo)
525 (push '("attach to org heading" . gnorb-gnus-mime-org-attach)
526 gnus-mime-action-alist)
527 ;; The only way to add mime button command keys is by redefining
528 ;; gnus-mime-button-map, possibly not ideal. Ideal would be a
529 ;; setter function in gnus itself.
530 (push '(gnorb-gnus-mime-org-attach "a" "Attach to Org heading")
531 gnus-mime-button-commands)
532 (setq gnus-mime-button-map
533 (let ((map (make-sparse-keymap)))
534 (define-key map gnus-mouse-2 'gnus-article-push-button)
535 (define-key map gnus-down-mouse-3 'gnus-mime-button-menu)
536 (dolist (c gnus-mime-button-commands)
537 (define-key map (cadr c) (car c)))
538 map))))
539
540 (eval-after-load "message"
541 '(progn
542 (define-key message-mode-map (kbd "C-c t") 'gnorb-gnus-outgoing-do-todo)))
543 #+END_SRC