From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felix Dietrich Newsgroups: gmane.emacs.help Subject: Print eldoc information interactively (was: Re: major mode for G-Code?) Date: Wed, 06 Apr 2022 04:20:57 +0200 Message-ID: <8735irymt2.fsf_-_@sperrhaken.name> References: <8735jpzl53.fsf@zoho.eu> <0854cd57-6d99-85e1-a488-df5504ee3577@rixotstudio.cz> <871qz92gar.fsf@zoho.eu> 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="37799"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 06 04:22:21 2022 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 1nbvJM-0009ja-W2 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 06 Apr 2022 04:22:20 +0200 Original-Received: from localhost ([::1]:38972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbvJL-0002mC-Ik for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 05 Apr 2022 22:22:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbvID-0002PD-RQ for help-gnu-emacs@gnu.org; Tue, 05 Apr 2022 22:21:09 -0400 Original-Received: from mout.kundenserver.de ([212.227.17.10]:46911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbvI8-0004Hm-RH for help-gnu-emacs@gnu.org; Tue, 05 Apr 2022 22:21:09 -0400 Original-Received: from localhost ([78.54.126.235]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MvrRB-1nt2y11h0Z-00swNq for ; Wed, 06 Apr 2022 04:21:02 +0200 In-Reply-To: <871qz92gar.fsf@zoho.eu> (Emanuel Berg via Users list for the's message of "Fri, 11 Mar 2022 06:45:32 +0100") X-Provags-ID: V03:K1:RFAhOA/qoOpM28pixaogQQoHsaYzx8FmsUILks5JO6j2zna7QHG OTKA6A3zBfVEZd7Yksixvz60iYEN7dKk1zRVGVoCRsWABKV6cJgC6RHzuRdVTWR+/uGgDs8 9IqCHX94IM0k4HS+3WDFZvqSOQlwiwQFSj/134bPsFKhnl4fp2sX5ML5RQL+FlIGrx6LR/F tWRG/hRC+SrjqP+UCGlPg== X-UI-Out-Filterresults: notjunk:1;V03:K0:QFBxeEhINH8=:I8A2A0GlYezEQEvdRsQMuR h8QG0/7rgKFMgpkgz+eviRV47XFb8M5D6Y/jV5Tx1EArPMK2Rp3iLWkQRflDU1TkNBoVcU8GB jrIItQ/rJt+92l1XJdHBILxJXueDQ3opYLbegu1FjFq+wUr0HJ6yTfOy12FU7bcd16aIojmFL hBUZyj7pEFT9tc6LdWLosI+xS0xoIZagO8tG7H9Jq0yDsXwupsmWxphXzu8lF/NZpGyl/tjxV zVqD/ZtJc6pkNs9S+sZMaivH7kbJjlezW1pl+BfFvMLGqkNiOHpNPKTXcTBGnSl1FtH32njQs 8Q4hPbIzicnjEpvha43Kf/C22xeIFZCMQjpYF8M19P0+4kfBvedUDY9lebWm4mtPiBAYRz25K c0RL3YE+A6licgjrRAYKskcCeQdg9WwNcEvoMCTBojeYFcsZ7Go2NLgToCTPLGOh51K2eDM4m NjNNV1WIQP0/iwWrh9/HL0zrKQwadFEIuQW3Yqr15OqCD/gJ/3HcHJ+cgE2VfzVFhhwDcj95o LsD9Rkh4FmYofuRlqig5RFus6h3Vx1TRNhxpfQbL7EzojBMDxQG2cGO/phoibYLprykSfwcV+ fEuXvA0ZB2g1YwvIcLrGVf4zgNSkz7EqBVCtQXgL7qzAcDFLY2mKyaJ8aw6Mj4GPN+NpCfMjO AtYZpRYGih7R0xszb4O/yBktXeypXgLsYF2gwNvVyJ8rE+tahH0ysL/wtQ7KB58ut9WqE0zTK g1CtZM2MxZIXKc4N Received-SPF: none client-ip=212.227.17.10; envelope-from=felix.dietrich@sperrhaken.name; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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:136871 Archived-At: Emanuel Berg via Users list for the GNU Emacs text editor writes: > Works but ... I wonder if you could get `eldoc-mode' to not be > based on inactivity and then display (after the timeout) but > never say anything unless the user hits a key to display > it ... Maybe it would be enough to just yank the relevant code out of =E2=80=98eldoc-print-current-symbol-info=E2=80=99? #+begin_src emacs-lisp (defun my/eldoc-print-current-symbol-info () (interactive) (with-demoted-errors "eldoc error: %s" (let ((non-essential t)) ;; Only keep looking for the info as long as the user hasn't ;; requested our attention. This also locally disables ;; inhibit-quit. (while-no-input (eldoc-message (funcall eldoc-documentation-function)))))) #+end_src You can=CA=BCt just make =E2=80=98eldoc-print-current-symbol-info=E2=80=99 = interactive because of the (not this-command) test in =E2=80=98eldoc-display-message-p= =E2=80=99: #+begin_src emacs-lisp ;; Decide whether now is a good time to display a message. (defun eldoc-display-message-p () "Return non-nil when it is appropriate to display an ElDoc message." (and (eldoc-display-message-no-interference-p) ;; If this-command is non-nil while running via an idle ;; timer, we're still in the middle of executing a command, ;; e.g. a query-replace where it would be annoying to ;; overwrite the echo area. (not this-command) (eldoc--message-command-p last-command))) #+end_src --=20 Felix Dietrich