From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Troy Brown Newsgroups: gmane.emacs.bugs Subject: bug#64143: 29.0.60; find-function-search-for-symbol truncates library path Date: Sun, 18 Jun 2023 13:39:05 -0400 Message-ID: References: <835y7lp5mp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23771"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64143@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 18 19:40:18 2023 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 1qAwNt-0005zo-Gn for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Jun 2023 19:40:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qAwNi-0007PZ-09; Sun, 18 Jun 2023 13:40:06 -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 1qAwNf-0007PQ-86 for bug-gnu-emacs@gnu.org; Sun, 18 Jun 2023 13:40:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qAwNe-00013U-07 for bug-gnu-emacs@gnu.org; Sun, 18 Jun 2023 13:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qAwNd-0002OC-SP for bug-gnu-emacs@gnu.org; Sun, 18 Jun 2023 13:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Troy Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Jun 2023 17:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64143 X-GNU-PR-Package: emacs Original-Received: via spool by 64143-submit@debbugs.gnu.org id=B64143.16871099659134 (code B ref 64143); Sun, 18 Jun 2023 17:40:01 +0000 Original-Received: (at 64143) by debbugs.gnu.org; 18 Jun 2023 17:39:25 +0000 Original-Received: from localhost ([127.0.0.1]:54929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAwN3-0002NG-3R for submit@debbugs.gnu.org; Sun, 18 Jun 2023 13:39:25 -0400 Original-Received: from mail-ej1-f45.google.com ([209.85.218.45]:55474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAwN1-0002Mz-Ck for 64143@debbugs.gnu.org; Sun, 18 Jun 2023 13:39:23 -0400 Original-Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-98746d7f35dso294839266b.2 for <64143@debbugs.gnu.org>; Sun, 18 Jun 2023 10:39:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687109957; x=1689701957; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hWxFT3ujO7A3W47XWGVpLPI/g4KUjaemloZbGIMvnpo=; b=AqS1Rb0SrwVgEMHMRjKeiNOkuQ1FfnNMQ8SUYwYTUdjppU4BVfC66N9uUmhi2I8pKn wtIUiS6w2N21CeKLZs7F/Jj7YArtNXrItixXzgZa4X6gQivTJyD8YxKaVKyixJ3lC6A/ cKyZsXHUpGmSHQRp0RsPNH0g3ruhwTZGdWFMNAZvezmuP4m6INZtUoVXA0yKga4HCIFc Zshsrtzizq4UgJgFnIMLAFFgL7S6heE9ssLgljL+0gX582kpHwxFD0f6vr2BiUpMZN5J Mh8v22u57Fwi/s9Ybvi3CK/rILuQhsHCdWPdjM8T83jG7tZF/PbMZSvC/YFk6S9Tmn3T pIJQ== X-Gm-Message-State: AC+VfDznvleiqomiqDNTEUHhGA31f9lpEcMRV/+FIi6sepX7f4jGkUJr ygO9EtlAn+4HtHR+b8eETjTWitGmKTN9hnY6 X-Google-Smtp-Source: ACHHUZ7FLugJMq9Ig+3Fh7cJJ6VExE/XKfol4ufCTdBVjAIi8g61OuIC1bGCpoLIP4/i3Nn8BarPQA== X-Received: by 2002:a17:907:3f87:b0:97d:9b73:690b with SMTP id hr7-20020a1709073f8700b0097d9b73690bmr8393101ejc.59.1687109957220; Sun, 18 Jun 2023 10:39:17 -0700 (PDT) Original-Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com. [209.85.208.44]) by smtp.gmail.com with ESMTPSA id o6-20020a17090611c600b00987bc81506dsm2012174eja.202.2023.06.18.10.39.16 for <64143@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Jun 2023 10:39:17 -0700 (PDT) Original-Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-51a2c8e5a2cso3844114a12.2 for <64143@debbugs.gnu.org>; Sun, 18 Jun 2023 10:39:16 -0700 (PDT) X-Received: by 2002:aa7:da12:0:b0:50c:646:cafd with SMTP id r18-20020aa7da12000000b0050c0646cafdmr5276197eds.7.1687109956370; Sun, 18 Jun 2023 10:39:16 -0700 (PDT) In-Reply-To: <835y7lp5mp.fsf@gnu.org> X-Gmail-Original-Message-ID: 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:263649 Archived-At: Eli Zaretskii writes: > What do you mean by "truncates the library path"? Do you mean > truncation of the file name 'emacs.el' to yield just 'emacs'? or do > you mean something else? (To avoid confusion, please don't use "path" > to refer to file names, only to refer to lists of directories in the > style of PATH or load-path.) I was referring specifically to the LIBRARY parameter passed into find-function-search-for-symbol. In this scenario, I'd expect it to be passed to find-library-name unaltered. In other words, the value of the LIBRARY parameter passed in is: "/home/troy/.emacs.elpa/elpa/company-20230416.2034/company.el" However, the value passed on to find-library-name is: "/home/troy/.emacs" This is being altered due to the fact that it contains a ".emacs.el" substring within it (i.e., "/home/troy/<.emacs.el>pa"). > This says it cannot find ".emacs", not "emacs". So is your init file > called ".emacs.el" or (as you mentioned above) "emacs.el"? The problem has nothing to do with my init file (and manifests regardless of init file name), only whether the path supplied by --init-directory contains an ".emacs.el" substring in it (which "~/.emacs.elpa" clearly does). Here is a more precise way to reproduce this using "emacs -Q". I was previously trying to provide a real-world example of how I was seeing this behavior, but maybe it added confusion. If we toggle "debug-on-error" and then evaluate each expression below in turn, we can examine the value that find-function-search-for-symbol passes to find-library-name (as this assumes a bogus username "someuser" and thus an invalid path to trigger the error). In the first case (simulating using --init-directory=/home/someuser/.emacs.d), the value is as expected (the value passed as the LIBRARY parameter to find-function-search-for-symbol). In the second case (simulating using --init-directory=/home/someuser/.emacs.elpa), we see that the value passed to find-library-name is no longer the same as the value passed as the LIBRARY parameter to find-function-search-for-symbol, but was truncated instead. (find-function-search-for-symbol 'company-mode nil "/home/someuser/.emacs.d/elpa/company-20230416.2034/company.el") (find-function-search-for-symbol 'company-mode nil "/home/someuser/.emacs.elpa/elpa/company-20230416.2034/company.el") Debugger entered--Lisp error: (file-error "Can't find library" "/home/someuser/.emacs.d/elpa/company-20230416.2034/company.el") find-library-name("/home/someuser/.emacs.d/elpa/company-20230416.2034/company.el") find-function-search-for-symbol(company-mode nil "/home/someuser/.emacs.d/elpa/company-20230416.2034/company.el") (progn (find-function-search-for-symbol 'company-mode nil "/home/someuser/.emacs.d/elpa/company-20230416.2034/company.el")) eval((progn (find-function-search-for-symbol 'company-mode nil "/home/someuser/.emacs.d/elpa/company-20230416.2034/company.el")) t) elisp--eval-last-sexp(nil) eval-last-sexp(nil) funcall-interactively(eval-last-sexp nil) call-interactively(eval-last-sexp nil nil) command-execute(eval-last-sexp) Debugger entered--Lisp error: (file-error "Can't find library" "/home/someuser/.emacs") find-library-name("/home/someuser/.emacs") find-function-search-for-symbol(company-mode nil "/home/someuser/.emacs.elpa/elpa/company-20230416.2034/company.el") (progn (find-function-search-for-symbol 'company-mode nil "/home/someuser/.emacs.elpa/elpa/company-20230416.2034/company.el")) eval((progn (find-function-search-for-symbol 'company-mode nil "/home/someuser/.emacs.elpa/elpa/company-20230416.2034/company.el")) t) elisp--eval-last-sexp(nil) eval-last-sexp(nil) funcall-interactively(eval-last-sexp nil) call-interactively(eval-last-sexp nil nil) command-execute(eval-last-sexp) > Does the patch below fix this problem? > Indeed, it does. > Also, I see that you have some advice installed for > find-function-search-for-symbol. Would you please verify that > removing that advice still produces the problem in Emacs 29? > See above where I provided a way to reproduce this using just "emacs -Q".