From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.help Subject: Re: xref in GNU ELPA broken on Emacs 26 Date: Tue, 19 Oct 2021 16:18:53 +0300 Message-ID: <19d4409e-c0c5-06a9-ba43-a58d220ec5a2@yandex.ru> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13404"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 To: Yuri Khan , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 19 15:19:34 2021 Return-path: Envelope-to: geh-help-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 1mcp1i-0003JJ-Ff for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 19 Oct 2021 15:19:34 +0200 Original-Received: from localhost ([::1]:52126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcp1h-0000Zr-8f for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 19 Oct 2021 09:19:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcp19-0000Xu-3U for help-gnu-emacs@gnu.org; Tue, 19 Oct 2021 09:18:59 -0400 Original-Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]:46059) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mcp16-0004A4-PH for help-gnu-emacs@gnu.org; Tue, 19 Oct 2021 09:18:58 -0400 Original-Received: by mail-lf1-x130.google.com with SMTP id x192so7325622lff.12 for ; Tue, 19 Oct 2021 06:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zaIAzWJ4JmjdjkM6s/VcERlW9Uap/WKBpfUlDNJ89kM=; b=bSIbQkz25kEX2AlmKzyIDZkZToXcA59hzS9YDKIcuR8qsbr0YwAWBDQpkOjkcwjg1K SW4M6j0zDWG3/1eE4yEyow4H5I3AEyUK/1F9UsjFsk75pLFxTdv9BlPaB1yNw2j851G5 l0Yw+HKm5grj3BA7P5bsr6Xqr0VDAGG13PLash6B5uR9QD3Zevo5Z/kROqteYskIE4Oz lVa2kMcM1VxFb0ud5w9mBWxKeoUuY8/xqqR4JcwTWgp3QmDTKoyelwHFTLT033OHf804 9n+SDRbMvlDDqqaNYWAwnfJeZV9ndTnFXK7f6GXCvufH8pse0KB8rigeVE72GtQkXWce XbVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zaIAzWJ4JmjdjkM6s/VcERlW9Uap/WKBpfUlDNJ89kM=; b=ccaZtbFwc4gVqoRlb6DxMgcPFme2UuwpVUPZklcY60OKoAa9XUBMpWgM+cjO/rPk4Q zs0yMx87TAxjjFIBJpVMEbf/c298+6Imzp8OWxlEyOb1Fd9h3z6UWlrnxthDn8EVriIg dfIgWNbBSveWDTivklES6bWyILBpFEPVoR1wiNXnmcqvEbYC6GJX4uLjlQ5kKVgUaG8k i0hxC9OFsx8UgFdCX1KTF4KJ284GOmgI9Bcsv87hm5Al7m4l7SL36Pmx/szTys3qC1ok KyxAjppll+25pPD7w/QjA3Q+gLNy5h+GKThbpAW+0V1KWh5oowWyMSQNIoig/J3/OvXq rYTQ== X-Gm-Message-State: AOAM531CtgT6YzLNN9+KOyKea7zKcwX/Bn2Vk0kR4w6VfK049862KW5q ZtPc+3xshzYUpd03ZpXPCUgzgoTiyzE= X-Google-Smtp-Source: ABdhPJxODfAA7tM2IQvWUMJTbzGxq5SiH1yPqDEfUyQ7vTsW73UOyaE0DbdgTjBgHIiYx+Uk7NhDcg== X-Received: by 2002:ac2:5a0a:: with SMTP id q10mr6227832lfn.604.1634649534860; Tue, 19 Oct 2021 06:18:54 -0700 (PDT) Original-Received: from [192.168.0.103] ([5.18.248.29]) by smtp.googlemail.com with ESMTPSA id b30sm459796lfv.288.2021.10.19.06.18.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Oct 2021 06:18:54 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=raaahh@gmail.com; helo=mail-lf1-x130.google.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, NICE_REPLY_A=-2.074, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133885 Archived-At: Hi! On 19.10.2021 13:55, Yuri Khan wrote: > I foolishly did a M-x package-list-packages RET U x RET and got an > xref package version 1.3.0. It attempts to use the cl-defstruct option > :noinline, which is not supported in cl-macs.el that comes with Emacs > 26.3 that comes with Ubuntu 20.04. > > xref 1.3.0 declares dependency on Emacs 26.1. > > I seem to have managed to repair my local installation by manually > downloading xref-1.2.1.tar.lz from the GNU ELPA site and telling > ‘package-install-file’ to install from the directory I got by > unpacking it, then exiting Emacs and removing > ~/.emacs.d/elpa/xref-1.3.0. Sorry about this. I'm not sure how to fix it best, but could you try the following patch? Applying it to the installed package, latest version (1.3.0), not to Emacs sources. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 52a4e0c543..fa026ae072 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -195,18 +195,27 @@ xref-location-group ;;; Cross-reference -(cl-defstruct (xref-item - (:constructor xref-make (summary location)) - (:noinline t)) - "An xref item describes a reference to a location somewhere." - summary location) - -(cl-defstruct (xref-match-item - (:include xref-item) - (:constructor xref-make-match (summary location length)) - (:noinline t)) - "A match xref item describes a search result." - length) +(eval-and-compile + (eval + (let ((ni-supported (version< "27" emacs-version))) + `(progn + (cl-defstruct (xref-item + (:constructor xref-make (summary location)) + ,@(if ni-supported + '((:noinline t)) + nil)) + "An xref item describes a reference to a location somewhere." + summary location) + + (cl-defstruct (xref-match-item + (:include xref-item) + (:constructor xref-make-match (summary location length)) + ,@(if ni-supported + '((:noinline t)) + nil)) + "A match xref item describes a search result." + length)))) + t) (cl-defgeneric xref-match-length ((item xref-match-item)) "Return the length of the match."