From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: michael@cadilhac.name (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) Newsgroups: gmane.emacs.devel Subject: Re: defcustom and the stars. Date: Wed, 03 Jan 2007 12:05:51 +0100 Organization: Epita/LRDE Message-ID: <877iw4pdyo.fsf@lrde.org> References: <87d55xozrn.fsf@lrde.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1150681385==" X-Trace: sea.gmane.org 1167822384 3750 80.91.229.12 (3 Jan 2007 11:06:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 Jan 2007 11:06:24 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 03 12:06:19 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H23wo-0000Zs-Oe for ged-emacs-devel@m.gmane.org; Wed, 03 Jan 2007 12:06:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H23wo-00076S-3y for ged-emacs-devel@m.gmane.org; Wed, 03 Jan 2007 06:06:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H23wZ-00075A-8E for emacs-devel@gnu.org; Wed, 03 Jan 2007 06:06:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H23wX-00074Z-Ja for emacs-devel@gnu.org; Wed, 03 Jan 2007 06:06:02 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H23wX-00074T-Ei for emacs-devel@gnu.org; Wed, 03 Jan 2007 06:06:01 -0500 Original-Received: from [213.251.189.42] (helo=42.mail-out.ovh.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1H23wW-0002mT-HF for emacs-devel@gnu.org; Wed, 03 Jan 2007 06:06:01 -0500 Original-Received: (qmail 1808 invoked by uid 503); 3 Jan 2007 11:06:05 -0000 Original-Received: from b6.ovh.net (HELO mail92.ha.ovh.net) (213.186.33.56) by 42.mail-out.ovh.net with SMTP; 3 Jan 2007 11:06:05 -0000 Original-Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 3 Jan 2007 11:06:01 -0000 Original-Received: from ivr94-6-82-230-255-91.fbx.proxad.net (HELO localhost) (82.230.255.91) by ns0.ovh.net with SMTP; 3 Jan 2007 11:05:58 -0000 Original-To: Stefan Monnier Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAYFBMVEUWCwUyFQk6JBNLGglQK BVRMiRkHQtwMBZuOCRyRi1iQiZyUUCFNxuIPCKRTC2mVTSpZTqVVS2SW0OYZkixb0qraE/KeU7EcT +4h2bPhVfQkm7hlnDkvZjYqIjrwJnzwqB5+4wZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAACXZwQWc AAAAwAAAAMADO7oxXAAADvUlEQVRIx32Wi5ajIAyGRcCAchErVqu27/+W+wfbs724i3Mcz5n/S0JI wlTbyXrs+zrFEL1zPuIdY7xO6+PBf6u27f4DrFPO3jvoQYRYFoj9CXyu+7ZPEWrXUNM0zpEfgjuY9 RTY1hyg5qUNgMb44Dwiiz5OZ8DCwVCjpdLaGNOVtw+M+Lz+AlNwRAhGSamh1abrtFKmG0DkmL8BhE +GdCNlreChBaO7DpjpIvbv/fr4AnqErhoYF6KI4aPrLIeFQLGj6RO4JWLjtdZ1WQXhvegGG0EKyO/ vwH7xJBk4tLrW5UPxN3zAufHDO3Axh4MCMPLisKQyRuJo/Btw60gpWcu6OogjsmIeiRIKgUlj3oCp a1QtRP1ywT9VfXCiZMEg4X+BfYADAHhhdc+NV1UBBT9SIedvgFFwDFslkO7S8e+KtQcohJCyefdgt DoC4pe+FB8VL3bDeiGB/AVurZJCvY5AtdaSKpYLJArxCXCOlMUpiRpF0Sbb8nZYBnGBPoGZuOCGAd lTqgXRlrrDuUgpDh+VNPYN0IRALnkIFsVTiBanbBQbesYl1Num584iojnnHIPVJRSJvFnrrFHPmD6 yBKJVbZ+nKScjIVfatlSaJ9BBiIbcW1rnOSF4F/OYGiFLQaCXyAUsLTggnAN9VOuMaBtuX1QmHwok RD4CIHzXChG5z37oWkRhxx5tCmdKNUSp7/tUYlQwQ/6z424JPtr+mlwwwbbGQj5CXwBjyPj4NQRmJ J7GZez7mPpk02W+jvgMnFrUaozhE7jPF9va+QZinMaxn0dGMSy5ExuHmdZ8APf7felTv9zGccGal3 le2JdHt0lJaGklvjwA6JcVACwXpugd+gAJQvuIL2C7r9eJgQscXQH0I+sxkrBjjE0ukW9gui7rMo9 DAoGnTzyZceA8lYh+AMxWeFiu/ZhSLCeAUex4hhPr6XsPPAqu0xRxNVAaS0J58pODvhCN/AFWziLP rMtYjsxD6y0dDpDeH2Cf+sxEyPmSYuIJbOi1zCmQc/DkbQg2FQ/O2RfgDP0Aj8eU+VpDmlpLvBkqe kTJpe5+r6xtz9A7VnCxlthfAJkz4JGRJfzVcEiHHK36BOgE2PYRPpIna0K5wAzGCLcWN6A6A3CRRu SJWo+NoybQfag9TA/CxymwTdnDWkh4cPOweckTRCkhzgH8K+ChxkKG2L4oQBlPp8B2G/sc02CDKTp xXExlOJ3q79vcpyGYlmelFOXRxyj/hwe+XnBhw6osY17wJfB/IB/3o2a14Hl8jNfqDx44iLN4w0aG AAAAAElFTkSuQmCC In-Reply-To: (Stefan Monnier's message of "Tue\, 02 Jan 2007 22\:56\:51 -0500") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux) X-Ovh-Remote: 82.230.255.91 (ivr94-6-82-230-255-91.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|H 0.5/N X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:64677 Archived-At: --===============1150681385== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Stefan Monnier writes: >> Since I started Elisp programming, I've always wondered why there is >> an opposition between the following lines of the manual: > >> -- Macro: defcustom option standard doc [keyword value]... >> [...]There is no need to start [the docstring] with a `*' > >> [and] >> (this is 3011 matches of bad-style according to the doc) > >> Is there any reason ? > > History. The * used to be necessary for M-x set-variable to be usable. > Now the * in defcustoms is just a relic and should slowly disappear. Why slowly? :-) Don't you think it can be disturbing for new users to see that star, and after a little search on the (info "(emacs)") to read: (it is an obsolete indicator that may eventually disappear.) And, reading that part of the manual, there is: The line that says you can customize the variable indicates that this variable is a user option. So the only documentation for `user options' is that some of them are customizable variable. Don't we want to talk about (defvar)s with a docstring starting by "*"? Won't the user be surprised to see that the completion list for M-x set-variable and M-x customize-variable aren't the same? Apart from that, why don't we propose in C-h v to modify user variables ((defvar)s with "*")? I propose the following change, if the idea is ok. --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: inline; filename=help.patch Content-Transfer-Encoding: quoted-printable Index: lisp/help-mode.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/help-mode.el,v retrieving revision 1.50 diff -c -r1.50 help-mode.el *** lisp/help-mode.el 21 Jul 2006 22:54:40 -0000 1.50 =2D-- lisp/help-mode.el 3 Jan 2007 11:00:09 -0000 *************** *** 139,144 **** =2D-- 139,154 ---- (customize-variable v)) 'help-echo (purecopy "mouse-2, RET: customize variable")) =20=20 + (define-button-type 'help-change-variable + :supertype 'help-xref + 'help-function (lambda (v) + (let ((read-variable (symbol-function 'read-variable))) + (fset 'read-variable (lambda (prompt &optional d-v) + (fset 'read-variable read-variable) + v)) + (call-interactively 'set-variable))) + 'help-echo (purecopy "mouse-2, RET: change user variable")) +=20 (define-button-type 'help-customize-face :supertype 'help-xref 'help-function (lambda (v) Index: lisp/help-fns.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/help-fns.el,v retrieving revision 1.94 diff -c -r1.94 help-fns.el *** lisp/help-fns.el 17 Dec 2006 22:14:11 -0000 1.94 =2D-- lisp/help-fns.el 3 Jan 2007 11:00:09 -0000 *************** *** 573,578 **** =2D-- 573,581 ---- (safe-var (get variable 'safe-local-variable)) (doc (or (documentation-property variable 'variable-do= cumentation) (documentation-property alias 'variable-docum= entation)))) + ;; If DOC starts with a `*' remove it. + (when (eq (aref doc 0) ?*) + (setq doc (substring doc 1))) (unless (eq alias variable) (princ (format "\nThis variable is an alias for `%s'.\n" = alias))) (if (or obsolete safe-var) *************** *** 603,609 **** (save-excursion (re-search-backward (concat "\\(" customize-label "\\)") nil t) ! (help-xref-button 1 'help-customize-variable variable))))) (print-help-return-message) (save-excursion (set-buffer standard-output) =2D-- 606,623 ---- (save-excursion (re-search-backward (concat "\\(" customize-label "\\)") nil t) ! (help-xref-button 1 'help-customize-variable variable)))) ! (if (user-variable-p variable) ! (let ((change-label "change")) ! (terpri) ! (terpri) ! (princ (concat "You can " change-label ! " at user level this variable.")) ! (with-current-buffer standard-output ! (save-excursion ! (re-search-backward ! (concat "\\(" change-label "\\)") nil t) ! (help-xref-button 1 'help-change-variable variable)))))) (print-help-return-message) (save-excursion (set-buffer standard-output) Index: lisp/ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/ChangeLog,v retrieving revision 1.10518 diff -C0 -r1.10518 ChangeLog *** lisp/ChangeLog 2 Jan 2007 10:16:04 -0000 1.10518 =2D-- lisp/ChangeLog 3 Jan 2007 11:00:33 -0000 *************** *** 0 **** =2D-- 1,9 ---- + 2007-01-03 Micha=EBl Cadilhac +=20 + * help-mode.el (help-change-variable): New. Call `set-variable' with + the variable name (first argument) fixed. +=20 + * help-fns.el (describe-variable): If the docstring starts with a star, + then remove it. + Propose the user to change (with `set-variable') user variables. +=20 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable =2D-=20 | Micha=EBl `Micha' Cadilhac | Un certain Blaise Pascal = | | Epita/LRDE Promo 2007 | etc... etc... = | | http://michael.cadilhac.name | -- Pr=E9vert (Les paris stupides) = | `--JID: michael.cadilhac@gmail.com--' - = --' --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFm44QUJhDmOfFA3URAsq0AKC9DfrGdiBUobw0os/3qnqwHOf0FgCgz8DP EBooQhmrYteXwnQSIsjifqE= =aQYo -----END PGP SIGNATURE----- --==-=-=-- --===============1150681385== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============1150681385==--