annotate lisp/org/org-mhe.el @ 99849:621e15919df0

2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-dblock-write:clocktable): Make sure the clocktable sees the first line. (org-clock-in): Warn if the clock cannot be resumed. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-open-at-point): Fix mixup about interactive and non-interactive elisp links. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-preprocess-string): Allow one comment line before the first headline to always be included. This is to not miss a commented target. * org-mouse.el (org-mouse-insert-item): Call `org-indent-to-column' instead of `indent-to', for XEmacs compatibility. * org.el (org-refile-targets): Fix customize definition so that it works also in XEmacs. (org-fixup-indentation): Call `org-indent-to-column' instead of `indent-to', for XEmacs compatibility. 2008-11-23 Tokuya Kameshima <kames@fa2.so-net.ne.jp> * org-mew.el (org-mew-store-link): Get the correct case folder for refiled messages. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-as-ascii): Remove the "\\" forced line break indicators. * org.el (org-ido-completing-read): Remove the "i:" prefix for ido-completion propts. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org-remember.el (org-remember-apply-template): Use `org-substring-no-properties'. * org-compat.el (org-substring-no-properties): New function. * org-remember.el (org-remember-apply-template): Use `org-substring-no-properties' for compatibility. * org-list.el (org-list-two-spaces-after-bullet-regexp): New option. (org-fix-bullet-type): respect `org-list-two-spaces-after-bullet-regexp'. * org-clock.el (org-clock-load): Clean up the code. * org.el (org-adaptive-fill-function): Allow two spaces after "1." as a list bullet. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-save, org-clock-load): Check for live buffers, existing files, and buffer file names to ensure consistent information. (org-clock-persist): Make `clock' a special value of this variable, and improve docstring. * org-list.el (org-cycle-list-bullet, org-fix-bullet-type) (org-get-string-indentation): Adapt indentation when the bullet width changes. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org-remember.el (org-remember-finalize): Make interactive. (org-remember-kill): New command. (org-remember-finish-immediately): Call `org-remember-finalize' directly. (org-remember-finalize): Make `org-remember-finalize' an interactive function. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org-remember.el (org-remember-apply-template): No ido completion for free prompts in remember templates. (org-remember-before-finalize-hook): New hook. (org-remember-mode): New minor mode. (org-remember-apply-template): Turn on `org-remember-mode'. * org-id.el (org-id-add-location): Avoid error when no file is given. * org-remember.el (org-remember-apply-template): Fix the way how the list of allowed properties is retrieved from the target file. * org.el (org-insert-link): Improve file link matching. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org-colview.el (org-columns-display-here): New argument DATELINE, to trigger using the new face. (org-agenda-colview-summarize): Call `org-columns-display-here' with the new argument. * org-faces.el (org-agenda-column-dateline): New face. * org-publish.el (org-publish-org-index): Use index-title at page title, not as section. * org-exp.el (org-export-html-format-desc): Respect the org-protect property. (org-export-as-html): Protect image specifiers that are in the description part of a link. * org.el (org-sort-entries-or-items, org-completing-read) (org-refile-get-location, org-olpath-completing-read, org-todo) (org-show-todo-tree, org-sparse-tree, org-make-tags-matcher) (org-set-tags, org-change-tag-in-region, org-fast-tag-selection) (org-set-property, org-delete-property) (org-delete-property-globally): Use `org-ido-completing-read'. * org-remember.el (org-remember-apply-template): Use `org-ido-completing-read'. * org-publish.el (org-publish): Use `org-ido-completing-read'. * org-colview.el (org-columns-edit-value, org-columns-new) (org-insert-columns-dblock): Use `org-ido-completing-read'. * org-colview-xemacs.el (org-columns-edit-value) (org-columns-new, org-insert-columns-dblock): Use `org-ido-completing-read'. * org-attach.el (org-attach-delete-one, org-attach-open): Use `org-ido-completing-read'. * org-agenda.el (org-todo-list, org-agenda-filter-by-tag): Use `org-ido-completing-read'. * org.el (org-time-today): New function. (org-matcher-time): Use `org-time-today'. Add special treatment for "<tomorrow>" and "<yesterday>". (org-ido-completing-read): New function. (org-completion-use-ido): New option. * org-exp.el (org-export-format-source-code): Fix bug in require htmlize code. (org-export-target-internal-links): Fix bug in search for text property. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org-export-latex.el (org-export-latex-subcontent): Interprete target aliases as additonal labels. * org-exp.el (org-export-target-aliases): New variable. (org-export-preprocess-string) (org-export-handle-invisible-targets): Fill the alias alist. (org-export-as-html): Remove the &nbsp; from the anchor, and also assign an id. (org-html-level-start): Insert the target aliases as additonal anchors. * org.el (org-edit-fixed-width-region): Fix bug when starting a new picture area. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-open-at-mouse): Ensure correct link abbreviations when following a link with the mouse from the agenda. * org-exp.el (org-export-as-html): Avoid lone </div> when no headlines are created. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-link-translation-function): New option. (org-open-at-point): Call `org-link-translation-function' if non-nil. (org-translate-link): New function. (org-translate-link-from-planner): New function. (org-open-at-point): Allow interactive commands in elisp links. * org-exp.el (org-icalendar-cleanup-string): Restore the old iCalendar quoting. The new one seems to caus problems with applications. * org.el (org-yank): Set `this-command' to `yank', so that `yank-pop' will work. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-icalendar-cleanup-string): Improve RFC2455 compliance as far as quoting is concerned. * org.el (org-link-expand-abbrev): Implement %h as an escape for a hexified version of the tag. * org-vm.el (org-vm-follow-link): Require `vm-search'. * org.el (org-up-heading-safe, org-forward-same-level): Always call `org-back-to-heading' instead of `outline-back-to-heading'. (org-back-to-heading): New wrapper around outline-back-to-heading, with a useful error message telling where the error happened. * org-list.el (org-update-checkbox-count): Always call `org-back-to-heading' instead of `outline-back-to-heading'. * org-exp.el (org-export-as-html): Make sure that each <img> tag has an `alt' attribute, to ensure XHTML validation. 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com> * org-publish.el (org-publish-attachment): Allow publishing to overwrite attachment files. * org-agenda.el (org-agenda-timerange-leaders): New option. (org-agenda-get-blocks): Use `org-agenda-timerange-leaders'. * org.el (org-edit-src-exit): Untabify ASCII image before returning.
author Carsten Dominik <dominik@science.uva.nl>
date Sun, 23 Nov 2008 13:37:44 +0000
parents e3acb52d33e1
children 57447f70a253
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
94414
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
1 ;;; org-mhe.el --- Support for links to MH-E messages from within Org-mode
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
2
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
4
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
5 ;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
6 ;; Keywords: outlines, hypermedia, calendar, wp
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
7 ;; Homepage: http://orgmode.org
99849
621e15919df0 2008-11-23 Carsten Dominik <carsten.dominik@gmail.com>
Carsten Dominik <dominik@science.uva.nl>
parents: 99501
diff changeset
8 ;; Version: 6.13
94414
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
9 ;;
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
11 ;;
94676
ba3167bc4143 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94441
diff changeset
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
94414
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
94676
ba3167bc4143 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94441
diff changeset
14 ;; the Free Software Foundation, either version 3 of the License, or
ba3167bc4143 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94441
diff changeset
15 ;; (at your option) any later version.
94414
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
16
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
20 ;; GNU General Public License for more details.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
21
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
94676
ba3167bc4143 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94441
diff changeset
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
94414
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
24 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
25 ;;
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
26 ;;; Commentary:
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
27
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
28 ;; This file implements links to MH-E messages from within Org-mode.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
29 ;; Org-mode loads this module by default - if this is not what you want,
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
30 ;; configure the variable `org-modules'.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
31
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
32 ;;; Code:
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
33
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
34 (require 'org)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
35
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
36 ;; Customization variables
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
37
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
38 (defcustom org-mhe-search-all-folders nil
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
39 "Non-nil means the search for the mh-message may extend to all folders.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
40 When non-nil, the search for a message will extend to all other
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
41 folders if it cannot be found in the folder given in the link.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
42 Searching all folders may be slow with the default pick based
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
43 search but is very efficient with one of the other search engines
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
44 supported by MH-E."
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
45 :group 'org-link-follow
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
46 :type 'boolean)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
47
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
48 ;; Declare external functions and variables
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
49 (declare-function mh-display-msg "mh-show" (msg-num folder-name))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
50 (declare-function mh-find-path "mh-utils" ())
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
51 (declare-function mh-get-header-field "mh-utils" (field))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
52 (declare-function mh-get-msg-num "mh-utils" (error-if-no-message))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
53 (declare-function mh-header-display "mh-show" ())
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
54 (declare-function mh-index-previous-folder "mh-search" ())
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
55 (declare-function mh-normalize-folder-name "mh-utils"
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
56 (folder &optional empty-string-okay dont-remove-trailing-slash
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
57 return-nil-if-folder-empty))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
58 (declare-function mh-search "mh-search"
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
59 (folder search-regexp &optional redo-search-flag
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
60 window-config))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
61 (declare-function mh-search-choose "mh-search" (&optional searcher))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
62 (declare-function mh-show "mh-show" (&optional message redisplay-flag))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
63 (declare-function mh-show-buffer-message-number "mh-comp" (&optional buffer))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
64 (declare-function mh-show-header-display "mh-show" t t)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
65 (declare-function mh-show-msg "mh-show" (msg))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
66 (declare-function mh-show-show "mh-show" t t)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
67 (declare-function mh-visit-folder "mh-folder" (folder &optional
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
68 range index-data))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
69 (defvar mh-progs)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
70 (defvar mh-current-folder)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
71 (defvar mh-show-folder-buffer)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
72 (defvar mh-index-folder)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
73 (defvar mh-searcher)
96044
c1ef445563bb 2008-06-17 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents: 94676
diff changeset
74 (defvar mh-search-regexp-builder)
94414
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
75
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
76 ;; Install the link type
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
77 (org-add-link-type "mhe" 'org-mhe-open)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
78 (add-hook 'org-store-link-functions 'org-mhe-store-link)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
79
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
80 ;; Implementation
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
81 (defun org-mhe-store-link ()
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
82 "Store a link to an MH-E folder or message."
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
83 (when (or (equal major-mode 'mh-folder-mode)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
84 (equal major-mode 'mh-show-mode))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
85 (let ((from (org-mhe-get-header "From:"))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
86 (to (org-mhe-get-header "To:"))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
87 (message-id (org-mhe-get-header "Message-Id:"))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
88 (subject (org-mhe-get-header "Subject:"))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
89 link desc)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
90 (org-store-link-props :type "mh" :from from :to to
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
91 :subject subject :message-id message-id)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
92 (setq desc (org-email-link-description))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
93 (setq link (org-make-link "mhe:" (org-mhe-get-message-real-folder) "#"
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
94 (org-remove-angle-brackets message-id)))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
95 (org-add-link-props :link link :description desc)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
96 link)))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
97
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
98 (defun org-mhe-open (path)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
99 "Follow an MH-E message link specified by PATH."
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
100 (let (folder article)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
101 (if (not (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
102 (error "Error in MH-E link"))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
103 (setq folder (match-string 1 path)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
104 article (match-string 3 path))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
105 (org-mhe-follow-link folder article)))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
106
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
107 ;;; mh-e integration based on planner-mode
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
108 (defun org-mhe-get-message-real-folder ()
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
109 "Return the name of the real folder for the current message.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
110 So if you use sequences, it will now work."
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
111 (save-excursion
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
112 (let* ((folder
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
113 (if (equal major-mode 'mh-folder-mode)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
114 mh-current-folder
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
115 ;; Refer to the show buffer
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
116 mh-show-folder-buffer))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
117 (end-index
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
118 (if (boundp 'mh-index-folder)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
119 (min (length mh-index-folder) (length folder))))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
120 )
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
121 ;; a simple test on mh-index-data does not work, because
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
122 ;; mh-index-data is always nil in a show buffer.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
123 (if (and (boundp 'mh-index-folder)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
124 (string= mh-index-folder (substring folder 0 end-index)))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
125 (if (equal major-mode 'mh-show-mode)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
126 (save-window-excursion
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
127 (let (pop-up-frames)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
128 (when (buffer-live-p (get-buffer folder))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
129 (progn
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
130 (pop-to-buffer folder)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
131 (org-mhe-get-message-folder-from-index)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
132 )
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
133 )))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
134 (org-mhe-get-message-folder-from-index)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
135 )
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
136 folder
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
137 )
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
138 )))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
139
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
140 (defun org-mhe-get-message-folder-from-index ()
96044
c1ef445563bb 2008-06-17 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents: 94676
diff changeset
141 "Return the name of the message folder in an index folder buffer."
94414
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
142 (save-excursion
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
143 (mh-index-previous-folder)
96044
c1ef445563bb 2008-06-17 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents: 94676
diff changeset
144 (if (re-search-forward "^\\(+.*\\)$" nil t)
c1ef445563bb 2008-06-17 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents: 94676
diff changeset
145 (message "%s" (match-string 1)))))
94414
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
146
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
147 (defun org-mhe-get-message-folder ()
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
148 "Return the name of the current message folder.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
149 Be careful if you use sequences."
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
150 (save-excursion
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
151 (if (equal major-mode 'mh-folder-mode)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
152 mh-current-folder
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
153 ;; Refer to the show buffer
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
154 mh-show-folder-buffer)))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
155
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
156 (defun org-mhe-get-message-num ()
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
157 "Return the number of the current message.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
158 Be careful if you use sequences."
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
159 (save-excursion
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
160 (if (equal major-mode 'mh-folder-mode)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
161 (mh-get-msg-num nil)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
162 ;; Refer to the show buffer
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
163 (mh-show-buffer-message-number))))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
164
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
165 (defun org-mhe-get-header (header)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
166 "Return the field for HEADER of the message in folder mode.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
167 This will create a show buffer for the corresponding message. If
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
168 you have a better idea of how to do this then please let us know."
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
169 (let* ((folder (org-mhe-get-message-folder))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
170 (num (org-mhe-get-message-num))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
171 (buffer (get-buffer-create (concat "show-" folder)))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
172 (header-field))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
173 (with-current-buffer buffer
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
174 (mh-display-msg num folder)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
175 (if (equal major-mode 'mh-folder-mode)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
176 (mh-header-display)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
177 (mh-show-header-display))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
178 (set-buffer buffer)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
179 (setq header-field (mh-get-header-field header))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
180 (if (equal major-mode 'mh-folder-mode)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
181 (mh-show)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
182 (mh-show-show))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
183 header-field)))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
184
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
185 (defun org-mhe-follow-link (folder article)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
186 "Follow an MH-E link to FOLDER and ARTICLE.
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
187 If ARTICLE is nil FOLDER is shown. If the configuration variable
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
188 `org-mhe-search-all-folders' is t and `mh-searcher' is pick,
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
189 ARTICLE is searched in all folders. Indexed searches (swish++,
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
190 namazu, and others supported by MH-E) will always search in all
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
191 folders."
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
192 (require 'mh-e)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
193 (require 'mh-search)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
194 (require 'mh-utils)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
195 (mh-find-path)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
196 (if (not article)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
197 (mh-visit-folder (mh-normalize-folder-name folder))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
198 (mh-search-choose)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
199 (if (equal mh-searcher 'pick)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
200 (progn
96044
c1ef445563bb 2008-06-17 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents: 94676
diff changeset
201 (setq article (org-add-angle-brackets article))
94414
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
202 (mh-search folder (list "--message-id" article))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
203 (when (and org-mhe-search-all-folders
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
204 (not (org-mhe-get-message-real-folder)))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
205 (kill-this-buffer)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
206 (mh-search "+" (list "--message-id" article))))
96044
c1ef445563bb 2008-06-17 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents: 94676
diff changeset
207 (if mh-search-regexp-builder
c1ef445563bb 2008-06-17 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents: 94676
diff changeset
208 (mh-search "+" (funcall mh-search-regexp-builder
c1ef445563bb 2008-06-17 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents: 94676
diff changeset
209 (list (cons 'message-id article))))
c1ef445563bb 2008-06-17 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents: 94676
diff changeset
210 (mh-search "+" article)))
94414
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
211 (if (org-mhe-get-message-real-folder)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
212 (mh-show-msg 1)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
213 (kill-this-buffer)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
214 (error "Message not found"))))
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
215
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
216 (provide 'org-mhe)
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
217
94441
da5141d2e8fc Add arch tagline
Miles Bader <miles@gnu.org>
parents: 94414
diff changeset
218 ;; arch-tag: dcb05484-8627-491d-a8c1-01dbd2bde4ae
96044
c1ef445563bb 2008-06-17 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents: 94676
diff changeset
219
94414
d86cb59eea9f 2008-04-27 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
diff changeset
220 ;;; org-mhe.el ends here