From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: master 9ade7ea: Fix Eldoc problem when loading on Emacs 26.3 Date: Fri, 10 Jul 2020 23:41:47 +0100 Message-ID: <874kqfdmc4.fsf@gmail.com> References: <20200710004934.18557.69586@vcs0.savannah.gnu.org> <20200710004936.2935520A27@vcs0.savannah.gnu.org> <0veepjz719.fsf@fencepost.gnu.org> <87lfjrdzna.fsf@gmail.com> <87h7ufdtyr.fsf@gmail.com> <87a707docl.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30455"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Glenn Morris , Noam Postavsky , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 11 00:42:26 2020 Return-path: Envelope-to: ged-emacs-devel@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 1ju1ir-0007ot-6F for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Jul 2020 00:42:25 +0200 Original-Received: from localhost ([::1]:36442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ju1iq-0001Z8-6f for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Jul 2020 18:42:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ju1iL-00018d-PL for emacs-devel@gnu.org; Fri, 10 Jul 2020 18:41:53 -0400 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:33690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ju1iJ-0003gO-WA; Fri, 10 Jul 2020 18:41:53 -0400 Original-Received: by mail-wr1-x432.google.com with SMTP id f18so7406570wrs.0; Fri, 10 Jul 2020 15:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=R8e6ZZFejxd+ZICRukwRgO9zaF84VjF9/idgY4o5Mas=; b=Uynz/64UmKLUfvyDvogPqXFXubiYnJm9ahn6RWu4FNMsJFm+CeFfLnNP6otHubwdM4 Y2GL1ul9wO2Yp21zPhNMzLcK0Ak5I/XRsy2TMA2buwAAnhjWmc01/u9GQin9vKWIzjry bAdhOS6nBhvX4G8Hr9XObymdwp5Ly39T88fM5+tLjZ8X6FCba39Jbm3aH91AsSe3yXhV +h1QB8RbZ8FpEPxvGrV3HgX+Ofx3eb4kiDDbb4/aPFrwfQrcjvRXeNVEuXWqH9+XXojx 0F3Q3ibmbFrm7NdsEuC9hzPTVQMNFYMaMevlAgfYqVrUwFpVB56OCu0d6zLjnna1yqig CcRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=R8e6ZZFejxd+ZICRukwRgO9zaF84VjF9/idgY4o5Mas=; b=Efflex9dUAokFh+7J878yejErYYBibLdPOGYj6tbvhmNWbTK98K/g8suWFN2rnzAx8 vYOmxP32We+Ehg5H39t+gulp5bWmkPI5Hd29XLaJw0VcdcKIdTQgEz/IJNWBNn6bWwBw /zRHuXgVFMjdlYwjR3OIPqDNmDozfWn87Z3h6KfzO/OtEwjpyjY6WvHssBX6I4jeoJ2Q PdDg4KdPtR2rdNIWayKcKAtcq6MA8gtqWNXjFQ1K1PO9myjylZnzQvq4ytOsXUaE1vsT q9kEKIi6vcUb26820VAxNaKEFWe3vK0ri9r4XTfHKrAMRo87YHNuIJZXkf0rldN+nY3/ HuLw== X-Gm-Message-State: AOAM531MRau2A4ovuVMKHNCS1+XbJIJho/8CJq88o3hMfEPPPnDkQDmy WjBBhDYYJmXdDmwi52klLdODolqx X-Google-Smtp-Source: ABdhPJxO7p5aICxVVjFhySdQWw8v4iC5bQgPrtuu83HnCj/N8XuNdK+01nRj4LpB35okAY+hd4WEfw== X-Received: by 2002:adf:e60a:: with SMTP id p10mr66645029wrm.181.1594420909675; Fri, 10 Jul 2020 15:41:49 -0700 (PDT) Original-Received: from krug ([2001:818:d820:9500:824a:171:15a:2213]) by smtp.gmail.com with ESMTPSA id n125sm11390560wme.30.2020.07.10.15.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 15:41:48 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Fri, 10 Jul 2020 18:16:17 -0400") Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=joaotavora@gmail.com; helo=mail-wr1-x432.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252847 Archived-At: Stefan Monnier writes: >>>>> Maybe come up with a better idea, or maybe, like Stefan suggests, don= 't >>>>> make it an alias at all, just deprecate it and keep using it instead = of >>>>> eldoc-documentation-strategy when we find it to be bound. >>>> That sort of works, but it forces extensions that do want to >>>> "Package-Require" eldoc to remember to unbind >>>> eldoc-documentation-function if they are loaded on older Emacs version= s, >>>> which is undesirable. > > No. If they're only written for the old API they set > `eldoc-documentation-function` and live in blissful ignorance of what > they miss. If they're only written for the new API, they add-hook to > `eldoc-documentation-functions` and live in bliss. I was describing my own earlier solution, by the way, where I'm pretty sure that would happen. > And if they want to support both they do > > (if (boundp 'eldoc-documentation-functions) > (add-hook 'eldoc-documentation-functions ...) > (setq eldoc-documentation-function ...)) >>> Maybe use a rule like: >>> >>> (if (and (buffer-local-p 'eldoc-documentation-function) >>> (not (buffer-local-p 'eldoc-documentation-functions))) >>> >>> >> >> Sounds a bit complicated for me, especially since there's already a >> eldoc--supported-p which does similar heuristics. > > But that's one of the other benefits. It lets us distinguish in > `eldoc--supported-p` the case where `eldoc-documentation-strategy` was > set from the case where `eldoc-documentation-function` was set. > >> Wouldn't it break in some older Emacs version that loads the new Eldoc >> and has some global value in eldoc-documentation-functions (say, >> a spell-checking eldoc backend)? > > The above `buffer-local-p` tests would be in eldoc.el, not in the client > packages, so I don't see what scenario you're worried about. > And of course the presence of a global value doesn't affect > `buffer-local-p` anyway, so ... I guess I must be missing something? Maybe I am, surely. This is complicated, and I'm probably not seeing through the complexity as well as you are. If you want to do these changes I won't object, but I'd probably mess them up. At least for now, I really do think the best way is to alias the two variables. Whichever way we alias them, it's just as if I never renamed the singular "e-d-function" to "e-d-strategy" at all, which is, after all, a much safer bet. I've even thought about dropping the whole "rename function to strategy" idea completely, which was just a cosmetic way to escape the awful mind-bending confusion between "e-d-function" singular and "e-d-functions" plural. So I think I'm going to go with the simple alias patch, unless you (or someone) strongly opposes. Jo=C3=A3o