emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-links for Gnus in imap with Gmail (for a convenient todo.org


From: Joseph Vidal-Rosset
Subject: Re: [O] org-links for Gnus in imap with Gmail (for a convenient todo.org list)
Date: Sun, 11 Aug 2019 19:50:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Le sam. 27 juil. 2019  à 11:32:01 , Bob Newell <address@hidden>
a envoyé ce message:
> Bonjour Josef,
>
> Je ne suis pas assez doué avec org-mode pour donner des conseils
> expertes. Mais j'ai quand même une idée. Peut-être vous pouviez utiliser
> 'advice' au lieu d'un 'hook' sur org-capture-finalize
>
> Par exemple (attention! pas verifié!)
>
> (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, 
-- 
Joseph 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]