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: How to save custom variable programmatically? Date: Tue, 10 Nov 2020 08:24:25 -0800 (PST) Message-ID: <31315912-2ddd-455e-912d-a5d0e405cf25@default> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="916"; mail-complaints-to="usenet@ciao.gmane.io" To: Jean Louis , GNU Emacs Help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 10 17:25:23 2020 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 1kcWSP-00005c-9b for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 10 Nov 2020 17:25:21 +0100 Original-Received: from localhost ([::1]:41690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcWSO-0005GO-6o for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 10 Nov 2020 11:25:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcWRe-0005Eo-6w for help-gnu-emacs@gnu.org; Tue, 10 Nov 2020 11:24:34 -0500 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:59800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcWRa-0002PP-5a for help-gnu-emacs@gnu.org; Tue, 10 Nov 2020 11:24:33 -0500 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0AAGNv9X029614; Tue, 10 Nov 2020 16:24:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=9Ot48ttdqpylRCGRckVDloHEjckKk2NRV/dz7d82vE0=; b=YZDWiDFCc2ZD+SHH1sQb0fUGufuGUX4ECZJgEaSrwR6bkJLlgtgorhFhk2QqtQBbmf6t 1islZSYLXV8OzMhVSdnzNkK7qa9l5LNThEmCVkRc4PXuhA/jqQRmD7Hs9DHks8yjE05j tvEb/kGgwQPh0JmiDQ+p0KT6JSmTeat+lvHV5BKaHPfEn6br3rfMEyeuYn/ufTq4/ZRM FvxPJaZLlwaJb58a5zdFOo7KwGjM5AD8V6AxCnlX82qK4tc4AOmqASlRsw6DKQlBYyvz xhX1JAjcUjT2su0R83TnCStaSTDmWqyNLjDNjFvgoC5gJmSAciR/CDGMnKNK62ways7t SQ== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 34nh3avpby-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 10 Nov 2020 16:24:28 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0AAGErGm043061; Tue, 10 Nov 2020 16:24:28 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 34p5g0hhmq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Nov 2020 16:24:27 +0000 Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0AAGOQIu024508; Tue, 10 Nov 2020 16:24:26 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5071.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9801 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 malwarescore=0 adultscore=0 phishscore=0 bulkscore=0 mlxlogscore=876 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011100115 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9801 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 mlxscore=0 spamscore=0 suspectscore=0 mlxlogscore=890 impostorscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011100116 Received-SPF: pass client-ip=141.146.126.79; envelope-from=drew.adams@oracle.com; helo=aserp2130.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/10 11:24:29 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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:125195 Archived-At: > I would like to use custom variables in such way to ask user > pragmatically, not through customize interface, to change a > variable. This could be for example user's location. >=20 > Upon changing it, I would like programatically to save it for future. >=20 > Should I use below function? Or maybe something else is recommended? >=20 > (defun customize-save-variable (variable value &optional comment) >=20 > This way it is not working: >=20 > (require 'cus-edit) > (customize-save hyperscope-default-server "localhost") >=20 > Any good way? Michael has given the answer: `customize-save-variable'. ___ This page has more on the topic of Customize and saving, if you're interested. (Just one opinion.) https://www.emacswiki.org/emacs/CustomizingAndSaving