From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id cLXXOY9TpGJxRQAAbAwnHQ (envelope-from ) for ; Sat, 11 Jun 2022 10:34:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MINyOY9TpGKuLgAAauVa8A (envelope-from ) for ; Sat, 11 Jun 2022 10:34:23 +0200 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 886F7169BD for ; Sat, 11 Jun 2022 10:34:23 +0200 (CEST) Received: from localhost ([::1]:34936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzwZa-0000v8-GI for larch@yhetil.org; Sat, 11 Jun 2022 04:34:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzwXD-00080L-6C for emacs-orgmode@gnu.org; Sat, 11 Jun 2022 04:31:55 -0400 Received: from mail-vs1-xe2c.google.com ([2607:f8b0:4864:20::e2c]:42701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzwXB-0006OI-Ia for emacs-orgmode@gnu.org; Sat, 11 Jun 2022 04:31:54 -0400 Received: by mail-vs1-xe2c.google.com with SMTP id i186so1326066vsc.9 for ; Sat, 11 Jun 2022 01:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=WdKbSpiVy5cI/NUiK0YctLXpP+CSVYT1UGs7Y9seA8w=; b=lsnaPWplQtnPPSOeeIRrNtCNFfgMJPJhHR1emRe+VBwsq4P7BVaydrnKDbhVXqQ/1o P260dE+dXK4sNggMEl+lQrfQQStfzq+TCfloydeH4Jj262ZDp8EiuJwitnTRPB1/jCg2 Qyxo75PbK3rleEk00Ox1gg7BBfz3C84qv9ws1s5voVn16sl+b1gcz3hyTf5mPFp23jfb hin4aD8SBydmyALEdhWhwgkZBqI/WmcPxngCIZhr7riopHoKOxn5z3CX3tSqJDVM53NX 4lNCe5LnfuyIFaoDRQtjRj/a5RqjhU930zxLXOpTequDkeNfuypoylBK1b813kvEvzN1 NTRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=WdKbSpiVy5cI/NUiK0YctLXpP+CSVYT1UGs7Y9seA8w=; b=71Y64H0relfz8sd8rZZimuFdTr8d3WyfrjJdMvTvSitxSwIHwPsVJEsgsjC+7Cqbuk Pt1ddQCJRkAroFqz7yZYsa56byekq/ndJFY2i2lNYBUXeUDxstV2NDhl33n3CLRjq85X mKA+0RsTSLAmO6u96H3rhI0dxgjU8m29FtmWqfFxSxzOz5BGijUrBYk3g0VsQYqLV2VB 9Ilf5k8kDAaIzfRq2p/Y2mRXWKLqIie8wkw0v9aVBskxb38f1epKOlPMCced7yLNwxDa CEduoniDPN9XrheV+IArhT898iE3Spfk5LXMCLIEM6nL3W6ntjnV3tCg5h4xBHyWhtPl G85g== X-Gm-Message-State: AOAM531YY2y8fOw7SGZejtN8AbMtssbkAnb913ifJPw4ow4WhyIIS6aF qkSMC2j2IKhcaikOjZE6QYXz7Dh1nr2nhe0R X-Google-Smtp-Source: ABdhPJx+KbMsjc8ayZ/69R4cOTSm4WljbOgkRusIwQXZv2BGLT9Ayf/Ri1/D84AfEP4jO87QcPsX4g== X-Received: by 2002:a17:902:f682:b0:163:f4e9:5145 with SMTP id l2-20020a170902f68200b00163f4e95145mr48829579plg.63.1654936302295; Sat, 11 Jun 2022 01:31:42 -0700 (PDT) Received: from localhost ([64.32.23.62]) by smtp.gmail.com with ESMTPSA id b1-20020a170902a9c100b0015ea8b4b8f3sm982537plr.263.2022.06.11.01.31.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jun 2022 01:31:41 -0700 (PDT) From: Ihor Radchenko To: Mikhail Skorzhinskii Cc: Org Mode Subject: Re: [PATCH] org-agenda.el: customise outline path in echo area In-Reply-To: References: <645e9e94235057a7b8f4b541fe11677d6f74ccf8.camel@eml.cc> <87k0frscpe.fsf@localhost> Date: Sat, 11 Jun 2022 16:32:19 +0800 Message-ID: <87r13vbnxo.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::e2c; envelope-from=yantar92@gmail.com; helo=mail-vs1-xe2c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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 X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654936463; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=WdKbSpiVy5cI/NUiK0YctLXpP+CSVYT1UGs7Y9seA8w=; b=CAyQNpV7k3TeCls82vBmQgUOaGoM8evixALjozGWPK1f/ibL6DkBUTm0q/YVeyLgtRztmN gNMcXic9IP+MjQfPPnnGYpWhLyQYbsQEeCmcwj8tS9Ucgth9QsKK9f7sE++2kqtwy0oMLM 52/BGpwgAFijGWPI/KOenP9UsNNyamIbEOrnDuB1fdJ3lrpBMVHVq08/Lxoaxm3ToqwBmx ousUqiDmyfQ+xTwaEWwqHCU0GzIFUHkG6kZcaAYTahbbDJVWzgYwKiPBQ8LcOs0i3XCylu vA9DQsI6NQ6j9oAqq1CDo9TGE+rpE+fEPzEplM/6o+nliTa0zi4/l9MmdfD+Qg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654936463; a=rsa-sha256; cv=none; b=HUI1dQzgezo8hxRfL+66ISDbyrmh57YbLnMqyd2I8JckDq5tMXIj8Aod2CpVerE4SsdKwV VJ5BUt/KzG8ZwPltHVhLc8ED+ZBsiTD+5OPAV5UtcGuz5zm9NEQsjrLRNDr5JAe8rsnYvE H2ylYbEe32NzsqktKzUifhQSte1vZBl4nCF9GNsCw+P4NcUXNgzzjLtjZu86RdbWeuvZJ2 JitxRxZqLWkKNlV5w5dncVLj+CXVaxvmY8KQPDXQdUyWSX2g/e9bgFvAkrfV/Id7ULDWz2 7Aw0ZSVeB4hTZanwyMI3HODGI5auScsricM6iY7aGQq9xHEge5rfNb4JIvmJjw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lsnaPWpl; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.79 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lsnaPWpl; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 886F7169BD X-Spam-Score: -8.79 X-Migadu-Scanner: scn0.migadu.com X-TUID: pywN1dq0uOzi Mikhail Skorzhinskii writes: > Thank you for your comments once again. I've changed string= to eq and > it appears to be working OK. > > I've also renamed "title" variable to "title-prop" for better > readability. The -prop suffix should show the reader that it was > extracted from the file, and thus cost some CPU/IO. > > I've attached an updated version to this email. Would love to hear what > you think. Thanks! And sorry for the late reply. Your patch fell through the cracks in my todo list. > * lisp/org-agenda.el (org-agenda-show-outline-path): add an option to > show document title in outline path (instead of file name) > * lisp/org.el (org-get-title-from-file): a function to collect the > document title from the org-mode file > * lisp/org.el (org-display-outline-path): add logic that will collect a > document title and put it into the outline path if > org-agenda-show-outline-path set to 'title It would make sense to document the new customization in ORG-NEWS. > +(defun org-get-title-from-file (file) > + "Collect tilte from the provided `org-mode' FILE." > + (let (title) ^ typo > + (when file > + (with-current-buffer > + (get-file-buffer file) > + (pcase (org-collect-keywords '("TITLE")) > + (`(("TITLE" . ,val)) > + (setq title (car val))))) > + title))) Note that this function behavior is underfined when FILE buffer does not exist. It would be better to accept buffer as argument. Best, Ihor