From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#31558: 27.0; `custom-file' settings messed up by Emacs 27 Date: Wed, 23 May 2018 08:47:38 -0700 (PDT) Message-ID: References: <5cd8f30c-a341-40c9-bb1f-441425e1a160@default> <87wovug2pn.fsf@gmx.de> <8f1290c2-ad20-4ba9-809d-154188bae0fb@default> <87fu2ih1dg.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1527090420 14646 195.159.176.226 (23 May 2018 15:47:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 23 May 2018 15:47:00 +0000 (UTC) Cc: 31558@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 23 17:46:55 2018 Return-path: Envelope-to: geb-bug-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 1fLVyY-0003hm-Fp for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 May 2018 17:46:55 +0200 Original-Received: from localhost ([::1]:34220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLW0f-0005XS-KG for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 May 2018 11:49:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLVzj-00057D-OS for bug-gnu-emacs@gnu.org; Wed, 23 May 2018 11:48:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLVze-0003NQ-FM for bug-gnu-emacs@gnu.org; Wed, 23 May 2018 11:48:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37652) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fLVze-0003Mz-BW for bug-gnu-emacs@gnu.org; Wed, 23 May 2018 11:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fLVzd-0003Ql-WE for bug-gnu-emacs@gnu.org; Wed, 23 May 2018 11:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 May 2018 15:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31558 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31558-submit@debbugs.gnu.org id=B31558.152709047113171 (code B ref 31558); Wed, 23 May 2018 15:48:01 +0000 Original-Received: (at 31558) by debbugs.gnu.org; 23 May 2018 15:47:51 +0000 Original-Received: from localhost ([127.0.0.1]:45549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLVzT-0003QN-07 for submit@debbugs.gnu.org; Wed, 23 May 2018 11:47:51 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:34540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLVzP-0003Q7-8a for 31558@debbugs.gnu.org; Wed, 23 May 2018 11:47:49 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4NFfLJD108728; Wed, 23 May 2018 15:47:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=mlY9KC4aFVSMjxRi6/lFgUD6Wrc+nUSaT/F4R+gwcnM=; b=d0zKDn7GcAumPWxrFMpt0SwW3IQ1iM7EVnL+n/b38jWyXAuxy12XdSI6b3FORPx7zel5 5spmCk0zZOa390hu4uf479bPX4FXfd5ulyNasISYG0zwBUKmOA9iuRVX0yQJKBAeOb8Y U/BMfoLMYOTS8naHqwat0QRRlsrGgOJr5eALQQ0Jqc6jXyfbvozBm+06Ad5mMFFOKhAx HJM/cPwDWBj2GTELda3s3MOeZ6twLinW9qEFamOqhv0HgB2joYnnb7UH32gwGMgRNnSe irrWFpRQl+IkpxC/vrO/MHvw5N9XKba+WgzIFNKjy0KORbAildiB/L+c1BY/2uJFEeTj fA== Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2j4nh7mncc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 May 2018 15:47:41 +0000 Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4NFlemY025394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 May 2018 15:47:40 GMT Original-Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w4NFldON004029; Wed, 23 May 2018 15:47:39 GMT In-Reply-To: <87fu2ih1dg.fsf@gmx.de> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4690.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8902 signatures=668700 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805230155 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:146434 Archived-At: > >> Maybe you put at the beginning of your custom file > >> (or (locate-library "tramp") (provide 'tramp)) > > > > Yes, I guess that would work and is better than nothing, > > but it seems wrong to tell Emacs that something has > > been provided that has not. ;-) > > > > Worse than style or ugliness, though, is that there > > might be code here or there that tests > > (featurep 'tramp) and acts accordingly. That code > > surely will be led astray by such a hack. >=20 > We're spaeking about Emacs < 22. How many such Emacsen are in use today, > which also use packages checking for Tramp? Yes, I said at the outset: Admittedly, this is probably not a problem that others will run into often. But it is quite annoying for me. I end up trying to remember to do this immediately after saving any (!) user option in Emacs 26+: Open my `custom-file' and delete the offending parts of the sexp. Otherwise, when I later open Emacs 20 I get the error. But when you say "which also use packages checking for Tramp", what it really comes down to is being able to use the same `custom-file' (which has only stuff that is inserted automatically by Emacs) with multiple Emacs releases (in this case including Emacs 20). > > Seems like there should be a way for Tramp and > > Customize to collaborate to produce a conditional > > sexp that does not require tramp unconditionally. > > E.g., one that tests (at time of evaluating > > `custom-set-variables') whether Tramp is even > > included in the Emacs version. > > > > Or maybe somehow just use a soft-require - the > > equivalent of (require 'tramp nil t)? Would that > > work for Tramp, if it were possible for > > `custom-set-variables'? > > > > Seems like something is missing from Emacs for > > such cases. A library wants to ensure that it is > > loaded before evaluating a sexp that sets one of > > its user options. But if loading the library is > > impossible then setting the variable is benign, > > so a soft-require is all that is really needed. >=20 > If there were such a possibility I would consider it. Can we perhaps consider this bug report as a request for such an enhancement? > But it must already exist for Emacsen < 22; No, I don't think so. (But I'm not sure what you mean.) It would be enough that such a mechanism exists for Emacs 26+ or whatever. > I doubt we will change them if it's not possible yet. Isn't it already possible to DTRT here (use a soft-require instead of a hard-require)? Can't Tramp, for example, just use a :set, or an :initialize, function that does a soft-require, instead of using :require, which puts a hard-require into `custom-file'? Something like this, for example: (defcustom tramp-verbose 3 "..." :group 'tramp :type 'integer :set (lambda (sym val) (when (require 'tramp nil t) (custom-set-default sym val))) :initialize 'custom-initialize-set) > And given the low likelihood plus the existing workaround, > I believe it is not worth to spend time for this. Sorry. I think the defcustom above would fit the bill, and it would require no time to implement. It just sets the variable normally, but only if Tramp can first be loaded. It does nothing is Tramp is not available. (boundp 'tramp-verbose) returns nil in that case. (Am I missing something?)