emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Joseph Vidal-Rosset <joseph.vidal.rosset@gmail.com>
To: "Fraga, Eric" <e.fraga@ucl.ac.uk>
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: Fri, 26 Jul 2019 11:43:23 +0200	[thread overview]
Message-ID: <5d3acb3b.1c69fb81.d3010.ccc8@mx.google.com> (raw)
In-Reply-To: 87v9vqgiy6.fsf@ucl.ac.uk

[-- Attachment #1: Type: text/plain, Size: 1974 bytes --]

Le   jeu.   07/25/19   juil.   2019   à   04:47:14   ,   "Fraga,   Eric"
<e.fraga@ucl.ac.uk> a envoyé 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. 
>
> [...]
>
>> 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:

#+BEGIN_SRC 
;;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. 


Best wishes,
 

-- 
Joseph 

[-- Attachment #2.1: Type: text/html, Size: 2841 bytes --]

  parent reply	other threads:[~2019-07-26  9:43 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 [this message]
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

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=5d3acb3b.1c69fb81.d3010.ccc8@mx.google.com \
    --to=joseph.vidal.rosset@gmail.com \
    --cc=e.fraga@ucl.ac.uk \
    --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).