From: John Wiegley <johnw@newartisans.com>
To: emacs-orgmode@gnu.org
Subject: Fix to org-nnml.el
Date: Sun, 30 Sep 2007 21:25:03 -0400 [thread overview]
Message-ID: <m21wcfvd74.fsf@newartisans.com> (raw)
I found that org-nnml doesn't quite work when you go to visit the links! This
is fixed in version 1.1, pasted below. To make this work, make sure to search
through your org-mode file for occurences of "nnml://" to "nnml:".
John
;;; org-nnml.el - Support for links to nnml messages by Message-ID
;; version 1.1, by John Wiegley <johnw@gnu.org>
(require 'org)
(eval-when-compile
(require 'nnml)
(require 'gnus-sum))
(org-add-link-type "nnml" 'org-nnml-open)
(add-hook 'org-store-link-functions 'org-nnml-store-link)
(defun org-nnml-open (message-id)
"Visit the nnml message with the given Message-ID."
(let ((info (nnml-find-group-number message-id)))
(gnus-summary-read-group (concat "nnml:" (car info)) 100 t)
(gnus-summary-goto-article (cdr info) nil t)))
(defun org-nnml-store-link ()
"Store a link to an nnml e-mail message by Message-ID."
(when (memq major-mode '(gnus-summary-mode gnus-article-mode))
(and (eq major-mode 'gnus-article-mode) (gnus-article-show-summary))
(let* ((article (gnus-summary-article-number))
(header (gnus-summary-article-header article))
(message-id (mail-header-id header)))
(if (eq (aref message-id 0) ?\<)
(setq message-id
(substring message-id 1 (1- (length message-id)))))
(org-store-link-props
:type "nnml"
:link (cons (concat "nnml:" message-id)
(concat "nnml:" message-id))
:description (mail-header-subject header)))))
(provide 'org-nnml)
;;; org-nnml.el ends here
reply other threads:[~2007-10-01 1:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m21wcfvd74.fsf@newartisans.com \
--to=johnw@newartisans.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).