From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tianxiang Xiong Newsgroups: gmane.emacs.devel Subject: Re: Proposal: font lock for `describe-variable` Date: Mon, 10 Oct 2016 21:11:05 -0700 Message-ID: References: <1474949378.32234.5.camel@gmail.com> <83shslbax3.fsf@gnu.org> <83ponpb5rv.fsf@gnu.org> <57d030e9-1f2e-bc8e-f032-6ac345798c5f@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c001e8c1dd0e053e8f1052 X-Trace: blaine.gmane.org 1476159165 30773 195.159.176.226 (11 Oct 2016 04:12:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Oct 2016 04:12:45 +0000 (UTC) Cc: Eli Zaretskii , Emacs developers , =?UTF-8?B?Q2zDqW1lbnQgUGl0LS1DbGF1ZGVs?= , monnier@iro.umontreal.ca To: Tino Calancha Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 11 06:12:41 2016 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 1btoQL-0004We-1P for ged-emacs-devel@m.gmane.org; Tue, 11 Oct 2016 06:12:17 +0200 Original-Received: from localhost ([::1]:53656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btoQJ-0008AC-O7 for ged-emacs-devel@m.gmane.org; Tue, 11 Oct 2016 00:12:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btoPK-0007pS-4G for emacs-devel@gnu.org; Tue, 11 Oct 2016 00:11:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btoPH-0003dq-7y for emacs-devel@gnu.org; Tue, 11 Oct 2016 00:11:13 -0400 Original-Received: from mail-yb0-x230.google.com ([2607:f8b0:4002:c09::230]:35704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btoPD-0003bh-MH; Tue, 11 Oct 2016 00:11:07 -0400 Original-Received: by mail-yb0-x230.google.com with SMTP id 184so3187341yby.2; Mon, 10 Oct 2016 21:11:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NR/YE4m4Rpn/+k0izooMhTfSn4VHK9riSnj712sDCgw=; b=xsck9CdmG6ByHrkePeL/jkhwxiRq/N3goAJVDnasQDeP4r43x7ZSqYfrutIrHakRsA sBeMEnKfh0dZS+Jvh85Yl5C+SQZfC8XBbqjcAeu7yto+vbSe8o+IPmTldYNZaJkSZXJn bROxoIT3GZxcAdhEkm7ofPfCli4ws06YjwyKWXXAVlYrHf/lzk6OLezoYMRRTrYMdE90 jIAwf05r7TQ9ryJakhHc0GuuO83S8UmhGrAF7sAAQXcyXgJJNwDW1843TzMsZfY8rBdJ tNkWAogqq3tCgSdEslvafjNhNIZJTuY/OlO1KwZdY+uWVTS2bhdZbYZ8sh6qKMcv0pqy ARUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NR/YE4m4Rpn/+k0izooMhTfSn4VHK9riSnj712sDCgw=; b=YRJvqucXdCcJBqvmJ+gnANv3uqudHS/WoXzQxf23Ijk78UeHKUBaG0WGzNoMpyxGQt OekIwf/0YDzYGg/l7UjrDT72xcNTIjpWtC6VTv/Gf2HVMWgAepDKnpNdSOoRy9Yn0hl6 yGQh+Ek1fdzS38te9aswLgJ0JgKv4Yb7Vv7t1mkLqyGYmeGnPAsf3pTX19zMYlVDIloX uCTtRx2aQwjyK2d+VjHgaFuhJZdiM9ZLgyPX8VxNyqMU9GAKQZByQnx5oS72nb0dxUIm g/1P+W+mrvPg33enIKZNrRyhdWHTP5DYEB821HZT/201nSSSMZnM7YxYYS48eIxbj9zl 42OQ== X-Gm-Message-State: AA6/9RliUM+LoQ0zZwayDchsjcK7Aovr2tOOVQ6nYtjlXZ5ePVnD69ED1+M26Rqid640htYVKcOTjS0Il2Ctkg== X-Received: by 10.37.4.203 with SMTP id 194mr1522194ybe.10.1476159065937; Mon, 10 Oct 2016 21:11:05 -0700 (PDT) Original-Received: by 10.129.80.195 with HTTP; Mon, 10 Oct 2016 21:11:05 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c09::230 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:208148 Archived-At: --001a11c001e8c1dd0e053e8f1052 Content-Type: text/plain; charset=UTF-8 @Tino Thanks, I'll take a look at these issues and create a new patch. On Sun, Oct 9, 2016 at 8:48 AM, Tino Calancha wrote: > > > On Sat, 8 Oct 2016, Tianxiang Xiong wrote: > > Here's a version that fixes a few issues: >> > Thank you very much. > > i have tested your patch and i have several comments. > > I) > If you plan to fontify `describe-variable' then you should fontify > `describe-function' as well. Before your patch, the output of > these two functions looks similar. It would be confusing if > 'd-v' uses `font-lock-doc-face' and 'd-f' do not. > > II) > You dropped the button with label 'below' which appears when the > variable value is very long. Please, add this button. > See examples below. > > III) > The condition to consider a variable value long in your patch is > different. In the example below, your patch shows a long var > value at the beginning, but without applying your patch it is shown > at the end. I guess, you are defining 'large' as a value > composed of >= 3000 characters. Please keep same definition > of variable being large as before your patch. > > IV) Wouldn't be possible to show all the buttons with face 'button? > Even buttons inside the doc string. Before your patch is visually > very clear where there is a button; after your patch is less > clear because all doc string shows face `font-lock-doc-face'. > > IV) The message 'Global value is', sometimes get confused and shows > things like: > global value is Documentation: > or > global value is Automatically becomes buffer-local when set. > See examples below. > > VI) I found one inconsistency between using `F1-v' and `F1-o' > with a Elisp variable: they might report different variable > value after your patch. > See examples below. > > Personally i like how Emacs currently shows 'd-v' and 'd-f'. > They look also consistent with `describe-mode'. I don't > see the necessity to apply the fontifications in your patch. > But this is just my opinion. Others may think differently. > > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;;;;;;;;;;;;;;;;;;; > EXAMPLES > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;;;;;;;;;;;;;;;;;;; > > Save following in a file /tmp/test.el > ;;;;;;;;;;;;;;;;;;;;; FILE BEGIN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;;;;;;;;;;;;;; > (defvar-local test-var nil > "Variable to test Xion patch. > > When its value is long, `describe-variable' shows it at the end of > the *Help* buffer; in that case, there is one button with label > 'below': pushing this button sets point to the buffer position > where the value is shown. > > You should get the same documentation with `describe-symbol'. > > Note that there is also a button in `describe-variable': pushing > it will show the documentation for describe-variable. This button > has face 'button, different from the rest of the text which shows > face 'default: that help users to visualize that there is a button.") > (setq test-var '(("/tmp/" > ((foo . 2) > (bar . "123") > (baz . "456") > (qux . "a")) > ((foo . 2) > (bar . "123") > (baz . "456") > (qux . "b")) > ((foo . 2) > (bar . "123") > (baz . "456") > (qux . "c")) > ((foo . 2) > (bar . "123") > (baz . "456") > (qux . "d")) > ((foo . 3) > (bar . "123") > (baz . "456") > (qux . "e")) > ((foo . 3) > (bar . "123") > (baz . "456") > (qux . "f")) > ((foo . 2) > (bar . "123") > (baz . "456") > (qux . "g")) > ((foo . 3) > (bar . "123") > (baz . "456") > (qux . "h")) > ((foo . 2) > (bar . "123") > (baz . "456") > (qux . "i")) > ((foo . 2) > (bar . "123") > (baz . "456") > (qux . "j")) > ((foo . 2) > (bar . "123") > (baz . "456") > (qux . "k"))))) > ;;;;;;;;;;;;;;;;;;;;; FILE END ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;;;;;;;;;;;;;; > Compare w/ and w/o your patch: > [A] > emacs -Q -l /tmp/test.el > F1-v test-var RET > ;; w/ patch: value appears at the beginning; value is non-nil. > ;; w/o patch: value appears at end; button below is present. > > F1-o test-var RET > ;; w/ patch: value is nil. > ;; w/o patch: value appears at end: same as using `F1-v' > ;; button below is present. > > [B] > emacs -Q > M-: (dired source-directory) RET > * / > M-: (save-excursion (mapc 'dired-maybe-insert-subdir > (dired-get-marked-files))) RET > F1-v dired-subdir-alist RET > ;; w/ patch: value appears at the beginning > ;; w/o patch: value appears at the end; button 'below' OK. > > ;;; Add more subdirs > * / > M-: (save-excursion (mapc 'dired-maybe-insert-subdir > (dired-get-marked-files))) RET > F1-v dired-subdir-alist RET > ;; w/ patch: value appears at the end; no button 'below'. > ;; w/o patch: value appears at the end; button 'below' OK. > --001a11c001e8c1dd0e053e8f1052 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
@Tino Thanks, I'll take a look at these issues and cre= ate a new patch.

On Sun, Oct 9, 2016 at 8:48 AM, Tino Calancha <tino.calancha@gm= ail.com> wrote:


On Sat, 8 Oct 2016, Tianxiang Xiong wrote:

Here's a version that fixes a few issues:
Thank you very much.

i have tested your patch and i have several comments.

I)
If you plan to fontify `describe-variable' then you should fontify
`describe-function' as well.=C2=A0 Before your patch, the output of
these two functions looks similar.=C2=A0 It would be confusing if
'd-v' uses `font-lock-doc-face' and 'd-f' do not.

II)
You dropped the button with label 'below' which appears when the variable value is very long.=C2=A0 Please, add this button.
See examples below.

III)
The condition to consider a variable value long in your patch is
different.=C2=A0 In the example below, your patch shows a long var
value at the beginning, but without applying your patch it is shown
at the end.=C2=A0 I guess, you are defining 'large' as a value
composed of >=3D 3000 characters.=C2=A0 Please keep same definition
of variable being large as before your patch.

IV) Wouldn't be possible to show all the buttons with face 'button?=
Even buttons inside the doc string.=C2=A0 Before your patch is visually
very clear where there is a button; after your patch is less
clear because all doc string shows face `font-lock-doc-face'.

IV) The message 'Global value is', sometimes get confused and shows=
things like:
global value is Documentation:
or
global value is Automatically becomes buffer-local when set.
See examples below.

VI) I found one inconsistency between using `F1-v' and `F1-o'
with a Elisp variable: they might report different variable
value after your patch.
See examples below.

Personally i like how Emacs currently shows 'd-v' and 'd-f'= .
They look also consistent with `describe-mode'.=C2=A0 I don't
see the necessity to apply the fontifications in your patch.
But this is just my opinion.=C2=A0 Others may think differently.


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;;;;;;;;;;;;
EXAMPLES
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;;;;;;;;;;;;

Save following in a file /tmp/test.el
;;;;;;;;;;;;;;;;;;;;;=C2=A0 FILE BEGIN=C2=A0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;;;;;;;;;;;;
(defvar-local test-var nil
=C2=A0 "Variable to test Xion patch.

When its value is long, `describe-variable' shows it at the end of
the *Help* buffer; in that case, there is one button with label
'below': pushing this button sets point to the buffer position
where the value is shown.

You should get the same documentation with `describe-symbol'.

Note that there is also a button in `describe-variable': pushing
it will show the documentation for describe-variable.=C2=A0 This button
has face 'button, different from the rest of the text which shows
face 'default: that help users to visualize that there is a button.&quo= t;)
(setq test-var '(("/tmp/"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((foo . 2) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(bar .= "123")
=C2=A0 =C2=A0 =C2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C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(baz .= "456")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(qux .= "k")))))
;;;;;;;;;;;;;;;;;;;;;=C2=A0 FILE END=C2=A0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Compare w/ and w/o your patch:
[A]
emacs -Q -l /tmp/test.el
F1-v test-var RET
;; w/ patch: value appears at the beginning; value is non-nil.
;; w/o patch: value appears at end; button below is present.

F1-o test-var RET
;; w/ patch: value is nil.
;; w/o patch: value appears at end: same as using `F1-v'
;;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 button below is present.

[B]
emacs -Q
M-: (dired source-directory) RET
* /
M-: (save-excursion (mapc 'dired-maybe-insert-subdir (dired-get-marked-= files))) RET
F1-v dired-subdir-alist RET
;; w/ patch: value appears at the beginning
;; w/o patch: value appears at the end; button 'below' OK.

;;; Add more subdirs
* /
M-: (save-excursion (mapc 'dired-maybe-insert-subdir (dired-get-marked-= files))) RET
F1-v dired-subdir-alist RET
;; w/ patch: value appears at the end; no button 'below'.
;; w/o patch: value appears at the end; button 'below' OK.

--001a11c001e8c1dd0e053e8f1052--