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 iLMHK65PD2MJCQAAbAwnHQ (envelope-from ) for ; Wed, 31 Aug 2022 14:10:22 +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 AB7zKq5PD2PFjAAAauVa8A (envelope-from ) for ; Wed, 31 Aug 2022 14:10:22 +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 226F541177 for ; Wed, 31 Aug 2022 14:10:22 +0200 (CEST) Received: from localhost ([::1]:56524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTMY1-00030r-3T for larch@yhetil.org; Wed, 31 Aug 2022 08:10:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTMWa-00030M-JQ for emacs-orgmode@gnu.org; Wed, 31 Aug 2022 08:08:53 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:38540) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTMWY-00018C-Ii for emacs-orgmode@gnu.org; Wed, 31 Aug 2022 08:08:52 -0400 Received: by mail-pg1-x531.google.com with SMTP id r22so13340135pgm.5 for ; Wed, 31 Aug 2022 05:08:50 -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=DSgWfLyYOQD2qBmarq/l6Ivl67UqQNBrwu7j8FewQPU=; b=RkWV48B2iycosAxAU6b69H/0e48oEOxtXSRevnYJFQEEm0LDfRDmodZwsfF9VH81Ch fkwfWGcCz7f9vl09gORoe7qz63yb0jTpdH8qUDpfBKd9tdhGRIqbOZOf7ffpB9p55XbT kiJRr760UAnr+cTwUIxuO0DThfWDXpOIFZxvqRxb07cl7a2+AiS7OC/ZPoODmKxzkMvu 2OYr3LxK5+XcNpYtxUHa7R9Wk1I90rBaTl1U3VbTc/scSy8lZ/nZZJ7tTS3XVDKTkBR0 sU+wkR93GH7WOg5r+wycT6qVP/U5yvwjabdKpXCCcz9AfckDoYoOnhQkGhWveKS9ND7y vuDw== 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=DSgWfLyYOQD2qBmarq/l6Ivl67UqQNBrwu7j8FewQPU=; b=J1cu3szDSfiedjzqp3Ox6BqqayOiEmqIJMLDp1DyITwaIh91zanf0xiSNtB0EXTAGT a2SGRrn2+BfbY+GvWA7A1zp1NT5ccJ+hqjYjLlr4ucUqcdCxaYR9i0H0k/3U4ddwJVFB kcbv/GEXohQRbmPcDcAeAG3vaGXfMH/ygyR/uFywVJhEd55jziPenyPImz8DviaIUYYw G/287Njn5aOehfZ+J9IE8SJL4pxemJXHvXOjwkh4iK29EKJFECKMrTmGAqsprLf7kG15 5K6bN3oiGQV3LccqW8vi22n4aRo6DfTFt71Srlk8VVh/N/YXbN3dVwncve3kT05DJyQk bFmQ== X-Gm-Message-State: ACgBeo0PQ/h0i6z3fl/J37RbHgAr96yJrAjWJ3Tg9qsXmCBPp9CvLUyN bEOtVMsmiOIseCJfpwlmbD8= X-Google-Smtp-Source: AA6agR71o+Ii9KyMdk6jPSFAnW9BmPn1ajtR2EVUBANhHDm6l7t92gHtf8EXlZJPMjIh3OgvbkmskQ== X-Received: by 2002:a63:5418:0:b0:42a:d773:cbd6 with SMTP id i24-20020a635418000000b0042ad773cbd6mr21870988pgb.106.1661947728988; Wed, 31 Aug 2022 05:08:48 -0700 (PDT) Received: from localhost ([2409:8a70:2b3:c8a0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id t22-20020a635356000000b0042c5a1715d7sm3222164pgl.83.2022.08.31.05.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 05:08:48 -0700 (PDT) From: Ihor Radchenko To: Mikhail Skorzhisnkii Cc: Org Mode Subject: Re: [PATCH] ox-icalendar.el: customizable vevent summary prefix In-Reply-To: <87o7w1j0su.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> Date: Wed, 31 Aug 2022 20:09:47 +0800 Message-ID: <87v8q8obqs.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=yantar92@gmail.com; helo=mail-pg1-x531.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=1661947822; 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=DSgWfLyYOQD2qBmarq/l6Ivl67UqQNBrwu7j8FewQPU=; b=Ri5uhJCIFEvWD0iLgbg8/a4MRYVV55Tb5F/ccLoU9tuolYPWzJKO3kHBXC4viMGLc/gCJe 6R8HXTPdl7GcIM1mmivlxxc/WCOBOUcuwTZ4GkZxusMmVAhTN6nSsGlT6HC9eVCpSlrh/K R6OgtVfDWG1SXMM+ev3a/6othLXKsjpYmEqsEgp56+MZKskQrQSX9ARBAje6DM4E/psPT8 JDccCzLDxS2ZAm9xygHhhygmqMR48XuCKGvelqpZn4V4es+lyQ5Ra1f/2y9rc+3W5kHixv 6+iynKMCL69EPK+Kh80Mq2mu4CfCqtZyyS5OYpBaKIsvzMA+ZgnG9nzL9ef3AA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661947822; a=rsa-sha256; cv=none; b=CMX/n+Qtb1xtAaPpe58KUprkmSPEG9+WRBj132mRez4tu+WSn4dN2m4JzzSh7/+RZOeVxd TSKXhx4MsQCCmwywyymAtgsHIDtTtYmhThliFGnlYZafYYARoAaWazGkb6HjUJrovRYewb Tuh6i4DpJCt2QQdf5ll6zRpZDV4gufciJ7uVqJo1ZUMeSSXjoalobQFZhcevvb6cl/5Z2y tq7padYeH9yUYaRnvURQaYH5RrtLSEcyOIrAs994eIK5L3EE4z/j7YUgHPGlfUCY2c2dMe To8AxmLs5W7qPi3Nc/70lAEypADyo9Bc4hXC/S7MREdQTKEbIPwJOmv26+5sHw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=RkWV48B2; 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: -5.28 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=RkWV48B2; 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: 226F541177 X-Spam-Score: -5.28 X-Migadu-Scanner: scn0.migadu.com X-TUID: hKtvrOSHOC9D Mikhail Skorzhisnkii writes: > I have signed FSF papers. Attaching a rebased patch with additional changes to > ORG-NEWS Thanks! > 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) Please follow the commit message conventions as described in https://orgmode.org/worg/org-contribute.html#commit-messages In particular, start sentences from capital letters, end them with ".", separate sentences with double space, and quote lisp symbols as `symbol'. > * lisp/org.el (org-get-title-from-buffer): a function to collect the New > 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 This is not what the patch does. From this message, it looks like `org-agenda-show-outline-path' is affecting the output of `org-display-outline-path', which is not true. > (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." This is not very clear. I'd rather put more detailed explanation as in the defcustom :type spec below. > :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))) > -(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)) Why not just (or (buffer-base-buffer buffer) buffer (current-buffer)) > + title) > + (with-current-buffer buffer > + (pcase (org-collect-keywords '("TITLE")) > + (`(("TITLE" . ,val)) > + (setq title (car val))))) > + title)) Extra `title' variable is unnecessary here. You can simply do (with-current-buffer buffer (pcase (org-collect-keywords '("TITLE")) (`(("TITLE" ,val . _)) val))) Also, what will happen in a file like #+TITLE: Begin title #+TITLE: .. end 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)) can be simply (eq file-or-title 'title) -- 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