From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/83986 Path: news.gmane.org!not-for-mail From: Jan Tatarik Newsgroups: gmane.emacs.gnus.general Subject: Re: FEATURE: icalendar - link to original gnus message from org entry Date: Thu, 19 Dec 2013 21:12:46 +0100 Message-ID: <87r4988url.fsf@nb-jtatarik2.xing.hh> References: <87mwk5g45h.fsf@nb-jtatarik2.xing.hh> <87lhzhq2wp.fsf@topper.koldfront.dk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1387484055 1802 80.91.229.3 (19 Dec 2013 20:14:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Dec 2013 20:14:15 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32238@lists.math.uh.edu Thu Dec 19 21:14:21 2013 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vtjz9-0002AM-BO for ding-account@gmane.org; Thu, 19 Dec 2013 21:14:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Vtjy1-0001r1-L7; Thu, 19 Dec 2013 14:13:09 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Vtjxx-0001qh-SZ for ding@lists.math.uh.edu; Thu, 19 Dec 2013 14:13:05 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1Vtjxv-0005J9-UW for ding@lists.math.uh.edu; Thu, 19 Dec 2013 14:13:05 -0600 Original-Received: from mail-bk0-f45.google.com ([209.85.214.45]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1Vtjxq-0002M1-Hn for ding@gnus.org; Thu, 19 Dec 2013 21:13:02 +0100 Original-Received: by mail-bk0-f45.google.com with SMTP id mx13so890834bkb.18 for ; Thu, 19 Dec 2013 12:12:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=BunW22oLlUjJ6BO+llx97i+nFR6JVz96ybtFq6bWt70=; b=zvrHLdZhIXU1ca8uFh0Hx92YLsUFVnKZ+i8BfhqMHftzAC03k2ZzcqAsAPADfvik/o kJG/rJFfqIzQLgXdj7mwG/C4At+x7Q7rO/A/okYfKgQAb+Cqq4ehZZ9NtOJ+fu+/ilg4 tJ2OdkxaG2MZRXWTRVaednU7jpJzn27hACtks5XbLX79Ia1p1f6k0hjvMhR34pjJMrM/ pYAiInen5Jzh5b0v4XnO+f94+Lb0eDOu3JDj93Tut/uZR1hXNCfE29u4xkTaUzkDs8Ci H2Z9DUYrh0WLUSxmETyPw/MOc83ol4NzkIBGU4aD2ksOTPDEoZkhAqQAm0a0vdUtji49 GeKA== X-Received: by 10.204.53.75 with SMTP id l11mr1725692bkg.35.1387483972872; Thu, 19 Dec 2013 12:12:52 -0800 (PST) Original-Received: from nb-jtatarik2.xing.hh (e177052130.adsl.alicedsl.de. [85.177.52.130]) by mx.google.com with ESMTPSA id tn8sm4452685bkb.16.2013.12.19.12.12.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 19 Dec 2013 12:12:51 -0800 (PST) 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") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Spam-Score: -3.0 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:83986 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Dec 18 2013, Adam Sj=C3=B8gren wrote: > Jan Tatarik 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=message-link.patch 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 - - * 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 * 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) --=-=-=--