emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Joseph Vidal-Rosset <joseph.vidal.rosset@gmail.com>
To: Bob Newell <bobnewell@bobnewell.net>
Cc: emacs-orgmode list <emacs-orgmode@gnu.org>
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	[thread overview]
Message-ID: <5d50554d.1c69fb81.83d8e.e64b@mx.google.com> (raw)
In-Reply-To: <87zhkzduzy.fsf@bobnewell.net> (Bob Newell's  message of "Sat, 27 Jul 2019 11:32:01 -1000")

Le sam. 27 juil. 2019  à 11:32:01 , Bob Newell <bobnewell@bobnewell.net>
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 

      parent reply	other threads:[~2019-08-11 17:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25 16:24 org-links for Gnus in imap with Gmail (for a convenient todo.org list) Joseph Vidal-Rosset
2019-07-25 16:47 ` Fraga, Eric
2019-07-25 17:24   ` Joseph Vidal-Rosset
2019-07-25 17:33     ` Fraga, Eric
2019-07-25 17:41       ` Joseph Vidal-Rosset
2019-07-25 17:46         ` Eric Abrahamsen
2019-07-26  9:43   ` Joseph Vidal-Rosset
2019-07-25 19:15 ` Ken Mankoff
2019-07-26  7:14   ` Joseph Vidal-Rosset
2019-07-26  7:24     ` Ken Mankoff
2019-07-26  7:41       ` Joseph Vidal-Rosset
2019-07-26 17:30         ` Bob Newell
2019-07-27  9:36           ` Joseph Vidal-Rosset
     [not found]             ` <87zhkzduzy.fsf@bobnewell.net>
2019-07-28  7:22               ` Joseph Vidal-Rosset
2019-08-11 17:50               ` Joseph Vidal-Rosset [this message]

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=5d50554d.1c69fb81.83d8e.e64b@mx.google.com \
    --to=joseph.vidal.rosset@gmail.com \
    --cc=bobnewell@bobnewell.net \
    --cc=emacs-orgmode@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).