From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/18535 Path: news.gmane.org!.POSTED!not-for-mail From: Bob Newell Newsgroups: gmane.emacs.orgmode,gmane.emacs.gnus.user Subject: IMAP Gmail and org-mode links Date: Fri, 03 Mar 2017 09:13:19 -1000 Organization: Avi Gobbler Publishing Message-ID: <87d1dyrx68.fsf@bobnewell.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488568444 30569 195.159.176.226 (3 Mar 2017 19:14:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 3 Mar 2017 19:14:04 +0000 (UTC) User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1 (gnu/linux) To: info-gnus-english , emacs-orgmode Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Fri Mar 03 20:14:00 2017 Return-path: Envelope-to: geo-emacs-orgmode@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjseK-0007JY-96 for geo-emacs-orgmode@m.gmane.org; Fri, 03 Mar 2017 20:13:56 +0100 Original-Received: from localhost ([::1]:59799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjseQ-0007ko-7N for geo-emacs-orgmode@m.gmane.org; Fri, 03 Mar 2017 14:14:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjsds-0007j6-3d for emacs-orgmode@gnu.org; Fri, 03 Mar 2017 14:13:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjsdo-0004In-Uc for emacs-orgmode@gnu.org; Fri, 03 Mar 2017 14:13:28 -0500 Original-Received: from mail-pg0-x229.google.com ([2607:f8b0:400e:c05::229]:33324) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjsdo-0004Hw-NI for emacs-orgmode@gnu.org; Fri, 03 Mar 2017 14:13:24 -0500 Original-Received: by mail-pg0-x229.google.com with SMTP id 25so46854057pgy.0 for ; Fri, 03 Mar 2017 11:13:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bobnewell-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:organization:date:message-id:user-agent :mime-version; bh=eXWlCUPInBMW+fac7hQyOV6IIR3Tqz23sou5pyXoe9s=; b=Zlo7kIFRtmgDfkl+j5JKUn8TOw+cL7zqUb033lX3BzAPpqJQEOx9Y1YTF+32blrf1y SpvsgYKjQQHlmPiTCahFPZP+VPW/57BTQJzeSqc/xIfryA+xgjpdsJB8EMOOYJP/Dkx7 p+WbzlaDwGs2J4joMc9ZwiUn9RI99ZJCvOB4WQFUJVDwegvgJCDJIOVUHVyyTIE1fK6K JADGhTGQp45IF/m7sc1Ggs+Z2NVztEyDLtpmwuc7EzA1ViuIy10kDvdZviFIWJHSlMas NDezNMJpIZQsMkqKxG7hABygN/rcyZRd6T42JY9+Yq7Y7yez6W/Mq/11MiQsUsX87yQQ MQKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:organization:date:message-id :user-agent:mime-version; bh=eXWlCUPInBMW+fac7hQyOV6IIR3Tqz23sou5pyXoe9s=; b=mrb+ob3O6C5FhITA1ufaPw/bRJMx/Gj/2TlcGKI6hyH8HiiP2IDMai0rVDMKZH2jtA Lvzx3Mkf6aDm56J8Oeo1/uIh+iMFYDyPXpfITjhUl09ikT4DGPbBWjojcJe2mqqPXVVq BsdIewOrhfBhbe8liUyBcXBBwxsoqp3oBIgeC5aGW7N0mL//kn3jNEYE606RfcjllHOz 941RisNTxA+ADqhz/LJ7KZKk4JPm+zklzcETHYvZqDqLUf0aHpxE2NFi0tDFfKCEdDBk W2Gl7Ks2E5GaRpaXBaF0Ls+mYaBzwHskBoPLr5G/Fgp1Lati93uZEzbXkhYnyBAF5KK6 eyWg== X-Gm-Message-State: AMke39lrQCZcNRcpIUxOj1NDP6tqcoN5xwNiLCClN0UY2bMGqLI6bO/24On2Zi3s9n4aAw== X-Received: by 10.98.252.211 with SMTP id e202mr5339397pfh.118.1488568402113; Fri, 03 Mar 2017 11:13:22 -0800 (PST) Original-Received: from localhost (udp226603uds.hawaiiantel.net. [72.235.47.4]) by smtp.gmail.com with ESMTPSA id d72sm18401800pfb.21.2017.03.03.11.13.21 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 03 Mar 2017 11:13:21 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::229 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Original-Sender: "Emacs-orgmode" Xref: news.gmane.org gmane.emacs.orgmode:112476 gmane.emacs.gnus.user:18535 Archived-At: 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 *