From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 2EudAmqM92IKqAAAbAwnHQ (envelope-from ) for ; Sat, 13 Aug 2022 13:35:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id ULuiAWqM92KmEwEAG6o9tA (envelope-from ) for ; Sat, 13 Aug 2022 13:35:06 +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 8488A298E9 for ; Sat, 13 Aug 2022 13:35:05 +0200 (CEST) Received: from localhost ([::1]:37606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMpQ0-0006VM-Ah for larch@yhetil.org; Sat, 13 Aug 2022 07:35:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMpPN-0006Uz-Lv for Emacs-orgmode@gnu.org; Sat, 13 Aug 2022 07:34:25 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:46602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMpPL-00034r-Tq for Emacs-orgmode@gnu.org; Sat, 13 Aug 2022 07:34:25 -0400 Received: by mail-pj1-x1030.google.com with SMTP id q7-20020a17090a7a8700b001f300db8677so2990983pjf.5 for ; Sat, 13 Aug 2022 04:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc; bh=vvQ8hBXfLFqHnkgPvwoZ+EGtyRF3+NZyrbUd6zmsSok=; b=YBhr7bEtWUY3kxpb0FiseAPFnuWUNdZyLMLuzk/pXFBIZ1fQxQBzKfpDID8adsUPGF LgK8GWilwY3p21KuCvxvmKfROAaFGIM3C63AvFXnQwd/xXwz6tSQS/mvvMqVsduhGfkD u2Mg/lNc+/j/VBcyISnLckSDTGFFFiRue+4kqXEfmNAfZ+JlMqhOwjSlzkYVbfVfb7XM W424tKMnjnOJAE/qfqtf5f5SlfVcmodJqgWUZtB4XNDsbiDpc+Vgs8gaZ/1yyAIuz+F8 fiHUH1Hzmo4FJA/d5wqY+lpTfUILGVR0i3EJyai5++DS//Pbjwic+F1XSJQtT3AT9y1W npZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=vvQ8hBXfLFqHnkgPvwoZ+EGtyRF3+NZyrbUd6zmsSok=; b=s5H3W0ClHAsxHW+n4MFX7zD/ZWVKw5unvmg2qRp6QCXpuJxuFEOFdtwbArQeXmtmls IREBe+Dr+h3fRZsmiuvnPElUxpcdHbiPA6o+FYc5wm1H/bFR0iQ1Eyc7Lcuhp1bjHrG1 xLRwsADMMU4QhU/b2W95E2wf/XZm+atSjmvgIOuebSXCcLoGdZt6W8lPy4hfICfXzuXB y6djP4v9rAirLPtuZKc8d9Fmd8988bs/idCrBhgOyCpgl5J8sTCKHmz9TO1zv7OmPUBi 7qFQC8550luXs33SNEnc0DZhNkjH8rmEI6b7eUxgdWBM8zoS1vrWXvIA4NP0o5dq/6kx eCNA== X-Gm-Message-State: ACgBeo0MySmEkAQ5uzbfrYE4ygYlPPTmBQ1J8NV90wyF7KGonI4s5iZB MghlodM4NlBxqfX1hAzW3dU= X-Google-Smtp-Source: AA6agR7Xo2P+5KaOwUCDssgmTo9d9CDWL2bS0EnzhQWXQW4oHGJ39Gj8rfZgk4J2g+nlMjR5+QCiYg== X-Received: by 2002:a17:902:e394:b0:171:3f46:1f13 with SMTP id g20-20020a170902e39400b001713f461f13mr7793090ple.174.1660390462235; Sat, 13 Aug 2022 04:34:22 -0700 (PDT) Received: from localhost ([2409:8a70:2bf:80b0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id l20-20020a17090b079400b001f89383d587sm1344548pjz.56.2022.08.13.04.34.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Aug 2022 04:34:21 -0700 (PDT) From: Ihor Radchenko To: Duy Nguyen Cc: Emacs-orgmode@gnu.org Subject: Re: [Patch] Show org file title in org-clock clocktable In-Reply-To: References: <87edxk7etq.fsf@localhost> Date: Sat, 13 Aug 2022 19:35:22 +0800 Message-ID: <87tu6g5qbp.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1030.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=1660390505; 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=vvQ8hBXfLFqHnkgPvwoZ+EGtyRF3+NZyrbUd6zmsSok=; b=NZDoHpzoFwe28uUwPCyTPeeRmu+WtNvUaanOkqu4VXVt746jypY1FZBhweEy6Alu5Snqsa J3MDPBdf12uz4QAI/n1G69N/zlZdT1PVpPmyor5Qa6MXb4tSgmThoM+ZRRNRMgLWoUvmqV e3kpT+puza6zqunNXvppPD9CcDgJneakvXKfrifAJN0NtjNsMlBF+ghHTX30MH/+15P7qH mS05IVMLsIhdd4CJ0fSZCaIt7FTnf0w5mAmIY8xlEU7NkhOUzSX6lycvoKjPhLsYr/4d4r B3bX+oP/x8ncpMqL/XoFuxyha4eu88FJU7ilO2XmdpAThN9DID3L62+L4CgPYg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660390505; a=rsa-sha256; cv=none; b=DaHzlo5oxB6UABzYO/g4d2bxqZbLcQuSPy53syh7J6HMURsc6o2N2gOH693plP9P6GlZ8T bmuZ4IV7p3O5Ov27PAcX7DRPlSLPhhBqERLCGMdPToaaBRVcDjl2U5plGeVzZ1MliHxj+d 9WPEQ2Gz9QW9NtBfQvEOuZ2N1tgSsFV4wQpt9gAa5HR/0GER67iTZTz1OhvXGv/59FPfmb urNob9KxudfWlR/Sa6jrOolWmtiKEXnR4zd/I0EfE9kILODrErxaXn1Sh3Hf0gtHJ6VigP v36qZ9zSpTiPZdeT9+Z/KIMCTH9SoQzmnIf3SpTomRkbg1H3F62fJ7VKDUh9dA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=YBhr7bEt; 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: -1.86 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=YBhr7bEt; 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: 8488A298E9 X-Spam-Score: -1.86 X-Migadu-Scanner: scn1.migadu.com X-TUID: RlbSCe7oXGvN Duy Nguyen writes: > Not sure how you normally go about updates to submitted patches. For this > time, I just updated the patch by amending the commit of the previous patch > I sent. Please let me know another approach is preferable going forward. This is ok. Ideally, you can also assign reroll count (version) to the patch and add something like [PATCH v2] to the subject. But this is optional. > From 45882f233d961aadbcbc88ee28ba3aac8599296a Mon Sep 17 00:00:00 2001 > From: Duy Nguyen > Date: Fri, 12 Aug 2022 18:40:10 +0200 > Subject: [PATCH] lisp/org-clock.el: Show file title in org-clock clocktable Thanks for the update! I have some more comments. > diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS > index 00fe101dc..e9585617e 100644 > --- a/etc/ORG-NEWS > +++ b/etc/ORG-NEWS > @@ -270,6 +270,19 @@ example, > > prints a sub-bibliography containing the book entries with =ai= among > their keywords. > +*** New =:filetitle= option for clock table > + > +The =:filetitle= option for clock tables can be set to =t= to show org > +file title (set by =#+title:=) in the ~File~ column instead of the > +file name. For example: We usually use ~code~ for Elisp symbols and code. So, =t= -> ~t~ and ~File~ -> "File". See doc/Documentation_Standards.org > +#+begin_src org > +#+BEGIN: clocktable :scope agenda :maxlevel 2 :block thisweek :filetitle t > +#+end_src Please, escape #+BEGIN with comma: ,#+BEGIN. (this is done automatically if you use C-c ' to edit the src block) > +;;;###autoload > +(defun org-clock-get-file-title (file-name) > + "Get the file title from FILE-NAME as a string. Returns short > +FILE-NAME if title is not found." > + (with-current-buffer (find-file-noselect file-name) > + (let ((title (org-collect-keywords '("title")))) > + (if (null title) > + (file-name-nondirectory file-name) > + (nth 1 (assoc "TITLE" title)))))) By convention, we consider a document title to be concatenation of all the values of #+TITLE keyword inside buffer. That is #+TITLE: This is #+TITLE: a title #+TITLE: written in multiple #+TITLE: lines See org-macro--find-keyword-value and org-macro--collect-macros. You may even make use of the fact that (assoc "title" org-macro-templates) should give you the document title without any extra analysis. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92