From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joseph Vidal-Rosset Subject: Re: org-links for Gnus in imap with Gmail (for a convenient todo.org list) Date: Fri, 26 Jul 2019 11:43:23 +0200 Message-ID: <5d3acb3b.1c69fb81.d3010.ccc8@mx.google.com> References: <5d39d7af.1c69fb81.2893e.8fde@mx.google.com> <87v9vqgiy6.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:37600) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqwlC-0002lW-Ux for emacs-orgmode@gnu.org; Fri, 26 Jul 2019 05:43:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hqwl7-0000W3-6J for emacs-orgmode@gnu.org; Fri, 26 Jul 2019 05:43:31 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:38309) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hqwl6-0000EZ-Pk for emacs-orgmode@gnu.org; Fri, 26 Jul 2019 05:43:29 -0400 Received: by mail-wm1-x333.google.com with SMTP id s15so25768705wmj.3 for ; Fri, 26 Jul 2019 02:43:27 -0700 (PDT) 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 Sender: "Emacs-orgmode" To: "Fraga, Eric" Cc: emacs-orgmode list --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Le jeu. 07/25/19 juil. 2019 =C3=A0 04:47:14 , "Fraga, Eri= c" a envoy=C3=A9 ce message: > On Thursday, 25 Jul 2019 at 18:24, Joseph Vidal-Rosset wrote: >> But for gnus-imap-gmail users, it is more difficult to get the same >> thing.=20 > > [...] > >> But I need to change the mention of INBOX in the link to John's >> email.=20 > > Why is that? If I create a link to an email from gmail using %a, this > seems to work (having just tested it). Am I missing something? Hi again Eric and everybody, Considering the code: #+BEGIN_SRC=20 ;;capture todo items using C-c c t (define-key global-map (kbd "C-c c") 'org-capture) (setq org-capture-templates '( ("t" "todo" entry (file+headline "~/Dropbox/Orgzly/todo.org" "Tasks") "* TODO [#A] %?\n [[~/Dropbox/Orgzly/links.org::%(org-insert-time-= stamp (org-read-date nil t \"%:date\"))]] \n* %(org-insert-time-stamp (org-= read-date nil t \"%:date\")) %a " ) ) ) (defun hs/replace () (interactive) (goto-char 1) (let ((search-invisible t)) (replace-string "gnus:INBOX#" "gnus:%5BGmail= %5D/Tous les messages#"))) (define-key global-map (kbd "C-c r") 'hs/replace) (add-hook 'org-capture-prepare-finalize-hook 'hs/replace) (defun my/refile (file headline &optional arg) (let ((pos (save-excursion (find-file file) (org-find-exact-headline-in-buffer headline)))) (org-refile arg nil (list headline file nil pos))) (switch-to-buffer (current-buffer))) #+END_SRC a better option would be to get in only one function org-capture-template and hs/replace : if string "gnus/INBOX" exists, hs/replace works and replaces the string, if not, the link is given without change. The idea is simple, but I do not succeed to realize it, because I do not know enough the syntax. But I would be surprised if this would be impossible to make it.=20 Best wishes, =20 --=20 Joseph=20 --=-=-= Content-Type: multipart/related; boundary="==-=-=" --==-=-= Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

Le jeu. 07/25/19 juil. 2019 =C3=A0 04:47:14 , ??Fraga, Er= ic??

a envoy=C3=A9 ce message:
On Thursday, 25 Jul 2019 at 18:24, Joseph Vidal-Rosset wrote:
But for gnus-imap-gmail users, it is more difficult to get the same
thing.

>

[=E2=80=A6]

>

But I need to change the mention of INBOX in the link to John?s
email.

>

Why is that? If I create a link to an email from gmail using %a, this
seems to work (having just tested it). Am I missing something?

Hi again Eric and everybody,

Considering the code:

;;capture todo items using C-c c t
(define-key global-map (kbd "C-c c") 'org-capture)
(setq org-capture-templates
      '(
	("t" "todo" entry (file+headline "~/Dropbox/Orgzly/todo.org" "Tasks")
         "* TODO [#A] %?\n [[~/Dropbox/Orgzly/links.org::%(org-insert-time-=
stamp (org-read-date nil t \"%:date\"))]] \n* %(org-insert-time-stamp (org-=
read-date nil t \"%:date\")) %a "
	 )
	)
      )

(defun hs/replace ()
   (interactive)
   (goto-char 1)
   (let ((search-invisible t)) (replace-string "gnus:INBOX#" "gnus:%5BGmail=
%5D/Tous les messages#")))
(define-key global-map (kbd "C-c r") 'hs/replace)
(add-hook 'org-capture-prepare-finalize-hook 'hs/replace)
(defun my/refile (file headline &optional arg)
  (let ((pos (save-excursion
               (find-file file)
               (org-find-exact-headline-in-buffer headline))))
    (org-refile arg nil (list headline file nil pos)))
  (switch-to-buffer (current-buffer)))

a better option would be to get in only one function org-capture-template<= br /> and hs/replace : if string « gnus/INBOX » exists, h= s/replace works and
replaces the string, if not, the link is given without change. The
idea is simple, but I do not succeed to realize it, because I do not
know enough the syntax. But I would be surprised if this would be
impossible to make it.

Best wishes,


Joseph

--==-=-=-- --=-=-=--