Gnus development mailing list
 help / color / mirror / Atom feed
* FEATURE: icalendar - link to original gnus message from org entry
@ 2013-12-12 21:17 Jan Tatarik
  2013-12-18 21:12 ` Adam Sjøgren
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Tatarik @ 2013-12-12 21:17 UTC (permalink / raw)
  To: ding

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

On Wed, Nov 27 2013, Mario Peter wrote:

> Hi again,

> it be cool to have a back link to the gnus message in the org entry
> beeing created from gnus article. What do you think?

This patch implements the requested feature.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: message-link.patch --]
[-- Type: text/x-diff, Size: 5711 bytes --]

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b747f7c6f74850a2a533ec3728477053962b4dba..43cdc73bb7d8a3fc8ff6cd135114b23e6c0e24d3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
+2013-12-12  Jan Tatarik  <jan.tatarik@gmail.com>
+
+	* gnus-icalendar.el (gnus-icalendar--update-org-event)
+	(gnus-icalendar-event->org-entry)
+	(gnus-icalendar--update-org-event)
+	(gnus-icalendar:org-event-save)
+	(gnus-icalendar-event:sync-to-org, gnus-icalendar-reply)
+	(gnus-icalendar-sync-event-to-org, gnus-icalendar-mm-inline):
+	Include org link to the original message when syncing events to
+	org.
+
 2013-12-08  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-msg.el (gnus-setup-message): Fix the type of argument passed to
diff --git a/lisp/gnus-icalendar.el b/lisp/gnus-icalendar.el
index 5f152921b663850918be8bfcb3a76f5e69bc1d6d..eb79ba119c04516ade363ad3ef9dbe35079be4fe 100644
--- a/lisp/gnus-icalendar.el
+++ b/lisp/gnus-icalendar.el
@@ -441,7 +441,7 @@ Return nil for non-recurring EVENT."
   (mapconcat #'identity participants ", "))
 
 ;; TODO: make the template customizable
-(defmethod gnus-icalendar-event->org-entry ((event gnus-icalendar-event) reply-status)
+(defmethod gnus-icalendar-event->org-entry ((event gnus-icalendar-event) reply-status message-link)
   "Return string with new `org-mode' entry describing EVENT."
   (with-temp-buffer
     (org-mode)
@@ -466,6 +466,10 @@ Return nil for non-recurring EVENT."
                 (org-entry-put (point) (car prop) (cdr prop)))
               props))
 
+      (insert "  ")
+      (org-insert-link nil message-link "Show the original message")
+      (insert "\n\n")
+
       (when description
         (save-restriction
           (narrow-to-region (point) (point))
@@ -511,7 +515,7 @@ is searched."
       (org-show-entry))))
 
 
