From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felician Nemeth Newsgroups: gmane.emacs.bugs Subject: bug#57325: 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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27496"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) To: 57325@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 21 20:35:37 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 1oPpnM-0006uU-CP for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Aug 2022 20:35:36 +0200 Original-Received: from localhost ([::1]:40714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oPpnL-0008Pd-FZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Aug 2022 14:35:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPpmt-0008PU-Hs for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 14:35:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47009) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oPpmo-0003I3-4F for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 14:35:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oPpmn-0004u8-U7 for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 14:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Felician Nemeth Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Aug 2022 18:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57325 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166110686918809 (code B ref -1); Sun, 21 Aug 2022 18:35:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Aug 2022 18:34:29 +0000 Original-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 Original-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 Original-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 Original-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 Original-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) Original-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) 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= 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-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:240350 Archived-At: --=-=-= 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) --=-=-=--