From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UMJsMF4GmGAgJQAAgWs5BA (envelope-from ) for ; Sun, 09 May 2021 17:57:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id SIPvK14GmGA5HgAAbx9fmQ (envelope-from ) for ; Sun, 09 May 2021 15:57:18 +0000 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 7133310E79 for ; Sun, 9 May 2021 17:57:18 +0200 (CEST) Received: from localhost ([::1]:43190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lflnv-0007xx-MM for larch@yhetil.org; Sun, 09 May 2021 11:57:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lflnP-0007sa-LM for emacs-orgmode@gnu.org; Sun, 09 May 2021 11:56:43 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:43776) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lflnO-0005AQ-5P for emacs-orgmode@gnu.org; Sun, 09 May 2021 11:56:43 -0400 Received: by mail-pg1-x535.google.com with SMTP id p12so11533639pgj.10 for ; Sun, 09 May 2021 08:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ejc81tF+RxyhqmplQQSPwhfL5J9Oi+PulYSUpdEtkwc=; b=DhAgJKxyTwu1XXDLYK4ltq/L34OXhgkTVTstCTiDsMlvs6mxWLKbYCL6wdDUikqEBk t+u1nRbsVai4oLjAcJVmOFUDFcpET5Oi/YDtTbl9x+3Jnk0BmgAVBbdlcC6ySwaiLSs/ GTMFZaZSdX6R7IH3uUDq7DPkVAVANW5WUfgmgQrDH0qTd+B5x215HKrQSS4K9em6CH2y N5nOuewAOeuNkHf+LSI9iwKF5gEgrgjfKvTo7yE8AKMTNv/aXKQnxf3Ww6sm2IJ/GuBY xd16NLba6sPAgDcOm+Q9hR3+0euDNzrKL+zEY0xrWaZReqWM/yX1R9yOOymjerPu2Nzf ERhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ejc81tF+RxyhqmplQQSPwhfL5J9Oi+PulYSUpdEtkwc=; b=cGgem0RfM9YXQl0nrftZ+nh48mSjcbTLLe5gos8iRH4zTzRUx3pdrOJx4AWI8gqzfR ogv79it8OhNn+YpYAu/WGG/JUTpjCUDRuUo532U/rIqW6p5+ScGu6btyeFbLgX/Ju52Z uOlF09JatN+VwDba+UoQA8bzXshBvn8HRMnSOufAj5jFsUdmfqC5hNBc9DWoh/UIDNzY 39jOeUOZyHpuJDDmPqC2DvqP8UJh0YQNI51EX1Q2KCPyda5S+x0iiVjN1yhtGUSF0hL8 d69DFQmvwB8N7YQ/2qpuhelzvtDPa1FspGOzhym/wCXcMk+qCXdYFLAflJUqmTefT5P9 MPDw== X-Gm-Message-State: AOAM532zZqDItZ11Dvs7NeJP3F7gdOhovQtiUxYlcmabyBU9xWdqzJzz RJGD2gzexF8rXyCcbaNgEcx3B3ABDAYyCw== X-Google-Smtp-Source: ABdhPJzAOfcZHOdTfZ/jYKcyAaEFaaBi6Y09y92LtYkowq0E0ZpXmirSr4Jxz1QQFTitKJ7GWu/f8g== X-Received: by 2002:a62:16d2:0:b029:27f:3dbf:a466 with SMTP id 201-20020a6216d20000b029027f3dbfa466mr20579282pfw.11.1620575800467; Sun, 09 May 2021 08:56:40 -0700 (PDT) Received: from localhost.localdomain (KD106154103141.au-net.ne.jp. [106.154.103.141]) by smtp.gmail.com with ESMTPSA id b16sm1743994pju.35.2021.05.09.08.56.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 May 2021 08:56:40 -0700 (PDT) From: satotake To: emacs-orgmode@gnu.org Subject: [PATCH 2/2] org-refile.el: Fix test case Date: Mon, 10 May 2021 00:55:32 +0900 Message-Id: <20210509155531.26615-2-doublequotation@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210509155531.26615-1-doublequotation@gmail.com> References: <20210509144712.23387-2-doublequotation@gmail.com> <20210509155531.26615-1-doublequotation@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=doublequotation@gmail.com; helo=mail-pg1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: satotake Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620575838; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ejc81tF+RxyhqmplQQSPwhfL5J9Oi+PulYSUpdEtkwc=; b=fjlR9YuSIJgBGdIvFzrOSKA0NnwaVFA5qU/dxxe+H9jGioMg4EFFkQzlbuL9/rGfUBl5Ic IC9HMVhjmraZU5FEq7XyJ0Uh8o6+zgl8KnBMxUpU7KaA+3HKRXUKRDQvxCR/Vpg554jvcS 22E8eHWtPSO0aO6cXsVSfwawyq1bAiGV5X9oEPhQtSxIOkvhR/UsqJcylwnGnkKbuNT/wY hQpBztPpFaKOmA5VhC/QR6rr4dvCbKFvXEDUqpDb+AnoKiCjWYDxkJFT0mqT4e2oSifuep 8eHJg5tJlBZWRNjH+fJSQZXzRXRCGCW13yOTf9/PlwNxoqGgLqCklRFNnoRKfg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620575838; a=rsa-sha256; cv=none; b=F3WiiSKG3HgPvSUlW9UPA/ZHN76ezqxKaG/sHcJ1KPgN2bfYj1m9HPl/RIAq4TT+jjcbD5 5IEd4I92hMx5Ec+3Fun74ejlHW0jQFfdlt1RzUkukpaksjEtcy+jd5747OZ1NtJRznQNux pH/RREP6N/D/O8+aqZ2SduwdQlZvlS4Cf0XaQmY+dPWYM3RXQFnQYXfeMCc8TMbJwgUmvx tnu7HB+tcm/1SalQ86fDd4AAD2PArBqS9xDHaMRdC6rIvc47oTHXgMLy0SzZ/eGF3b0fQn WXOKHpViL8xhiv9IApyGAD4e2Pmukn+twToxengCwdJMyRqTCZn3nlLybDvKRQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=DhAgJKxy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: 1.85 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=DhAgJKxy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 7133310E79 X-Spam-Score: 1.85 X-Migadu-Scanner: scn0.migadu.com X-TUID: Q2n5kQLXFecK * lisp/org-refile.el (org-refile-get-targets): Check `buffer-file-name' return value instead of `buffer-base-buffer'. To pass the related tests, we need to check `buffer-file-name'. TINYCHANGE --- lisp/org-refile.el | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lisp/org-refile.el b/lisp/org-refile.el index 6f5b8acee..2900be27e 100644 --- a/lisp/org-refile.el +++ b/lisp/org-refile.el @@ -310,13 +310,12 @@ converted to a headline before refiling." (setq f (buffer-file-name (buffer-base-buffer f)))) (setq f (and f (expand-file-name f))) (when (eq org-refile-use-outline-path 'file) - (push (list (if f (file-name-nondirectory f) nil) f nil nil) tgs)) + (push (list (and f (file-name-nondirectory f)) f nil nil) tgs)) (when (eq org-refile-use-outline-path 'buffer-name) (push (list (buffer-name (buffer-base-buffer)) f nil nil) tgs)) (when (eq org-refile-use-outline-path 'full-file-path) - (push (list (if (buffer-base-buffer) - (file-truename (buffer-file-name (buffer-base-buffer))) - nil) + (push (list (and (buffer-file-name (buffer-base-buffer)) + (file-truename (buffer-file-name (buffer-base-buffer)))) f nil nil) tgs)) (org-with-wide-buffer (goto-char (point-min)) @@ -341,10 +340,9 @@ converted to a headline before refiling." (append (pcase org-refile-use-outline-path (`file (list - (if (buffer-base-buffer) - (file-name-nondirectory - (buffer-file-name (buffer-base-buffer))) - nil))) + (and (buffer-file-name (buffer-base-buffer)) + (file-name-nondirectory + (buffer-file-name (buffer-base-buffer)))))) (`full-file-path (list (buffer-file-name (buffer-base-buffer)))) -- 2.30.0