From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0CyEJP52Z1/6UQAA0tVLHw (envelope-from ) for ; Sun, 20 Sep 2020 15:36:30 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id WAdnIP52Z1/kZwAAB5/wlQ (envelope-from ) for ; Sun, 20 Sep 2020 15:36:30 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 11CC1940142 for ; Sun, 20 Sep 2020 15:36:29 +0000 (UTC) Received: from localhost ([::1]:35788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kK1O7-0004XH-Oq for larch@yhetil.org; Sun, 20 Sep 2020 11:36:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK1Mx-0004Wv-CM for emacs-orgmode@gnu.org; Sun, 20 Sep 2020 11:35:15 -0400 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]:40524) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kK1Mu-0001sc-Qs; Sun, 20 Sep 2020 11:35:14 -0400 Received: by mail-qv1-xf2c.google.com with SMTP id j3so6021659qvi.7; Sun, 20 Sep 2020 08:35:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=/BHr6hFPSo8W8BWbpbUJyFttoQ4woBEDR4Qg+/TKvWg=; b=SJbC4NIg2hlFjD+Xb561gmK27E9N+IXJ8DwUAAnsCyIIdKwCtiKMQ0dir18nnArvz4 nemQVFt/wTHeH0lltfBm445jHMSZv2+h2FU0NdNOWv6nDJRtZOJFy/RVv01tPjNXLpaM eIyF5BrYnt/ozH0FmePYejNygY4gCUnJFgLMfdMK3vDhuQrfJOnpJxFutfDaWIgxyzwb BV0iu8st94LAFIL3HbgBZFbogQ9oyAQRuMkUhkPRV3AxTU+kp76eFap/onTBMKA2va9d o3NTpkdyauzBwvidr2tEzeHN2EDyXufEh45BMj9hYKjCvlsZIzrJxVwqaZicgBqdq53r AwxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:cc:subject:in-reply-to :references:date:message-id:mime-version; bh=/BHr6hFPSo8W8BWbpbUJyFttoQ4woBEDR4Qg+/TKvWg=; b=iGfiNKxpNiZuzJGCM/WvQkSHtKjUdS9joCmczqPnG6EQhEj9jR2AbMMeBNhButrKm8 eO0G6lzKH38+dLvFlrNFwbUgP6vn/VRHz66c1rxEBatc+NjH15F7mSMFVZGyscLZsnvC lc1Nd6mSyBL5B88nV6tBn+7VncRCHasjbuOzLprI1685uGswCJeT7xoNGDSi7iTLBa6t eFv4hmbiqwasjpWG9OiWvEZjOvDzql7iOYZ1x88U7BYjlTsTejJkxg8Eb4jqDrPmRkbm GFZKgQs7vrQDLrqdvSwPawQIZINTiNU8XdVXHjpW+VUDC7/wBKlfvkttpb8wXSViw277 uDCw== X-Gm-Message-State: AOAM530Y8fE/BJggjtyu27Ilc4aw2/Pl7l/zOhoNacISv0WXbcJp87r9 JqWwUCqqMyPxsT3HerBkf1w= X-Google-Smtp-Source: ABdhPJyyPeyfr4wXLx2NK9+J4cpKRVe7QuBz9MW7Xz5aF4oymIt5G5j6lKmjcoPIuuyf27Y93IiQaQ== X-Received: by 2002:a05:6214:1021:: with SMTP id k1mr25286106qvr.62.1600616110794; Sun, 20 Sep 2020 08:35:10 -0700 (PDT) Received: from gonk ([2607:f2c0:e360:1126:b071:eead:590b:5fdd]) by smtp.gmail.com with ESMTPSA id w194sm6796154qkb.130.2020.09.20.08.35.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Sep 2020 08:35:10 -0700 (PDT) From: James N. V. Cash To: Kyle Meyer Subject: Re: eldoc recursion error In-Reply-To: <87tuvtvyig.fsf@kyleam.com> References: <87tuvtvyig.fsf@kyleam.com> Date: Sun, 20 Sep 2020 11:35:09 -0400 Message-ID: <87mu1kxxzm.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::f2c; envelope-from=james.nvc@gmail.com; helo=mail-qv1-xf2c.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: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bzg@gnu.org, , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=SJbC4NIg; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.01 X-TUID: nPxIWU4tgN8h Kyle Meyer writes: > Using lexical-let here is problematic because it's obsolete since Emacs > 24. Taking a quick glance, I don't see any issues with switching this > file over to lexical binding by adding " -*- lexical-binding: t; -*-" to > the first line. Cool, will do. I was concerned that the lexical-binding stanza was missing for a reason, but I'll give it a shot. > Also, why use > > (doc-funs (symbol-value 'eldoc-documentation-functions)) > > rather than > > (doc-funs eldoc-documentation-functions) > > ? Good question...I was doing that just because the original code does ~(symbol-value 'eldoc-documentation-function)~ and I assumed there was some reason I didn't understand for doing so. >> + (lambda () >> + (let ((eldoc-documentation-functions doc-funs)) >> + (funcall eldoc-documentation-strategy)))) >> + (and eldoc-documentation-function >> + (symbol-value 'eldoc-documentation-function)))) > > nit: Please switch this to the Elisp style of indenting the `else' arm > less than the `then' arm. Oops, will do. >> -(defun org-eldoc-documentation-function (&rest _ignored) >> +(defun org-eldoc-documentation-function (&optional callback) > > Perhaps even with the callback parameter the &rest should stay around. > The docstring of eldoc-documentation-functions makes me nervous because > it says "each hook function is called with _at least_ one argument" (my > emphasis). Good call, will do. > Hmm, I think the more complete approach you put together for > org-eldoc-get-mode-local-documentation-function, along with your change > to consider the callback parameter here, means we don't need to bother > with the condition-case/wrong-number-of-arguments dance. The callback > alone should be a reliable indication we're on Emacs 28, in which case > we can expect the function to accept a callback argument (even if they > ignore it like python-eldoc-function does). I was just thinking more about this, and I'm concerned I might need to change things around a little bit more. The closure that org-eldoc-get-mode-local-documentation-function now returns under Emacs 28 doesn't take any arguments and instead lets the eldoc-documentation-strategy function create its own new callback. I think the current approach will appear to work when the documentation function returns a value directly, but if it uses the callback, then I think that it won't, since it invokes a new, separate callback. I will take another crack at addressing this and send another patch shortly. > Thanks again for working on this. My pleasure!