From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bruno Barbier Newsgroups: gmane.emacs.help Subject: Re: Why does (file-exists-p "") return t? Date: Sat, 11 Feb 2023 20:34:38 +0100 Message-ID: <63e7edd1.050a0220.9a8d6.6c91@mx.google.com> References: <834jrvm04q.fsf@gnu.org> <87wn4q1r6w.fsf@posteo.net> <63e7697c.1c0a0220.a6be.a36d@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1967"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Edgar Vincent , eliz@gnu.org, help-gnu-emacs@gnu.org To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 11 20:35:28 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQveh-0000In-Hc for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 11 Feb 2023 20:35:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQveA-0000lF-OJ; Sat, 11 Feb 2023 14:34:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQve7-0000kz-HH for help-gnu-emacs@gnu.org; Sat, 11 Feb 2023 14:34:51 -0500 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQve5-0006Fw-Pu; Sat, 11 Feb 2023 14:34:51 -0500 Original-Received: by mail-wr1-x436.google.com with SMTP id h16so8393380wrz.12; Sat, 11 Feb 2023 11:34:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:date:references:in-reply-to:subject:cc:to:from :message-id:from:to:cc:subject:date:message-id:reply-to; bh=eQfE4HeQPh0eevog7WsDDlBptPw2UHD0zaUptreVQMk=; b=Z/Yh7TO9fj/aYiU0/Zqd/gF+IjKQXUnPwjg9sy/AE/zHmAh4zmEw3kdY2l2D/lUhk5 8+PZI6iU4XEoiJFhMVigGMVDd1cb/AKR1EouLzoOKdoQyYndbCJfddeSZ6LXJipJRMYU zuup7/Y64ZEgL6yGUEqCVFTHQmIuqKeisszWgvl8CiH8cJ9Z96SVTNK8iTet4Vfxwy6z Ef7tSQJq2V1XpLm1KdJXGFNtbGip2CuzCO+Ud2Qu0ITsjvS1PL/2o0YOgebh/TrwFRm4 igj/9R7anwlSfGg+YV8lfclUMCprAkPmj3v8cEGNaCzNn30mo0AHCejnlHqf4u9zFcIt UJCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:date:references:in-reply-to:subject:cc:to:from :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eQfE4HeQPh0eevog7WsDDlBptPw2UHD0zaUptreVQMk=; b=MSO7RPWfudYT8zggea3ITAqjX57phTWO/jdB9dVH4YBUFI9HYKYcZzUgBYguGlL1RW omI753OBTFctr5uzV1c1FAT6FaR2Hvo59jsjo4j1gDEZbBR1pHTPFiBcN6MooXUk5YzP w0C5jJy1fC+K1yKvEvY7wjVThidVBVX2DOOtV1epywnKwr64/udTFoJzy628v1uloXfq AoqmPpnuNut7RkCYdaA1ODFJWLUYFSiramkkBws4AJmCtpxyP2pdmzqjAdYbQEzf4wI+ n8U08B1zpK20JP2ofnjw10e+bRzID6iDAlbd+c4dKeHRzvp9rIjqSLxEQ5/4KPkZ6dQ7 EnLQ== X-Gm-Message-State: AO0yUKWfhRC9pLomL6WVEruQF/hEAciE/aM6WO42eveGqLjrtxzbG4pS M13nVAvPLsH56Qh7FpsyBwHkGmR5A3Peog== X-Google-Smtp-Source: AK7set9/wy5JDZbkexnedcE/ezvy3voJ6DUK02nknTOxjr6ePr3PUO6/QtxBoiwdyIEKSAhMA0YRtw== X-Received: by 2002:a5d:508d:0:b0:2c3:cf13:c46 with SMTP id a13-20020a5d508d000000b002c3cf130c46mr16750244wrt.53.1676144082202; Sat, 11 Feb 2023 11:34:42 -0800 (PST) Original-Received: from keynux ([2a01:e0a:505:3460:169:7511:f49a:58eb]) by smtp.gmail.com with ESMTPSA id m20-20020a056000181400b002c54e89fcadsm2184192wrh.55.2023.02.11.11.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 11:34:41 -0800 (PST) Original-Received: by keynux (sSMTP sendmail emulation); Sat, 11 Feb 2023 20:34:38 +0100 In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=brubar.cs@gmail.com; helo=mail-wr1-x436.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, MSGID_FROM_MTA_HEADER=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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142713 Archived-At: Jean Louis writes: > * Bruno Barbier [2023-02-11 13:10]: >> > As otherwise you may check the wrong path. >> >> Why ? >> >> One of the first thing `file-exists-p' is doing is to call >> `expand-file-name' to expand the file name. I don't see how calling >> `expand-file-name' before would help. > > I understand you and I am sure in most use cases it is not necessary > as it will be expanded later. > > Sometimes I wish to expand it before for reason that > `default-directory' sometimes changes: IIUC, you are saying that it may be better to expand immediately and to use the expanded version, to not risk the file to be expanded later, possibly in a wrong/unknown context. Very good point, indeed. Thanks for the explanation and the advice, Jean. Bruno