From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bert Burgemeister Subject: Re: [Accepted] Making the output of %% functions linkable in agenda views Date: Fri, 06 May 2011 09:49:30 +0200 Message-ID: <80ei4c5kvp.fsf@ID-264851.user.dfncis.de> References: <87aaf3tv5l.fsf@fastmail.fm> <20110504074311.96ACF43B354@u016822.science.uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIFnI-00018v-TI for emacs-orgmode@gnu.org; Fri, 06 May 2011 03:49:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIFnF-0007Bg-IO for emacs-orgmode@gnu.org; Fri, 06 May 2011 03:49:48 -0400 Received: from lo.gmane.org ([80.91.229.12]:54169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIFnF-0007BN-7M for emacs-orgmode@gnu.org; Fri, 06 May 2011 03:49:45 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QIFnC-0005Sx-S8 for emacs-orgmode@gnu.org; Fri, 06 May 2011 09:49:42 +0200 Received: from 141.30.183.169 ([141.30.183.169]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 May 2011 09:49:42 +0200 Received: from trebbu by 141.30.183.169 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 May 2011 09:49:42 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Carsten Dominik writes: > Patch 781 (http://patchwork.newartisans.com/patch/781/) is now "Accepted". > > Maintainer comment: none > > This relates to the following submission: > > http://mid.gmane.org/%3C87aaf3tv5l.fsf%40fastmail.fm%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: [O] Making the output of %% functions linkable in agenda views >> Date: Wed, 04 May 2011 00:56:54 -0000 >> From: Matt Lundin >> X-Patchwork-Id: 781 >> Message-Id: <87aaf3tv5l.fsf@fastmail.fm> >> To: Charles.Sebold@lcms.org (Sebold, Charles) >> Cc: emacs-orgmode >> >> charles.sebold@lcms.org writes: >> >> > On 7 Apr 2011, Charles Sebold wrote: >> > >> >> Here's a test. Take the line below and put it in an agenda file, then >> >> view the agenda. >> >> >> >> %%(format "%s" (concat "[[elisp:(info)]" "[Link to info]]")) >> >> >> >> The results as I see them give me a link that I can mouse-click on, >> >> but I can't move point to it and hit C-c C-o. >> >> >> >> What do I need to do to make this a normal org link in every way? Or >> >> is this a bug? >> >> >> >> Here's what seems to be going on. >> >> Clicking with the mouse works because it calls org-open-at-mouse, which >> (by calling org-open-at-point) simply looks at the text surrounding the >> click point to find a link. >> >> The function org-agenda-open-link, on the other hand, grabs part of the >> headline as a string (the prefix), then jumps to the location in the >> original buffer and calls org-offer-links-in-entry to look for links in >> both the entry and the prefix of agenda text. Obviously, it won't find >> your link in the original entry since it looks like this: >> >> %%(format "%s" (concat "[[elisp:(info)]" "[Link to info]]")) >> >> I think it shouldn't be a problem to pass the whole agenda line to >> org-offer-links-in-entry. This will not result in duplicate links, since >> org-offer-links-in-entry "uniquifies" the links. >> >> I've attached a patch. >> >> The bigger question, however, is why the expression above is even >> showing up in the agenda, since it contains no scheduling information. >> :) >> >> Best, >> Matt >> >> >> >From 58c7621c0c84b9c1930098a098e4559aa516eec0 Mon Sep 17 00:00:00 2001 >> From: Matt Lundin >> Date: Tue, 3 May 2011 15:54:35 -0400 >> Subject: [PATCH] Pass entire text of agenda line to org-offer-links-in-entry. >> >> * lisp/org-agenda.el (org-agenda-open-link): Pass entire text of >> agenda line to org-offer-links-in-entry. >> >> This fixes bug noticed by Charles Sebold, in which links that are >> dynamically formatted for the agenda view are ignored. >> http://permalink.gmane.org/gmane.emacs.orgmode/40673 >> --- >> lisp/org-agenda.el | 4 +--- >> 1 files changed, 1 insertions(+), 3 deletions(-) >> >> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el >> index 65f7cea..609edd4 100644 >> --- a/lisp/org-agenda.el >> +++ b/lisp/org-agenda.el >> @@ -6879,9 +6879,7 @@ at the text of the entry itself." >> (org-get-at-bol 'org-marker))) >> (buffer (and marker (marker-buffer marker))) >> (prefix (buffer-substring >> - (point-at-bol) >> - (or (text-property-any (point-at-bol) (point-at-eol) 'org-heading t) >> - (point-at-bol))))) >> + (point-at-bol) (point-at-eol)))) >> (cond >> (buffer >> (with-current-buffer buffer >> -- >> 1.7.5 >> >> > > Just curious, is there anything I should have known that prevented the patch submitted in http://article.gmane.org/gmane.emacs.orgmode/39313, > From: Bert Burgemeister > Subject: [O] [PATCH] Bugfix: org-agenda-open-link > Newsgroups: gmane.emacs.orgmode > To: emacs-orgmode@gnu.org > Date: Sun, 13 Mar 2011 16:18:44 +0100 > > > * Org-agenda.el (org-agenda-open-link): C-c C-o didn't open links > inserted via the `%%( )' mechanism, affecting usability of > `%%(org-bbdb-anniversaries). > > TINYCHANGE > --- > > > The bug was apparently introduced in commit > ba1e90893d128d8004e4cb6763af692c5a6cd677. > > -- > Bert > > > > lisp/org-agenda.el | 14 +++++++------- > 1 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index 4b4dd68..123668c 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -6742,13 +6742,13 @@ at the text of the entry itself." > (+ (point-at-bol) > (or (org-get-at-bol 'prefix-length) 0))))) > (cond > - (buffer > - (with-current-buffer buffer > - (save-excursion > - (save-restriction > - (widen) > - (goto-char marker) > - (org-offer-links-in-entry arg prefix))))) > + ((and buffer > + (with-current-buffer buffer > + (save-excursion > + (save-restriction > + (widen) > + (goto-char marker) > + (org-offer-links-in-entry arg prefix)))))) > ((or (org-in-regexp (concat "\\(" org-bracket-link-regexp "\\)")) > (save-excursion > (beginning-of-line 1) > -- > 1.7.2.3 from being noticed? -- Bert