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 aGb+KAUvDmPSdQEAbAwnHQ (envelope-from ) for ; Tue, 30 Aug 2022 17:38:45 +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 sGfnKAUvDmPSZQEAauVa8A (envelope-from ) for ; Tue, 30 Aug 2022 17:38:45 +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 2688E944F for ; Tue, 30 Aug 2022 17:38:45 +0200 (CEST) Received: from localhost ([::1]:41668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT3K7-0002ME-5k for larch@yhetil.org; Tue, 30 Aug 2022 11:38:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT3B5-0005ro-HI for emacs-orgmode@gnu.org; Tue, 30 Aug 2022 11:29:23 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:38159) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT3B3-0000lq-65 for emacs-orgmode@gnu.org; Tue, 30 Aug 2022 11:29:23 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B99045C00AF; Tue, 30 Aug 2022 11:29:20 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 30 Aug 2022 11:29:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eml.cc; h=cc:cc :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1661873360; x=1661959760; bh=6Y9q/J7GEu WptyE0I+ZriicDbIT3ozxNgDI+/E043BQ=; b=FYu/Fqt7sD8piIKticvCRhiSwr XS1FVjyGJBtEX6ySLFzF434g334PDJkTtpKunOlF/0LycWmWpGRguAj7puVW+/N9 sDiADGDMETHF1l+TUre1aNM5OT+9rJjFgWUpnZ6WmtyCAlIOthZMKJ78DshuA4Nu PsEigG9xKPp15M0SXP0FdsTXgAZjDRRYPG2u1+MyX60h2WcXxxD93u4Yt0Sw0m8V wMwQ1i0XxccTg3GsiuSfEgT/GnOKbVtpqa7+9663y+MOvuHt8Hq3HnvzCRq86YMY 0DZ3OAzhntQVjqziZU7/Ca7la0Vrkc7OWbWy0GyBcCCchlTL3PVNW5docLeA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1661873360; x=1661959760; bh=6Y9q/J7GEuWptyE0I+ZriicDbIT3 ozxNgDI+/E043BQ=; b=cE9jyi/+oY4LmtP+53fANWc/e2fvKaW/obr8Q4Smx3A/ wlnLfcV3TUBV0Sry5Z6nOtLaONgwcbo/lUSvmUb0B1Ng0pLvrRPXjSvUu/hUjLhj U46AEhgD8QAhyhqtpew7uznBs1xHXtMVZXJqUnkxMrXlBwbODRfMTCHhKaN32nN6 6podyk2BEPSqC69Z8OXkMrs+TSgzDVcR0hpnTSM9HnBe9XIQQy+lxptuuWHxJo3B Z4COM7VY7kuLCQrH1Hyi1Yyh+OucMYLc9/02XHchlrUw8JRxuZ4BI8hD9Bzko4ZK FNMlr4oJCxXpl208JbyC0LoyCA7hPkqfnJ1FNH+HZQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdekfedgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdludehmdenucfjughrpefhvfevuffffhgfjgfkgggtsehmtderredt reejnecuhfhrohhmpefoihhkhhgrihhlucfukhhorhiihhhishhnkhhiihcuoehmshhkoh hriihhihhnshhkihhisegvmhhlrdgttgeqnecuggftrfgrthhtvghrnheptdffuefhvdeh hedvtdeihefhieejgedtieelhfdtfeehfeelgeeiveeiheegtddtnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhskhhorhiihhhinhhskhhi hiesvghmlhdrtggt X-ME-Proxy: Feedback-ID: i171146f6:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 30 Aug 2022 11:29:19 -0400 (EDT) From: Mikhail Skorzhisnkii To: Ihor Radchenko Cc: Mikhail Skorzhinskii , Org Mode Subject: Re: [PATCH] org-agenda.el: customise outline path in echo area Date: Tue, 30 Aug 2022 16:59:57 +0200 References: <645e9e94235057a7b8f4b541fe11677d6f74ccf8.camel@eml.cc> <87k0frscpe.fsf@localhost> <87r13vbnxo.fsf@localhost> User-agent: mu4e 1.8.7; emacs 29.0.50 In-reply-to: <87r13vbnxo.fsf@localhost> Message-ID: <87r10x22lw.fsf@eml.cc> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=66.111.4.29; envelope-from=mskorzhinskiy@eml.cc; helo=out5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-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=1661873925; 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=TOIwE+oAoKjp965kDfb+80W2SzapKY7Ef2SqGQUFWTU=; b=mM0ydIwQOKb3c45qUL1UPp5tc8wOk+h/WkxKxLneMUCERcKMo3cEEJr2JP63jjXN3WzmtG HKTeYtpt+sUIcOFaq7aAsyV071XmsNCd5f6/RZ7XFnCkncrfxMsu32kqZO2RYqeGmdTZ2A 9v0ocwokjDQSqvlQxb0gpc0sd/YBY606d1o4IWrfOFYsG3YG083A4rkmeAm9igHTeth+ZA O8Uwap6BIQZ2ykY7xaxRmZCsodQEe8EwdAsiwr5XWyeZolMkyhI+yGTLtl1kshDpay7aWb 2oP31B5lwld543qrE7E0/yEh0AnlmgOjkznX/jHJFCiQuEVe9AGRM7A4rzok5g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661873925; a=rsa-sha256; cv=none; b=dFPUn1WMA4p4h+IpP8PJaS8ybe+7NH3hOkoKkiuQwh+BpaiJeh7uZD0xkDU2DGFlOeqOde hQ9KoEaVKXUm6YVcc3zevXdA6ilGPR6zMkW4i/NJp/53a+9Mv3d28enK1R3PQhWLcuw92k SSEH8Y9p9LsRvxMNPHlQqzWFdu3VpZ5IMEKIxpONAxKPkYWqHh78Nc2Fdzo9oLcGvv+Dol +QGZ+XKlnbc7OlTJh0dexpbYfHa8AUcw4miji0Ki23r4DyeX+PRaCTYA52LzZrOCCNsOuk wSiJCdcrPZFH7N1dhlZ6w9E1x8ggcwwZecSIpInzIl+DNrEyoUt2xX7/aesnuA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=eml.cc header.s=fm1 header.b="FYu/Fqt7"; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b="cE9jyi/+"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=eml.cc (policy=none); 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: 6.41 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=eml.cc header.s=fm1 header.b="FYu/Fqt7"; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b="cE9jyi/+"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=eml.cc (policy=none); 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: 2688E944F X-Spam-Score: 6.41 X-Migadu-Scanner: scn1.migadu.com X-TUID: V1SUG1yO6ryW --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I have signed the FSF papers now and we can continue the review of this wor= k now. I am attaching updated and rebased patch for this and another e-mail thread= , since these two patches are depend on each other. I have additionally tes= ted the functionality of these changes by verifying that it works as expect= ed on my setup; =E2=80=A2 Tried to use org-agenda on buffers with and without title propert= y set =E2=80=A2 Tried to call org-refile and see if refiling will happen =E2=80=A2 `make test' passes I have *not* tried to see if it will work on buffers without file represent= ation, but the component tests for refile should cover that. Let me know what you think. Thanks, Mikhail Skorzhinskii Ihor Radchenko writes: > Mikhail Skorzhinskii writes: > >> Thank you for your comments once again. I=E2=80=99ve changed string=3D t= o eq and >> it appears to be working OK. >> >> I=E2=80=99ve also renamed =E2=80=9Ctitle=E2=80=9D variable to =E2=80=9Ct= itle-prop=E2=80=9D for better >> readability. The -prop suffix should show the reader that it was >> extracted from the file, and thus cost some CPU/IO. >> >> I=E2=80=99ve attached an updated version to this email. Would love to he= ar 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 =E2=80=99title > > It would make sense to document the new customization in ORG-NEWS. > >> +(defun org-get-title-from-file (file) >> + =E2=80=9CCollect tilte from the provided `org-mode=E2=80=99 FILE.=E2= =80=9D >> + (let (title) > ^ typo >> + (when file >> + (with-current-buffer >> + (get-file-buffer file) >> + (pcase (org-collect-keywords =E2=80=99(=E2=80=9CTITLE=E2=80=9D)) >> + (`((=E2=80=9CTITLE=E2=80=9D . ,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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-org-refile.el-show-refile-targets-with-doc.-title.patch >From 646af66fa88fbcc2b1f2848a14dd5c262763ef98 Mon Sep 17 00:00:00 2001 From: Mikhail Skorzhinskii Date: Mon, 21 Sep 2020 14:53:13 +0200 Subject: [PATCH 2/2] org-refile.el: show refile targets with doc. title * lisp/org-refile.el (org-refile-use-outline-path): add an option 'title * lisp/org-refile.el (org-refile-get-targets): start refile target outline with document title (#+title) instead of file name --- etc/ORG-NEWS | 4 ++++ lisp/org-refile.el | 16 +++++++++++++--- testing/lisp/test-org.el | 37 ++++++++++++++++++++++++++++++++++++- 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 4405489bb..df2c882bb 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -290,6 +290,10 @@ level used for top level headings, much like how headings in HTML export. ** New options +*** A new option for custom setting =org-refile-use-outline-path= to show document title in refile targets + +Setting =org-refile-use-outline-path= to ='title= will show title instead of the file name in refile targets. If the documen do not have a title, the filename will be used, similar to ='file= option. + *** A new option for custom setting =org-agenda-show-outline-path= to show document title Settings =org-agenda-show-outline-path= to ='title= will show title instead of diff --git a/lisp/org-refile.el b/lisp/org-refile.el index 01f0dfa46..14bd81a2b 100644 --- a/lisp/org-refile.el +++ b/lisp/org-refile.el @@ -158,7 +158,8 @@ When `buffer-name', use the buffer name." (const :tag "Yes" t) (const :tag "Start with file name" file) (const :tag "Start with full file path" full-file-path) - (const :tag "Start with buffer name" buffer-name))) + (const :tag "Start with buffer name" buffer-name) + (const :tag "Start with document title" title))) (defcustom org-outline-path-complete-in-steps t "Non-nil means complete the outline path in hierarchical steps. @@ -317,6 +318,9 @@ converted to a headline before refiling." (push (list (and (buffer-file-name (buffer-base-buffer)) (file-truename (buffer-file-name (buffer-base-buffer)))) f nil nil) tgs)) + (when (eq org-refile-use-outline-path 'title) + (push (list (or (org-get-title-from-buffer) + (and f (file-name-nondirectory f))) f nil nil) tgs)) (org-with-wide-buffer (goto-char (point-min)) (setq org-outline-path-cache nil) @@ -343,7 +347,13 @@ converted to a headline before refiling." (and (buffer-file-name (buffer-base-buffer)) (file-name-nondirectory (buffer-file-name (buffer-base-buffer)))))) - (`full-file-path + (`title (list + (or + (org-get-title-from-buffer) + (and (buffer-file-name (buffer-base-buffer)) + (file-name-nondirectory + (buffer-file-name (buffer-base-buffer))))))) + (`full-file-path (list (buffer-file-name (buffer-base-buffer)))) (`buffer-name @@ -631,7 +641,7 @@ this function appends the default value from (tbl (mapcar (lambda (x) (if (and (not (member org-refile-use-outline-path - '(file full-file-path))) + '(file full-file-path title))) (not (equal filename (nth 1 x)))) (cons (concat (car x) extra " (" (file-name-nondirectory (nth 1 x)) ")") diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index b14cbeb26..b85dd7dea 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -6728,7 +6728,42 @@ Paragraph" (org-test-with-temp-text "* H1" (let* ((org-refile-use-outline-path 'buffer-name) (org-refile-targets `((nil :level . 1)))) - (member (buffer-name) (mapcar #'car (org-refile-get-targets))))))) + (member (buffer-name) (mapcar #'car (org-refile-get-targets)))))) + ;; When `org-refile-use-outline-path' is `title', return extracted + ;; document title + (should + (equal '("T" "T/H1") + (org-test-with-temp-text-in-file "#+title: T\n* H1" + (let* ((org-refile-use-outline-path 'title) + (org-refile-targets `((nil :level . 1)))) + (mapcar #'car (org-refile-get-targets)))))) + ;; When `org-refile-use-outline-path' is `title' validate that + ;; deeper levels are correctly reported too (the same behaviour as + ;; 'file) + (should + (equal '("T" "T/H1" "T/H1/H2" "T/H1/H2/H3" "T/H1") + (org-test-with-temp-text-in-file "#+title: T\n* H1\n** H2\n*** H3\n* H1" + (let ((org-refile-use-outline-path 'title) + (org-refile-targets `((nil :maxlevel . 3)))) + (mapcar #'car (org-refile-get-targets)))))) + ;; When `org-refile-use-outline-path' is `title' and document do not + ;; have an extracted document title, return just the file name + (should + (org-test-with-temp-text-in-file "* H1" + (let* ((filename (buffer-file-name)) + (org-refile-use-outline-path 'title) + (org-refile-targets `((nil :level . 1)))) + (member (file-name-nondirectory filename) + (mapcar #'car (org-refile-get-targets)))))) + ;; When `org-refile-use-outline-path' is `title' and document is a + ;; temporary buffer without a file, it is still possible to extract + ;; a title + (should + (equal '("T" "T/H1") + (org-test-with-temp-text "#+title: T\n* H1\n** H2" + (let* ((org-refile-use-outline-path 'title) + (org-refile-targets `((nil :level . 1)))) + (mapcar #'car (org-refile-get-targets))))))) -- 2.35.1 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-org-agenda.el-customize-outline-path-in-echo-area.patch >From ceb6c9836032c92a792bf58aab91d74141664f50 Mon Sep 17 00:00:00 2001 From: Mikhail Skorzhinskii Date: Sat, 12 Sep 2020 18:10:05 +0200 Subject: [PATCH 1/2] org-agenda.el: customize outline path in echo area * 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-buffer): a function to collect the document title from the org-mode buffer * 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 --- etc/ORG-NEWS | 10 ++++++++++ lisp/org-agenda.el | 11 ++++++++--- lisp/org.el | 25 ++++++++++++++++++++++--- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 7dae03dc6..4405489bb 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -290,6 +290,12 @@ level used for top level headings, much like how headings in HTML export. ** New options +*** A new option for custom setting =org-agenda-show-outline-path= to show document title + +Settings =org-agenda-show-outline-path= to ='title= will show title instead of +the file name at the beginning of the outline. The title of the +document can be set by special keyword =#+title:=. + *** A new custom setting =org-hide-drawer-startup= to control initial folding state of drawers Previously, all the drawers were always folded when opening an Org @@ -320,6 +326,10 @@ event time when the alarm time is set to 0. The default value is nil -- do not create alarms at the event time. ** New functions and changes in function arguments +*** New function ~org-get-title-from-buffer~ to get ~#+TITLE:~ property + +A function to collect the document title from the org-mode buffer. + *** ~org-fold-show-entry~ does not fold drawers by default anymore ~org-fold-show-entry~ now accepts an optional argument HIDE-DRAWERS. diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index b98041ea8..f308f8f76 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -1058,9 +1058,14 @@ current item's tree, in an indirect buffer." :type 'boolean) (defcustom org-agenda-show-outline-path t - "Non-nil means show outline path in echo area after line motion." + "Non-nil means show outline path in echo area after line motion. + +If set to 'title, show document title." :group 'org-agenda-startup - :type 'boolean) + :type '(choice + (const :tag "Don't show outline path in agenda view." nil) + (const :tag "Show outline path with prepended file name." t) + (const :tag "Show outline path with prepended document title. Fallback to file name is no title is present." title))) (defcustom org-agenda-start-with-entry-text-mode nil "The initial value of entry-text-mode in a newly created agenda window." @@ -9424,7 +9429,7 @@ When called with a prefix argument, include all archive files as well." (org-agenda-tree-to-indirect-buffer nil) (org-agenda-show))) (and org-agenda-show-outline-path - (org-with-point-at m (org-display-outline-path t)))))) + (org-with-point-at m (org-display-outline-path org-agenda-show-outline-path)))))) (defun org-agenda-show-tags () "Show the tags applicable to the current item." diff --git a/lisp/org.el b/lisp/org.el index 858123e67..fd76af48a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7396,10 +7396,24 @@ the default is \"/\"." (setf (substring fpath (- width 2)) ".."))) fpath)) -(defun org-display-outline-path (&optional file current separator just-return-string) +(defun org-get-title-from-buffer (&optional buffer) + "Collect title from the provided `org-mode' BUFFER." + (let* ((buffer (or buffer (current-buffer))) + (buffer (or (buffer-base-buffer buffer) + buffer)) + title) + (with-current-buffer buffer + (pcase (org-collect-keywords '("TITLE")) + (`(("TITLE" . ,val)) + (setq title (car val))))) + title)) + +(defun org-display-outline-path (&optional file-or-title current separator just-return-string) "Display the current outline path in the echo area. -If FILE is non-nil, prepend the output with the file name. +If FILE-OR-TITLE is 'title, prepend outline with file title. If +it is non-nil or title is not present in document, prepend +outline path with the file name. If CURRENT is non-nil, append the current heading to the output. SEPARATOR is passed through to `org-format-outline-path'. It separates the different parts of the path and defaults to \"/\". @@ -7407,6 +7421,8 @@ If JUST-RETURN-STRING is non-nil, return a string, don't display a message." (interactive "P") (let* (case-fold-search (bfn (buffer-file-name (buffer-base-buffer))) + (title-prop (when (and file-or-title (eq file-or-title 'title)) + (org-get-title-from-buffer))) (path (and (derived-mode-p 'org-mode) (org-get-outline-path))) res) (when current (setq path (append path @@ -7418,7 +7434,10 @@ If JUST-RETURN-STRING is non-nil, return a string, don't display a message." (org-format-outline-path path (1- (frame-width)) - (and file bfn (concat (file-name-nondirectory bfn) separator)) + (and file-or-title bfn (concat (if (and (eq file-or-title 'title) title-prop) + title-prop + (file-name-nondirectory bfn)) + separator)) separator)) (add-face-text-property 0 (length res) `(:height ,(face-attribute 'default :height)) -- 2.35.1 --=-=-=--