Gnus development mailing list
 help / color / mirror / Atom feed
From: Jan Tatarik <jan.tatarik@gmail.com>
To: ding@gnus.org
Subject: Re: FEATURE: icalendar - link to original gnus message from org entry
Date: Thu, 19 Dec 2013 21:12:46 +0100	[thread overview]
Message-ID: <87r4988url.fsf@nb-jtatarik2.xing.hh> (raw)
In-Reply-To: <87lhzhq2wp.fsf@topper.koldfront.dk> ("Adam \=\?utf-8\?Q\?Sj\?\= \=\?utf-8\?Q\?\=C3\=B8gren\=22's\?\= message of "Wed, 18 Dec 2013 22:12:38 +0100")

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

  reply	other threads:[~2013-12-19 20:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12 21:17 Jan Tatarik
2013-12-18 21:12 ` Adam Sjøgren
2013-12-19 20:12   ` Jan Tatarik [this message]
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

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r4988url.fsf@nb-jtatarik2.xing.hh \
    --to=jan.tatarik@gmail.com \
    --cc=ding@gnus.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.
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).