From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#62029: 29.0.60; Allow users to customize eldoc buffer separator Date: Fri, 24 Mar 2023 17:44:10 +0000 Message-ID: <87h6uacadx.fsf@gmail.com> References: <0C40D168-54D5-47E9-8BD8-77CFCD70B895@gmail.com> <87355vdufe.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="13878"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 62029@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 24 23:02:19 2023 Return-path: Envelope-to: geb-bug-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 1pfpUI-0003SO-Bt for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Mar 2023 23:02:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfpTN-0004Aw-Me; Fri, 24 Mar 2023 18:01:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pfpTE-00044V-1W for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 18:01:12 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pfpTD-0000eY-KC for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 18:01:11 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pflRO-0008Um-Bq for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 13:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Mar 2023 17:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62029 X-GNU-PR-Package: emacs Original-Received: via spool by 62029-submit@debbugs.gnu.org id=B62029.167967973832600 (code B ref 62029); Fri, 24 Mar 2023 17:43:02 +0000 Original-Received: (at 62029) by debbugs.gnu.org; 24 Mar 2023 17:42:18 +0000 Original-Received: from localhost ([127.0.0.1]:41304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pflQf-0008Tk-LX for submit@debbugs.gnu.org; Fri, 24 Mar 2023 13:42:18 -0400 Original-Received: from mail-ed1-f48.google.com ([209.85.208.48]:43945) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pflQe-0008TX-2Z for 62029@debbugs.gnu.org; Fri, 24 Mar 2023 13:42:16 -0400 Original-Received: by mail-ed1-f48.google.com with SMTP id x3so10830450edb.10 for <62029@debbugs.gnu.org>; Fri, 24 Mar 2023 10:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679679730; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FiTR6c6gH6YsOHnb60C1Y2fi+jyimhXElH7qgFWtazg=; b=DMJrXyGLvM1PHZTgy0mR0W9bb5VFg/DHP2y/RybS/kFVsPJXPuBbdcKqFmwXEYkT/F ErpI/2pSYA74mmzsyZVsNEqgeHenc40G/9jz3JvfRsxcJFGjOPGqwPo/AxH6DtFm0Nyu b8xzC8E5HTbQFKJhWTjeLrR0ERz4DRGtagGiLwuXOiErpOclvccL+teOOtUE0CTzDwve pynrM670fqToEUCcUuX+WqXxTTF4S0yRwZRhDMCSE/yRuYt3De2kKNPvKaxAeYK/nC2O ex0JiXCCF8pfknPH1TT7iw5cmbZqgwahQMjyNsBkfoORgsoAyxUHrLhzL7E+FhEJqT7W SUjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679679730; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FiTR6c6gH6YsOHnb60C1Y2fi+jyimhXElH7qgFWtazg=; b=vdHCTbJbgEsCT6eTpR5qk6CO7aNM/pDBc9ov+PnDC5hQ0QAc92aXfORLUhdlsr3aYe u5z+BL+IBL4ydWfJ/Vi1Qa9YoBBZ2jKVeoN7yBq0mKLn/vp9mObakppm831QUta5Ja2M Oa3kadGRQpMnOuCdujDd1jx1T/R8Y48ZjG1hNHagHridXQ269Bow5nZVhZhMBurHlw4Y qKNLQFPgFn/VpuiwbUlKbEgIBtILEmZN9vB4nDls3VmtF+DBZiF1+tS7iFg5CI/I/f8Z 8yvndgc+/ptK7is5VXV9h6IpGlS6Pv19J5TZxjZLsxjerqD/dEq5eOrZuQ2Fp/pZnUO7 O+rg== X-Gm-Message-State: AAQBX9f7zLS15bntwP1Qsj/LK1jMvwvbdEXig0FSEqoEBW4KNexRK+p1 pOUNscnbnbp58oZz/ukKQIN82a7h0Wo= X-Google-Smtp-Source: AKy350aQcATiMa8R4aUoXxRs4MK7xW24/SYE9J5vn+LphoLmNQhqCnfCogg1aLyOKNGmjrwvFyV77w== X-Received: by 2002:a17:906:4805:b0:92b:3c78:91fa with SMTP id w5-20020a170906480500b0092b3c7891famr3415573ejq.28.1679679729738; Fri, 24 Mar 2023 10:42:09 -0700 (PDT) Original-Received: from krug (87-196-72-75.net.novis.pt. [87.196.72.75]) by smtp.gmail.com with ESMTPSA id e6-20020a170906748600b008bfe95c46c3sm10623111ejl.220.2023.03.24.10.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 10:42:09 -0700 (PDT) In-Reply-To: (Yuan Fu's message of "Thu, 23 Mar 2023 17:12:15 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:258512 Archived-At: Yuan Fu writes: > For separator, maybe something like > > (insert =E2=80=9CTitle" (propertize "-" 'display > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 '(space :align-to right) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 'font-lock-face '(:strike-through t) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 'face '(:strike-through t))) > > for GUI, and use underline for terminal. I've now pushed a commit to master introducing the user variable eldoc-doc-buffer-separator. It's not a defcustom yet, as I'm not too familiar with those, but feel free to change it. (defvar eldoc-doc-buffer-separator "String used to separate items in Eldoc documentation buffer." (concat "\n" (propertize "\n" 'face '(:inherit separator-line :extend t= )) "\n")) There is a difference between a separator and a title. I've stopped short of adding titles, as I fear it would be confusing unless the content allows it. To be investigated later for eldoc-display-in-echo-area or maybe you can try it in eldoc-box. Also, I've been testing with these unpushed changes to elisp-mode.el, which render more of the docstring in emacs-lisp-mode. The use case here is navigating around in an .el file while having a window open with the *eldoc* buffer. Jo=C3=A3o diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 45e3848362e..054da900616 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1779,11 +1779,22 @@ 'elisp-eldoc-documentation-function =20 (defun elisp-eldoc-funcall (callback &rest _ignored) "Document function call at point by calling CALLBACK. -Intended for `eldoc-documentation-functions' (which see)." +Intended for `eldoc-documentatiok-functions' (which see)." (let* ((sym-info (elisp--fnsym-in-current-sexp)) - (fn-sym (car sym-info))) + (fn-sym (car sym-info)) + (echo (and fn-sym + (apply #'elisp-get-fnsym-args-string sym-info))) + (fulldoc + (and echo + (with-temp-buffer + (let ((standard-output (current-buffer))) + (describe-function-1 fn-sym) + (help-make-xrefs) + (buffer-string)))))) (when fn-sym - (funcall callback (apply #'elisp-get-fnsym-args-string sym-info) + (funcall callback + fulldoc + :echo echo :thing fn-sym :face (if (functionp fn-sym) 'font-lock-function-name-face @@ -1794,9 +1805,18 @@ elisp-eldoc-var-docstring Intended for `eldoc-documentation-functions' (which see). Also see `elisp-eldoc-var-docstring-with-value'." (let* ((sym (elisp--current-symbol)) - (docstring (and sym (elisp-get-var-docstring sym)))) + (docstring (and sym (elisp-get-var-docstring sym))) + (rawdoc (and docstring + (documentation-property + sym 'variable-documentation t))) + (fulldoc (and rawdoc + (with-temp-buffer + (insert rawdoc) + (help-make-xrefs) + (buffer-string))))) (when docstring - (funcall callback docstring + (funcall callback fulldoc + :echo docstring :thing sym :face 'font-lock-variable-name-face)))) =20