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#57325: 27.1; functions in ff-other-file-alist Date: Thu, 25 Aug 2022 11:14:20 +0300 Message-ID: <831qt44u5f.fsf@gnu.org> References: <87fshpjviu.fsf@betli.tmit.bme.hu> <83h725bf4w.fsf@gnu.org> <875yiljslg.fsf@betli.tmit.bme.hu> <837d30biz4.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8913"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57325@debbugs.gnu.org To: felician.nemeth@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 25 11:07:19 2022 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 1oR8pa-00027U-L8 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Aug 2022 11:07:18 +0200 Original-Received: from localhost ([::1]:48728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oR8pZ-00021Q-HQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Aug 2022 05:07:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR810-0001Vm-RN for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2022 04:15:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59073) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oR810-0005Tz-GV for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2022 04:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oR810-0001US-0P for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2022 04:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Aug 2022 08:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57325 X-GNU-PR-Package: emacs Original-Received: via spool by 57325-submit@debbugs.gnu.org id=B57325.16614152585661 (code B ref 57325); Thu, 25 Aug 2022 08:15:01 +0000 Original-Received: (at 57325) by debbugs.gnu.org; 25 Aug 2022 08:14:18 +0000 Original-Received: from localhost ([127.0.0.1]:48822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR80I-0001TF-2d for submit@debbugs.gnu.org; Thu, 25 Aug 2022 04:14:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR80G-0001T2-4E for 57325@debbugs.gnu.org; Thu, 25 Aug 2022 04:14:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59498) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR80A-0005QU-Th; Thu, 25 Aug 2022 04:14:10 -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=NbkYohY7luMy0P8tL2ozkKQZtnL1gYp61pAEVYVFIGI=; b=fBofpL6k0RoB Yz7VphvI3JXU+o4KLY6zfPkLVuDCtyKHUNBF87LndBbWC3n9vSMn9LZ04U7NxSojHKYfaccVBGKso 5eCwi2CQeHbFM4VQAd5iDMVRx6kd/gyHWAhkSk8rORM4B4llKrktAq+I3wcFRmG/D87g/mspMPnI+ C0dzvVjAY5S83ZUXZ3i+Oep+DGnq+EzHzd5hsmR/wsuXi7+76uAN+YILZWO8gOroMe1//oK74IRDX 6Pjpui/TaGycsukXk37SnxA/wyzL7qksqo2T47IvvjcGcmMLnYXKGWQkZ1ZsRhbWV1cZ1cvLDbwAG pfqlb3u+tS4Ul5hnwcwVyw==; Original-Received: from [87.69.77.57] (port=2287 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR80A-0000PH-7A; Thu, 25 Aug 2022 04:14:10 -0400 In-Reply-To: <837d30biz4.fsf@gnu.org> (message from Eli Zaretskii on Mon, 22 Aug 2022 14:44:47 +0300) 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" Xref: news.gmane.io gmane.emacs.bugs:240688 Archived-At: > Cc: 57325@debbugs.gnu.org > Date: Mon, 22 Aug 2022 14:44:47 +0300 > From: Eli Zaretskii > > > From: Felician Nemeth > > Cc: 57325@debbugs.gnu.org > > Date: Sun, 21 Aug 2022 21:37:31 +0200 > > > > I got confused because if I remove the > > (setq uniquify-buffer-name-style nil) line from bug.el, then > > ff-find-related-file will open the parent directory of xref.el, which > > feels correct. However, with that line setting > > uniquify-buffer-name-style, ff-find-related-file selects /tmp/dir/1234, > > which feels wrong because that buffer has nothing to do with xref.el. > > > > In my case, a file can contain a link to another file (a .toml file to a > > schema file). I wasn't sure what to do when the original file did not > > contain a link. Maybe my-find-related-file should ask the user what to > > do in this case, or just do a (user-error "There's no related file."). > > OK, I will look closer at this specific use case and see whether > there's some problem in find-file.el in that case. AFAICT, what you saw is the consequence of one basic problem: ff-find-the-other-file is unprepared to deal with a function that returns nil (instead of a list of file-name extensions to try). So it tries to use that nil value as if it was a list of extensions, and the result is basically random. It should be easy to make ff-find-the-other-file detect the nil value and handle it as if it found no match for the current buffer's file. Do you think this would be better? Or we could simply document that a function in ff-other-file-alist must return a list of extensions. WDYT?