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: Sun, 11 Aug 2019 19:50:04 +0200 Message-ID: <5d50554d.1c69fb81.83d8e.e64b@mx.google.com> References: <5d39d7af.1c69fb81.2893e.8fde@mx.google.com> <87k1c6x6vu.fsf@gmail.com> <5d3aa844.1c69fb81.a5d88.d59d@mx.google.com> <87ef2d1cmz.fsf@gmail.com> <5d3aaeaf.1c69fb81.409b9.f45e@mx.google.com> <87k1c4zosh.fsf@bobnewell.net> <5d3c1b32.1c69fb81.91715.a5f9@mx.google.com> <87zhkzduzy.fsf@bobnewell.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:34814) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hwryv-0001RD-6f for emacs-orgmode@gnu.org; Sun, 11 Aug 2019 13:50:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hwryr-0006Zq-Rk for emacs-orgmode@gnu.org; Sun, 11 Aug 2019 13:50:13 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:53800) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hwryr-0006YK-Lh for emacs-orgmode@gnu.org; Sun, 11 Aug 2019 13:50:09 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 10so10179598wmp.3 for ; Sun, 11 Aug 2019 10:50:08 -0700 (PDT) In-Reply-To: <87zhkzduzy.fsf@bobnewell.net> (Bob Newell's message of "Sat, 27 Jul 2019 11:32:01 -1000") 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: Bob Newell Cc: emacs-orgmode list Le sam. 27 juil. 2019 =C3=A0 11:32:01 , Bob Newell a envoy=C3=A9 ce message: > Bonjour Josef, > > Je ne suis pas assez dou=C3=A9 avec org-mode pour donner des conseils > expertes. Mais j'ai quand m=C3=AAme une id=C3=A9e. Peut-=C3=AAtre vous po= uviez utiliser > 'advice' au lieu d'un 'hook' sur org-capture-finalize > > Par exemple (attention! pas verifi=C3=A9!) > > (defun jr/fix-the-link (&rest args) > (interactive) > (save-excursion > (find-file "~/Dropbox/Orgzly/links.org") > (goto-char (point-min)) > (while (search-forward "INBOX" nil t) > (replace-match "Tous les messages")) > (save-buffer))) > (advice-add 'org-capture-finalize :after #'jr/fix-the-link) > > Bonne chance ... ! Dear Bob, In fact, I just realized that this code works as I wanted: (defun jr/fix-the-link (&rest args) (interactive) (save-excursion (find-file "~/Dropbox/Orgzly/todo.org") (goto-char (point-min)) (while (search-forward "gnus:INBOX#" nil t) (replace-match "gnus:%5BGmail%5D/Tous les messages#")) (save-buffer))) (advice-add 'org-capture-finalize :after #'jr/fix-the-link) after C-c c t the link is in todo.org, and with C-c C-w , once refiled in links.org, the email link is correctly changed! I do not understand this magic trick, but many many thanks for your kind and very efficient help ! Best wishes,=20 --=20 Joseph=20