From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: About how misspelled word are displayed Date: Fri, 12 May 2017 15:08:44 -0700 (PDT) Message-ID: <262055bc-44b9-4b2b-932a-52b146a5916e@default> References: <3993ee96-42e7-e597-f7d0-306003faa235@alice.it> <40f5d8bd-8956-b3fa-1818-eb3622f6ff12@alice.it> <20170512141406.GA27429@tuxteam.de> <8479790d-443e-48fc-a59b-f14a917fafab@default> <8778c766-ce0a-4b42-939d-96b0f0b49a82@default> <87efvtzrw5.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1494626967 8556 195.159.176.226 (12 May 2017 22:09:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 12 May 2017 22:09:27 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "N. Raghavendra" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 13 00:09:21 2017 Return-path: Envelope-to: geh-help-gnu-emacs@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 1d9IkT-00020K-6e for geh-help-gnu-emacs@m.gmane.org; Sat, 13 May 2017 00:09:21 +0200 Original-Received: from localhost ([::1]:55462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9IkT-0001dw-TF for geh-help-gnu-emacs@m.gmane.org; Fri, 12 May 2017 18:09:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Ik1-0001dh-Gx for help-gnu-emacs@gnu.org; Fri, 12 May 2017 18:08:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Ijy-0008Kn-Cn for help-gnu-emacs@gnu.org; Fri, 12 May 2017 18:08:53 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:19505) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d9Ijy-0008Jt-2u for help-gnu-emacs@gnu.org; Fri, 12 May 2017 18:08:50 -0400 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v4CM8kl4025078 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 May 2017 22:08:47 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v4CM8kcA015835 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 May 2017 22:08:46 GMT Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v4CM8jes020948; Fri, 12 May 2017 22:08:46 GMT In-Reply-To: <87efvtzrw5.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6767.5000 (x86)] X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113013 Archived-At: > Evaluating (customize-set-variable option value) uses the :set property > of OPTION, but doesn't check that VALUE has the type specified in the > (defcustom option ...) expression. Correct. Likewise, `custom-set-variables'. They assume that when used non-interactively the new value is of the right type. This is perhaps a holdover from their Customize pedigree: if written by Customize, `custom-set-variables' uses a valid type, and `customize-set-variable' was probably expected to be used mostly interactively (and interactively it does provide some type checking). Please consider filing an enhancement request that would make them optionally check the type (e.g. by an optional argument): `M-x report-emacs-bug'. This needs to be optional not only for backward compatibility but also because this checking can slow things down considerably, and it is not needed at all for a `custom-set-variables' set by Customize. While waiting (... ;-)) you can define your own function, similar to `customize-set-variable' but which does the type checking. Here is the type-checking code from `set-variable': (let ((type (get variable 'custom-type))) (when type ; Match with custom type. (require 'cus-edit) (setq type (widget-convert type)) (unless (widget-apply type :match value) (error "Value `%S' does not match type %S of %S" value (car type) variable)))) > On the other hand, evaluating (set-variable option value) does > this type-checking, but ignores the :set property of OPTION. Correct. See these threads: http://lists.gnu.org/archive/html/emacs-devel/2010-10/msg00813.html http://lists.gnu.org/archive/html/emacs-devel/2006-06/msg00137.html http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00106.html http://lists.gnu.org/archive/html/emacs-devel/2015-10/msg01481.html Emacs Dev has several times discussed removing `set-variable' altogether. I'm in favor of keeping it - at least as long as it does things that `customize-set-variable' does not do. > So, is there a recommended way of setting an > option using Emacs Lisp directly (without going through customization > buffers), which ensures that the :set, :type, :initialize, and other > specifications of the option are respected? Not that I know of - not ready-made. See above.