From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aEikIw84LmF0FgEAgWs5BA (envelope-from ) for ; Tue, 31 Aug 2021 16:09:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 1ewyHw84LmGwNAAA1q6Kng (envelope-from ) for ; Tue, 31 Aug 2021 14:09:19 +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 07E8620E3C for ; Tue, 31 Aug 2021 16:09:19 +0200 (CEST) Received: from localhost ([::1]:37376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL4Ry-0007d4-3A for larch@yhetil.org; Tue, 31 Aug 2021 10:09:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL4LD-0005XN-W7 for emacs-orgmode@gnu.org; Tue, 31 Aug 2021 10:02:20 -0400 Received: from mail-vs1-xe2a.google.com ([2607:f8b0:4864:20::e2a]:39635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mL4L9-0004LZ-VH for emacs-orgmode@gnu.org; Tue, 31 Aug 2021 10:02:19 -0400 Received: by mail-vs1-xe2a.google.com with SMTP id m190so1984269vsm.6 for ; Tue, 31 Aug 2021 07:02:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=l8ZBOZ2ATgB5Xs/QlA+vry/ZcYSVEqMCRfxHYtyJNsM=; b=TCn4T4cRgRkICgK/4W7kgXrjMVbWgxZ40eaBLaiOCraqyQoTxUnd/co7sZuIZWCRlA KXYszQeOnl4592n7mvpLucVv6OIVA4oDFKUL99SrlmL598KMf1tA4zBj1rl0F0mPnbaB udxlpvdPqjDu7qRNEvcfFafSl2TZRqxitbMZ0DlokX93V/m28+e7rfJ6AwMp0Fwu4psn Ra94Xqom++5LTTZqAPJbg3hV3eU2jdMQg5ghqrZheAnIwsZz/nd2jICpQbhVprvhk2HR Ol3H8B+TzHMvtHTthVsHUuI1Rs47dhC4aBb4UZxb/hATTttqPkKd0QVcsh3cCKu/bYkN KQFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=l8ZBOZ2ATgB5Xs/QlA+vry/ZcYSVEqMCRfxHYtyJNsM=; b=mR4w86NlQ/8XEwEs5founkVgDksTKccifnR1DEVMzein058otCUVil8f9qOiqmtKXg nRU/IkerBAWOpveMX3l8wXjdjHZaTm2rRGKTx9c3kDBEuBrMBcU/JAyp/1DeVeRu6Cts 74/hGCh2KPyo//25A2cehQdP8sbdBhGepuyRXGnWPHEIR0UHTEfmbB1/dwfXbmBoJxqU 2ZMuSxtZUGCjxGqWIsEnu21kB3nOfM3wxHUmy4ozo8OgyFPkjKNpAfuPpIePyz9ZfXZi h+PUrU4bBUDw1ns3yFT2Mrn3DFuwpKy1/JzmUtKXy2cg+hg/JwMLS1NVfKcIVQkkMF0c OWeQ== X-Gm-Message-State: AOAM530Uxpln/8ERmMRh/eG6i3cNMvDjXrMLklbkJ+mgvlHXDVX03JR6 SzwQ7juvICDVEYRH9Oti82nYq3wzbFT8J9Njh82mYB/2Lis= X-Google-Smtp-Source: ABdhPJye9eyZuARm4ELJ/BGSrkusQChMVA4pV6WIY1mnKRSm0Ab2qcr75dJAQkohVTmAmxoZu+cGYBdnGThJy2bKzRs= X-Received: by 2002:a67:f243:: with SMTP id y3mr19027727vsm.33.1630418531292; Tue, 31 Aug 2021 07:02:11 -0700 (PDT) MIME-Version: 1.0 From: Shankar Rao Date: Tue, 31 Aug 2021 16:02:00 +0200 Message-ID: Subject: Insert outline breadcrumbs just before headings text in agenda view To: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="0000000000006499c105cadb6503" Received-SPF: pass client-ip=2607:f8b0:4864:20::e2a; envelope-from=shankar.rao@gmail.com; helo=mail-vs1-xe2a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630418959; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=l8ZBOZ2ATgB5Xs/QlA+vry/ZcYSVEqMCRfxHYtyJNsM=; b=bJG6x7E1Oq9zXdSUKkh32MNiYqFPrUCK3g4p/G2ch5pnqQy6nxdtQst1MN0qE+Ci5Lbu9Z kJThdsPMQHQSSMh68QzomX2Epw73Ha1JmZ68kQzZJc+nXcj8hAOok6fePukb0BhLOk9ny8 GlCwf2IcHYS3dQu2136NsMZVQTuof/TbiXLNqExEqUnxS3CmQbbwDR+wCXDvUMVq3iimkq /DajPSoJNwZy3S/o6Z0FgaJyEQQ+PytvshJTWO5XeZ/3OwMjEI7C/9menY1WHxF21X/jsS nlkwoS9wXr/CyJXjF9tItHKlzq5LQKPl87ddMNRSxndY6cx5GbrHjmoDaqyD/Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630418959; a=rsa-sha256; cv=none; b=suc9d+tynwPWQLuew/hB8o5tqsE5d9BFz4ymh8ydPi/M27NEn2VbynmnQu/h/aTnbhdsH5 Mz5JamjgRaumBJ5nkVlbOtNpzwkHLcP29QaZ82bmH80Ue4/Y3O1K8SzrPPafVK9kZROSiX aGk6SNO7q88HaIj2J7qlazam0qe8va7TvFWetAtzopZYO9AQs0hdNdSqf12VhHX6u37uqs +DKo6haJYwjvddymxeVMzhNiynSjs4/RtVsOMdz3A9sZUMiOMgzyy8mZOtZOiK3BeddppJ d0do+YmAzwLieTetSk7RFMNU+P7dt+j/XWbUVaJLINw6NHqpwv1S4cjs72Je8w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=TCn4T4cR; 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-Migadu-Spam-Score: -1.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=TCn4T4cR; 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-Migadu-Queue-Id: 07E8620E3C X-Spam-Score: -1.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: d36O19kP5aWR --0000000000006499c105cadb6503 Content-Type: text/plain; charset="UTF-8" In Emacs org-mode, I have a set of TODOs in the following format: * H1 ** H2 *** H3 **** TODO [#A] File Taxes If I activate breadcrumbs in org-agenda-prefix-format (i.e., by doing (setf (alist-get 'agenda org-agenda-prefix-format) " %i %-12:c%?-12t% s%b")), when I look at the agenda-todo view, it shows up as: H1->H2->H3->TODO [#A] File Taxes However, I would like it to instead be displayed like this: TODO [#A] H1->H2->H3->File Taxes I asked about this on Reddit and Stack Exchange , and since it appeared that no one had already come up with a solution for this, I decided to cook up my own using an advice function: (defvar org-agenda-breadcrumbs-level 1 "Highest level subtree to include in Org agenda breadcrumb.") (defun org-agenda-breadcrumbs-string () "Create formatted string with outline of Org subtree at point. The outline goes up to subtree level `org-agenda-breadcrumbs-level` and the subtree headings are separated by `org-agenda-breadcrumbs-separator`." (org-format-outline-path (nthcdr (1- org-agenda-breadcrumbs-level) (org-get-outline-path)) (1- (frame-width)) nil org-agenda-breadcrumbs-separator)) (defun org-agenda-insert-breadcrumbs-before-text (args) "In Org agenda, insert outline breadcrumbs just before heading text in ARGS. This is an advice function for use with `org-agenda-format-item` by doing: (advice-add #'org-agenda-format-item :filter-args #'org-agenda-insert-breadcrumbs-before-text) Since ARGS is the list of arguments to be passed to `org-agenda-format-item`, the second list element of ARGS contains the heading text to be modified." (org-with-point-at (org-get-at-bol 'org-marker) (let* ((txt (org-get-heading t t t t)) (index (or (cl-search txt (cadr args)) 0)) (bc (let ((s (org-agenda-breadcrumbs-string))) (if (eq "" s) "" (concat s org-agenda-breadcrumbs-separator))))) (setf (substring (cadr args) index index) bc) args))) (advice-add #'org-agenda-format-item :filter-args #'org-agenda-insert-breadcrumbs-before-text) In my init.el, because I don't want the top level headings in the outline breadcrumbs, I also have the following: (setq org-agenda-breadcrumbs-level 2) In my opinion, a feature like this is of sufficiently broad interest that it should be included in Org so that it can be enabled without the use of an advice function. However, it's not clear to me what would be the best interface for configuring it. For example, it doesn't make sense to add an option for this to org-agenda-prefix-format, since this modifies the heading text rather than the prefix. If people agree that this feature is of broad interest, and have suggestions on a good configuration interface, I would be happy to submit this as a patch. Shankar Rao --0000000000006499c105cadb6503 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In Emacs org-mode, I have a set of TODOs in the following format:
* H1
** H2
*** H3
**** TODO [#A] File Taxes
If I activate breadcrumbs in org-agenda-prefix-format (i.e., b= y
doing (setf (alist-get 'agenda org-= agenda-prefix-format)
" %i %-12:c%?-12t% s= %b")), when I look at the agenda-todo view, it
s= hows up as:
H1->H2->H3->TODO [#A] File Taxes
<=
code>However, I would like it to instead be=
 displayed like this:
TODO [#A] H1->H2->H3->File Taxes
I asked abou=
t this on Reddit and=
 Stack E=
xchange, and since it 
appeared that no one had already come up with= a solution for
this, I decided to cook up my own using an advice funct= ion:
(defvar org-agenda-breadcrumbs-level 1 "Highest level subtree to include in Org agenda breadcrumb.") (defun org-agenda-breadcrumbs-string () "Create formatted string with outline of Org subtree at point. The outline goes up to subtree level `org-agenda-breadcrumbs-level` and the subtree headings are separated by `org-agenda-breadcrumbs-separator`." (org-format-outline-path (nthcdr (1- org-agenda-breadcrumbs-level) (org-get-outline-path)) (1- (frame-width)) nil org-agenda-breadcrumbs-separator)) (defun org-agenda-insert-breadcrumbs-before-text (args) "In Org agenda, insert outline breadcrumbs just before heading text = in ARGS. This is an advice function for use with `org-agenda-format-item` by doing: (advice-add #'org-agenda-format-item :filter-args=20 #'org-agenda-insert-breadcrumbs-before-text) Since ARGS is the list of arguments to be passed to `org-agenda-format-item`, the second list element of ARGS contains the heading text to be modified." (org-with-point-at (org-get-at-bol 'org-marker) (let* ((txt (org-get-heading t t t t)) (index (or (cl-search txt (cadr args)) 0)) (bc (let ((s (org-agenda-breadcrumbs-string))) (if (eq "" s)
"&qu= ot;
(concat s org-agenda-breadcrumbs-separator)))))<= br> (setf (substring (cadr args) index index) bc) args))) (advice-add #'org-agenda-format-item :filter-args #'org-agenda-insert-breadcrumbs-before-text)
In my init.el, because I don't want the top level headings= in the
outline breadcrumbs, I also have the following:

(s= etq org-agenda-breadcrumbs-level 2) In my opinion, a feature like this is of sufficiently broad
interest tha= t it should be included in Org so that it can be enabled
without the u= se of an advice function. However, it's not clear to me
what would b= e the best interface for configuring it. For example,
it doesn't mak= e sense to add an option for this to
org-agenda-prefix-format, since this modifies the heading textrather than the prefix.
If people agree that this feature is of broad interest, and=
 have
suggestions on a good configuration interface, I would be happyto submit this as a patch.

Shankar Rao
--0000000000006499c105cadb6503--