From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Loury Subject: Re: Is OrgMode really GTD compliant? Date: Tue, 29 Apr 2014 15:26:46 +0200 Message-ID: <874n1cjmg9.fsf@konixwork.incubateur.ens-lyon.fr> References: <87wqeaqp5t.fsf@berkeley.edu> <877g68jum5.fsf@konixwork.incubateur.ens-lyon.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wf83l-0001OP-Lg for emacs-orgmode@gnu.org; Tue, 29 Apr 2014 09:27:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wf83h-0003mT-Ai for emacs-orgmode@gnu.org; Tue, 29 Apr 2014 09:26:57 -0400 Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]:38432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wf83h-0003kz-3v for emacs-orgmode@gnu.org; Tue, 29 Apr 2014 09:26:53 -0400 Received: by mail-we0-f175.google.com with SMTP id q58so207820wes.6 for ; Tue, 29 Apr 2014 06:26:52 -0700 (PDT) In-Reply-To: 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: Alan Schmitt Cc: emacs-orgmode@gnu.org, Rene --=-=-= Content-Type: text/plain Alan Schmitt writes: > On 2014-04-29 12:30, Samuel Loury writes: >> Alan Schmitt writes: >>> On 2014-04-28 19:18, Rene writes: >>> I have not defined an Energy property, but I recently played with date >>> properties (and a user defined sorting function). If it's helpful to >>> you, the code is there: >>> https://github.com/brabalan/org-review/blob/master/org-review.el#L156 >> I looked at the code and I don't get what means the part of the code >> getting the org-marker text property of a: >> (get-text-property (point-min) 'org-marker a) >> In this part, the point-min returns the point-min of the current buffer >> (the agenda buffer in that case) while the function looks for the >> property into a. >> >> I tried launching this code into a custom agenda compare function and I >> get the error: >> Args out of range: 1197, 1197 >> This makes sense since the agenda appears to be narrowed at that time so >> that (point-min) returns 1197 and the a string at this time is not 1197 >> characters long. >> >> Replacing (point-min) by 0 appears to work (I assumed the 0th character >> of the string has the wanted text property). > > I used to have `1' instead of `point-min', but I changed it following > a suggestion from Bastien > (http://thread.gmane.org/gmane.emacs.orgmode/85217/focus=85241). Thanks for the link. I am not a good lisp hacker, so I cannot be sure of this, but I suppose Bastien did not notice the last argument 'a'. Indeed, the function is defined as: --8<---------------cut here---------------start------------->8--- (get-text-property POSITION PROP &optional OBJECT) Return the value of POSITION's property PROP, in OBJECT. OBJECT should be a buffer or a string; if omitted or nil, it defaults to the current buffer. If POSITION is at the end of OBJECT, the value is nil. --8<---------------cut here---------------end--------------->8--- Then, the POSITION argument is the position in OBJECT to look for the property. Therefore, the use of a function related to the current buffer (like point-min) seems to strongly assume that OBJECT is the current buffer (or nil). In that case, OBJECT is not the current buffer but a string called 'a'. Thus, IIUC, it makes no sense to use OBJECT=a and POSITION=(point-min). -- Konubinix GPG Key : 7439106A Fingerprint: 5993 BE7A DA65 E2D9 06CE 5C36 75D2 3CED 7439 106A --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTX6iWAAoJEHXSPO10ORBqKvYIAKrDCDSQX7sOPN/VHJugVsWM zZqXZsuCY15lDUdnT3Wy1d71nyBkTOiGgBBSU4gCz5RmO5jfjJy9kE/2NB3mD6nc bOihT4JNerzneev4emlD0Rq8VHepZ58FA1Phk17TNCZ2ffu+AW/pAMDymidkHgD/ QF1iA9Rxd7rtBsD55Y53RkRwSEBBprouPpRsfrfliCrCbkfHxPJiRoc6KX3or6yf CYkD+7Kux9DQOZqrvhLeh+vmGdrdZXk9pOW0TOV17ve17wyvWF8VVmYHYtn8nk8B y6rdSzMS2dcks1Sd3Wt0BaFdManhyGuyzt/Aes3jIGg1s5zX4AC5xUGVrN2Ja+Y= =yxBu -----END PGP SIGNATURE----- --=-=-=--