comparison lisp/org/org-gnus.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
comparison
equal deleted inserted replaced
99848:80e53e313ff5 99849:621e15919df0
1 ;;; org-gnus.el --- Support for links to Gnus groups and messages from within Org-mode 1 ;;; org-gnus.el --- Support for links to Gnus groups and messages from within Org-mode
2 2
3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4 4
5 ;; Author: Carsten Dominik <carsten at orgmode dot org> 5 ;; Author: Carsten Dominik <carsten at orgmode dot org>
6 ;; Tassilo Horn <tassilo at member dot fsf dot org>
6 ;; Keywords: outlines, hypermedia, calendar, wp 7 ;; Keywords: outlines, hypermedia, calendar, wp
7 ;; Homepage: http://orgmode.org 8 ;; Homepage: http://orgmode.org
8 ;; Version: 6.12a 9 ;; Version: 6.13
9 ;; 10 ;;
10 ;; This file is part of GNU Emacs. 11 ;; This file is part of GNU Emacs.
11 ;; 12 ;;
12 ;; GNU Emacs is free software: you can redistribute it and/or modify 13 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by 14 ;; it under the terms of the GNU General Public License as published by
35 (eval-when-compile 36 (eval-when-compile
36 (require 'gnus-sum)) 37 (require 'gnus-sum))
37 38
38 ;; Customization variables 39 ;; Customization variables
39 40
40 (defcustom org-usenet-links-prefer-google nil 41 (when (fboundp 'defvaralias)
42 (defvaralias 'org-usenet-links-prefer-google 'org-gnus-prefer-web-links
43 "Deprecated name for `org-gnus-prefer-web-links'."))
44
45 (defcustom org-gnus-prefer-web-links nil
41 "Non-nil means, `org-store-link' will create web links to Google groups. 46 "Non-nil means, `org-store-link' will create web links to Google groups.
42 When nil, Gnus will be used for such links. 47 When nil, Gnus will be used for such links.
43 Using a prefix arg to the command \\[org-store-link] (`org-store-link') 48 Using a prefix arg to the command \\[org-store-link] (`org-store-link')
44 negates this setting for the duration of the command." 49 negates this setting for the duration of the command."
45 :group 'org-link-store 50 :group 'org-link-store
55 ;; Install the link type 60 ;; Install the link type
56 (org-add-link-type "gnus" 'org-gnus-open) 61 (org-add-link-type "gnus" 'org-gnus-open)
57 (add-hook 'org-store-link-functions 'org-gnus-store-link) 62 (add-hook 'org-store-link-functions 'org-gnus-store-link)
58 63
59 ;; Implementation 64 ;; Implementation
65
66 (defun org-gnus-group-link (group)
67 "Create a link to the Gnus group GROUP.
68 If GROUP is a newsgroup and `org-gnus-prefer-web-links' is
69 non-nil, create a link to groups.google.com or gmane.org.
70 Otherwise create a link to the group inside Gnus.
71
72 If `org-store-link' was called with a prefix arg the meaning of
73 `org-gnus-prefer-web-links' is reversed."
74 (let ((unprefixed-group (replace-regexp-in-string "^[^:]+:" "" group)))
75 (if (and (string-match "^nntp" group) ;; Only for nntp groups
76 (org-xor current-prefix-arg
77 org-gnus-prefer-web-links))
78 (concat (if (string-match "gmane" unprefixed-group)
79 "http://news.gmane.org/"
80 "http://groups.google.com/group/")
81 unprefixed-group)
82 (concat "gnus:" group))))
83
84 (defun org-gnus-article-link (group newsgroups message-id x-no-archive)
85 "Create a link to a Gnus article.
86 The article is specified by its MESSAGE-ID. Additional
87 parameters are the Gnus GROUP, the NEWSGROUPS the article was
88 posted to and the X-NO-ARCHIVE header value of that article.
89
90 If GROUP is a newsgroup and `org-gnus-prefer-web-links' is
91 non-nil, create a link to groups.google.com or gmane.org.
92 Otherwise create a link to the article inside Gnus.
93
94 If `org-store-link' was called with a prefix arg the meaning of
95 `org-gnus-prefer-web-links' is reversed."
96 (if (and (org-xor current-prefix-arg org-gnus-prefer-web-links)
97 newsgroups ;; Make web links only for nntp groups
98 (not x-no-archive)) ;; and if X-No-Archive isn't set.
99 (format (if (string-match "gmane\\." newsgroups)
100 "http://mid.gmane.org/%s"
101 "http://groups.google.com/groups/search?as_umsgid=%s")
102 (org-fixup-message-id-for-http
103 (replace-regexp-in-string "[<>]" "" message-id)))
104 (org-make-link "gnus:" group "#" message-id)))
105
60 (defun org-gnus-store-link () 106 (defun org-gnus-store-link ()
61 "Store a link to a Gnus folder or message." 107 "Store a link to a Gnus folder or message."
62 (cond 108 (cond
63 ((eq major-mode 'gnus-group-mode) 109 ((eq major-mode 'gnus-group-mode)
64 (let ((group (cond ((fboundp 'gnus-group-group-name) ; depending on Gnus 110 (let* ((group (cond ((fboundp 'gnus-group-group-name) ; depending on Gnus
65 (gnus-group-group-name)) ; version 111 (gnus-group-group-name)) ; version
66 ((fboundp 'gnus-group-name) 112 ((fboundp 'gnus-group-name)
67 (gnus-group-name)) 113 (gnus-group-name))
68 (t "???"))) 114 (t "???")))
69 desc link) 115 desc link)
70 (unless group (error "Not on a group")) 116 (unless group (error "Not on a group"))
71 (org-store-link-props :type "gnus" :group group) 117 (org-store-link-props :type "gnus" :group group)
72 (setq desc (concat 118 (setq desc (org-gnus-group-link group)
73 (if (org-xor current-prefix-arg
74 org-usenet-links-prefer-google)
75 "http://groups.google.com/groups?group="
76 "gnus:")
77 group)
78 link (org-make-link desc)) 119 link (org-make-link desc))
79 (org-add-link-props :link link :description desc) 120 (org-add-link-props :link link :description desc)
80 link)) 121 link))
81 122
82 ((memq major-mode '(gnus-summary-mode gnus-article-mode)) 123 ((memq major-mode '(gnus-summary-mode gnus-article-mode))
83 (and (eq major-mode 'gnus-article-mode) (gnus-article-show-summary)) 124 (and (eq major-mode 'gnus-summary-mode) (gnus-summary-show-article))
84 (let* ((group gnus-newsgroup-name) 125 (let* ((group gnus-newsgroup-name)
85 (article (gnus-summary-article-number)) 126 (header (with-current-buffer gnus-article-buffer
86 (header (gnus-summary-article-header article)) 127 (gnus-summary-toggle-header 1)
87 (from (mail-header-from header)) 128 (goto-char (point-min))
88 (message-id (mail-header-id header)) 129 (mail-header-extract-no-properties)))
89 (date (mail-header-date header)) 130 (from (mail-header 'from header))
90 (extra (mail-header-extra header)) 131 (message-id (mail-header 'message-id header))
91 (to (cdr (assoc 'To extra))) 132 (date (mail-header 'date header))
133 (to (mail-header 'to header))
134 (newsgroups (mail-header 'newsgroups header))
135 (x-no-archive (mail-header 'x-no-archive header))
92 (subject (gnus-summary-subject-string)) 136 (subject (gnus-summary-subject-string))
93 desc link) 137 desc link)
94 (org-store-link-props :type "gnus" :from from :subject subject 138 (org-store-link-props :type "gnus" :from from :subject subject
95 :message-id message-id :group group :to to) 139 :message-id message-id :group group :to to)
96 (setq desc (org-email-link-description)) 140 (setq desc (org-email-link-description)
97 (if (org-xor current-prefix-arg org-usenet-links-prefer-google) 141 link (org-gnus-article-link group newsgroups message-id x-no-archive))
98 (setq link
99 (format "http://groups.google.com/groups?as_umsgid=%s"
100 (org-fixup-message-id-for-http message-id)))
101 (setq link (org-make-link "gnus:" group "#"
102 (or message-id
103 (number-to-string article)))))
104 (org-add-link-props :link link :description desc) 142 (org-add-link-props :link link :description desc)
105 link)))) 143 link))))
106 144
107 (defun org-gnus-open (path) 145 (defun org-gnus-open (path)
108 "Follow the Gnus message or folder link specified by PATH." 146 "Follow the Gnus message or folder link specified by PATH."