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 13:34:28 -0700 (PDT) Message-ID: <557766eb-48c0-4eaf-8c08-459b2376da8c@default> References: <3993ee96-42e7-e597-f7d0-306003faa235@alice.it> <4bf8d1cf-5287-f74e-d6c5-938bbf295d6c@alice.it> 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 1494621319 2849 195.159.176.226 (12 May 2017 20:35:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 12 May 2017 20:35:19 +0000 (UTC) To: Angelo Graziosi , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 12 22:35:13 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 1d9HHM-0000Vy-DJ for geh-help-gnu-emacs@m.gmane.org; Fri, 12 May 2017 22:35:12 +0200 Original-Received: from localhost ([::1]:55197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9HHO-0003GB-R2 for geh-help-gnu-emacs@m.gmane.org; Fri, 12 May 2017 16:35:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9HGq-0003Ft-Hj for help-gnu-emacs@gnu.org; Fri, 12 May 2017 16:34:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9HGl-0006mh-LR for help-gnu-emacs@gnu.org; Fri, 12 May 2017 16:34:40 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:22256) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d9HGl-0006lX-Af for help-gnu-emacs@gnu.org; Fri, 12 May 2017 16:34:35 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v4CKYUXE004606 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 May 2017 20:34:31 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v4CKYUdN025626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 May 2017 20:34:30 GMT Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v4CKYTgV002608; Fri, 12 May 2017 20:34:29 GMT In-Reply-To: <4bf8d1cf-5287-f74e-d6c5-938bbf295d6c@alice.it> 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: userv0021.oracle.com [156.151.31.71] 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:113007 Archived-At: > > And for stuff that is not so simple, it is better to rely > > on Customize. >=20 > Yes, you are right but I have spent all the afternoon trying to find in > 'Options - Customize Emacs' the things to customize and how...=20 Yes, it can be difficult to find out which things to customize. That's unrelated to the question of whether to use Customize or Lisp to set them. If you know which option or face you want to change then the previously raised question comes into play: _how_ to change it. > In short I have to use something like this: >=20 > (custom-set-faces > '(flyspell-duplicate ((t (:foreground "Gold3" :underline t :weight > normal)))) > '(flyspell-incorrect ((t (:foreground "OrangeRed" :underline t > :weight normal))))) You can write that by hand, or you can let Customize take care of it for you. That was the choice being discussed. > Really I already have in my init.el: >=20 > ;; Instead of saving on ~/.emacs.d/init.el > (setq custom-file "~/.emacs.d/custom.el") > (load custom-file) Good. > this because I have installed packages from MELPA and I didn't > want my init file changed silently (*). IOW, we now have not only Customize writing to your `custom-file' or init file; we have also the package system doing that. It's questionable whether that's a great idea - a question that was discussed briefly on emacs-devel@gnu.org: http://lists.gnu.org/archive/html/emacs-devel/2016-02/msg00958.html One of the Emacs maintainers asked there whether we shouldn't use a different file for this. But AFAIK that thread went nowhere. An earlier thread also broached the question somewhat: http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg00534.html http://lists.gnu.org/archive/html/emacs-devel/2015-03/msg01010.html Anyway, this is a side question, here. > For this reasons, usually, I want to put all customizations, > decided by me, in init.el leaving all the rest in custom.el. Decided by you or coded by you? If you mean the latter, then yes, exactly. And your init file can have conditional code. (And you can have multiple init files, e.g. for different platforms.) And your init file can load other Lisp files you might write or use. You can do all kinds of things in your init file. But if you mean the former (decided by you but not necessarily coded by you) then the previous discussion applies: Why not use Customize to do that? Whatever face appearances you decide on, Customize will save them to your `custom-file', leaving your init file alone. Customize and the package system will (should - otherwise there is an Emacs bug) play well together wrt updating that file. > In this case, since _I_ want to change 'flyspell-duplicate', > 'flyspell-incorrect', I would to add the code in init.el without > duplicating the "custom-set-faces" (one in init.el and one in > custom.el (*)) You are right to not have another `custom-set-faces' in the particular file (init file or `custom-file') that is updated by Customize. That's the purpose of the warning in the automatically inserted comment. However, there is nothing wrong with invoking multiple `custom-set-faces' sexps, including the case where the same face is updated. The reason for that warning is that if Customize writes to that file then it wipes out all `custom-set-faces' occurrences except the last. IOW, the problem is not invoking that function more than once; it is that Customize rewrites the file, wiping stuff out. That's the reason to sacrifice a separate file, `custom-file', to Customize: to keep its hands off your init file. It won't bother your init file if `custom-file' is defined. IMHO, everyone should have a `custom-file'. Give that to Customize to fiddle with. Keep it away from your hand-written code, and keep your code away from `custom-file'. Never the twain should meet. In addition to reserving your init file for your own code, that file can load other Lisp files, and they too can use `custom-set-faces' or `custom-set-variables' if you like.