From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id D0FLHAVClV7jCQAA0tVLHw (envelope-from ) for ; Tue, 14 Apr 2020 04:54:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id gI0NDQhClV5rSwAA1q6Kng (envelope-from ) for ; Tue, 14 Apr 2020 04:54:32 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2ADE1941AD6 for ; Tue, 14 Apr 2020 04:54:30 +0000 (UTC) Received: from localhost ([::1]:52546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jODae-0005jw-NF for larch@yhetil.org; Tue, 14 Apr 2020 00:54:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59047) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jODaE-0005jY-6X for emacs-orgmode@gnu.org; Tue, 14 Apr 2020 00:54:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jODaC-0002ih-Nm for emacs-orgmode@gnu.org; Tue, 14 Apr 2020 00:54:02 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:51927) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jODaC-0002iL-G8 for emacs-orgmode@gnu.org; Tue, 14 Apr 2020 00:54:00 -0400 Received: by mail-pj1-x1034.google.com with SMTP id e16so4487361pjp.1 for ; Mon, 13 Apr 2020 21:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=ZGM1LS6jOdFKwOTqm0IjOPKVk/3S779HAwD0sT0H70Y=; b=mER6jTc0WTWMJFi0D1l25QBYQtWkZK+Icob3M5x3yVItKahROiFYs/0HNgNvxxvaWx MyRc/hZcimDgovFfSVI334aEGaNqb6yyhMY0ih6IkUgPxwrod+ut00terLtY1IA/5zVu qHt5DbEUEmv/yYhCDywPHB6x40zwXxfgSH7T61kQz/zIkQ7P6I/0wdhQ9I5XgqvzmCrK kIWSfpZd1iOq0G48xaFVae5S9DBT3CMFYFkGxZzIwpDquWldfOZ4ILO8wEybU4u6O3cl oG6eAsWTdOLEJkO2bK60qUkK/WSYSaPHbkpHCxxGGtySZLpwDN7kDkL4qCYXZXfsY/3E xH+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=ZGM1LS6jOdFKwOTqm0IjOPKVk/3S779HAwD0sT0H70Y=; b=SNKGb06AI9WvUne4S7vHzTKUDgIJrmiryskYaN/sVd7ra6kWhWSp5aPqdB1rZk3Ar2 1OeOLntDTO9RPZuq2NHWiNfMq3RVTNVEzE4elxcuIFTLILLQTwBnfpMar0kQiXFg+EOA 38mUCOCBk/+8XRXoqMXpYGGzDhaGzgJ9ECexEX962Zf3ecTmv+bG6W232DiM+Deszy/C SFcUdQP3vlOBXK93wKEtI2nKcpFTzuWSndnmtobCX3kMUhi50RmGvymZ8nFl/N2OEiGR OQ1pLNF5VLwLLPqQO8iGhp896+GDfmVC08YDswn7FoxzPs+BisAuP5KyyMwjKT2EvXPv Ax3w== X-Gm-Message-State: AGi0PuawgFYNpwaZiaNiDHwxDi1BHxTmA/6g5lXnmx3PYmOKg/68BQ5W VVyp9aqAAmpnbpjMV+Xx+bU= X-Google-Smtp-Source: APiQypLln/e/WjLp1efQLxTl+eacqpFrflAUJPifZzQ7PMTY8qefFP7j0TcA6Y7RpZKl3YeAiT2y7Q== X-Received: by 2002:a17:902:9b89:: with SMTP id y9mr12696211plp.75.1586840039084; Mon, 13 Apr 2020 21:53:59 -0700 (PDT) Received: from localhost ([210.3.160.226]) by smtp.gmail.com with ESMTPSA id x188sm10054712pfx.198.2020.04.13.21.53.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 21:53:58 -0700 (PDT) From: Ihor Radchenko To: Samuel Maynard , emacs-orgmode@gnu.org Subject: Re: custom props in `org-agenda-get-scheduled` In-Reply-To: References: Date: Tue, 14 Apr 2020 12:50:12 +0800 Message-ID: <87r1wqu0vv.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1034 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: -1.21 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=mER6jTc0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [-1.21 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.57631678374481]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; FREEMAIL_FROM(0.00)[gmail.com]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.28), country: US(-0.01), ip: 209.51.188.17(-0.58)]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FREEMAIL_TO(0.00)[gmail.com,gnu.org]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[yantar92@gmail.com,emacs-orgmode-bounces@gnu.org]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; HAS_LIST_UNSUB(-0.01)[]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_SEVEN(0.00)[7]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: FylKBq+tm3P5 > The problem is that there doesn't seem to be any hook available for me > to add a prop during the agenda creation process. Am I missing > something? Or do I just need to modify `org-agenda-get-scheduled` directly? The closest to what you want is org-agenda-prefix-format, where you can add user-defined functions to format prefix strings in agenda. The function will be ran with point at the headline in org file. Alternatively, you may add a function cycling over the agenda headlines to org-agenda-finalize-hook. Then, you can edit the agenda lines as you wish. Every headline in agenda has 'org-hd-marker text property pointing to the headline position in the org file. Hope it helps. Best, Ihor Samuel Maynard writes: > Hi all, > > First time on the mailing list. Been using org-mode for about half a year. > > I'm trying to add a custom display to the agenda view, similar to > org-habit. I'm want to pull information from a task's `:LOGBOOK:` drawer > and display some stats next to the item in the agenda view. > > I've written the code that parses the stats I'm interested in, but I > can't seem to figure out how to show them in the agenda. Looking through > the org-habit code it seems I need to first use `org-add-props` (or > `add-text-properties`) to add a custom `text-property`, which I can then > process in an `org-finalize-hook`. > > The problem is that there doesn't seem to be any hook available for me > to add a prop during the agenda creation process. Am I missing > something? Or do I just need to modify `org-agenda-get-scheduled` directly? > > Thanks, > Sam > -- Ihor Radchenko, PhD, Center for Advancing Materials Performance from the Nanoscale (CAMP-nano) State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg