From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: [External] : Re: Is there a way of setting a variable only when it exists? Date: Tue, 15 Mar 2022 15:38:12 +0000 Message-ID: References: <87lexdul8e.fsf@mbork.pl> <878rtcir1h.fsf@zoho.eu> <87a6drviwp.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9011"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "help-gnu-emacs@gnu.org" To: Marcin Borkowski , Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 15 16:49:27 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nU9QM-00028h-VM for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 15 Mar 2022 16:49:27 +0100 Original-Received: from localhost ([::1]:38698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU9QL-00056s-Ss for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 15 Mar 2022 11:49:25 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU9Fc-0008Tl-Du for help-gnu-emacs@gnu.org; Tue, 15 Mar 2022 11:38:20 -0400 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:62394) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU9Fa-0002Dl-1I for help-gnu-emacs@gnu.org; Tue, 15 Mar 2022 11:38:19 -0400 Original-Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22FFX3uI023007; Tue, 15 Mar 2022 15:38:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=gjFthW82LHBAGSxjHwvRdoLtV+xSEjSc/acDZMPeNNc=; b=k3il0uaNHwDFAjqpwdhjBCzzewo593IzLaVQqMlO/dUubXpYL/A5/OOJobNMUlEcGn33 gZNpQ760gXBdDPd3SZLAvuwpd8cbcUZK9JAL/icKmZVmCacrImkP6IFJDEtM54p/oAk0 /Lh9yeDJnKwV2paVD2+OOpm/KRTO8HKqJwdiSzwh8Am3TXyYSYMHW6s8O2WEF8Qtmep2 QAmZo16+bNcfOAoNazxonqTwS6C2+dW/FJm6fk2agX9Je0kfz+15sIK/qEWufZ2tJev8 vMZiJG22wktO8e+0tnjS9HSys0DpIXF/2anMqoCSSzC2dVyMkc6DBRilQxFjb15PSGYx /A== Original-Received: from userp3030.oracle.com ([156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3et60rbenb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Mar 2022 15:38:14 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 22FFV55w105239; Tue, 15 Mar 2022 15:38:13 GMT Original-Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2040.outbound.protection.outlook.com [104.47.56.40]) by userp3030.oracle.com with ESMTP id 3et65pnup3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Mar 2022 15:38:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L3cib5JFAAarTpFUoXSfixaaddbBDGQw7h3NCJbLE6QTtIatCjDFY9wvqBXqcSW5NHeIe+Vc/h2G/poHl3RcN1oI4HvAOR5ttf7ldNi4UquVRiEc6Xrnj/hKDfxyXbUwmLnyjte8ikbDQLqFao3TJEFwakZ2kKqVCmxdAlLde1fXl7KZQSqVm6zsEwyGcwxT7PAH7LQ7l2d82PODpUE+tPNO6HuLqqy1Y79oEQdy/x/f+xWOQnbenkzzx2OToN/SpnZzevkDXhPMRTX4yumuJ53vuwPz0EgD2wQGU907qafqt+kMdMANkA8UVq/E8NmogAT6TZR+koIt2X36EifQGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gjFthW82LHBAGSxjHwvRdoLtV+xSEjSc/acDZMPeNNc=; b=fUF8ZUsM35I+ERAI7U9NLvdXo67oG1RXnYVGIo7tIFWklutMAk8ij2TI03G7DNui0Oyf/jIHYx3WBHavG9tS2wNjoNuG1GWMKrsMIF4UryW57twS/UZJr6yZdz+ZUz2R+y5sMAwOn4vjV5GJlPui7+YnQdYWxmHCKUF9rkDQBQ/Uq9qaIVPGhTC6kRlO4GusYi6RJXutjzrJM7EUtJg36sOf5vHg+l1upp+9cImDT2nriGY6YBG26bRzGBG/sbqBNRVWjMtOZ+FeXCm1Zaov1z0ix0Cs9ANwVG67QDqJdmZUS/hH+/lUkXxyoin9YaP12VvownGhes37LlWYwDXG4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gjFthW82LHBAGSxjHwvRdoLtV+xSEjSc/acDZMPeNNc=; b=EG2Ux0Qn+VqkxD8xN43DyS/MO6GrG4qlaE8/U/Heecf+v5ax1TxH5XSA2zgx8tze76oDdyxC7UCO+D6GgBMPHMlTRV/vo8L+lX7vFoL1tQ5CF3NaOQGTSGoGODlbOUg3zvNfLgZ3WeORiI235WCD2i7xSVNxwvy9tuwQ3l7ew4I= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BY5PR10MB3889.namprd10.prod.outlook.com (2603:10b6:a03:1b1::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.26; Tue, 15 Mar 2022 15:38:12 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::ec69:8077:89b0:4379]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::ec69:8077:89b0:4379%7]) with mapi id 15.20.5081.014; Tue, 15 Mar 2022 15:38:12 +0000 Thread-Topic: [External] : Re: Is there a way of setting a variable only when it exists? Thread-Index: AQHYODxttXhy1SnGSEWiKNiktNM646zAk+0Q In-Reply-To: <87a6drviwp.fsf@mbork.pl> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 256c2614-2884-46d9-c943-08da0699d04d x-ms-traffictypediagnostic: BY5PR10MB3889:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sWXvf8450c+lSJge5lV4S8K+hMB0Syk21SLlpTXDeY4pRzIYtWFNAU1Rf5Wwv2njbcldhsvgpuaiW5xkAMwCElolKyoH/PyRYPZZ2iaVPGB/8AigQtg6yRnM01ymYiUiliMdFJzXfRkv0u1puwOtO6uJLYZpIuLkbqHc/M7P669CaAxAV+X+N+6VsGOcxqfARZ6gSMWJCDdDcD1+4/HJdi12wHIDnZUz8+xnhlEl0Ox07jl8mu2Yd1SieFOOCkjqbNUDVJZ5c2kFi2FK8doiVucwBL5bKbX7Jz4Im+iCnvN0JH4L/Sk2cefrjT8rQ1Jq7gdpKKk7c3xhmW9CMEabQhKq5K96um4cwF8LFVTtwZbiQnTH97WQGBz5cxN6qiziEXsKrPydg/Pq2FbJMnGJ5mXeMRKccqTY19CD4vmOjjRh+jU2ZF8HKli7YAU+VcLNeYGDBHBq8WwyFgGXnzC/0TGcAPfIABikmKvqzypA9+Cn77Knp9HJkfYv2RZDVMB8W5VW3Bqui6jVudgpvNJO8oe92TglJ7LZc1GdnWxmPrhxJ+/yWJQ9a6wwExs1Wri2CcpK72MAnqiBx0etwfuntyL0FTV6GhGn8NuovqoDxAs3A+OkHElcApGMF0XpOxEj5w1w0tOiVv2AYCCBE09B36Bh/FbWrY4WKkhZR2HQFE3wlwnSoBCiYklMUwpdf5DRteW+mfHGINqYgIRKcQPdKw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(38070700005)(508600001)(71200400001)(38100700002)(76116006)(86362001)(122000001)(64756008)(66556008)(66476007)(66446008)(66946007)(316002)(110136005)(8676002)(26005)(186003)(4326008)(33656002)(9686003)(7696005)(6506007)(4744005)(2906002)(8936002)(44832011)(52536014)(55016003)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?TA9RfBOtoKQWu4EhtlEFPOO7cAnWPPVgPpSYYhMG6JxPbW3TPvei04uRiNhC?= =?us-ascii?Q?D1xGfUculyxGTe4WYALmWaaSAKbHfmY68ciur36GkRvoiL8k9xKPeU1oYVgW?= =?us-ascii?Q?ffvxUcy47dNsEHsmKYbXkygRG+G+fF6jeD8yoflEsHM+2mpB79wLcsfvI3RD?= =?us-ascii?Q?vI0M2pf7qkAeeMRrMFYKcrUAGep6KVNx02ObLRRlNBb1aLVG0kdf+D5LG5Jl?= =?us-ascii?Q?c31NZPZLPTgSv0q3cGt3fY4oR4O82zzNJFtF7RkbcfgZHUpO6vbBgBPx2t4r?= =?us-ascii?Q?cJt261vD+tLCVe6rWtSaG7nfrWeh3vqiPiIdw7TkNhwD2xni4J3QNd6stRou?= =?us-ascii?Q?cA3+/G9V7oKLk3rQrkLPvfiLXCu3vBNd6FX+3vjjunSuYS2MYW/gw9Sc8yrJ?= =?us-ascii?Q?xsHcIShfacASdzaQY85lqgbheDutOyndkBnNH1rr8RshkOB7O5mxtdPfZrv6?= =?us-ascii?Q?8Vme+AJw5/ckprElbe5fIEBXts6N4dnbVP0Op/6U9H4s2pQSsPJy9lslZ0mt?= =?us-ascii?Q?C5vKfydblSQ/Vetag/4pcsKhvCzEpL8/LPJpoAkbr2TGO0y5ngGu6OxSedG2?= =?us-ascii?Q?bYkU5d0OR42ZvYq1JXeYXHqH3KrhOXK7kkQ6XPbpCrGYoRyvPnnrlKVt2JSE?= =?us-ascii?Q?Yl X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 256c2614-2884-46d9-c943-08da0699d04d X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2022 15:38:12.0399 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: n6VmZwHdB/MNTf+rwDTHbw+9VWxe6SjF6FCQqXIf1gH6THM07nW0Kpksk/2gMMQFc6raQkEvhaqwjSvmo7lYsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB3889 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10287 signatures=693139 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=770 phishscore=0 suspectscore=0 adultscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203150101 X-Proofpoint-GUID: ygd7Ld5JDWOyT0zSiXKiM_3UuQgqgD9l X-Proofpoint-ORIG-GUID: ygd7Ld5JDWOyT0zSiXKiM_3UuQgqgD9l Received-SPF: pass client-ip=205.220.177.32; envelope-from=drew.adams@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:136590 Archived-At: > What if it's an internal Emacs variable which might become a user > option one day (I submitted a bug report about it) and then my > customization silently disappears? It's the "silently" part I > want to guard against... What do you mean by "an internal Emacs variable"? If it's a defvar then Emacs's predefined defvar has no effect if you defvar the variable before Emacs does. And it has no effect if you setq the var before or after Emacs defvars it (as long as Emacs doesn't _use_ it before you setq it). If Emacs later changes it to a defcustom, the same things apply. However, if the defcustom has a :set function then your own setting of it might no longer be appropriate ("valid").