emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug] org-store-link on gnus message fails
@ 2011-01-12 13:58 Eric S Fraga
  2011-01-12 16:36 ` Tassilo Horn
  2011-01-12 16:45 ` Tassilo Horn
  0 siblings, 2 replies; 8+ messages in thread
From: Eric S Fraga @ 2011-01-12 13:58 UTC (permalink / raw)
  To: Emacs Org mode mailing list

Hello,

Trying to store a link to a gnus email message (=org-store-link=) when
the cursor is on a particular message in a gnus Summary mode window, I
get:

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (error "Invalid date: ")
  signal(error ("Invalid date: "))
  error("Invalid date: %s" "")
  byte-code("\300\301\302\217\207" [nil (byte-code "\301\302\303\304\b!!\"\207" [date apply encode-time parse-time-string timezone-make-date-arpa-standard] 5) ((error ...))] 3)
  date-to-time("")
  (format-time-string (org-time-stamp-format t) (date-to-time date))
  (and date (format-time-string (org-time-stamp-format t) (date-to-time date)))
  (let* ((group gnus-newsgroup-name) (header ...) (from ...) (message-id ...) (date ...) (date-ts ...) (date-ts-ia ...) (subject ...) (to ...) newsgroups x-no-archive desc link) (set-text-properties 0 (length subject) nil subject) (when (org-xor current-prefix-arg org-gnus-prefer-web-links) (save-window-excursion ...) (setq to ... newsgroups ... x-no-archive ...)) (org-store-link-props :type "gnus" :from from :subject subject :message-id message-id :group group :to to) (when date (org-add-link-props :date date :date-timestamp date-ts :date-timestamp-inactive date-ts-ia)) (setq desc (org-email-link-description) link (org-gnus-article-link group newsgroups message-id x-no-archive)) (org-add-link-props :link link :description desc) link)
  (cond ((eq major-mode ...) (let* ... ...)) ((memq major-mode ...) (let* ... ... ... ... ... ... ... link)))
  org-gnus-store-link()
  run-hook-with-args-until-success(org-gnus-store-link)
  (cond ((run-hook-with-args-until-success ...) (setq link ... desc ...)) ((equal ... "*Org Edit Src Example*") (let ... ... ... ... ... ... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...) (let ... ... ...)) ((eq major-mode ...) (setq cpltxt ... link ...) (org-store-link-props :type "w3" :url ...)) ((eq major-mode ...) (setq cpltxt ... link ...) (org-store-link-props :type "w3m" :url ...)) ((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode ...) (setq cpltxt ... link ...) (org-store-link-props :type "image" :file buffer-file-name)) ((eq major-mode ...) (let ... ... ...)) ((and ... ...) (setq custom-id ...) (cond ... ... ...)) ((buffer-file-name ...) (setq cpltxt ...) (when ... ... ...) (setq link ...)) ((interactive-p) (error "Cannot link to a buffer which 
 is not visiting a file")) (t (setq link nil)))
  (let ((outline-regexp ...) link cpltxt desc description search txt custom-id agenda-link) (cond (... ...) (... ...) (... ...) (... ...) (... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (... ... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and ... link) (progn ... ... ...) (or agenda-link ...)))
  org-store-link(nil)
  call-interactively(org-store-link nil nil)
--8<---------------cut here---------------end--------------->8---

Any hints as to what could be wrong (i.e. have I misconfigured
something)?

Thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.4 (release_7.4.166.gf7a7)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [bug] org-store-link on gnus message fails
  2011-01-12 13:58 [bug] org-store-link on gnus message fails Eric S Fraga
@ 2011-01-12 16:36 ` Tassilo Horn
  2011-01-12 16:45 ` Tassilo Horn
  1 sibling, 0 replies; 8+ messages in thread
From: Tassilo Horn @ 2011-01-12 16:36 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> Trying to store a link to a gnus email message (=org-store-link=) when
> the cursor is on a particular message in a gnus Summary mode window, I
> get:

What's the Date: header of that mail?

Bye,
Tassilo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [bug] org-store-link on gnus message fails
  2011-01-12 13:58 [bug] org-store-link on gnus message fails Eric S Fraga
  2011-01-12 16:36 ` Tassilo Horn
@ 2011-01-12 16:45 ` Tassilo Horn
  2011-01-12 20:23   ` Eric S Fraga
  2011-01-13 11:53   ` [Accepted] " Carsten Dominik
  1 sibling, 2 replies; 8+ messages in thread
From: Tassilo Horn @ 2011-01-12 16:45 UTC (permalink / raw)
  To: emacs-orgmode

Hi Eric,

this patch should do the trick.  I think the issue was a malformed Date:
header that couldn't be converted to a timestamp.

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el
index 32641bf..ae5dc52 100644
--- a/lisp/org-gnus.el
+++ b/lisp/org-gnus.el
@@ -152,11 +152,16 @@ If `org-store-link' was called with a prefix arg the meaning of
 	   (from (mail-header-from header))
 	   (message-id (org-remove-angle-brackets (mail-header-id header)))
 	   (date (org-trim (mail-header-date header)))
-	   (date-ts (and date (format-time-string
-			       (org-time-stamp-format t) (date-to-time date))))
-	   (date-ts-ia (and date (format-time-string
-				  (org-time-stamp-format t t)
-				  (date-to-time date))))
+	   (date-ts (and date
+			 (condition-case nil
+			     (format-time-string
+			      (org-time-stamp-format t)
+			      (date-to-time date)))))
+	   (date-ts-ia (and date
+			    (condition-case nil
+				(format-time-string
+				 (org-time-stamp-format t t)
+				 (date-to-time date)))))
 	   (subject (copy-sequence (mail-header-subject header)))
 	   (to (cdr (assq 'To (mail-header-extra header))))
 	   newsgroups x-no-archive desc link)
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: Re: [bug] org-store-link on gnus message fails
  2011-01-12 16:45 ` Tassilo Horn
@ 2011-01-12 20:23   ` Eric S Fraga
  2011-01-13  8:38     ` Sébastien Vauban
  2011-01-13 11:53   ` [Accepted] " Carsten Dominik
  1 sibling, 1 reply; 8+ messages in thread
From: Eric S Fraga @ 2011-01-12 20:23 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-orgmode

Tassilo Horn <tassilo@member.fsf.org> writes:

> Hi Eric,
>
> this patch should do the trick.  I think the issue was a malformed Date:
> header that couldn't be converted to a timestamp.

Actually, I am curious about this.  What is the point of extracting the
date in any case?  It's used to store link properties but I don't
understand where these properties can be used?  I'm asking in case I'm
missing a useful functionality I hadn't thought of...

Thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.4 (release_7.4.166.gf7a7.dirty)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [bug] org-store-link on gnus message fails
  2011-01-12 20:23   ` Eric S Fraga
@ 2011-01-13  8:38     ` Sébastien Vauban
  2011-01-14  8:48       ` Eric S Fraga
  0 siblings, 1 reply; 8+ messages in thread
From: Sébastien Vauban @ 2011-01-13  8:38 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Eric,

Eric S Fraga wrote:
> Tassilo Horn <tassilo-IGUgQLVVQiRCV4ILt04nZQ@public.gmane.org> writes:
>> this patch should do the trick. I think the issue was a malformed Date:
>> header that couldn't be converted to a timestamp.
>
> Actually, I am curious about this. What is the point of extracting the date
> in any case? It's used to store link properties but I don't understand where
> these properties can be used? I'm asking in case I'm missing a useful
> functionality I hadn't thought of...

Well, I often (now) keep extracts of mail in my Org buffers. Via a capture
template[1], these get a TODO keyword, a SCHEDULED date (by default, set to
today), a link to the Gnus message (or http link to Gmane) and the date of the
mail.

Why keeping the date of the original mail?  Because it's interested to see,
when scanning which emails I still have to answer on, when they've been
issued -- without having to follow on the link.

It is an indication of the age of the mail, that could serve as well for
sorting the subtrees (if I'm not wrong -- I don't use that feature but...).

Does this answer your question?

Best regards,
  Seb

Footnotes:
[1] Reference code...
#+begin_src emacs-lisp
          (setq org-capture-templates
                `(("m" "Mail" entry
                   (file+headline "~/Personal/refile.org" "Tasks")
                   "* TODO %:subject%? (from %:fromname) :mail:
   %:date-timestamp-inactive
   SCHEDULED: %t

#+begin_verse
%i
#+end_verse

From %a"
                   :empty-lines 1 :immediate-finish)))
#+end_src

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Accepted] Re: [bug] org-store-link on gnus message fails
  2011-01-12 16:45 ` Tassilo Horn
  2011-01-12 20:23   ` Eric S Fraga
@ 2011-01-13 11:53   ` Carsten Dominik
  2011-01-13 13:38     ` Tassilo Horn
  1 sibling, 1 reply; 8+ messages in thread
From: Carsten Dominik @ 2011-01-13 11:53 UTC (permalink / raw)
  To: emacs-orgmode

Patch 533 (http://patchwork.newartisans.com/patch/533/) is now "Accepted".

Maintainer comment: No comment

This relates to the following submission:

http://mid.gmane.org/%3C87bp3moyua.fsf%40member.fsf.org%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [Orgmode] Re: [bug] org-store-link on gnus message fails
> Date: Wed, 12 Jan 2011 21:45:17 -0000
> From: Tassilo Horn <tassilo@member.fsf.org>
> X-Patchwork-Id: 533
> Message-Id: <87bp3moyua.fsf@member.fsf.org>
> To: emacs-orgmode@gnu.org
> 
> Hi Eric,
> 
> this patch should do the trick.  I think the issue was a malformed Date:
> header that couldn't be converted to a timestamp.
> 
> --8<---------------cut here---------------start------------->8---
> --8<---------------cut here---------------end--------------->8---
> 
> Bye,
> Tassilo
> 
> 
> diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el
> index 32641bf..ae5dc52 100644
> --- a/lisp/org-gnus.el
> +++ b/lisp/org-gnus.el
> @@ -152,11 +152,16 @@ If `org-store-link' was called with a prefix arg the meaning of
>  	   (from (mail-header-from header))
>  	   (message-id (org-remove-angle-brackets (mail-header-id header)))
>  	   (date (org-trim (mail-header-date header)))
> -	   (date-ts (and date (format-time-string
> -			       (org-time-stamp-format t) (date-to-time date))))
> -	   (date-ts-ia (and date (format-time-string
> -				  (org-time-stamp-format t t)
> -				  (date-to-time date))))
> +	   (date-ts (and date
> +			 (condition-case nil
> +			     (format-time-string
> +			      (org-time-stamp-format t)
> +			      (date-to-time date)))))
> +	   (date-ts-ia (and date
> +			    (condition-case nil
> +				(format-time-string
> +				 (org-time-stamp-format t t)
> +				 (date-to-time date)))))
>  	   (subject (copy-sequence (mail-header-subject header)))
>  	   (to (cdr (assq 'To (mail-header-extra header))))
>  	   newsgroups x-no-archive desc link)
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Accepted] Re: [bug] org-store-link on gnus message fails
  2011-01-13 11:53   ` [Accepted] " Carsten Dominik
@ 2011-01-13 13:38     ` Tassilo Horn
  0 siblings, 0 replies; 8+ messages in thread
From: Tassilo Horn @ 2011-01-13 13:38 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik <cdominik@newartisans.com> writes:

Hi Carsten,

> Patch 533 (http://patchwork.newartisans.com/patch/533/) is now "Accepted".

The patch below was wrong.  The patch in the next mail that used
`ignore-errors' instead of `condition-case' is the right one.

Bye,
Tassilo

>> diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el
>> index 32641bf..ae5dc52 100644
>> --- a/lisp/org-gnus.el
>> +++ b/lisp/org-gnus.el
>> @@ -152,11 +152,16 @@ If `org-store-link' was called with a prefix arg the meaning of
>>  	   (from (mail-header-from header))
>>  	   (message-id (org-remove-angle-brackets (mail-header-id header)))
>>  	   (date (org-trim (mail-header-date header)))
>> -	   (date-ts (and date (format-time-string
>> -			       (org-time-stamp-format t) (date-to-time date))))
>> -	   (date-ts-ia (and date (format-time-string
>> -				  (org-time-stamp-format t t)
>> -				  (date-to-time date))))
>> +	   (date-ts (and date
>> +			 (condition-case nil
>> +			     (format-time-string
>> +			      (org-time-stamp-format t)
>> +			      (date-to-time date)))))
>> +	   (date-ts-ia (and date
>> +			    (condition-case nil
>> +				(format-time-string
>> +				 (org-time-stamp-format t t)
>> +				 (date-to-time date)))))
>>  	   (subject (copy-sequence (mail-header-subject header)))
>>  	   (to (cdr (assq 'To (mail-header-extra header))))
>>  	   newsgroups x-no-archive desc link)
>> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: [bug] org-store-link on gnus message fails
  2011-01-13  8:38     ` Sébastien Vauban
@ 2011-01-14  8:48       ` Eric S Fraga
  0 siblings, 0 replies; 8+ messages in thread
From: Eric S Fraga @ 2011-01-14  8:48 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode

Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:

> Hi Eric,
>
> Eric S Fraga wrote:
>> Tassilo Horn <tassilo@member.fsf.org> writes:
>>> this patch should do the trick. I think the issue was a malformed Date:
>>> header that couldn't be converted to a timestamp.
>>
>> Actually, I am curious about this. What is the point of extracting the date
>> in any case? It's used to store link properties but I don't understand where
>> these properties can be used? I'm asking in case I'm missing a useful
>> functionality I hadn't thought of...
>
> Well, I often (now) keep extracts of mail in my Org buffers. Via a capture
> template[1], these get a TODO keyword, a SCHEDULED date (by default, set to
> today), a link to the Gnus message (or http link to Gmane) and the date of the
> mail.
>
> Why keeping the date of the original mail?  Because it's interested to see,
> when scanning which emails I still have to answer on, when they've been
> issued -- without having to follow on the link.
>
> It is an indication of the age of the mail, that could serve as well for
> sorting the subtrees (if I'm not wrong -- I don't use that feature but...).
>
> Does this answer your question?

Seb,

it does indeed.  Many thanks, and also for the emacs lisp code that
shows how to use the extra link information.  I wouldn't need to use
this information in the way you do because my capture template for task
creation, which is usually what I do as a result of emails, is based on
a date tree...  but it's still very useful to see other ways of handling
the information overflow we have!

Thanks again,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.4 (release_7.4.174.g163cd)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-01-14 10:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-12 13:58 [bug] org-store-link on gnus message fails Eric S Fraga
2011-01-12 16:36 ` Tassilo Horn
2011-01-12 16:45 ` Tassilo Horn
2011-01-12 20:23   ` Eric S Fraga
2011-01-13  8:38     ` Sébastien Vauban
2011-01-14  8:48       ` Eric S Fraga
2011-01-13 11:53   ` [Accepted] " Carsten Dominik
2011-01-13 13:38     ` Tassilo Horn

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).