-(defun gnus-icalendar--update-org-event (event reply-status &optional org-file)
+(defun gnus-icalendar--update-org-event (event reply-status message-link &optional org-file)
   (let ((file (gnus-icalendar-find-org-event-file event org-file)))
     (when file
       (with-current-buffer (find-file-noselect file)
@@ -546,6 +550,12 @@ is searched."
                   (forward-line)
                   (delete-region (point) entry-end))
 
+                (insert "\n")
+                (org-insert-link nil message-link "Show the original message")
+                (indent-region (line-beginning-position) (line-end-position)
+                               (1+ entry-outline-level))
+                (insert "\n")
+
                 ;; put new event description in the entry body
                 (when description
                   (save-restriction
@@ -608,9 +618,9 @@ is searched."
     ;;         org-capture-templates-contexts))
     ))
 
-(defun gnus-icalendar:org-event-save (event reply-status)
+(defun gnus-icalendar:org-event-save (event reply-status message-link)
   (with-temp-buffer
-    (org-capture-string (gnus-icalendar-event->org-entry event reply-status)
+    (org-capture-string (gnus-icalendar-event->org-entry event reply-status message-link)
                         gnus-icalendar-org-template-key)))
 
 (defun gnus-icalendar-show-org-agenda (event)
@@ -622,12 +632,12 @@ is searched."
 
     (org-agenda-list nil (gnus-icalendar-event:start event) duration-days)))
 
-(defmethod gnus-icalendar-event:sync-to-org ((event gnus-icalendar-event-request) reply-status)
+(defmethod gnus-icalendar-event:sync-to-org ((event gnus-icalendar-event-request) reply-status message-link)
   (if (gnus-icalendar-find-org-event-file event)
-      (gnus-icalendar--update-org-event event reply-status)
-    (gnus-icalendar:org-event-save event reply-status)))
+      (gnus-icalendar--update-org-event event reply-status message-link)
+    (gnus-icalendar:org-event-save event reply-status message-link)))
 
-(defmethod gnus-icalendar-event:sync-to-org ((event gnus-icalendar-event-cancel) reply-status)
+(defmethod gnus-icalendar-event:sync-to-org ((event gnus-icalendar-event-cancel) reply-status message-link)
   (when (gnus-icalendar-find-org-event-file event)
     (gnus-icalendar--cancel-org-event event)))
 
@@ -677,6 +687,9 @@ only makes sense to define names or email addresses."
 (make-variable-buffer-local
  (defvar gnus-icalendar-handle nil))
 
+(make-variable-buffer-local
+ (defvar gnus-icalendar-message-link nil))
+
 (defvar gnus-icalendar-identities
   (apply #'append
          (mapcar (lambda (x) (if (listp x) x (list x)))
@@ -786,13 +799,13 @@ only makes sense to define names or email addresses."
           ;; Back in article buffer
           (setq-local gnus-icalendar-reply-status status)
           (when gnus-icalendar-org-enabled-p
-            (gnus-icalendar--update-org-event event status)
+            (gnus-icalendar--update-org-event event status gnus-icalendar-message-link)
             ;; refresh article buffer to update the reply status
             (with-current-buffer gnus-summary-buffer
               (gnus-summary-show-article))))))))
 
 (defun gnus-icalendar-sync-event-to-org (event)
-  (gnus-icalendar-event:sync-to-org event gnus-icalendar-reply-status))
+  (gnus-icalendar-event:sync-to-org event gnus-icalendar-reply-status gnus-icalendar-message-link))
 
 (defmethod gnus-icalendar-event:inline-reply-buttons ((event gnus-icalendar-event) handle)
   (when (gnus-icalendar-event:rsvp event)
@@ -841,6 +854,7 @@ only makes sense to define names or email addresses."
   (let ((event (gnus-icalendar-event-from-handle handle gnus-icalendar-identities)))
 
     (setq gnus-icalendar-reply-status nil)
+    (setq-local gnus-icalendar-message-link (org-gnus-store-link))
 
     (when event
       (gmm-labels ((insert-button-group (buttons)

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

* Re: FEATURE: icalendar - link to original gnus message from org entry
  2013-12-12 21:17 FEATURE: icalendar - link to original gnus message from org entry Jan Tatarik
@ 2013-12-18 21:12 ` Adam Sjøgren
  2013-12-19 20:12   ` Jan Tatarik
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Sjøgren @ 2013-12-18 21:12 UTC (permalink / raw)
  To: ding

Jan Tatarik <jan.tatarik@gmail.com> writes:

> On Wed, Nov 27 2013, Mario Peter wrote:

>> it be cool to have a back link to the gnus message in the org entry
>> beeing created from gnus article. What do you think?

> This patch implements the requested feature.

I get a conflict (and not just from the ChangeLog), when I try to apply
this. Could you respin the patch?


  Best regards,

    Adam

-- 
 "Accept the mystery!"                                        Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: FEATURE: icalendar - link to original gnus message from org entry
  2013-12-18 21:12 ` Adam Sjøgren
@ 2013-12-19 20:12   ` Jan Tatarik
  2013-12-26 15:51     ` Lars Ingebrigtsen
  2014-02-01  0:34     ` Lars Ingebrigtsen
  0 siblings, 2 replies; 11+ messages in thread
From: Jan Tatarik @ 2013-12-19 20:12 UTC (permalink / raw)
  To: ding

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

On Wed, Dec 18 2013, Adam Sjøgren wrote:

> Jan Tatarik <jan.tatarik@gmail.com> writes:

>> On Wed, Nov 27 2013, Mario Peter wrote:

>>> it be cool to have a back link to the gnus message in the org entry
>>> beeing created from gnus article. What do you think?

>> This patch implements the requested feature.

> I get a conflict (and not just from the ChangeLog), when I try to apply
> this. Could you respin the patch?

Here you go.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: message-link.patch --]
[-- Type: text/x-diff, Size: 5752 bytes --]

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 01e34af869b0c15275738f4977beaadbc1a6085a..f352cf968f64abad1df5f3ee5070c30fa78b2efa 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,14 +1,3 @@
-2013-12-19  Jan Tatarik  <jan.tatarik@gmail.com>
-
-	* gnus-icalendar.el (gnus-icalendar--update-org-event)
-	(gnus-icalendar-event->org-entry)
-	(gnus-icalendar--update-org-event)
-	(gnus-icalendar:org-event-save)
-	(gnus-icalendar-event:sync-to-org, gnus-icalendar-reply)
-	(gnus-icalendar-sync-event-to-org, gnus-icalendar-mm-inline):
-	Include org link to the original message when syncing events to
-	org.
-
 2013-12-19  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-uu.el (gnus-uu-decode-binhex, gnus-uu-decode-binhex-view):
diff --git a/lisp/gnus-icalendar.el b/lisp/gnus-icalendar.el
index 23eaca1e4ce9f14ad3ab21d04e816d8b2e2bf4bd..1abcb6e27e4b40f504de1544f8ff2b1320648e82 100644
--- a/lisp/gnus-icalendar.el
+++ b/lisp/gnus-icalendar.el
@@ -441,7 +441,7 @@ Return nil for non-recurring EVENT."
   (mapconcat #'identity participants ", "))
 
 ;; TODO: make the template customizable
-(defmethod gnus-icalendar-event->org-entry ((event gnus-icalendar-event) reply-status message-link)
+(defmethod gnus-icalendar-event->org-entry ((event gnus-icalendar-event) reply-status)
   "Return string with new `org-mode' entry describing EVENT."
   (with-temp-buffer
     (org-mode)
@@ -466,10 +466,6 @@ Return nil for non-recurring EVENT."
                 (org-entry-put (point) (car prop) (cdr prop)))
               props))
 
-      (insert "  ")
-      (org-insert-link nil message-link "Show the original message")
-      (insert "\n\n")
-
       (when description
         (save-restriction
           (narrow-to-region (point) (point))
@@ -515,7 +511,7 @@ is searched."
       (org-show-entry))))
 
 
-(defun gnus-icalendar--update-org-event (event reply-status message-link &optional org-file)
+(defun gnus-icalendar--update-org-event (event reply-status &optional org-file)
   (let ((file (gnus-icalendar-find-org-event-file event org-file)))
     (when file
       (with-current-buffer (find-file-noselect file)
@@ -550,12 +546,6 @@ is searched."
                   (forward-line)
                   (delete-region (point) entry-end))
 
-                (insert "\n")
-                (org-insert-link nil message-link "Show the original message")
-                (indent-region (line-beginning-position) (line-end-position)
-                               (1+ entry-outline-level))
-                (insert "\n")
-
                 ;; put new event description in the entry body
                 (when description
                   (save-restriction
@@ -618,9 +608,9 @@ is searched."
     ;;         org-capture-templates-contexts))
     ))
 
-(defun gnus-icalendar:org-event-save (event reply-status message-link)
+(defun gnus-icalendar:org-event-save (event reply-status)
   (with-temp-buffer
-    (org-capture-string (gnus-icalendar-event->org-entry event reply-status message-link)
+    (org-capture-string (gnus-icalendar-event->org-entry event reply-status)
                         gnus-icalendar-org-template-key)))
 
 (defun gnus-icalendar-show-org-agenda (event)
@@ -632,12 +622,12 @@ is searched."
 
     (org-agenda-list nil (gnus-icalendar-event:start event) duration-days)))
 
-(defmethod gnus-icalendar-event:sync-to-org ((event gnus-icalendar-event-request) reply-status message-link)
+(defmethod gnus-icalendar-event:sync-to-org ((event gnus-icalendar-event-request) reply-status)
   (if (gnus-icalendar-find-org-event-file event)
-      (gnus-icalendar--update-org-event event reply-status message-link)
-    (gnus-icalendar:org-event-save event reply-status message-link)))
+      (gnus-icalendar--update-org-event event reply-status)
+    (gnus-icalendar:org-event-save event reply-status)))
 
-(defmethod gnus-icalendar-event:sync-to-org ((event gnus-icalendar-event-cancel) reply-status message-link)
+(defmethod gnus-icalendar-event:sync-to-org ((event gnus-icalendar-event-cancel) reply-status)
   (when (gnus-icalendar-find-org-event-file event)
     (gnus-icalendar--cancel-org-event event)))
 
@@ -687,9 +677,6 @@ only makes sense to define names or email addresses."
 (make-variable-buffer-local
  (defvar gnus-icalendar-handle nil))
 
-(make-variable-buffer-local
- (defvar gnus-icalendar-message-link nil))
-
 (defun gnus-icalendar-identities ()
   "Return list of regexp-quoted names and email addresses belonging to the user.
 
@@ -802,13 +789,13 @@ These will be used to retrieve the RSVP information from ical events."
           ;; Back in article buffer
           (setq-local gnus-icalendar-reply-status status)
           (when gnus-icalendar-org-enabled-p
-            (gnus-icalendar--update-org-event event status gnus-icalendar-message-link)
+            (gnus-icalendar--update-org-event event status)
             ;; refresh article buffer to update the reply status
             (with-current-buffer gnus-summary-buffer
               (gnus-summary-show-article))))))))
 
 (defun gnus-icalendar-sync-event-to-org (event)
-  (gnus-icalendar-event:sync-to-org event gnus-icalendar-reply-status gnus-icalendar-message-link))
+  (gnus-icalendar-event:sync-to-org event gnus-icalendar-reply-status))
 
 (defmethod gnus-icalendar-event:inline-reply-buttons ((event gnus-icalendar-event) handle)
   (when (gnus-icalendar-event:rsvp event)
@@ -857,7 +844,6 @@ These will be used to retrieve the RSVP information from ical events."
   (let ((event (gnus-icalendar-event-from-handle handle (gnus-icalendar-identities))))
 
     (setq gnus-icalendar-reply-status nil)
-    (setq-local gnus-icalendar-message-link (org-gnus-store-link))
 
     (when event
       (gmm-labels ((insert-button-group (buttons)

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

* Re: FEATURE: icalendar - link to original gnus message from org entry
  2013-12-19 20:12   ` Jan Tatarik
@ 2013-12-26 15:51     ` Lars Ingebrigtsen
  2013-12-26 22:10       ` Steinar Bang
                         ` (2 more replies)
  2014-02-01  0:34     ` Lars Ingebrigtsen
  1 sibling, 3 replies; 11+ messages in thread
From: Lars Ingebrigtsen @ 2013-12-26 15:51 UTC (permalink / raw)
  To: Jan Tatarik; +Cc: ding, Katsumi Yamaoka

Jan Tatarik <jan.tatarik@gmail.com> writes:

> Here you go.

Looks good.  However, Emacs is in a feature freeze for a month, so it
might be best to hold this back until the trunk is open again.

Or should we create a branch in git Gnus for Emacs 24.4, and keep
applying new features to the Gnus trunk?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



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

* Re: FEATURE: icalendar - link to original gnus message from org entry
  2013-12-26 15:51     ` Lars Ingebrigtsen
@ 2013-12-26 22:10       ` Steinar Bang
  2013-12-26 22:39       ` Katsumi Yamaoka
  2013-12-26 22:40       ` Jan Tatarik
  2 siblings, 0 replies; 11+ messages in thread
From: Steinar Bang @ 2013-12-26 22:10 UTC (permalink / raw)
  To: ding

>>>>> Lars Ingebrigtsen <larsi@gnus.org>:

> Or should we create a branch in git Gnus for Emacs 24.4, and keep
> applying new features to the Gnus trunk?

Yes.




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

* Re: FEATURE: icalendar - link to original gnus message from org entry
  2013-12-26 15:51     ` Lars Ingebrigtsen
  2013-12-26 22:10       ` Steinar Bang
@ 2013-12-26 22:39       ` Katsumi Yamaoka
  2013-12-27  3:30         ` Lars Ingebrigtsen
  2013-12-26 22:40       ` Jan Tatarik
  2 siblings, 1 reply; 11+ messages in thread
From: Katsumi Yamaoka @ 2013-12-26 22:39 UTC (permalink / raw)
  To: ding

Lars Ingebrigtsen wrote:
> Or should we create a branch in git Gnus for Emacs 24.4, and keep
> applying new features to the Gnus trunk?

As for me, a Gnus and Emacs merging engineer, it's ok that anyone
commits new features to the Gnus trunk.  I'll keep them till the
Emacs feature freeze is lifted off.  But please announce it here.



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

* Re: FEATURE: icalendar - link to original gnus message from org entry
  2013-12-26 15:51     ` Lars Ingebrigtsen
  2013-12-26 22:10       ` Steinar Bang
  2013-12-26 22:39       ` Katsumi Yamaoka
@ 2013-12-26 22:40       ` Jan Tatarik
  2 siblings, 0 replies; 11+ messages in thread
From: Jan Tatarik @ 2013-12-26 22:40 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: ding, Katsumi Yamaoka

On Thu, Dec 26 2013, Lars Ingebrigtsen wrote:

[...]

> Looks good.  However, Emacs is in a feature freeze for a month, so it
> might be best to hold this back until the trunk is open again.

> Or should we create a branch in git Gnus for Emacs 24.4, and keep
> applying new features to the Gnus trunk?

I'm for a separate Emacs integration branch.



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

* Re: FEATURE: icalendar - link to original gnus message from org entry
  2013-12-26 22:39       ` Katsumi Yamaoka
@ 2013-12-27  3:30         ` Lars Ingebrigtsen
  2013-12-27  8:32           ` Steinar Bang
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Ingebrigtsen @ 2013-12-27  3:30 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> As for me, a Gnus and Emacs merging engineer, it's ok that anyone
> commits new features to the Gnus trunk.  I'll keep them till the
> Emacs feature freeze is lifted off.

Great!  Then we don't have to mess with different branches during the
Emacs feature freeze.

> But please announce it here.

Will do.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



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

* Re: FEATURE: icalendar - link to original gnus message from org entry
  2013-12-27  3:30         ` Lars Ingebrigtsen
@ 2013-12-27  8:32           ` Steinar Bang
  0 siblings, 0 replies; 11+ messages in thread
From: Steinar Bang @ 2013-12-27  8:32 UTC (permalink / raw)
  To: ding

>>>>> Lars Ingebrigtsen <larsi@gnus.org>:
> Katsumi Yamaoka <yamaoka@jpl.org> writes:

>> As for me, a Gnus and Emacs merging engineer, it's ok that anyone
>> commits new features to the Gnus trunk.  I'll keep them till the
>> Emacs feature freeze is lifted off.

> Great!  Then we don't have to mess with different branches during the
> Emacs feature freeze.

Branches in git are really painless.

Especially when using something as simple as a branch made for
stabilization. 




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

* Re: FEATURE: icalendar - link to original gnus message from org entry
  2013-12-19 20:12   ` Jan Tatarik
  2013-12-26 15:51     ` Lars Ingebrigtsen
@ 2014-02-01  0:34     ` Lars Ingebrigtsen
  2014-02-02 11:20       ` Jan Tatarik
  1 sibling, 1 reply; 11+ messages in thread
From: Lars Ingebrigtsen @ 2014-02-01  0:34 UTC (permalink / raw)
  To: Jan Tatarik; +Cc: ding

Jan Tatarik <jan.tatarik@gmail.com> writes:

>> I get a conflict (and not just from the ChangeLog), when I try to apply
>> this. Could you respin the patch?
>
> Here you go.

For some reason or other, this was in my "pending" mail box.  But this
has been applied, right?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



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

* Re: FEATURE: icalendar - link to original gnus message from org entry
  2014-02-01  0:34     ` Lars Ingebrigtsen
@ 2014-02-02 11:20       ` Jan Tatarik
  0 siblings, 0 replies; 11+ messages in thread
From: Jan Tatarik @ 2014-02-02 11:20 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Jan Tatarik, ding

On Sat, Feb 01 2014, Lars Ingebrigtsen wrote:

> Jan Tatarik <jan.tatarik@gmail.com> writes:

>>> I get a conflict (and not just from the ChangeLog), when I try to apply
>>> this. Could you respin the patch?

>> Here you go.

> For some reason or other, this was in my "pending" mail box.  But this
> has been applied, right?

Right.



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

end of thread, other threads:[~2014-02-02 11:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-12 21:17 FEATURE: icalendar - link to original gnus message from org entry Jan Tatarik
2013-12-18 21:12 ` Adam Sjøgren
2013-12-19 20:12   ` Jan Tatarik
2013-12-26 15:51     ` Lars Ingebrigtsen
2013-12-26 22:10       ` Steinar Bang
2013-12-26 22:39       ` Katsumi Yamaoka
2013-12-27  3:30         ` Lars Ingebrigtsen
2013-12-27  8:32           ` Steinar Bang
2013-12-26 22:40       ` Jan Tatarik
2014-02-01  0:34     ` Lars Ingebrigtsen
2014-02-02 11:20       ` Jan Tatarik

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 NNTP newsgroup(s).