From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mathieu Marques Newsgroups: gmane.emacs.bugs Subject: bug#47109: eldoc.el: Allow custom separator between documentations in the echo area Date: Sat, 13 Mar 2021 13:26:56 +0100 Message-ID: References: <87o8foaxdc.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000021277705bd6a1f10" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20888"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 47109@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 13 13:27:26 2021 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 1lL3Mc-0005IW-05 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Mar 2021 13:27:26 +0100 Original-Received: from localhost ([::1]:59520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lL3Mb-0000LT-1H for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Mar 2021 07:27:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lL3ME-0000Kz-R0 for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 07:27:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47697) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lL3ME-00032I-JT for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 07:27:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lL3ME-0008NN-Da for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 07:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mathieu Marques Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Mar 2021 12:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47109 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 47109-submit@debbugs.gnu.org id=B47109.161563837932142 (code B ref 47109); Sat, 13 Mar 2021 12:27:02 +0000 Original-Received: (at 47109) by debbugs.gnu.org; 13 Mar 2021 12:26:19 +0000 Original-Received: from localhost ([127.0.0.1]:59242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lL3LW-0008ML-Uh for submit@debbugs.gnu.org; Sat, 13 Mar 2021 07:26:19 -0500 Original-Received: from mail-io1-f47.google.com ([209.85.166.47]:44413) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lL3LT-0008M7-JG for 47109@debbugs.gnu.org; Sat, 13 Mar 2021 07:26:17 -0500 Original-Received: by mail-io1-f47.google.com with SMTP id 81so28588811iou.11 for <47109@debbugs.gnu.org>; Sat, 13 Mar 2021 04:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RuTbTwbBDL/dB92JX/AgomevWmECTX3TvlALBwSQ7dg=; b=YPoOvmE949FiD9wGoM84XAbxeRXjxQdCtuRDkFDUf64fXBp1PN8NHv0ghSCOp0tnaH 5gET2YXUQ8LJ3jcsW6i89BlxcwZnLJTRpiqnfj+w5/MCIpLVOaBNyxq9kV/a9w4++F8l EyYHOmn4hKm2ENbqTKd0vJOoVx0lxongIDdO8c72m2aPk+l4GLiVRVx4dJ20WJ9ckaPS d1YPvOQvS1WJ47mjT9kbqpJrwtRcQXjOKIJGCSXOfG5IxWRn3m8iOSl1/tgcKJ4jpB0B IskqYUz7gC3AOFMJxw3TKjF1SWptDV9LIMXbGbSu7305IVm/fgNEx4XbON+3Pc55pVDr GIuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RuTbTwbBDL/dB92JX/AgomevWmECTX3TvlALBwSQ7dg=; b=rr8TD4oNVQnO0vCIdf0jZg4+D/Hpm3zhh7f9vMh4t75f1deXNMvyeWcrsP7EYmPA9H d7u3CcUYjcATC6L9OyGbnXUgAzu3vA6Jn+P4Vyn03ws4JLB/8YxsL1MfiBZjjweu857g 3mXnKhxO1h+FC5kOS3XLq28jUcVD4S4nC3hl7J2an3vrkmFdtawbX5Yz8//I3kfSa4xO uVNGPeClYwTqPb4BPZEroO4nJY2NIoBC2iHEkVOk6SQpCQgRnhhEilvAf1FlYXSzhnq5 GhAzykhQM4VY71PIa9+4BVsDwEtjiTWTt5bv4PakdY67mXH4WZB2fvpkvP2ZLm6HMGJw p4VQ== X-Gm-Message-State: AOAM532TTHiesFW1s9KK+H9rT0ffULWxDtJBCW9Au5Tt4/H/kHXgNuC3 RWAX3fbWW52OmVyzFyDFkAWs1CVTc9tw25oiLUw= X-Google-Smtp-Source: ABdhPJw1r407xdo8PSMXL6u5IZHIusEARoT0NelgaSZFCqeflqDMHQMBvm0crduro01pXlCUHfAdpLNfoJ+AeRq+BPs= X-Received: by 2002:a5d:9c50:: with SMTP id 16mr2520322iof.66.1615638369994; Sat, 13 Mar 2021 04:26:09 -0800 (PST) In-Reply-To: <87o8foaxdc.fsf@tcd.ie> 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" Xref: news.gmane.io gmane.emacs.bugs:202260 Archived-At: --00000000000021277705bd6a1f10 Content-Type: multipart/alternative; boundary="00000000000021277305bd6a1f0e" --00000000000021277305bd6a1f0e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the feedback. Joined a replacement for 2nd patch following the suggested improvements. On Fri, Mar 12, 2021 at 10:13 PM Basil L. Contovounesios wrote: > severity 47109 wishlist > tags 47109 patch > quit > > Mathieu Marques writes: > > > While trying out eglot.el, I played around with eldoc.el and needed to > > display all pieces of documentations in the echo area at once. The > > joined patch allows for a custom separator between said > > documentations. > > Thanks, CCing Jo=C3=A3o as an expert on both packages. > > > First patch is a fix to indenting levels as well as untabifying the > > whole file. That was done automatically by my configuration and given > > the existing code I thought it would be beneficial to most to provide > > a patch for that as well. Feel free to dismiss it if needed. > > Indeed, the Emacs convention is to only make whitespace/formatting > changes when already modifying that code for other purposes. > > > Subject: [PATCH 2/2] * lisp/emacs-lisp/eldoc.el > (eldoc--format-doc-buffer): > > Allow custom separator > > The log message should also mention the new symbols being added, e.g.: > > Make ElDoc separator customizable > > * lisp/emacs-lisp/eldoc.el (eldoc-documentation-separator): > New user option (bug#47109). > (eldoc-documentation-separator): New face. > (eldoc--format-doc-buffer): Use them as a custom separator. > > > +(defcustom eldoc-documentation-separator "" > > + "Separator to use between each documentation thing, when multiple." > > + :type 'string) > > + > > +(defface eldoc-documentation-separator '((t (:extend t :inherit > shadow))) > > According to (info "(elisp) Defining Faces"), this syntax is supported > for backward compatibility; nowadays the preferred format is: > > '((t :inherit shadow :extend t)) > > But: ElDoc supports Emacs =E2=89=A5 26.3, so use of the newer :extend att= ribute > has to be conditional on that, e.g.: > > `((t :inherit shadow ,@(and (>=3D emacs-major-version 27) '(:extend t))= )) > > > + "Face to use for the separator between documentation things.") > > Both the defcustom and the defface also need a :version tag. > > Thanks, > > -- > Basil > --=20 Mathieu Marques --00000000000021277305bd6a1f0e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the feedback. Joined a replacement for 2nd patc= h following the suggested improvements.

