From: Bob Newell <bobnewell@bobnewell.net>
To: info-gnus-english <info-gnus-english@gnu.org>,
emacs-orgmode <emacs-orgmode@gnu.org>
Subject: IMAP Gmail and org-mode links
Date: Fri, 03 Mar 2017 09:13:19 -1000 [thread overview]
Message-ID: <87d1dyrx68.fsf@bobnewell.net> (raw)
Aloha kakou,
I'm cross-posting to both gnus and org lists, although I suspect the
readership overlaps greatly. I wanted to solve the problem of using
Gmail via IMAP with gnus and org-mode links, wherein if you make a link
from, say, INBOX, and then archive the mail, the link is no longer
valid. But in Gmail, everything is in All Mail--- but you don't want to
have to leave INBOX and go to All Mail just to make a link.
The first part is this. It's kludgy, but it works for me. It edits the
link just after creation to force it to point to All Mail if it's a
Gmail link. The regexp could possibly have to change in another
environment; I don't have a means to test that.
---
;; This function and defadvice attempts to solve the problem of Gmail
;; email being moved from folder to folder. We change org-mode email
;; links involving gmail to always point to the All Mail folder, where
;; everything resides except stuff that has been purged.
(defun changegroupinemaillink (&rest args)
(if org-stored-links
(let* ( (oldlink (car (car org-stored-links)))
(newlink (replace-regexp-in-string
"gmail:.*#" "gmail:[Gmail]/All Mail#" oldlink)))
(setcar (car org-stored-links) newlink))))
(advice-add 'org-store-link :after #'changegroupinemaillink)
---
You should also use the gnus registry, with the nnregistry method added
as documented in the gnus manual. (You may have more methods than shown
below; modify to suit.
---
;; Referer (parent) lookup.
(setq gnus-refer-article-method
'(current
(nnregistry)))
--
Perhaps this is redundant, but as I've got it working and doing what I
need, I'm reluctant to mess it up :)
--
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *
reply other threads:[~2017-03-03 19:13 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=87d1dyrx68.fsf@bobnewell.net \
--to=bobnewell@bobnewell.net \
--cc=emacs-orgmode@gnu.org \
--cc=info-gnus-english@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).