From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70914: 29.3; Crashes often on Windows Date: Thu, 23 May 2024 19:02:50 +0300 Message-ID: <865xv44itx.fsf@gnu.org> References: <829659206.4083070.1716354489264@mail.yahoo.com> <582535681.1158538.1716358337102@mail.yahoo.com> <86zfsi6qdx.fsf@gnu.org> <867cfm6j14.fsf@gnu.org> <86v835676h.fsf@gnu.org> <86le415cmz.fsf@gnu.org> <87v834yg5o.fsf@localhost> <86v8344xtc.fsf@gnu.org> <87pltcyfbk.fsf@localhost> <86ttio4ve7.fsf@gnu.org> <87fru8ycdk.fsf@localhost> <86cypc4pra.fsf@gnu.org> <878r00y6sq.fsf@localhost> <868r004o9q.fsf@gnu.org> <871q5sy5d2.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1217"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70914-done@debbugs.gnu.org, simendsjo@gmail.com, corwin@bru.st, ssbssa@yahoo.de To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 23 18:04:28 2024 Return-path: Envelope-to: geb-bug-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 1sAAvb-000AZX-Lw for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 May 2024 18:04:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAAvA-0006M7-RY; Thu, 23 May 2024 12:04:00 -0400 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 1sAAv6-0006KM-Sp for bug-gnu-emacs@gnu.org; Thu, 23 May 2024 12:03:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAAv6-0008Jw-K6 for bug-gnu-emacs@gnu.org; Thu, 23 May 2024 12:03:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sAAvC-0004Ko-WA for bug-gnu-emacs@gnu.org; Thu, 23 May 2024 12:04:03 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 May 2024 16:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 70914 X-GNU-PR-Package: emacs Mail-Followup-To: 70914@debbugs.gnu.org, eliz@gnu.org, simendsjo@gmail.com Original-Received: via spool by 70914-done@debbugs.gnu.org id=D70914.171648019316588 (code D ref 70914); Thu, 23 May 2024 16:04:02 +0000 Original-Received: (at 70914-done) by debbugs.gnu.org; 23 May 2024 16:03:13 +0000 Original-Received: from localhost ([127.0.0.1]:59717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAAuP-0004JU-0Y for submit@debbugs.gnu.org; Thu, 23 May 2024 12:03:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAAuM-0004JL-Ad for 70914-done@debbugs.gnu.org; Thu, 23 May 2024 12:03:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAAu9-0008Bt-Eb; Thu, 23 May 2024 12:02:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3GrVusqNJkBFqsfqsoLVsixZJpnZwoAIX6D+1GoCuCY=; b=gjqNWtBD48v7 Iz9Bhf3U7nngPuUDir0lituG1EmNTJjnyRuuWHP9olcumB2r2is8VHJsVB4QuQHDPCJj91AQDTw1N 12L97xlLoUYPdkvnuRwUlRkro7GEJROBQR3O1wFcF2jGq9jBRTuUS9ccZKjlSx/rYL4595cCg98TP Hx6SltJpxtSH74912+GfA15wjfw5iw7FsTCIDqoJl0KS2R86GplD+YRZ58EADefWc1n4jRZapVxeJ 7WwEtFZeXL+AlOegqchwxBJLKczqSNsO+Y+q+010lxvadDf4z9xhoH0th3TqZ99BKgQbHmAiYhGAV 1c9klLA5f9T4w+cAARcqHg==; In-Reply-To: <871q5sy5d2.fsf@localhost> (message from Ihor Radchenko on Thu, 23 May 2024 14:23:21 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:285720 Archived-At: > From: Ihor Radchenko > Cc: simendsjo@gmail.com, ssbssa@yahoo.de, corwin@bru.st, 70914@debbugs.gnu.org > Date: Thu, 23 May 2024 14:23:21 +0000 > > Eli Zaretskii writes: > > >> > My point is that if the URI is "file://", the corresponding :path on > >> > Windows is not "//". > >> > >> Sure. But what is passed to :activate-func is not a file path. It is > >> "Org mode link path". They are not the same in this specific case, but > >> there is nothing wrong on Org side. > > > > Then on whose side is something wrong in this case? Which code calls > > file-exists-p with the string "//" in the case you described? > > https://github.com/doomemacs/doomemacs/blob/master/modules/lang/org/config.el#L500 > > >> >> IMHO, the bug is in file-exists-p: > >> > > >> > I don't think so. "//" is an invalid file name on Windows, so the > >> > only requirement from file-exists-p in that case is not to crash. > >> > Which it does, after the recent fix. > >> > >> IMHO, "invalid file name on Windows" leads to "trouble determining > >> whether the file exists". > > > > Since the file name "//" is invalid, you get undefined behavior. > > > Examples: > > > > (file-exists-p "//) > > => nil > > As I tried to explain, I do not see the behaviour as "undefined" when the > file name is really invalid. Not for `file-exists-p'. AFAIU, > `file-attributes' and `file-directory-p' do not give such promises in > their docstrings. > > > but > > > > (file-attributes "//") > > => (t 1 1001 513 (0 0 0 0) (0 0 0 0) (0 0 0 0) 0 "drwxrwxrwx" t 0 0) > > This is somewhat surprising, but also somewhat expected - > `file-exists-p' does not always mean that file does not exist: "This > returns nil for a symlink to a nonexistent file." Yet, symlink to a > nonexistent file can have attributes. So, I can see how > `file-attributes' can return something strange for non-existing files. > > > and > > > > (file-directory-p "//") > > => nil > > This also follows from the docstring of `file-directory-p': > > Return t if FILENAME names an existing directory. > > Return nil if FILENAME does not name a directory, or if there > was trouble determining whether FILENAME is a directory. > > >> AFAIU, this is what happens after the fix anyway, so there is nothing > >> more that should be done on Emacs side. > > > > Generating such invalid file names is wrong, so it should be prevented > > if possible. But I won't argue more if you are still unconvinced. > > Org does not care about "file" part. There is a link. The link has a > path. User can put anything in that path. Org does not generate file > names - Org parses Org link syntax and leaves its interpretation up to > the more specialized code. > > Of course, if you see problems with Org mode code that interprets file > links specifically and are _also_ designed to handle file links, I will > be happy to fix edge cases like you described. The fontification code in > Org mode has nothing to do with interpreting the meaning of the links. Got it. I'm closing this bug, since there doesn't seem to be anything left to do here.