On Fri, Mar 12, 2021 at 10:13 PM Bas= il L. Contovounesios <contovob@tcd.ie= > wrote:
= severity 47109 wishlist
tags 47109 patch
quit

Mathieu Marques <mathieumarques78@gmail.com> writes:

> While trying out eglot.el, I played around with eldoc.el and needed to=
> display all pieces of documentations in the echo area at once. The
> joined patch allows for a custom separator between said
> documentations.

Thanks, CCing Jo=C3=A3o as an expert on both packages.

> First patch is a fix to indenting levels as well as untabifying the > whole file. That was done automatically by my configuration and given<= br> > the existing code I thought it would be beneficial to most to provide<= br> > a patch for that as well. Feel free to dismiss it if needed.

Indeed, the Emacs convention is to only make whitespace/formatting
changes when already modifying that code for other purposes.

> Subject: [PATCH 2/2] * lisp/emacs-lisp/eldoc.el (eldoc--format-doc-buf= fer):
>=C2=A0 Allow custom separator

The log message should also mention the new symbols being added, e.g.:

=C2=A0 Make ElDoc separator customizable

=C2=A0 * lisp/emacs-lisp/eldoc.el (eldoc-documentation-separator):
=C2=A0 New user option (bug#47109).
=C2=A0 (eldoc-documentation-separator): New face.
=C2=A0 (eldoc--format-doc-buffer): Use them as a custom separator.

> +(defcustom eldoc-documentation-separator ""
> +=C2=A0 "Separator to use between each documentation thing, when = multiple."
> +=C2=A0 :type 'string)
> +
> +(defface eldoc-documentation-separator '((t (:extend t :inherit s= hadow)))

According to (info "(elisp) Defining Faces"), this syntax is supp= orted
for backward compatibility; nowadays the preferred format is:

=C2=A0 '((t :inherit shadow :extend t))

But: ElDoc supports Emacs =E2=89=A5 26.3, so use of the newer :extend attri= bute
has to be conditional on that, e.g.:

=C2=A0 `((t :inherit shadow ,@(and (>=3D emacs-major-version 27) '(:= extend t))))

> +=C2=A0 "Face to use for the separator between documentation thin= gs.")

Both the defcustom and the defface also need a :version tag.

Thanks,

--
Basil


--
Mathieu Marques
--00000000000021277305bd6a1f0e-- --00000000000021277705bd6a1f10 Content-Type: text/x-patch; charset="US-ASCII"; name="0002-Make-ElDoc-separator-customizable.patch" Content-Disposition: attachment; filename="0002-Make-ElDoc-separator-customizable.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_km7pe7t10 RnJvbSBkNWExNzAxYTc1ZDcwNjhkNTE4MzVhYWIyZjE1MTUzYjliOTg5MTk5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXRoaWV1IE1hcnF1ZXMgPG1hdGhpZXVtYXJxdWVzNzhAZ21h aWwuY29tPgpEYXRlOiBGcmksIDEyIE1hciAyMDIxIDE5OjQ1OjE4ICswMTAwClN1YmplY3Q6IFtQ QVRDSF0gTWFrZSBFbERvYyBzZXBhcmF0b3IgY3VzdG9taXphYmxlCgogICogbGlzcC9lbWFjcy1s aXNwL2VsZG9jLmVsIChlbGRvYy1kb2N1bWVudGF0aW9uLXNlcGFyYXRvcik6CiAgTmV3IHVzZXIg b3B0aW9uIChidWcjNDcxMDkpLgogIChlbGRvYy1kb2N1bWVudGF0aW9uLXNlcGFyYXRvcik6IE5l dyBmYWNlLgogIChlbGRvYy0tZm9ybWF0LWRvYy1idWZmZXIpOiBVc2UgdGhlbSBhcyBhIGN1c3Rv bSBzZXBhcmF0b3IuCi0tLQogbGlzcC9lbWFjcy1saXNwL2VsZG9jLmVsIHwgMTYgKysrKysrKysr KysrKysrLQogMSBmaWxlIGNoYW5nZWQsIDE1IGluc2VydGlvbnMoKyksIDEgZGVsZXRpb24oLSkK CmRpZmYgLS1naXQgYS9saXNwL2VtYWNzLWxpc3AvZWxkb2MuZWwgYi9saXNwL2VtYWNzLWxpc3Av ZW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GhlIHJlc3VsdHMgb2YgdGhlIGxhc3QgZG9jdW1lbnRhdGlvbiByZXF1ZXN0LiIKICAgICAg ICAgICAgICAgICAgICAgICAgICI6ICIKICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMtZG9j KSkKICAgICAgICAgICAgICAgICAgZG8gKGluc2VydCB0aGlzLWRvYykKLSAgICAgICAgICAgICAg ICAgd2hlbiByZXN0IGRvIChpbnNlcnQgIlxuIikKKyAgICAgICAgICAgICAgICAgd2hlbiByZXN0 CisgICAgICAgICAgICAgICAgIGRvIChpbnNlcnQgKGNvbmNhdAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAiXG4iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwcm9wZXJ0aXpl IGVsZG9jLWRvY3VtZW50YXRpb24tc2VwYXJhdG9yCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICdmYWNlICdlbGRvYy1kb2N1bWVudGF0aW9uLXNlcGFyYXRvcikpKQog ICAgICAgICAgICAgICAgICBmaW5hbGx5IChnb3RvLWNoYXIgKHBvaW50LW1pbikpKQogICAgICAg ICA7OyBSZW5hbWUgdGhlIGJ1ZmZlciwgdGFraW5nIGludG8gYWNjb3VudCB3aGV0aGVyIGl0IHdh cwogICAgICAgICA7OyBoaWRkZW4gb3Igbm90Ci0tIAoyLjMwLjEKCg== --00000000000021277705bd6a1f10--