From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id iHndAkk0DmN0HAAAbAwnHQ (envelope-from ) for ; Tue, 30 Aug 2022 18:01:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id aFzAAkk0DmOOBgEA9RJhRA (envelope-from ) for ; Tue, 30 Aug 2022 18:01:13 +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 584AA27B6D for ; Tue, 30 Aug 2022 18:01:12 +0200 (CEST) Received: from localhost ([::1]:39980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT3Fx-0008VP-C1 for larch@yhetil.org; Tue, 30 Aug 2022 11:34:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT3B1-0005mu-GO for emacs-orgmode@gnu.org; Tue, 30 Aug 2022 11:29:19 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:37457) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT3Az-0000kb-6O for emacs-orgmode@gnu.org; Tue, 30 Aug 2022 11:29:19 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B970F5C0100; Tue, 30 Aug 2022 11:29:16 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 30 Aug 2022 11:29:16 -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=1661873356; x=1661959756; bh=Q4sH9WJWY2 1L12dwUHBtR313OvPL6sXmP8Y6XcI+NbU=; b=K2SBYojn1ixwyAS38HSy7NQsTU yG5In0mHHWYwJbAD2sLWrb+wjRTwhZ6DZ8WM0GmeDmLdXxwhD/8a5FdYHnBVnHgB UD1T+fCQQZky8flXeMtfjjymz9h+d91TQRFbEOeknUb65MUx0bStF93CmrVuNbKS 931BzhDtwpkZqntgwiDCjCCFSIEDtbhCJeTC9esr29wkuXiNkrQIyr4gxf5EJ08U JK3uIN5/gJNjJzd+UfaAbDowgK2pc4j3yoN4qGL5DgdpzfLX3YfFJ6qXgrIdj1cM pi9i6VbFXuMpdZpWHH5fEIbRDHBf3EYSsbFOycCEYyB1i70HI8D8Zur3AF+g== 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=1661873356; x=1661959756; bh=Q4sH9WJWY21L12dwUHBtR313OvPL 6sXmP8Y6XcI+NbU=; b=qa8Wc4qfMXkV8tZ/pcuStplY0JwNKfcdqULUiKeqAiDj woAURFXZVACUGbo4A1AlrglsF8bSE4XdDMXwkiGIp9GXZSdxb+95F2kR4yVlFu1x a3gl+B3ga4tDRbxQawRD7Kod3pI3XePtjhut2zAThYIQRpgaoEMODZmDnETxMWZw HPm95lKritmU6EBCCUVGRcEpIhpIdHV23gGkVogopU4o9o6/a82HUFZ4D8wIPEd4 QkUiKLJPfoBPSNoXci3/T56YYsy3uyjNTP4NDTSktjSUCdOiSCNm+wwPLpvQlOP6 1SMx8+cFXOoqbenohrOqFWqBiy+fEhPU1tN+c0fHIw== 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:16 -0400 (EDT) From: Mikhail Skorzhisnkii To: Ihor Radchenko Cc: Org Mode Subject: Re: [PATCH] ox-icalendar.el: customizable vevent summary prefix Date: Tue, 30 Aug 2022 15:50:08 +0200 References: <0a1b98af1974ec260c4074df056715e237c08fce.camel@eml.cc> <871r1zawhp.fsf@nicolasgoaziou.fr> <8451fcc20c68d9863a4613df5a1cd5dbba0a77cd.camel@eml.cc> <87h72xn44k.fsf@localhost> <25163bf9-2455-4790-b258-84e766813de3@www.fastmail.com> <87ilndl9jx.fsf@localhost> User-agent: mu4e 1.8.7; emacs 29.0.50 In-reply-to: <87ilndl9jx.fsf@localhost> Message-ID: <87o7w1j0su.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=1661875272; 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=Q4sH9WJWY21L12dwUHBtR313OvPL6sXmP8Y6XcI+NbU=; b=QvxOFxJiwGrXXr4VE15eQGZaHr52vh2DZ/jOUpZul6PcgS0PLsmGSNlzLX2V3aCz7xihnv tci6+zFC5NaGKyGPbKqKO4GFpoIl/9Xnh9mmN7ggA5wYckxGZaq2euA4hz6wfujLnSjJpb wbBcxjChmLWDr/gHLL5RtOf16mWLyhXH53fQY0AD0nnNXCqUNSbyOzknLyKchneeuj9iao gJqg1I2XiHFDHFZq5nLavpaniTqNd9q10aphQB4Rg5wUaG4xyJQZ/pBiOf/Rkpo1TLwI0P eCRoNsXQlXttsT4CUWT3+AVPt0I6MGwcKZyuHiUg+3EbTWnTT/vGnDvJGLIS+w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661875272; a=rsa-sha256; cv=none; b=dOPw64uVl1Kpe+6BaEdzYmd/ct/5qQ0HNBNp4df+Q2nM9r+L2guBPtTTsZPb3MkI6szFpm YaI1R85R+pgQyBMuUeXUkizq2yz2eKToBzEglH3k/8KiV72Da+XbTwOQ9jgd7tm2lvgQOH TkWhaTkKhVGUdJPvIHVyRl6Uq459oUlWEoZsxTzOQCs5EXwXVUi+RmEsLsqVJxI2QBwmTR eEk+w2LYculi3N+IVcZ07juthlttL8r+DIDubfWZjAEMS90jvL/JHA3YB7pkWv294z2itM M3gGrkC+QBys+YwZUaKbAcegH0dMvrmsXF26jRFlkvoNBn2DTJ7kaj3QB4sTyA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=eml.cc header.s=fm1 header.b=K2SBYojn; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=qa8Wc4qf; 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.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=eml.cc header.s=fm1 header.b=K2SBYojn; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=qa8Wc4qf; 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: 584AA27B6D X-Spam-Score: 6.31 X-Migadu-Scanner: scn1.migadu.com X-TUID: jsbRActmZ3GT --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I have signed FSF papers. Attaching a rebased patch with additional changes= to ORG-NEWS Ihor Radchenko writes: > =E2=80=9CMikhail Skorzhinskiy=E2=80=9D writes: > >> Thanks for review, Ihor. I have sent a copyright assignment request. Will >> resubmit the patches as soon as I complete the process. > > Thanks! Note that FSF clerk should reply within 5 working days. If not, > please let us know. > > Best, > Ihor --=-=-= 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 --=-=-=--