From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 EGqdHySKkWIRcgAAbAwnHQ (envelope-from ) for ; Sat, 28 May 2022 04:34:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id cO+fHiSKkWIpHQEAG6o9tA (envelope-from ) for ; Sat, 28 May 2022 04:34:12 +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 E85891F3F4 for ; Sat, 28 May 2022 04:34:11 +0200 (CEST) Received: from localhost ([::1]:60634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1numHK-0001lN-Qt for larch@yhetil.org; Fri, 27 May 2022 22:34:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1numGV-0001Fc-1p for emacs-orgmode@gnu.org; Fri, 27 May 2022 22:33:19 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:38824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1numGQ-000417-5u for emacs-orgmode@gnu.org; Fri, 27 May 2022 22:33:18 -0400 Received: by mail-pg1-x530.google.com with SMTP id 137so5400141pgb.5 for ; Fri, 27 May 2022 19:33:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=XhNfhl03xn6hDsaKGYCxMrw14VPVhtCbAsm3BWDrWc0=; b=iYhTGzpHRSp5aJ0FsKIFPQ2QlPjZ1d4TQ1N/eEDzOGJuQaywJeRyHSJAmIuGR+KXvr 6ZQYTJ5CU4v0odQprDprJhV9g1YKOF/zUZSl4+xosOaTT6UstbBcvPpr9uvFDU/LhWme 45+89OPFU0Lx4bXMpe3FEllf3ireJMkgwLkpVdl8m7kCkn7VhhXwu/EFLba29ZNctlgU bahe1TH19zYAUPaAX5pet2I1h3dyywaVVFpfUREjPj/gb49lATueD2d/gT1P6ijyDrK2 NqbwUVJSHpTyBM6yfEjcQ9jwd/oDoCIskec9zJsMqaI4O/XEPW43C/+V6J4jUpthxrY0 V7dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=XhNfhl03xn6hDsaKGYCxMrw14VPVhtCbAsm3BWDrWc0=; b=VTv6igtUnYk0L76Ch7OgIfeVEw2Sm/mpJsbI/TFUjzMHpeDVB+xwPqWjlSd07id6W4 2OtCBInltPFzKBqvLqbUKg8/JzZauGgJzwpfTnQGDv3MDPkH0/bIH4LqfyWTMyJh+NVC e4dDJlZBY6r5e+3OWoDS2zwd9VJ1DTrJ+/MkApTgKgTOB8cq9pNwveY6SR4/FZM8vsAh /dSwXrqV6nDteshC01AczbpLKETUKWUaE2wsm6P/lJNzD8intXl8XEbgqqUAKE15jLEt A2qxTFqgfneOC0A3Vc1zWU2kaZUS4g8HC6ULM2TULcpSViqCpQ19dUstSAJHdYzn+dx3 D4Sg== X-Gm-Message-State: AOAM533/9N1GLxrMftR7VOISAKrmYM4vh6jQvl3VfNXUI+FRASokIBxd wKhoFzVPxCwe9cdJCeT/Clc= X-Google-Smtp-Source: ABdhPJxOGTgZccXF5maWdM1MCdi4QTRDqQcdyWv/AGMrdyUPoqLMM4GzfHDti9UfU+stbnlplZzM/w== X-Received: by 2002:a63:313:0:b0:3fb:238f:5b76 with SMTP id 19-20020a630313000000b003fb238f5b76mr8460991pgd.14.1653705191638; Fri, 27 May 2022 19:33:11 -0700 (PDT) Received: from localhost ([64.32.23.62]) by smtp.gmail.com with ESMTPSA id cu19-20020a17090afa9300b001cd4989ff41sm2258447pjb.8.2022.05.27.19.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 19:33:11 -0700 (PDT) From: Ihor Radchenko To: Mikhail Skorzhinskii Cc: Org Mode Subject: Re: [PATCH] org-refile.el: show refile targets with doc. title In-Reply-To: References: <80f7d99b0cf16fefbcdd2db62c35f53946895162.camel@eml.cc> <87h7avsbzy.fsf@localhost> Date: Sat, 28 May 2022 10:33:51 +0800 Message-ID: <87a6b2e67k.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=yantar92@gmail.com; helo=mail-pg1-x530.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=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=1653705252; 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=XhNfhl03xn6hDsaKGYCxMrw14VPVhtCbAsm3BWDrWc0=; b=ql2k3Q/nSMbm80a638pQ7qqmmpmgNkD0eUDV6OasYOyXSNVpCI8MGsp+HAbpKxxjXTYzoT cTEREPp9uIAiS0r5mZp2wNEe5bCn75R0dOxo6QGq8VKrHWTogD6bTpbMr2QIn+XThcE0su s+Fe8jgQpwhh57P2LDp6Brz2ngeB01+trI0MBiLGW1s/r0E3Y5rv8qHV3qisL8oLm/9mMF OKeL0XjWWtAfm8eo0ZIDWBAw7ccUUndNvFjIV0HbwwLLYqnbb2Jzaw1zHj0pfmdbnyM6qj FkUgCeYnZU8/YDC3XoZaofOYbDN3D07oE+lptnvyxlyWfK4WkT9fUYjpqx5m0Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653705252; a=rsa-sha256; cv=none; b=gldB6TA2ezJ1YyUK98kI9HklDO3PyMMBEPTQr1KrbONlJ9189gKi+MUbH6YbBIS98PMf+5 St9erX0UMyvDgg76MPF5BRP0RmuqaFp5nA2tfjYDtx64QHrCPW21TpqLQvTgogFLBSwTQl 3sXrLZuzLi8Zg/BmGqFtWqq2MSI9pt0BN/lXxwqadijy7EFiZV2y5fhmQ2JD/V4C2+VKav pB/kjNFZncdWywce3oIsIyzZbkEXggI0F7FeTX+QKJzbeJ4k1LORzd8LtfFyGpjntEDWXD YtkJYaXiK9Kqcr0KeCWwLHtQ13Kck4zEPUwl0zG2k5MMejGFbUSw1TNdrW+c5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iYhTGzpH; 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: -4.34 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iYhTGzpH; 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: E85891F3F4 X-Spam-Score: -4.34 X-Migadu-Scanner: scn0.migadu.com X-TUID: O6FSx4IB5q+m Mikhail Skorzhinskii writes: > Thank you for reviewing the changes. Sorry for the sloppy patch, I've > retested everything and added a few additional fixes, there were more > problems. Thanks! And sorry for the slow review. Your email was lost near the tail of the todo list. > I've added a couple of test cases too. (BTW, test framework is awesome > and really easy to use!) Great! > * 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 Note that changes like this should be detailed in etc/ORG-NEWS > - (const :tag "Start with buffer name" buffer-name))) > + (const :tag "Start with buffer name" buffer-name) > + (const :tag "Start with document title" title))) You also need to document the new option in the docstring. > + ;; 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 `(((,filename) :level . 1)))) > + (member (file-name-nondirectory filename) > + (mapcar #'car (org-refile-get-targets))))))) It would also make sense to add a test when document is a temporary buffer without filename and also does not contain a title. Finally, your patch is exceeding 15LOC. You need to do copyright paperwork to get the patch merged. See https://orgmode.org/worg/org-contribute.html#copyright Best, Ihor