From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uIrKASwJmGAgJQAAgWs5BA (envelope-from ) for ; Sun, 09 May 2021 18:09:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id APz3OCsJmGAMTAAAB5/wlQ (envelope-from ) for ; Sun, 09 May 2021 16:09:15 +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 823D21161C for ; Sun, 9 May 2021 18:09:15 +0200 (CEST) Received: from localhost ([::1]:43938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lflzW-0002ks-KM for larch@yhetil.org; Sun, 09 May 2021 12:09:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lflvu-00048Y-ML for emacs-orgmode@gnu.org; Sun, 09 May 2021 12:05:31 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:40887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lflvs-0001ZC-Lj for emacs-orgmode@gnu.org; Sun, 09 May 2021 12:05:30 -0400 Received: by mail-pf1-x429.google.com with SMTP id x188so11933563pfd.7 for ; Sun, 09 May 2021 09:05:28 -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=ugEu69vO5Qj7ak81GBTUrEc5qcpG2vUWYZT4D9fSd9w03UlDrgFfYOCSi0DcB9kVHz 0t0PGZdgeyP6i3mv4t11I5qtrTqq4ba9tZBY0aN/GIxPuVFKreh14kiGBHQLTWlFNZ6w Qpjf6kyHAPKqKqpSZv8jjvSQW2vtT/vlzLfaMurkwVkHfWbcOT6FCNpjpF/vdRX4Ckbp FaJXHtO07SDQcYGTkLqIeARR+bVVfLINUEDbWwnWAv08NGOx8K4wk6Tli5XwA24MN9cM zZwGbqrSZ+K/VG3Z4Gde68UR4J6UTDT+ZO+xkmq1kjwd3D/g9QsLV9qxpIaJqOx7N8CZ zcyg== 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=ttxeUCtSpJ+PZDX05gWyL7JqFVM/XQENbSQrenvWYzt7H95WeeNssNf0uyehmZ0HJl wA8P7z2zfprKyCdPpYwq+LLthvVITVHJdPTFzKX4dtdlFDn425RL3psMxbBvIXrAb/kB wvlOWB9uLLUncYy+9fNrC9p7IWutZU6T2zBQ2t3xFyruYv3NgUV/zrBemC0d2G3RRZoz FTN9sQsD3cjBr/iQmS9sCQP7a0aT4pRnBPl1wqiy5sleyWX20aM/myADJUWcFBRnOcD7 KDWoIAjlbXGsJSpp+lv+aJTJ5bda1zID8rXuHV6RMBpxT1sCz6lDeAswFlPpmKkEYAwG EoKQ== X-Gm-Message-State: AOAM531/YJ5mPUheow7p3iAmSKs3DK49DD68zUFw7v961O9C7gynOBYc THtiontVVqZHweLjotF9tDBv6Kdq+hScpg== X-Google-Smtp-Source: ABdhPJxE70pwlAzDFFsDB1vSNquoMR9IKyEl+5PLccWKb5Iko3OTdiAvVVB4obsvDBAUeXjizO1O8A== X-Received: by 2002:a63:9d48:: with SMTP id i69mr20845133pgd.297.1620576326782; Sun, 09 May 2021 09:05:26 -0700 (PDT) Received: from localhost.localdomain (KD106154103141.au-net.ne.jp. [106.154.103.141]) by smtp.gmail.com with ESMTPSA id q18sm9168280pfj.131.2021.05.09.09.05.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 May 2021 09:05:26 -0700 (PDT) From: satotake To: emacs-orgmode@gnu.org Subject: [PATCH 2/2] org-refile.el: Fix test case Date: Mon, 10 May 2021 01:05:06 +0900 Message-Id: <20210509160506.26873-1-doublequotation@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210509155531.26615-1-doublequotation@gmail.com> References: <20210509155531.26615-1-doublequotation@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=doublequotation@gmail.com; helo=mail-pf1-x429.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=1620576555; 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=pIAlMXbTkmVKUsnC0U3ugm3wD3S2Qqm6f3ZBUlUhEBQf3CCRuOq00N2Hix3/9Jon6sLNDO TUh+Ez4cU7bLvWN67zX2TrncJFYH9O55wnh5Hqtbn4OkCEBupo1Z9bBTpphGsPX612pIdL t6v5T9mNjWwHkSIox5ePTm+HjhMPpWjqFMZ9GND9aEG7HiZhODH8FS/MbDRGW4FsRi2w2E Y5fXq/wMEYHpT1vpN6r+X4Q5xaNSK8gyvsQRA690HRNeK4rEdRdVBCzelIRD/GkYQ/JmSW wYtAIDDMO9ZgcV0DkDe0Ew1TeGb1AJpXpWgH4M+hjr2T5oau6FSlAOGXks8mWg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620576555; a=rsa-sha256; cv=none; b=O6ceTu5cF7O/u7xSG1/mplMy2GKgvGe1zx39x0w9vQbVjSPeUT9oAXElXJjE4HTJpzb+f+ /Cmt1bgBB5lukmYW8t0JGPdIyR2Cf58Ypg0hd/npUkB4A0DGX4M8oiGzs/QQqe26QpT7nN T5YxjcaQDP2um15MV1tZyN3tyTnsndZtmvpZNN/xkzY7G4DW3N4JxH/i2/a95kwwYQZh42 QHOs5gYbFwMdoaMm/R/kCbHzUKzbZvG6PnK9jN69p3tbCIWLAYjC0DVc56LQmreu8yNXo6 5VTlFPQ/5Vt1D+BrcXgMDNtU+jcmI4nP9gDWVAvG4t2Bvd5Te0UJwBMW5HxD0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=ugEu69vO; 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=ugEu69vO; 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: 823D21161C X-Spam-Score: 1.85 X-Migadu-Scanner: scn0.migadu.com X-TUID: H3J8N29Lr5ZU * 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