From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Calling eldoc-message directly Date: Tue, 8 May 2018 20:57:49 -0400 Message-ID: <2aba18fe-4424-6b08-b5e0-e590c039a4de@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1525827385 32370 195.159.176.226 (9 May 2018 00:56:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 9 May 2018 00:56:25 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 09 02:56:21 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fGDP3-0008K6-7M for ged-emacs-devel@m.gmane.org; Wed, 09 May 2018 02:56:21 +0200 Original-Received: from localhost ([::1]:53950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGDR8-0007jL-Ov for ged-emacs-devel@m.gmane.org; Tue, 08 May 2018 20:58:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGDQX-0007jG-Kd for emacs-devel@gnu.org; Tue, 08 May 2018 20:57:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGDQW-0005Qk-MD for emacs-devel@gnu.org; Tue, 08 May 2018 20:57:53 -0400 Original-Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]:37460) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGDQW-0005Qa-H7 for emacs-devel@gnu.org; Tue, 08 May 2018 20:57:52 -0400 Original-Received: by mail-qt0-x235.google.com with SMTP id q13-v6so42808550qtp.4 for ; Tue, 08 May 2018 17:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=IILKS28TQ+mp2ic95QvIX9Lu8jZs9W35anaBB1iBgIk=; b=QvkmXTlDrSuGAspfZMV457fXLcOfyycNBsIE+GrKXVy9cmHiRjz+QjaHs4z+iockhM 17bNgCW5BbkpPf6fkCzfL+jhrYWoe9dbVna4YH8P1qB+j1pX0myupMWrC+9wke7R26ed VRqEyp0C0Rc7ce1k+dnyFUtEISy3G5pMdGBY2S3bm3V1hw2en76J8giq4vlvjREoQkqO ljnea4fes7k7pvVzxAlXDrkj6PonhCjG/Yz4zxIzI9RPBArw1Lt+8lJJmgmSS0tMUscs K32baYTkR409vM8276Uvm95mOsdYzK4h+zzGQDcaNgp30aG+h/78ARIEI/WGw4VNbVlj yXng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=IILKS28TQ+mp2ic95QvIX9Lu8jZs9W35anaBB1iBgIk=; b=gPDKAdJT45qdFx+F5yy0Wo6IlSfobEcevSeDbilU98mdvyC6xp42WBlPsMcl9bwJq0 7kyT7sHI1L51bz1geThX+ia3fPkYMLiP5iKLSuBEpQa2rhpTK8pIpRE33cTE6ABIZvU4 M8MTNnPV6RJ0wn9wDgCIsedz+mYklb8P3qV1PfYcamV7ogi6TocGwBOySksLcSLNBvvV 5flAEJklMXJMCz2iTR0cN+v71ifpAvnXevl0D8WXAz2DHxjlKb31ZauMJ1gc3Opgyzum q8ZU+9C8Ckf2gXPC0cEribvMLuqet+2ZFh8BU6HOp7Yitag7EhWnWwJS22JruTzmGohz yFsw== X-Gm-Message-State: ALQs6tBAvCrTIGTknxsxhvygdX6W520hiuTEteNAs6Ak/7byciKth9aG cBUdTeSasPkYa0t7kgFCixZU1nsk X-Google-Smtp-Source: AB8JxZrs2+R7l74gRyG7oTI6xGemRv6YXIuCBDCr5C8ZUh8iTzfJUBItrCtT+QBps3x5soWJGg9uCQ== X-Received: by 2002:aed:2411:: with SMTP id r17-v6mr39133539qtc.273.1525827471778; Tue, 08 May 2018 17:57:51 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:7d29:3104:b05c:df65? ([2601:184:4180:66e7:7d29:3104:b05c:df65]) by smtp.gmail.com with ESMTPSA id w12-v6sm14280145qtb.80.2018.05.08.17.57.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 May 2018 17:57:51 -0700 (PDT) Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225160 Archived-At: Hi emacs-devel, The changelog for Emacs 27.1 says "For ElDoc support, you should set 'eldoc-documentation-function' instead of calling 'eldoc-message' directly". At least one of my packages calls eldoc-message directly, and I'm not sure how to get rid of it. In that package, I use a server process to get information about the current buffer. I can use it to asynchronously retrieve documentation about identifiers, among other things. This pattern seems pretty common (I think that's how tide, elpy, cider, and multiple other modes work). I currently have an eldoc-documentation-function that sends an asynchronous query, waits for a few milliseconds in the hope to get a quick answer, and otherwise registers a callback that calls eldoc-message directly. That callback checks that the buffer hasn't been modified and that the point hasn't moved, and if so calls eldoc-message. Can someone recommend a proper implementation, not based on eldoc-message? (I have vague recollections of a related thread on emacs-devel, but I can't seem to find it) Thanks, Clément.