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: Tue, 30 Aug 2022 10:46:22 +0200 Message-ID: <87pmgiqftt.fsf@betli.tmit.bme.hu> 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> 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="8567"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: 57325@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 30 10:47:12 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 1oSwtr-00024t-LF for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Aug 2022 10:47:11 +0200 Original-Received: from localhost ([::1]:33962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSwtq-0003HO-17 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Aug 2022 04:47:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSwti-0003H0-U7 for bug-gnu-emacs@gnu.org; Tue, 30 Aug 2022 04:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44975) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSwti-0005y1-MX for bug-gnu-emacs@gnu.org; Tue, 30 Aug 2022 04:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oSwti-0007Bn-Gk for bug-gnu-emacs@gnu.org; Tue, 30 Aug 2022 04:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Felician Nemeth Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Aug 2022 08:47:02 +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.166184919227592 (code B ref 57325); Tue, 30 Aug 2022 08:47:02 +0000 Original-Received: (at 57325) by debbugs.gnu.org; 30 Aug 2022 08:46:32 +0000 Original-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 Original-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 Original-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) 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 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) In-Reply-To: <83edwzvvtg.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 29 Aug 2022 19:49:47 +0300") 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 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:241092 Archived-At: --=-=-= 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: --=-=-=--