From unknown Tue Aug 19 21:02:27 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#57325 <57325@debbugs.gnu.org> To: bug#57325 <57325@debbugs.gnu.org> Subject: Status: 27.1; functions in ff-other-file-alist Reply-To: bug#57325 <57325@debbugs.gnu.org> Date: Wed, 20 Aug 2025 04:02:27 +0000 retitle 57325 27.1; functions in ff-other-file-alist reassign 57325 emacs submitter 57325 Felician Nemeth severity 57325 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 21 14:34:29 2022 Received: (at submit) by debbugs.gnu.org; 21 Aug 2022 18:34:29 +0000 Received: from localhost ([127.0.0.1]:36758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPpmH-0004tH-CB for submit@debbugs.gnu.org; Sun, 21 Aug 2022 14:34:29 -0400 Received: from lists.gnu.org ([209.51.188.17]:51906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPpmC-0004t6-DX for submit@debbugs.gnu.org; Sun, 21 Aug 2022 14:34:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPpmC-0008KD-8K for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 14:34:24 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:33745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oPpmA-0003GW-HA for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 14:34:23 -0400 Received: by mail-ej1-x635.google.com with SMTP id j21so12046831ejs.0 for ; Sun, 21 Aug 2022 11:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:face:user-agent:message-id:date:subject:to:from:from :to:cc; bh=1ayTJQ1wGiFQmLEm2pi42uYOi+ZYYbhgpXQddkseUcE=; b=YLilT1IC0yq2MiLH5EbrupSLeaSOPamRwOaNIFZtLoYSknf5rvYKGNrMYezRbeRuu8 dKM8rhkNpHUP9vDqUFd8PPl8Gsj752xqU4/c0iTBNokRuNZBnLneJ9j8UJRB/L6sAA79 SHFyulGYRmuna5GI0LYIPRWhdiv6HJq0vGe/rwLNg5PuWrVs23THVy+5VOtrOvOlW9jn V3JVE2HUmuq9Jd7M8pkhAx/hYsd7WS2Df/Y5Mb3aNOK7qKCFjoGsJUd8tOkadbO4f0vM lZ+viKh7pIupCYsU6jOSkMikAEANZ4evfNxrhn38y/jkpcOGZNWCVq3ZXRnaEuAkxSe8 4qQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:face:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc; bh=1ayTJQ1wGiFQmLEm2pi42uYOi+ZYYbhgpXQddkseUcE=; b=NYIuhXcro4fV9v6B6SqSIs3J+o99nZO8vCR6X6FQnkecJCmwkNmd2twzkrP8wMKyD4 Rz87/8HXFTrY0sy45JcNSdBkeFnoB2dlidropqKrq91Fv+1xl/NSGCJhzBdfvVBQTpqh rI+s/iknFzyiFcbYaxr9tELq+3ZUutAXRis/EnpZl57vSYtwV3mUH0OUBUrrnrYasim0 dD5RyWsqbR2Ui/fc6+UIxIFFWGnrtIU5mzqm8sHFscWZn6qJD3mzheR3PdIaN3sD7vgn l37FjveaRzGq5Y1nyQwbGkN5BjAE1tI51IWj5/FzD8MsU662yf7MAW+FBoPeUez0WOSM LX5Q== X-Gm-Message-State: ACgBeo0WwHYwiHPEUUxZDpz/Nqi6y34OckgBivskotMOwuL7jg3R0wiO qegoLRMxOmdBEV5A4Bk2hQ5QwDfWzis= X-Google-Smtp-Source: AA6agR4yYqSZjukIzFnrZ7IahgZoymraTDBNIMx1tr3q8e3ZrYPtsCC8sAmCpSplJW811loFJk43mg== X-Received: by 2002:a17:907:2d92:b0:731:3310:418d with SMTP id gt18-20020a1709072d9200b007313310418dmr10680186ejc.379.1661106858876; Sun, 21 Aug 2022 11:34:18 -0700 (PDT) Received: from betli.gmail.com (catv-86-101-66-128.catv.fixed.vodafone.hu. [86.101.66.128]) by smtp.gmail.com with ESMTPSA id b21-20020a17090630d500b0073d71b7527asm1403525ejb.151.2022.08.21.11.34.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Aug 2022 11:34:18 -0700 (PDT) From: Felician Nemeth To: bug-gnu-emacs@gnu.org Subject: 27.1; functions in ff-other-file-alist Date: Sun, 21 Aug 2022 20:34:17 +0200 Message-ID: <87fshpjviu.fsf@betli.tmit.bme.hu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEUMBwgHAgMFAAGPjY7/ //80MDHq6eqJt3pKAAABr0lEQVQ4jX2UzZKDIAzHqR177q7TPbtx2HMr6guQcrbY9txZ0fd/hA0f onXazcEJ/CD8E4Js8/HS9mwjXtqeMRxHXJkakTEm4b4GPVQW8PU8ov4fQCqeThlF60MBWdo1IXzd 2nEEZE7CEAZLwI0N/gJAhTj7ESQAX4gPgO8lyI+cvgViSVPlNomAj2M9gW40eg7VWY3cATjUcyiO Z+i03cFruGLYoUR7VyU3HihdmCEVhoDN65FXkpbSxkomOzsTQN/gySaodGb9Gdi1oSRXP46gdBWh LcUKJNdeGCWac74GKakmne0aHCFvyqJPYLsCFAVlhRTvGdzMdLHqtgRyUulyXIAH7CYQ3AB0Nody JQhAkq/qtOnbjhxdzYDkXPxlH5y4WdUAeUcX1NVJ6GR7UQEYPGWoAnA36OQNn5lRRp38vHTAp9Br LoTmvlPPDoRCKzpjG1SXT89AaT5l456BamJuMcs+NIOMzJ/s5dI6yUVcrARlruwOebfdv6gunTn4 ww3+QjGBEn5suVyLHoSGvAqREuDLN+iqZ+VcFg+HBbsJUU9+FZthbez9T+bdb+kPv2Ls6ct3hTkA AAAASUVORK5CYII= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=felician.nemeth@gmail.com; helo=mail-ej1-x635.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain [There is a simple reproducer at end of the bug report.] First, the documentation of ff-other-file-alist fails to mention that the value of the variable does not have to be alist, it can be a symbol as well. More importantly, if the associated value is a function, then there's no way for the function to signal that it cannot find a related file. If the function returns "/nonexistent", then ff-find-the-other-file (with the default settings) will try to create "/nonexistent". If the function returns nil, then ff-find-the-other-file will call ff-get-file-name and: (ff-get-file-name '("." "/usr/include" "/usr/local/include/*") nil nil) ==> "/home/nemethf/.emacs.d/News/drafts/drafts/679" "emacs -Q -l bug.el" reproduces the problem by setting uniquify-buffer-name-style. However, my uniquify-buffer-name-style is 'forward and not nil. Maybe Gnus changes uniquify-buffer-name-style under the hood, because drafts/679 corresponds to a buffer named "*sent wide reply to Somebody*<2>". I tend to think this bug in line 577 of find-file.el: http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/find-file.el?id=958924a8126cf532d44c4b446d13ed744438cc9b#n577 But I don't understand the purpose of that string-match-p. Thanks. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=bug.el Content-Transfer-Encoding: quoted-printable (defun my-find-related-file (filename) ;;'("/nonexistent")) nil) (setq ff-other-file-alist '((".el" my-find-related-file))) (setq uniquify-buffer-name-style nil) (find-file-noselect "/tmp/1234") (find-file-noselect "/tmp/dir/1234") ;; Find an .el file: (xref-find-definitions 'xref-find-definitions) ;; M-x ff-find-related-file RET, or: (ff-find-related-file) ;; /tmp/dir/1234 is selected, which has nothig to to with xref.el --=-=-= Content-Type: text/plain In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2021-03-28, modified by Debian built on x86-conova-01 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Debian GNU/Linux 11 (bullseye) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 21 14:55:38 2022 Received: (at 57325) by debbugs.gnu.org; 21 Aug 2022 18:55:38 +0000 Received: from localhost ([127.0.0.1]:36792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPq6k-0005SD-6Q for submit@debbugs.gnu.org; Sun, 21 Aug 2022 14:55:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPq6h-0005Rx-N3 for 57325@debbugs.gnu.org; Sun, 21 Aug 2022 14:55:37 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50808) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPq6b-00069C-No; Sun, 21 Aug 2022 14:55:29 -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=lGgJ10SMfT1NjqVYu2GqcRQA+D/0LltWR3Sta4YBXhQ=; b=XkfZlwH+Wytl VufEU/ZzsNNpG7FNEtbJVVOJnNQj0wLOLaVI/smZmFSTMz0dCtgKJIHOlXv9BOfiq1xVpF2+r7Clz GRNSQBlzqfuyBvn7fFHFbU6FWAI0A2hxOVaSZJytlaBqGqO6Nu9jl1NG9NF58KeAvD+8f4ZZ4CvIL 7PAmfZa9UCRoMffkXFbcHD5C9TGJfUfoyv24cOPu7lPbc0Gwdn4zWP3ZW75wZRprLkt9xPo1vnls5 AC0SUPIiTwkbbujz6V5NCVyiZrfjyHYl6/S6dn85YoESbD2GDVOY3mIQxtdHA8pzXt5Qn41GQHu2Y YuCA4o7lgoCUebUbxeQ33g==; Received: from [87.69.77.57] (port=1569 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 1oPq6X-0000nL-K9; Sun, 21 Aug 2022 14:55:28 -0400 Date: Sun, 21 Aug 2022 21:55:27 +0300 Message-Id: <83h725bf4w.fsf@gnu.org> From: Eli Zaretskii To: Felician Nemeth In-Reply-To: <87fshpjviu.fsf@betli.tmit.bme.hu> (message from Felician Nemeth on Sun, 21 Aug 2022 20:34:17 +0200) Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist References: <87fshpjviu.fsf@betli.tmit.bme.hu> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57325 Cc: 57325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Felician Nemeth > Date: Sun, 21 Aug 2022 20:34:17 +0200 > > First, the documentation of ff-other-file-alist fails to mention that > the value of the variable does not have to be alist, it can be a symbol > as well. Thanks, now fixed on the emacs-28 branch. > More importantly, if the associated value is a function, then there's no > way for the function to signal that it cannot find a related file. That's on purpose: this package's design causes such a situation to make no sense. Imagine that I wrote a C source file and what now to "find" the corresponding header file. If that header file doesn't exist, I need to write it and save it. Which is why ff-find-the-other-file behaves like it does: if the file doesn't exist, it visits that file as a new one and lets me edit it. What would you have the package do instead when "the other" file is not found? > If the function returns "/nonexistent", then ff-find-the-other-file > (with the default settings) will try to create "/nonexistent". > > If the function returns nil, then ff-find-the-other-file will call > ff-get-file-name and: > > (ff-get-file-name '("." "/usr/include" "/usr/local/include/*") nil nil) > ==> "/home/nemethf/.emacs.d/News/drafts/drafts/679" > > "emacs -Q -l bug.el" reproduces the problem by setting > uniquify-buffer-name-style. However, my uniquify-buffer-name-style is > 'forward and not nil. Maybe Gnus changes uniquify-buffer-name-style > under the hood, because drafts/679 corresponds to a buffer named > "*sent wide reply to Somebody*<2>". > > I tend to think this bug in line 577 of find-file.el: > http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/find-file.el?id=958924a8126cf532d44c4b446d13ed744438cc9b#n577 > But I don't understand the purpose of that string-match-p. It looks for buffers which were uniquified. But I don't think I understand what you don't understand there, nor how that part is related to the issue you are raising, which AFAIU is that the function cannot meaningfully signal a failure. Please elaborate. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 21 15:37:41 2022 Received: (at 57325) by debbugs.gnu.org; 21 Aug 2022 19:37:41 +0000 Received: from localhost ([127.0.0.1]:36835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPqlR-0000D9-AE for submit@debbugs.gnu.org; Sun, 21 Aug 2022 15:37:41 -0400 Received: from mail-ed1-f45.google.com ([209.85.208.45]:41551) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPqlP-0000Cu-4E for 57325@debbugs.gnu.org; Sun, 21 Aug 2022 15:37:40 -0400 Received: by mail-ed1-f45.google.com with SMTP id r4so11430797edi.8 for <57325@debbugs.gnu.org>; Sun, 21 Aug 2022 12:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc; bh=Mo0aJgBMOzsucV5piPDB6+zlaLKp3RKdS5aQmA0sC18=; b=D4H7WeWPUI8JELuazTUHRpCkgzTT4hquWuFSlcYsuQdkEr0G0B8w6ImRiqolFH+Vpv 4c7f+OHujoszTV7zpDVbiTK8NgQvhJzMietG3dysMGYTqlG7NCiGoWCsfiayhsg9XxQW AZYI4EXU/1zWgUOQ0hbIddZz76W4ExzfRGrdb6IVLuA7GbOUVtSTDtRuUbOE4UmekqWf /YorXAa5L/PnPpYHrEi/L3siTFKBJk7d6LVpMD5ybxKD43+N2smSK7uNCrxJauGe0H5G u2EeYWtYJr7s9g2kxHiwFrig1AxjLX1YDyH2mpgRDJeC+OmDobjtk5qay47VxeLWzC8l Tb1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc; bh=Mo0aJgBMOzsucV5piPDB6+zlaLKp3RKdS5aQmA0sC18=; b=icIhF3PeEJJciZHtXb2bJIiPONNA8Jxd5a9BKiUxL10YbkaOgKlipx3dJgwfLz6gtj 0rBg9dreDF4vVvZj5AjTN90qJOI1Xi8Z4Dlk6dCSHqOLwtvPumRxNG41hIJEW6yJLpmp TMyhsCcryW41PvDnhk05PxiierBSg47/vM9C8rA8SputITLK/M7sfktZ2eLxquKiZa7j 7Y7L4kdZPFEJsmcy33iS2/svUYgj3Rn9+DeKK+UkIGRbNjRlGHcv0AlAbT587/bbSG/b ns2FMwFXJQJkWW4+AKafHYRScDjVtbqxStMZSTRmPt7QUYMUnQNG9qvrTSjCmEwF0scM StqA== X-Gm-Message-State: ACgBeo1zYz37zcV/HlJNKUEkX3vqBFtSD9MWrvAVnMKZh13XdzpQdbUt 2CfU5Qzn+8KKR4duIXaDrLJM0v+bOKA= X-Google-Smtp-Source: AA6agR5zG3wsq9cnVioCetc/6+mkND+o3EG+ms41z8Htj9/4v0dE3rbWmbTki+HYqXPe1Z8BikzQ1w== X-Received: by 2002:a05:6402:34d5:b0:446:d2e8:3a3b with SMTP id w21-20020a05640234d500b00446d2e83a3bmr385793edc.297.1661110652894; Sun, 21 Aug 2022 12:37:32 -0700 (PDT) Received: from betli.gmail.com (catv-86-101-66-128.catv.fixed.vodafone.hu. [86.101.66.128]) by smtp.gmail.com with ESMTPSA id f9-20020a50fc89000000b0043bbb3535d6sm6871443edq.66.2022.08.21.12.37.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Aug 2022 12:37:32 -0700 (PDT) From: Felician Nemeth To: Eli Zaretskii Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist References: <87fshpjviu.fsf@betli.tmit.bme.hu> <83h725bf4w.fsf@gnu.org> Date: Sun, 21 Aug 2022 21:37:31 +0200 In-Reply-To: <83h725bf4w.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 21 Aug 2022 21:55:27 +0300") Message-ID: <875yiljslg.fsf@betli.tmit.bme.hu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX5+fmhoaEwMDD/ ///TMNVWAAAAAWJLR0QDEQxM8gAAAAlwSFlzAAAPEgAADxIBIZvyMwAAAAd0SU1FB+AICBUfHgLs gGoAAAGXSURBVCjPRdK/b5tAFAfw753gBEwM2ApMbuVIqf+Ko0qiyhOu4sj2xJBYMn/FUdX7UUUZ OjHgyvf+yj6IcW6Bjx53934ADEvs8bmEr8UVoTYTOyJO9KoYsVofN8kILdbeJ8Li6YpZWop4xOK0 VdfIoXmkHn5/5D7/Ts/8THacSqnkKTcMTxgUkVzFnEIRTKwwYYSCvzfg16f0i8YApW/XG/Pm8R49 dXjxKmRnxv3OwooQWcv4RUYem1fsNe/WU63uk7AmYxk78y32/ee2tZB4fO+WcZ7lnIGEolXW1EGw LfkSuQ0XTgRefgNlfNwRNV6QhBxJ8JNxTMUPyBqTd0bjaAP5G7NJRU39z80hLOZTjqB7K3tEEFSj aEsuQew6qBxxyhHjVUR7H7NpC9iHJZGLMCEuweqAqE1BHbfK2oRIz9EHYA/+wiFWru9smeVfuWNZ 2+NFtX80UA1TvJNdytM4DwO4kY7bJz8Qcd0G0ceslZGkkeoBsjUHwF1+jjM3XHaXEZ7mGLfwPFO+ RV9QLY2iEdmDo78D/gNPaXVYqd+pyQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wOC0wOFQyMzoz MDoyOCswMjowMGy/yHYAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTYtMDgtMDhUMjM6MzA6MjgrMDI6 MDAd4nDKAAAAAElFTkSuQmCC MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57325 Cc: 57325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Thanks, now fixed on the emacs-28 branch. Thank you. >> More importantly, if the associated value is a function, then there's no >> way for the function to signal that it cannot find a related file. > What would you have the package do instead when "the other" file is > not found? Most probably I just failed to understand that my-find-related-file should not return nil and, as you say, it cannot meaningfully signal a failure. If this is the case, this bug can be closed and I'm sorry for the noise. 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."). Thanks again. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 22 07:44:52 2022 Received: (at 57325) by debbugs.gnu.org; 22 Aug 2022 11:44:52 +0000 Received: from localhost ([127.0.0.1]:38177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ5rP-0005Ca-P0 for submit@debbugs.gnu.org; Mon, 22 Aug 2022 07:44:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ5rN-0005CN-Cx for 57325@debbugs.gnu.org; Mon, 22 Aug 2022 07:44:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQ5rI-0000Y2-5l; Mon, 22 Aug 2022 07:44:44 -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=AdMeh4lNTd0asub0CUp7lZr7/JugvedouQ6ERSXac5k=; b=bm3fLda51W91 F/w9XUSlaAE62RmzVyLZhJYuuNKxn4RNJTEPSZs2+xEjfJY7ZZR1/xt1X9eddFlLz4JEYkN07zpxV HjXN/sGH7dyO2P8O7FYQ99gfc3O43cmQr+3k7gBpaeyvpdW+Mj24EtimF+EzkAU/htAGX61Eufe/j WSl6QdFKF/85P/m3bcnoV0mHWGHLKlK9ftKkt90EmvFI2swhMFauU57sS4jLeF/gXruFDMfgUzcsN vRbYxc35UEFkwaOlmUh3YII4KvO+8UQySPqPjFeGjaSkF/GwKeOY5uTxNfloSCuQ+EbqF1J/+MUP9 VCXWSgxn9a8SkLHqBw12RA==; Received: from [87.69.77.57] (port=3456 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 1oQ5rH-0006Qm-KK; Mon, 22 Aug 2022 07:44:43 -0400 Date: Mon, 22 Aug 2022 14:44:47 +0300 Message-Id: <837d30biz4.fsf@gnu.org> From: Eli Zaretskii To: Felician Nemeth In-Reply-To: <875yiljslg.fsf@betli.tmit.bme.hu> (message from Felician Nemeth on Sun, 21 Aug 2022 21:37:31 +0200) Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist References: <87fshpjviu.fsf@betli.tmit.bme.hu> <83h725bf4w.fsf@gnu.org> <875yiljslg.fsf@betli.tmit.bme.hu> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57325 Cc: 57325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 25 04:14:18 2022 Received: (at 57325) by debbugs.gnu.org; 25 Aug 2022 08:14:18 +0000 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 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 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==; 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 Date: Thu, 25 Aug 2022 11:14:20 +0300 Message-Id: <831qt44u5f.fsf@gnu.org> From: Eli Zaretskii To: felician.nemeth@gmail.com In-Reply-To: <837d30biz4.fsf@gnu.org> (message from Eli Zaretskii on Mon, 22 Aug 2022 14:44:47 +0300) Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist References: <87fshpjviu.fsf@betli.tmit.bme.hu> <83h725bf4w.fsf@gnu.org> <875yiljslg.fsf@betli.tmit.bme.hu> <837d30biz4.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57325 Cc: 57325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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? From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 29 07:57:54 2022 Received: (at 57325) by debbugs.gnu.org; 29 Aug 2022 11:57:54 +0000 Received: from localhost ([127.0.0.1]:60278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSdOr-0003uY-Pt for submit@debbugs.gnu.org; Mon, 29 Aug 2022 07:57:54 -0400 Received: from mail-ed1-f51.google.com ([209.85.208.51]:47099) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSdOq-0003uM-Ea for 57325@debbugs.gnu.org; Mon, 29 Aug 2022 07:57:52 -0400 Received: by mail-ed1-f51.google.com with SMTP id s11so9753769edd.13 for <57325@debbugs.gnu.org>; Mon, 29 Aug 2022 04:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc; bh=p4oQOXUWkj3IAWp+/JpeK/OKhZlzC7u+3KdwbM0mW8Q=; b=qQW/akxa5de3l4bu9xiwJwYUykSql4zE5oC/LZ+nFVkapNICjmoA0QfN5zsXo4zkK3 9HVbYKEOxZAQGcjxvkMOvCF61QHV9ldO3aLyvOe7Rfcv6F0EN1sXrPKPDtm/sgYh4UPE vjVh4sMn6aGupY7bPI+xnOHm80abNSo9LWHneC44ntgmifwLYnvJy+iAsDpFzEofO/lm 5F8pvEAQSevus4V68O3h7i6XgrFjjBVDMg5jiiFsHl/g/T3h+opuOHoDwEKhpbCfgXXd i46dRf7Ueg9JZLdKVHJRCWptxuCBBI60EmrNCB8Ft/A1l7/rjCfhsuXdZpD5Wbun5gw1 A9HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc; bh=p4oQOXUWkj3IAWp+/JpeK/OKhZlzC7u+3KdwbM0mW8Q=; b=ltnnadSQki9fOgdjwYfnqqikIaokHQl1KdMPYxZIlhkxE+IKBJUj00+r5UwiHJSVp8 S9ugfRLlbpLYjJ5fCMjTh/PKhzPgUVVS+yh6kg1zycst/acPCP+VLx1zRMGQjYlyfvYr i7ugsZorYlGkyjKNnTmstOPv7wyF8hRslrpM1ASbDOXIGsIgbMizk9Y+D140FE7/WAbg SPSD/hOfyRQE1oBAZHZuXu9pgDeux8FKvbGmyY/7HtgGMh9U1Wm+IIFlNUVjzHKkzJpj nVb7haYcTrnXDo0VfF/4qiJr/oduIq2+YrbIFNXsWMoWmQfPiid3sx0QnNtCYMTXlr4y h0kw== X-Gm-Message-State: ACgBeo1dfj/vMPli5uTywV107qrRtAGniGE0R++HlTDN/4EY3lbGtOzZ 3E1c3YXfYxa+j215KQ+smFPNLX8d8xM= X-Google-Smtp-Source: AA6agR6DPZcm+ZScCC2ZsWXb6PU3Kx3NYrIheazVKeEOG4NHZCAZmUQQe7qXOThFQaUEn2XTUT/CXg== X-Received: by 2002:aa7:dcc8:0:b0:447:e8b3:b4f3 with SMTP id w8-20020aa7dcc8000000b00447e8b3b4f3mr11875087edu.374.1661774266089; Mon, 29 Aug 2022 04:57:46 -0700 (PDT) Received: from betli.gmail.com (catv-86-101-66-128.catv.fixed.vodafone.hu. [86.101.66.128]) by smtp.gmail.com with ESMTPSA id 1-20020a170906218100b0072af4af2f46sm4357354eju.74.2022.08.29.04.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 04:57:45 -0700 (PDT) From: Felician Nemeth To: Eli Zaretskii Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist References: <87fshpjviu.fsf@betli.tmit.bme.hu> <83h725bf4w.fsf@gnu.org> <875yiljslg.fsf@betli.tmit.bme.hu> <837d30biz4.fsf@gnu.org> <831qt44u5f.fsf@gnu.org> Date: Mon, 29 Aug 2022 13:57:44 +0200 In-Reply-To: <831qt44u5f.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 25 Aug 2022 11:14:20 +0300") Message-ID: <87czcjs1mv.fsf@betli.tmit.bme.hu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX5+fmhoaEwMDD/ ///TMNVWAAAAAWJLR0QDEQxM8gAAAAlwSFlzAAAPEgAADxIBIZvyMwAAAAd0SU1FB+AICBUfHgLs gGoAAAGXSURBVCjPRdK/b5tAFAfw753gBEwM2ApMbuVIqf+Ko0qiyhOu4sj2xJBYMn/FUdX7UUUZ OjHgyvf+yj6IcW6Bjx53934ADEvs8bmEr8UVoTYTOyJO9KoYsVofN8kILdbeJ8Li6YpZWop4xOK0 VdfIoXmkHn5/5D7/Ts/8THacSqnkKTcMTxgUkVzFnEIRTKwwYYSCvzfg16f0i8YApW/XG/Pm8R49 dXjxKmRnxv3OwooQWcv4RUYem1fsNe/WU63uk7AmYxk78y32/ee2tZB4fO+WcZ7lnIGEolXW1EGw LfkSuQ0XTgRefgNlfNwRNV6QhBxJ8JNxTMUPyBqTd0bjaAP5G7NJRU39z80hLOZTjqB7K3tEEFSj aEsuQew6qBxxyhHjVUR7H7NpC9iHJZGLMCEuweqAqE1BHbfK2oRIz9EHYA/+wiFWru9smeVfuWNZ 2+NFtX80UA1TvJNdytM4DwO4kY7bJz8Qcd0G0ceslZGkkeoBsjUHwF1+jjM3XHaXEZ7mGLfwPFO+ RV9QLY2iEdmDo78D/gNPaXVYqd+pyQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wOC0wOFQyMzoz MDoyOCswMjowMGy/yHYAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTYtMDgtMDhUMjM6MzA6MjgrMDI6 MDAd4nDKAAAAAElFTkSuQmCC MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57325 Cc: 57325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > 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? I think extending the documentation to explain what is expected from the function is enough. It would have helped me. Also, when the function returns an absolute file name, then the returned file should be already opened, otherwise ff-find-other-file cannot find it. Thank you. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 29 10:04:33 2022 Received: (at 57325) by debbugs.gnu.org; 29 Aug 2022 14:04:33 +0000 Received: from localhost ([127.0.0.1]:33304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSfNQ-0001Sp-UE for submit@debbugs.gnu.org; Mon, 29 Aug 2022 10:04:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51122) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSfNO-0001Sa-MK for 57325@debbugs.gnu.org; Mon, 29 Aug 2022 10:04:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42648) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSfNI-0005Is-EV; Mon, 29 Aug 2022 10:04:24 -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=+W50aEtNwcXZRezCEmNW1bVZNMhhljEZuaREPyumeCA=; b=QgWNg/OsfZBO UVXaqbP8hDU+pbe5PTHMppZgkeJBvf8/cPpdo/W7by6LgxspErROp7MqZ6N0XZgNwI6n6Pin0T5mo HZB3zop6CeCHQES41nTR1Jqh7YOsHZ5cMGVWdQWzCG7THyjZ7Ve8tpgGCnimkQdjNG32TgatfqNQN SoPZUx0WeLlaSYnu/JI1zhTnCs1CU6wdQpPixkm4Gb7mfwGtX+HhiQ0n4ZMsUm022LIgFfc2TIKSM VhC4w/WACU/YJPaR/VC+PNRYqwUXLNvRmgy8fdCyu4iKXqTF9jcIzUaDf84CoH8TwTHKvyV+7PuYP u2cgTVdUwnD4wsl/STvNGQ==; Received: from [87.69.77.57] (port=3038 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 1oSfNH-0000yr-Tt; Mon, 29 Aug 2022 10:04:24 -0400 Date: Mon, 29 Aug 2022 17:04:44 +0300 Message-Id: <83r10zw3gj.fsf@gnu.org> From: Eli Zaretskii To: Felician Nemeth In-Reply-To: <87czcjs1mv.fsf@betli.tmit.bme.hu> (message from Felician Nemeth on Mon, 29 Aug 2022 13:57:44 +0200) Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist References: <87fshpjviu.fsf@betli.tmit.bme.hu> <83h725bf4w.fsf@gnu.org> <875yiljslg.fsf@betli.tmit.bme.hu> <837d30biz4.fsf@gnu.org> <831qt44u5f.fsf@gnu.org> <87czcjs1mv.fsf@betli.tmit.bme.hu> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57325 Cc: 57325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Felician Nemeth > Cc: 57325@debbugs.gnu.org > Date: Mon, 29 Aug 2022 13:57:44 +0200 > > Eli Zaretskii writes: > > > 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? > > I think extending the documentation to explain what is expected from the > function is enough. It would have helped me. I did that now. > Also, when the function returns an absolute file name, then the > returned file should be already opened, otherwise ff-find-other-file > cannot find it. Hmm... not sure how this is relevant. The function should return a list of extensions, not a file name. What am I missing? From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 29 10:27:22 2022 Received: (at 57325) by debbugs.gnu.org; 29 Aug 2022 14:27:22 +0000 Received: from localhost ([127.0.0.1]:33342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSfjW-00022C-4G for submit@debbugs.gnu.org; Mon, 29 Aug 2022 10:27:22 -0400 Received: from mail-ej1-f51.google.com ([209.85.218.51]:37424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSfjU-000220-Dw for 57325@debbugs.gnu.org; Mon, 29 Aug 2022 10:27:20 -0400 Received: by mail-ej1-f51.google.com with SMTP id nc14so11156751ejc.4 for <57325@debbugs.gnu.org>; Mon, 29 Aug 2022 07:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc; bh=paFb9o+Lz5v/zrQxwNOanDCw9pnkY0MSLcg7V9Sg18M=; b=BOjuMqOGWurUMw0L1OlhOpR1GmqRptHJGr5x7jf43xvw1aR37SWlmsElkCYWVfS/wl rp0jqYsuyK6pVK2f1xYu2t9xvkH/DdBt64dUOIofoGalsR+2zieGvegCCqkvVW2sjkrs S4Wog8VD5laF5lmgpi0X8hsox13ZI/0WWPkJDRZIecfyUA9bNW3Gi8Las7UEk69X2a+A VS1ukP3iJnV5qXrua7dHNKtroLaxR+25toAcMXtV/xpOOLKzk+GqPTK29UoKM15rJK9p nTyXVkdSXvyT41ZZmSkw/8y7IUmTnDi8jhJU+XU6JnGz8Qr/t4X47kfIvF4PZl+yqMEk 6dIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc; bh=paFb9o+Lz5v/zrQxwNOanDCw9pnkY0MSLcg7V9Sg18M=; b=1YNdmZ4s02ul1/WnTqWHCEakG63J6TqG5yduqSvzxlFTREVHFpGTRynQ9lJ6fDfjqF 7Qa/QdiMSN8yvNOIZPrKUjYhlsDGln9xRlwnAEzH++6kubgSAVnoKF5YUVMmgCD2DUzP pgUUUirr2kXjGDlDPikIbpkWlrTxMx3fwFisv9Ql9muioTkMG50IRKP3CpZKTi19dHuM PXe+5AxMvvHG5o3r+KAOAg1cdGtPT7JGq/rZKe93xm3ybmFYRkOkr+YGbJmk0zmFcps3 S8gVH+wxMdFQxNzKvrNLJNjAmxyVzViJsLU7+0F4CHhhNIp4Day+sNwvz80iEYDn4siJ 5/+g== X-Gm-Message-State: ACgBeo2nO3ewh4mtFa4bVYsnn5GriCVEcbRpeVyYDVVaB4ZLUDCO5mbI TzrWsxn4mlciPX4hO7wO1MUv9CF4h5k= X-Google-Smtp-Source: AA6agR4l9uwdmYMvyjq/5SaXxqYo6l2GO9a+BRFf5HAn3ID1fGfDGu2glGlq2cY6DoJjhEzehpGhDw== X-Received: by 2002:a17:906:4795:b0:73d:d6e8:52a7 with SMTP id cw21-20020a170906479500b0073dd6e852a7mr12453710ejc.59.1661783234343; Mon, 29 Aug 2022 07:27:14 -0700 (PDT) Received: from betli.gmail.com (catv-86-101-66-128.catv.fixed.vodafone.hu. [86.101.66.128]) by smtp.gmail.com with ESMTPSA id 1-20020a170906218100b0073d03cb868csm4497263eju.75.2022.08.29.07.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 07:27:13 -0700 (PDT) From: Felician Nemeth To: Eli Zaretskii Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist References: <87fshpjviu.fsf@betli.tmit.bme.hu> <83h725bf4w.fsf@gnu.org> <875yiljslg.fsf@betli.tmit.bme.hu> <837d30biz4.fsf@gnu.org> <831qt44u5f.fsf@gnu.org> <87czcjs1mv.fsf@betli.tmit.bme.hu> <83r10zw3gj.fsf@gnu.org> Date: Mon, 29 Aug 2022 16:27:13 +0200 In-Reply-To: <83r10zw3gj.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 29 Aug 2022 17:04:44 +0300") Message-ID: <87zgfnqg5a.fsf@betli.tmit.bme.hu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEUMBwgHAgMFAAGPjY7/ //80MDHq6eqJt3pKAAABr0lEQVQ4jX2UzZKDIAzHqR177q7TPbtx2HMr6guQcrbY9txZ0fd/hA0f onXazcEJ/CD8E4Js8/HS9mwjXtqeMRxHXJkakTEm4b4GPVQW8PU8ov4fQCqeThlF60MBWdo1IXzd 2nEEZE7CEAZLwI0N/gJAhTj7ESQAX4gPgO8lyI+cvgViSVPlNomAj2M9gW40eg7VWY3cATjUcyiO Z+i03cFruGLYoUR7VyU3HihdmCEVhoDN65FXkpbSxkomOzsTQN/gySaodGb9Gdi1oSRXP46gdBWh LcUKJNdeGCWac74GKakmne0aHCFvyqJPYLsCFAVlhRTvGdzMdLHqtgRyUulyXIAH7CYQ3AB0Nody JQhAkq/qtOnbjhxdzYDkXPxlH5y4WdUAeUcX1NVJ6GR7UQEYPGWoAnA36OQNn5lRRp38vHTAp9Br LoTmvlPPDoRCKzpjG1SXT89AaT5l456BamJuMcs+NIOMzJ/s5dI6yUVcrARlruwOebfdv6gunTn4 ww3+QjGBEn5suVyLHoSGvAqREuDLN+iqZ+VcFg+HBbsJUU9+FZthbez9T+bdb+kPv2Ls6ct3hTkA AAAASUVORK5CYII= MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57325 Cc: 57325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> Also, when the function returns an absolute file name, then the >> returned file should be already opened, otherwise ff-find-other-file >> cannot find it. > > Hmm... not sure how this is relevant. The function should return a > list of extensions, not a file name. What am I missing? In my case, the related file of foo.toml is bar.json. From an extension it is not possible to guess whether the related file is bar.json or baz.json. find-file.el of Emacs 27.1 has this in the Commentary section: ;; These functions must return a list consisting of the possible names of the ;; corresponding file, with or without path. That's why I thought my function could return an absolute file name. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 29 12:49:33 2022 Received: (at 57325) by debbugs.gnu.org; 29 Aug 2022 16:49:33 +0000 Received: from localhost ([127.0.0.1]:33713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oShx7-0008HW-F2 for submit@debbugs.gnu.org; Mon, 29 Aug 2022 12:49:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oShx5-0008HJ-Lb for 57325@debbugs.gnu.org; Mon, 29 Aug 2022 12:49:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oShx0-00076I-Ei; Mon, 29 Aug 2022 12:49:26 -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=dTV0+4UCqICY30Gje/+wkLYOq1mC9bR+R6++wvW8b0A=; b=ZjBZJPeUjDVh adnqzc40cKV6BnUaZE+331R9JmgWWG2iKf9Q7Ay8yJpIm8ac4gpKKtgQrkHL5pSHdXAosVHMJK7fs LrvbblC8U3c9HXLGxOQtncvqSvNfEp39whkif+4A8T5kFy3xfkItrX3bBlAMinQwYAaj3cFmOjaz/ VqFkGpP5Jw3mTfuxWTzm2QrZnLglL41a6UaiSf9tpAhIFSIS/UHPg7goiNKR9c9mhPC6LzX7aIYbU hIvtgvWROBM+T3b8S8oh0B5W1M/5aad56MTY5SOcdgpeNk4QeTZZnG9+c9+rIKHfSuZEJ8KYWH2uY DHqCl7TYO4InNs5I2xINUg==; Received: from [87.69.77.57] (port=1262 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 1oShwz-0006wU-SU; Mon, 29 Aug 2022 12:49:26 -0400 Date: Mon, 29 Aug 2022 19:49:47 +0300 Message-Id: <83edwzvvtg.fsf@gnu.org> From: Eli Zaretskii To: Felician Nemeth In-Reply-To: <87zgfnqg5a.fsf@betli.tmit.bme.hu> (message from Felician Nemeth on Mon, 29 Aug 2022 16:27:13 +0200) Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist References: <87fshpjviu.fsf@betli.tmit.bme.hu> <83h725bf4w.fsf@gnu.org> <875yiljslg.fsf@betli.tmit.bme.hu> <837d30biz4.fsf@gnu.org> <831qt44u5f.fsf@gnu.org> <87czcjs1mv.fsf@betli.tmit.bme.hu> <83r10zw3gj.fsf@gnu.org> <87zgfnqg5a.fsf@betli.tmit.bme.hu> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57325 Cc: 57325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Felician Nemeth > Cc: 57325@debbugs.gnu.org > Date: Mon, 29 Aug 2022 16:27:13 +0200 > > >> Also, when the function returns an absolute file name, then the > >> returned file should be already opened, otherwise ff-find-other-file > >> cannot find it. > > > > Hmm... not sure how this is relevant. The function should return a > > list of extensions, not a file name. What am I missing? > > In my case, the related file of foo.toml is bar.json. From an extension > it is not possible to guess whether the related file is bar.json or > baz.json. find-file.el of Emacs 27.1 has this in the Commentary > section: > > ;; These functions must return a list consisting of the possible names of the > ;; corresponding file, with or without path. > > That's why I thought my function could return an absolute file name. If the returned list includes file names with leading directories, find-file.el strips the leading directories and uses the basename to match against. Another thing to clarify in the docs? From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 30 04:46:32 2022 Received: (at 57325) by debbugs.gnu.org; 30 Aug 2022 08:46:32 +0000 Received: from localhost ([127.0.0.1]:34724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSwtD-0007Ax-Tc for submit@debbugs.gnu.org; Tue, 30 Aug 2022 04:46:32 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:45829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSwtB-0007Ak-WF for 57325@debbugs.gnu.org; Tue, 30 Aug 2022 04:46:30 -0400 Received: by mail-wr1-f51.google.com with SMTP id bq11so13203444wrb.12 for <57325@debbugs.gnu.org>; Tue, 30 Aug 2022 01:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc; bh=zCpoCPQ3viPO3lfDQi6yz6DwapxOSzMS85rmwRJSlFQ=; b=UK+W3dGQhxVLI0K9cy3Tz0I/aQ9/bjnRk/BXw3H5Az5Fu+8WfOYarWSD9qtmtFNpI9 fznLRixVUbOjLb+KbcLDtPrG1d4VjiNZWtk9M5aC6WKkcabrkLEC/vmbt4PLxiGDhw2n WcO5YEUhSuWY0OAs+rpCwUBbZ9pmR130wz8hruIzg8CITYMuutYMN8uM4+GwcsWnoV2x haDz35VTkCL5NigULXQ4TSiGHzS9GL8ge86S5hIQKIPbhX+58Ls5ICa+M5giJZJQlvBs KQwc4/TizL0P1A0xDzXIPvjscpynq9b6aMNc3yAB8ESg3An9FH3pCSjf6zHlyqECPq6E I7HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc; bh=zCpoCPQ3viPO3lfDQi6yz6DwapxOSzMS85rmwRJSlFQ=; b=DfGj8I8A4+g4Y+FjoWuuIm4M9HAuNm4xD1pnp0LLUIczo3gJzBK5vhmRCziBW3++6X a15MwQJqWMpsLmoaK3JCWFP8xNb8Gvm2mrpZubgXv8o4NZuGee0ldvqHUHDXSQ44izsy hlhsCpzk+QAUGVxD72Oc0QmssdHu1u9FLS4USLVg1gYTy9Nen3c3/djWWtMxFL3BUSkW aaaNrZ7pDo1dLeMvyNr2en2WAUPDIsAb0G81csfsJyVkkzwSfOhrd2X8BUBTPHOW3/zS X4ncrxd7L9AjONBbpNwtkn9igi5yfGcHhtpwF/B10psbTN+MPwoL8wk2NrNi2dmpi34c maHA== X-Gm-Message-State: ACgBeo0ctAE6Wj6cTd7Uei1euvAF6cJ+TAFOvci7pKL/m3tIPb4zRSE1 4rcYQsS/tl9oFSo+7BbRMYrDtidw/bE= X-Google-Smtp-Source: AA6agR5Vn9oAWtk3mIY9HZbE8zEqC9np4hsciy6KeuAR06eSy4CFwoao6SfYw1sYfbME6hX25xaz6A== X-Received: by 2002:a5d:64ed:0:b0:225:11d4:76d1 with SMTP id g13-20020a5d64ed000000b0022511d476d1mr8195945wri.579.1661849183631; Tue, 30 Aug 2022 01:46:23 -0700 (PDT) Received: from betli.gmail.com (catv-86-101-66-128.catv.fixed.vodafone.hu. [86.101.66.128]) by smtp.gmail.com with ESMTPSA id o8-20020a05600c4fc800b003a32297598csm11850367wmq.43.2022.08.30.01.46.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 01:46:23 -0700 (PDT) From: Felician Nemeth To: Eli Zaretskii Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist References: <87fshpjviu.fsf@betli.tmit.bme.hu> <83h725bf4w.fsf@gnu.org> <875yiljslg.fsf@betli.tmit.bme.hu> <837d30biz4.fsf@gnu.org> <831qt44u5f.fsf@gnu.org> <87czcjs1mv.fsf@betli.tmit.bme.hu> <83r10zw3gj.fsf@gnu.org> <87zgfnqg5a.fsf@betli.tmit.bme.hu> <83edwzvvtg.fsf@gnu.org> Date: Tue, 30 Aug 2022 10:46:22 +0200 In-Reply-To: <83edwzvvtg.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 29 Aug 2022 19:49:47 +0300") Message-ID: <87pmgiqftt.fsf@betli.tmit.bme.hu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEWOdXElERN7LDLZs6/l 0dDQq6TepMcqAAACW0lEQVQ4jWWSzY7bMAyEaSm6mypylxjkroTRvUW8d9lavf+r7NDOZotWQHzg lyGHP0Sn5ed9qKrLWWIWos9/QJWIeCSywPNTd/AE0LtwFj7A+3WT5PwfeBrQKcsBnkfwVcNySWQr 3i34XN6gRNgis/v4uwSKHCD9lPitB0Aq9BHfHX4cgsI7cJJfLdZg/4bbCzoRmkD9MsagQSBDedZi CgNxkVSJmSOStTBUBKkywEnEoZzbwWj+ACiVJkF6pOpak2PMCqkMYDpaw+gatLR8atMOrB3JGzmm 3rSQo+tkxU+UAbhQSgtslULhsXKk6+IyQ1QTzeQB0MzjlpkCEUCeUdviWrwBcxVqpZjP+v0MYPA0 aq2rvIEZe4GRM0v+9QIB03rsABVSk5y+Mz3LSzExtJLlCCO6dV1uzDQFTBad+gO0TqqL9XE8x4ek +orvYiMJgzC8e+r6TqaPaK6QyqVNvoHtsRrooQ6tTi4vgaSkd8wIikodB3B0iIk58avsDdYNajpS bSKJ+mQnipGszB6zW4lGgsOkKHE2RWVcBpwhaIv3BYIAu3WsnC7YYKLRchp6w8fRGZIWiZuFsVai 7gbcUcJEhiDZ3K1+uzZvBlfaEO8oH4MLu6/hrKVM7QpQcIXJFuC1XjfbfKRxNslk94l9cYcEihV2 HWyNDQAXaLsvnrSyp7HaQhrAn13V6/XW11nh0XINBOEAV+tHK4EvAGNGvEwc0eZw8Vyr56imYEsV sOW9jxm/yb9AH1ufqGMviIK7A0Tc/723oM3tJ4HTOu9gDr3ftbdkxfdjsUv5AqWKwyfCYo5WAAAA AElFTkSuQmCC MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57325 Cc: 57325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> >> Also, when the function returns an absolute file name, then the >> >> returned file should be already opened, otherwise ff-find-other-file >> >> cannot find it. >> > >> > Hmm... not sure how this is relevant. The function should return a >> > list of extensions, not a file name. What am I missing? >> >> In my case, the related file of foo.toml is bar.json. From an extension >> it is not possible to guess whether the related file is bar.json or >> baz.json. find-file.el of Emacs 27.1 has this in the Commentary >> section: >> >> ;; These functions must return a list consisting of the possible names of the >> ;; corresponding file, with or without path. >> >> That's why I thought my function could return an absolute file name. > > If the returned list includes file names with leading directories, > find-file.el strips the leading directories and uses the basename to > match against. I think that not how it works. Even if the attached file is in a directory that contains a file named "hosts", when I 1. emacs -Q test.el 2. y 3. M-x eval-buffer RET 4. M-x ff-find-other-file RET Emacs is going to switch to the buffer containing /etc/hosts. > Another thing to clarify in the docs? Playing with the implementation, I think that these functions shouldn't return extensions. They should return file names. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=test.el Content-Transfer-Encoding: quoted-printable (defun nf-other-file (filename) (find-file-noselect "/etc/hosts") (list "/etc/hosts")) ;; Local Variables: ;; ff-other-file-alist: ((".el" nf-other-file)) ;; End: --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 30 08:43:44 2022 Received: (at 57325) by debbugs.gnu.org; 30 Aug 2022 12:43:44 +0000 Received: from localhost ([127.0.0.1]:35063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oT0am-00036j-Cu for submit@debbugs.gnu.org; Tue, 30 Aug 2022 08:43:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oT0aj-00036W-H0 for 57325@debbugs.gnu.org; Tue, 30 Aug 2022 08:43:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT0ae-0004fx-9v; Tue, 30 Aug 2022 08:43:36 -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=z/ahRUAH042m4r62dlOL9yWCh45N+h/Ct9REqZbKlCo=; b=RxByPrCSL9Tn uIQ8JtbQ1Q2jB9DtjYOlFvbYDtJQi3mAIdvSkVjAUsK2qFt6BGAfqnY+uSU6KhzpjgO/lNyLuq/Hk VVTjp17j5yXUgD5gWpfItxOepDJhMLTWWiZQgAgYx5WIyKVskfjeWtpkIAWXBxD/PE4EiajEYJ9z7 Mw3y8MKb4PzDlA8tJ0effy5FTb6DISQn3HUc+z1aEd1ZB5sW75ii2gguPjr1piWXltT20+Ip3o76z 22GOGPO48wqAVRDGEyg7iscpbfaFHO7YwzorJ/QWIchxriPea7qZpSMvceuQoyPWxcE75WvMXIg7+ XsSggmtzIcFmt5rLskNzmQ==; Received: from [87.69.77.57] (port=2792 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 1oT0ac-0005uz-8A; Tue, 30 Aug 2022 08:43:36 -0400 Date: Tue, 30 Aug 2022 15:43:56 +0300 Message-Id: <83a67lvr3n.fsf@gnu.org> From: Eli Zaretskii To: Felician Nemeth In-Reply-To: <87pmgiqftt.fsf@betli.tmit.bme.hu> (message from Felician Nemeth on Tue, 30 Aug 2022 10:46:22 +0200) Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist References: <87fshpjviu.fsf@betli.tmit.bme.hu> <83h725bf4w.fsf@gnu.org> <875yiljslg.fsf@betli.tmit.bme.hu> <837d30biz4.fsf@gnu.org> <831qt44u5f.fsf@gnu.org> <87czcjs1mv.fsf@betli.tmit.bme.hu> <83r10zw3gj.fsf@gnu.org> <87zgfnqg5a.fsf@betli.tmit.bme.hu> <83edwzvvtg.fsf@gnu.org> <87pmgiqftt.fsf@betli.tmit.bme.hu> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57325 Cc: 57325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Felician Nemeth > Cc: 57325@debbugs.gnu.org > Date: Tue, 30 Aug 2022 10:46:22 +0200 > > > If the returned list includes file names with leading directories, > > find-file.el strips the leading directories and uses the basename to > > match against. > > I think that not how it works. Sorry, I misread the code. You are right. But then I think we should replace this code in ff-get-file-name: (setq file (concat dir "/" filename)) with (setq file (expand-file-name filename dir)) and then the code will work with absolute file names as well, even if the file is not already visited in a buffer. Right? > Playing with the implementation, I think that these functions shouldn't > return extensions. They should return file names. You are right. I updated the doc string to say that. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 30 09:48:54 2022 Received: (at 57325) by debbugs.gnu.org; 30 Aug 2022 13:48:54 +0000 Received: from localhost ([127.0.0.1]:35188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oT1bp-0004ot-Ox for submit@debbugs.gnu.org; Tue, 30 Aug 2022 09:48:54 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:38529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oT1bo-0004of-4M for 57325@debbugs.gnu.org; Tue, 30 Aug 2022 09:48:52 -0400 Received: by mail-wm1-f54.google.com with SMTP id n23-20020a7bc5d7000000b003a62f19b453so9980999wmk.3 for <57325@debbugs.gnu.org>; Tue, 30 Aug 2022 06:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc; bh=tSIWTcD//mMp5pEyygLb8XgRK+bNV+txmhhEUJ+qh8c=; b=kNe9MmC3g4ZXuqM2bz8Jl6GHoBIfrtjLScCGaJCajvCuiZG3/EmL1URZKY0Jod4yC+ ALv9QUcX6Ndw/csBG/mOqbbDMrGsBNpbInc4K3xpSEcwSWcfEeZU/8Y69pOTr5bBbO5q xUi29Kb2lNa1L/aAg+yMAYbPBAXrO6ZQGYJetTQh5i70/q2FDjwLInFcQFjruuHyvkQt CsNjpBgeW6zDXBSObUKNtBRHlRxG/UtqHRa/ZPlEBZAMeoiMOWTbRMbJtWDomjfB1ots cvJ4GYdwM9kD/IXz3lJkJkzbWW6CH5jbjzzsRAH2oMAYqRN5oc4gFXAQYlefJoh9R1tg EmCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc; bh=tSIWTcD//mMp5pEyygLb8XgRK+bNV+txmhhEUJ+qh8c=; b=Cfruc8IvWd9RnRPBZfbQQYo/KRNdwWUAyPR4AW0XEyJhqT7kZAvRzTqHAgz9vlSv6V EbsDJQWyHmNiPIYAhGO5CZmRh0TFHnINfkEBSuw5uu6Iyl6SIi6IKGt6MiGqzrq1GR4T V6DoNnNbmeAm9RmNbEgG0IfpUNd0xhp0E5cLU09sPdb48dNmB+cf2Defyjwkynfy/ktv wR/mWc4PD5uRKTuGaayyb7Abh8pMQMwA9WE2IhNis3QYoagATXObUUzj9FGERwdXwLfi JfWPr50Fcy34hjR2d8nmwUKnVv7zNYAyOP2vdxwaIowY/a72/7x5W/chZuZ1bNs4n5J7 OwwA== X-Gm-Message-State: ACgBeo3hq6zSramDXrtw2nlv/MNsaGZFiE3t+6cHF0d/eLKwMHAibDpW Ps34ieC7P3fl1QPyhwkTB/hArCCQPNI= X-Google-Smtp-Source: AA6agR46P3FEww63DHhZKfS2PQSU1kHKGzXIjCq8XY98g7qmbYTpV9P0gdfXAwojxgOpFiWTeYOrwQ== X-Received: by 2002:a05:600c:3d0f:b0:3a5:eece:c061 with SMTP id bh15-20020a05600c3d0f00b003a5eecec061mr9742442wmb.74.1661867326094; Tue, 30 Aug 2022 06:48:46 -0700 (PDT) Received: from betli.gmail.com (catv-86-101-66-128.catv.fixed.vodafone.hu. [86.101.66.128]) by smtp.gmail.com with ESMTPSA id l6-20020adff486000000b0021e13efa17esm9982756wro.70.2022.08.30.06.48.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 06:48:45 -0700 (PDT) From: Felician Nemeth To: Eli Zaretskii Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist References: <87fshpjviu.fsf@betli.tmit.bme.hu> <83h725bf4w.fsf@gnu.org> <875yiljslg.fsf@betli.tmit.bme.hu> <837d30biz4.fsf@gnu.org> <831qt44u5f.fsf@gnu.org> <87czcjs1mv.fsf@betli.tmit.bme.hu> <83r10zw3gj.fsf@gnu.org> <87zgfnqg5a.fsf@betli.tmit.bme.hu> <83edwzvvtg.fsf@gnu.org> <87pmgiqftt.fsf@betli.tmit.bme.hu> <83a67lvr3n.fsf@gnu.org> Date: Tue, 30 Aug 2022 15:48:44 +0200 In-Reply-To: <83a67lvr3n.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 30 Aug 2022 15:43:56 +0300") Message-ID: <87k06pq1tv.fsf@betli.tmit.bme.hu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX5+fmhoaEwMDD/ ///TMNVWAAAAAWJLR0QDEQxM8gAAAAlwSFlzAAAPEgAADxIBIZvyMwAAAAd0SU1FB+AICBUfHgLs gGoAAAGXSURBVCjPRdK/b5tAFAfw753gBEwM2ApMbuVIqf+Ko0qiyhOu4sj2xJBYMn/FUdX7UUUZ OjHgyvf+yj6IcW6Bjx53934ADEvs8bmEr8UVoTYTOyJO9KoYsVofN8kILdbeJ8Li6YpZWop4xOK0 VdfIoXmkHn5/5D7/Ts/8THacSqnkKTcMTxgUkVzFnEIRTKwwYYSCvzfg16f0i8YApW/XG/Pm8R49 dXjxKmRnxv3OwooQWcv4RUYem1fsNe/WU63uk7AmYxk78y32/ee2tZB4fO+WcZ7lnIGEolXW1EGw LfkSuQ0XTgRefgNlfNwRNV6QhBxJ8JNxTMUPyBqTd0bjaAP5G7NJRU39z80hLOZTjqB7K3tEEFSj aEsuQew6qBxxyhHjVUR7H7NpC9iHJZGLMCEuweqAqE1BHbfK2oRIz9EHYA/+wiFWru9smeVfuWNZ 2+NFtX80UA1TvJNdytM4DwO4kY7bJz8Qcd0G0ceslZGkkeoBsjUHwF1+jjM3XHaXEZ7mGLfwPFO+ RV9QLY2iEdmDo78D/gNPaXVYqd+pyQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wOC0wOFQyMzoz MDoyOCswMjowMGy/yHYAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTYtMDgtMDhUMjM6MzA6MjgrMDI6 MDAd4nDKAAAAAElFTkSuQmCC MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57325 Cc: 57325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > But then I think we should replace this code in ff-get-file-name: > > (setq file (concat dir "/" filename)) > with > (setq file (expand-file-name filename dir)) > > and then the code will work with absolute file names as well, even if > the file is not already visited in a buffer. Right? Yes, I think that's right. The latest documentation still has this: Note: if an element of the alist names a FUNCTION as its cdr, that function must return a non-nil list of file-name extensions. It cannot return nil, nor can it signal in any way a failure to find a suitable list of extensions. The end of the first sentence should be "file-names." Then I think this bug report can be closed. Thanks again. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 30 12:10:04 2022 Received: (at 57325-done) by debbugs.gnu.org; 30 Aug 2022 16:10:04 +0000 Received: from localhost ([127.0.0.1]:37250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oT3oS-0004ws-BM for submit@debbugs.gnu.org; Tue, 30 Aug 2022 12:10:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oT3oQ-0004wJ-Nl for 57325-done@debbugs.gnu.org; Tue, 30 Aug 2022 12:10:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53306) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT3oL-0000Z5-H1; Tue, 30 Aug 2022 12:09: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=ry9ChxBoRbTBSFvkmi+R/mVTz0OKPlN0YWE27J1TP4w=; b=Jk01J8bPchC9 J2WL5rG1yjSfBQh1YFkqZRgLWBWpBQ5iRFhL8MeRzXhmHpJ91ZcU2Vz8BF7TNYuRyftWJPOCH9GqH /0J19BxqMUG9PAWnwmYxcjWYU3l2t0g6fA5JhByOAVMJ70rGdXYdjTV98ocb1NugGZGEsNePyrJYZ DsTmsN0SfKqPUYc7Twb4z6H3TWmQTVHCCAlIgBw/34vyRuZc1mcuupDaDJSTTXsAJNLgBq+gvkwmC VJEwEzp3LdtqDA21rrkZmVQxmC0oBi5PQQJ7B96v7LSTJzIXqnz5m+r7ThQ30eDYvtDnE/eTg7fbD lc8EpWo5rLuTH6tUzaNeEA==; Received: from [87.69.77.57] (port=3646 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 1oT3oK-0007MV-W9; Tue, 30 Aug 2022 12:09:57 -0400 Date: Tue, 30 Aug 2022 19:10:19 +0300 Message-Id: <83zgflu2z8.fsf@gnu.org> From: Eli Zaretskii To: Felician Nemeth In-Reply-To: <87k06pq1tv.fsf@betli.tmit.bme.hu> (message from Felician Nemeth on Tue, 30 Aug 2022 15:48:44 +0200) Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist References: <87fshpjviu.fsf@betli.tmit.bme.hu> <83h725bf4w.fsf@gnu.org> <875yiljslg.fsf@betli.tmit.bme.hu> <837d30biz4.fsf@gnu.org> <831qt44u5f.fsf@gnu.org> <87czcjs1mv.fsf@betli.tmit.bme.hu> <83r10zw3gj.fsf@gnu.org> <87zgfnqg5a.fsf@betli.tmit.bme.hu> <83edwzvvtg.fsf@gnu.org> <87pmgiqftt.fsf@betli.tmit.bme.hu> <83a67lvr3n.fsf@gnu.org> <87k06pq1tv.fsf@betli.tmit.bme.hu> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57325-done Cc: 57325-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Felician Nemeth > Cc: 57325@debbugs.gnu.org > Date: Tue, 30 Aug 2022 15:48:44 +0200 > > Eli Zaretskii writes: > > > But then I think we should replace this code in ff-get-file-name: > > > > (setq file (concat dir "/" filename)) > > with > > (setq file (expand-file-name filename dir)) > > > > and then the code will work with absolute file names as well, even if > > the file is not already visited in a buffer. Right? > > Yes, I think that's right. Done. > The latest documentation still has this: > > Note: if an element of the alist names a FUNCTION as its cdr, that > function must return a non-nil list of file-name extensions. It > cannot return nil, nor can it signal in any way a failure to find a > suitable list of extensions. > > The end of the first sentence should be "file-names." Then I think this > bug report can be closed. Fixed, and closing. Thanks a lot for your help. From unknown Tue Aug 19 21:02:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 28 Sep 2022 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator