From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: Proposal: font lock for `describe-variable` Date: Mon, 10 Oct 2016 00:48:18 +0900 (JST) 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: text/plain; charset=US-ASCII; format=flowed X-Trace: blaine.gmane.org 1476028143 31056 195.159.176.226 (9 Oct 2016 15:49:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Oct 2016 15:49:03 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: Eli Zaretskii , Emacs developers , =?ISO-8859-15?Q?Cl=E9ment_Pit--Claudel?= , monnier@iro.umontreal.ca, Tino Calancha To: Tianxiang Xiong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 09 17:48:58 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 1btGL9-0005AY-SA for ged-emacs-devel@m.gmane.org; Sun, 09 Oct 2016 17:48:40 +0200 Original-Received: from localhost ([::1]:44763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btGL7-0003To-V9 for ged-emacs-devel@m.gmane.org; Sun, 09 Oct 2016 11:48:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btGL1-0003TU-1f for emacs-devel@gnu.org; Sun, 09 Oct 2016 11:48:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btGKz-0001Zx-QZ for emacs-devel@gnu.org; Sun, 09 Oct 2016 11:48:30 -0400 Original-Received: from mail-pf0-x236.google.com ([2607:f8b0:400e:c00::236]:33420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btGKu-0001YT-FQ; Sun, 09 Oct 2016 11:48:24 -0400 Original-Received: by mail-pf0-x236.google.com with SMTP id 190so43515055pfv.0; Sun, 09 Oct 2016 08:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=IEMdu5YWMOdqYFQOJgA33HBjjo24HpEhlEuNsyuvzgE=; b=GBJDWI8MVAG7eqcplPB7yFd4qEvm7RgWq1bA5qTSW8d1vJIbAJV4MxquuXIVwJJ3zd KjEIhAKouVJHDbrv8DkGsHNsnOZO4CovHuopmwl/Nhs5roow94qEkOPj4NUcg9BXvgch pucyskNB6ECYXw2ZmTOcGWzn4fGlpvCEq2F59pmL70HPpEuK6trK5Xs3bULh658wCFBR g2BeB0WDHzOOmjfDEGS9nLkvPUnRzky9v2Xx5/EbukcLrsoECFsRHonV/RFnrr8yhKfw gyrJzOK57Q6P7YYC9xFWF5YB5ZXxjDLwuQoBN5hO+vjB46OKJ8mpdW1Oytk5iizFATD9 +wsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=IEMdu5YWMOdqYFQOJgA33HBjjo24HpEhlEuNsyuvzgE=; b=ik3a72O8HcdKZIjMicdRAbc85n1Udaus9yM5g/z+MyK6QpU0D9BTfEvmyvpmXWXYWC XHspPy1N9yiUAtmvvCvqU4nsvg3H909wbFYG9gew83K+oz4U16uC3FBmtcLugS6jmxZZ tWjK00fhJjGlgpaQo2KHD4ocF2LHDrD6Mr6+HIRtLxRprw3/r13Liud2IZu+S0A/IwcI czWSF80Iif2MT6xHq697O/3ydP11PXeKzagvhmXkv2t2pr9Gsyn4k7Ln7TMWTk2fpFKS 5Lw21wg+L2+QDTIsGsC7zzN0PRRbOU7DY8sZwHff6twsVhBQnPikgtGoV6uiE9Ih0Emu fcEw== X-Gm-Message-State: AA6/9RnSRIy7lVUarmaxvF+y5Xbb/iHlk16brvQcax7svku6Ggkv67MHyRz9YysAcp+JKg== X-Received: by 10.98.137.89 with SMTP id v86mr15763677pfd.38.1476028103429; Sun, 09 Oct 2016 08:48:23 -0700 (PDT) Original-Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id af17sm44938820pac.14.2016.10.09.08.48.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Oct 2016 08:48:22 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::236 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:208120 Archived-At: 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.