From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 8HTAL+oRG2PDMAEAbAwnHQ (envelope-from ) for ; Fri, 09 Sep 2022 12:14:02 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wB+RL+oRG2NQRgAAauVa8A (envelope-from ) for ; Fri, 09 Sep 2022 12:14:02 +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 0B41210BD4 for ; Fri, 9 Sep 2022 12:14:02 +0200 (CEST) Received: from localhost ([::1]:33028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWb1N-0007zc-3l for larch@yhetil.org; Fri, 09 Sep 2022 06:14:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWb0R-0007zS-BW for emacs-orgmode@gnu.org; Fri, 09 Sep 2022 06:13:04 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:37518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWb0O-0005cz-EJ for emacs-orgmode@gnu.org; Fri, 09 Sep 2022 06:13:02 -0400 Received: by mail-pj1-x102e.google.com with SMTP id o2-20020a17090a9f8200b0020025a22208so4899729pjp.2 for ; Fri, 09 Sep 2022 03:12:59 -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:subject:date; bh=Ywl4nWODr6Axgs9+O4nyPzLUw8io3OZwPYS6HKASJ3g=; b=HVqPF8zKRU71JSuQsfEYXc4AGKHaq4gSZnMH/bFZYv+QucDoCXI2yHfbOKYZ5F1BjF RR1xY4jIeqaNgmsIYddoEwU9UFb5FfM09OthK0YF07Vhdo8kuGjRH1/zhp3kEtybOzj+ Ecc/iBqVuIqSksqzoFY1S2YbvpIyOvztIU5M9owfHK7EDHfVd8v01hOubUawAUbXNhEF hkib9/MDJBoDTYiwUaTDYQDl44ZHCBRUkCV2dRKJYx6PEIQn6sVTF8TDWWZ2exwiu8dC BHLsXcWN6znrRuw0zrGAiDEUIYkL0rNv6CNfr67VVmfObbsyXt6HDvi9qyg6xeME6E6A K5Eg== 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:subject:date; bh=Ywl4nWODr6Axgs9+O4nyPzLUw8io3OZwPYS6HKASJ3g=; b=DFZjwsBuQ4g/nKyYQY1LCq/sFatHduEqratkqDvcO6xAIo86KEW4y8xCDXt3ObY/kD o4qw11rdA+BuTRoW66s0CmfblDZnJd5T3YpCCHwSQ3KhJJUORNX5xyNdE2uXh7PGrbxb lDzqquFcVXF9cffeDEb6I8N3CF6XJcKa6wsgtWQsk+ibB6TIxMRkIcG7uO4cqLbxCLrO +nKg2xCHEcOnTg6/2qzSi/Ix5aEVkAgj+o1TTAexPADBeHt97k6LGfmbk8oucWxmoVR+ dyOhd++yVzxIgzGfSNzMaND1ShvxGfij4MkJw7sMaM63H1sOztl35Z1gxGBEmSCyBU4e Tkkg== X-Gm-Message-State: ACgBeo3Ne6L3TGYCNV7iluyWzIBeEAas9kIvfCJ2+BC9qba85MjCZcCv oC4hQFa3UZg+tWixP1FTOa8= X-Google-Smtp-Source: AA6agR6LqFZdvt6FSd2vCV7YzClKFHUMmMqD++iVJwBR9Ysx7jgu4vWAKzD09vvnMK90pecyZP0apQ== X-Received: by 2002:a17:902:724c:b0:177:5080:cbeb with SMTP id c12-20020a170902724c00b001775080cbebmr11402726pll.67.1662718378407; Fri, 09 Sep 2022 03:12:58 -0700 (PDT) Received: from localhost ([2409:8a70:2b2:5800:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id y8-20020aa79e08000000b00537e40747adsm172712pfq.36.2022.09.09.03.12.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 03:12:57 -0700 (PDT) From: Ihor Radchenko To: Mikhail Skorzhisnkii Cc: Org Mode Subject: Re: [PATCH] ox-icalendar.el: customizable vevent summary prefix In-Reply-To: <871qslsjv2.fsf@eml.cc> 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> <87o7w1j0su.fsf@eml.cc> <87v8q8obqs.fsf@localhost> <87y1ux3awf.fsf@eml.cc> <875yhypgop.fsf@localhost> <871qslsjv2.fsf@eml.cc> Date: Fri, 09 Sep 2022 18:13:52 +0800 Message-ID: <874jxgety7.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102e.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=1662718442; 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=Ywl4nWODr6Axgs9+O4nyPzLUw8io3OZwPYS6HKASJ3g=; b=UBohh1RRTw15mO5lMmLYGhaz2pqZf8wEpW0xrKmuDrglYQPA2RVoAWtPoq3JDsgHKmlxfP rFjMyrTrwt+FRKADGRoIEA/up0f/OzTWRaV0alqcX+pHQWTdZ/11ILYKQ4Zov4fSxCjF6y zBOpkxBDj9HQ98XL4Ob82Kw4jp1LoeIDgK6lD7V7BDo9TL9Rki1Ip1zZSpHTvv7SQTwRa7 97Z5qXl7CU4UizGdB05wJU4dvoKZm1iNVXsmvB3fMrWymeWHum7xo1/8v/DTf2MJaE3XS1 B3phnLLgbT2J7L00MMboyxiszChmCUgwum5uwBnkB6tD4/v2eDybYulyYcPvQA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662718442; a=rsa-sha256; cv=none; b=MdIRT4DQQhPceLpFTGNulkZQGX8Z3flvaEhF5M4dt9yW+ubUdAvLYAJRlJvvxYsAkxAmNT CxvufxlEz4cDX+wakX/B2Cqz1U9SYUgtc2E+deIwip2I5d0GUoj4EsrTEvLi5JrzqRkHjb HIyiAZSA3ZP7DZB723zmmJsW8PPMD8wTmGD7DeMxIZcGNChi+kAuKMOhDHmgSiwRwo+hYz ka1hE5ap6bpQ4HP5m1Gaz6Cd3gYyOPN+5jRDzCHyyAUSM9Qh63icZAvi0TafqRapFvB79z luW752kqJ7iOer4lz/BWEaA2VeqoFEL+UaKlJDFwiIcedY2C84le3CBvsA6/fw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HVqPF8zK; 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.10 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HVqPF8zK; 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: 0B41210BD4 X-Spam-Score: -8.10 X-Migadu-Scanner: scn0.migadu.com X-TUID: xxaeGEKcjEJD Mikhail Skorzhisnkii writes: > Thank you for suggestion, I seen an announcement about this function, but somehow forgot about it. > > Sending next version of these patches. Changes from the next version: Thanks! > Subject: [PATCH 3/3] org-refile.el: show refile targets with a title > > * lisp/org-refile.el (org-refile-get-targets): Use a document > title (#+TITLE) instead of file or buffer name in outline path, if > a corresponding customisation option is set to 'title. Fallback to a > filename if there is no title in the document. Please use 2 spaces between sentences in docstrings, comments, and commit messages. Also, end sentences with ".". See https://orgmode.org/worg/org-contribute.html#commit-messages and https://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation-Tips.html > (defcustom org-outline-path-complete-in-steps t > "Non-nil means complete the outline path in hierarchical steps. > @@ -319,6 +320,11 @@ 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) > + (and f (file-name-nondirectory f))) > + f nil nil) > + tgs)) We have very too many whens in this function. It will be more succinct to use a single (pcase org-refile-use-outline-path ...) instead. > + ;; 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" You may as well add a test when multiple #+title lines are present. > From 62684b478ae5ceb03f66967fbebcc4d6163c826c Mon Sep 17 00:00:00 2001 > From: Mikhail Skorzhinskii > Date: Sat, 12 Sep 2020 18:10:05 +0200 > Subject: [PATCH 2/3] org-agenda.el: show document title in outline path ^Show > * lisp/org.el (org-display-outline-path): Show a document title (#+TITLE > value) and an outline path in an echo area if the customisation option > is set to 'title. Fallback to a file or a buffer name if the document ^ Fallback ;; (double space between sentences) > title is absent. > ** New options > -*** New custom settings =org-icalendar-scheduled-summary-prefix= and =org-icalendar-deadline-summary-prefix= This is removing an existing NEWS entry. I guess it is not intentional. > +*** A new option for custom setting =org-agenda-show-outline-path= to show document title > > (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 outline path with prepended document > +title. Fallback to file name is no title is present." > :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))) I think you can leave (const :tag "Show outline path with prepended document title." title) This text will be displayed in drop menu in cutomize interface alongside with the full docstring. Mentioning the fallback in the docstring should be good enough. > From 5b15f886b22dc542220b48ae9659c4c2d56dea78 Mon Sep 17 00:00:00 2001 > From: Mikhail Skorzhinskii > Date: Thu, 8 Sep 2022 21:29:23 +0200 > Subject: [PATCH 1/3] org-clock.el: rename org-clock-get-file-title ^Rename > * lisp/org.el (org-get-title): A new function to collect a document > title from an org-mode buffer, based on a org-clock-get-file-title > implementation. `org-clock-get-file-title'. Elisp symbols should be quoted. > ** New functions and changes in function arguments > +*** New function ~org-get-title~ to get ~#+TITLE:~ property from buffers We generally use ~code~ for Elisp symbols and =#+TITLE:= for verbatim non-code text. (This has not been consistently followed in etc/NEWS, but at least please change ~#+TITLE~ to =#+TITLE=). See doc/Documentation_Standards.org > ** Removed or renamed functions and variables > +*** Rename ~org-clock-get-file-title~ to ~org-get-file-title~ > + > +This function is now part of the =org.el= file. You do not need to mention this. org-clock-get-file-title was introduced in recent commits on main. Main is development branch, and we do not need to document changes on the changes made after the last release. > ;;;###autoload > (defun org-dblock-write:clocktable (params) > "Write the standard clocktable." > @@ -2739,7 +2729,7 @@ from the dynamic block definition." > "\n") > > (if filetitle > - (org-clock-get-file-title file-name) > + (org-get-file-title file-name) > (file-name-nondirectory file-name)) > (if level? "| " "") ;level column, maybe > (if timestamp "| " "") ;timestamp column, maybe This may introduce a compiler warning. I suggest running make after applying your patch and fix possible compiler warnings. (I suspect that you may need to add declare-function on top of org-clock.el) > +(defun org-get-file-title (file-name) > + "Collect title from `org-mode' FILE-NAME. > + > +Return file name if title does not exist." > + (or (org-get-title (find-file-noselect file-name)) > + (file-name-nondirectory file-name))) > + > +(defun org-get-title (&optional buffer) > + "Collect title from the provided `org-mode' BUFFER. > + > +Returns nil if there are no #+TITLE property." > + (let ((buffer (or (buffer-base-buffer) > + buffer > + (current-buffer)))) > + (with-current-buffer buffer > + (org-macro-initialize-templates) > + (let ((title (assoc-default "title" org-macro-templates))) > + (unless (string= "" title) > + title))))) These two functions can be merged into a single `org-get-title' that accepts buffer or file-name as an optional argument. -- 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