From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.help Subject: Re: How to save custom variable programmatically? Date: Tue, 10 Nov 2020 11:43:54 +0100 Message-ID: <87wnyth4ph.fsf@gmail.com> 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="39540"; mail-complaints-to="usenet@ciao.gmane.io" Cc: GNU Emacs Help To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 10 11:45:46 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 1kcR9m-000ACZ-9O for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 10 Nov 2020 11:45:46 +0100 Original-Received: from localhost ([::1]:44394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcR9l-0008Sb-Az for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 10 Nov 2020 05:45:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcR84-0007RT-Av for help-gnu-emacs@gnu.org; Tue, 10 Nov 2020 05:44:00 -0500 Original-Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:46933) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kcR82-0002y4-Km for help-gnu-emacs@gnu.org; Tue, 10 Nov 2020 05:43:59 -0500 Original-Received: by mail-wr1-x42d.google.com with SMTP id d12so10613072wrr.13 for ; Tue, 10 Nov 2020 02:43:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=pEWezIG1ZWepTOvlO62QNhppO05lbEzejs/NiJuYAyo=; b=OeWUUqeTKE8ZD8+l34JLUQST8AMjPAP14FYDitIDNRie/TXKjlEE0+im4BoA4jp3m7 Unv9zhWqPTehXEZs9zxITUSwmucsLqAtzX5tU1n38ci5qJn+XKV49oATXUl+pY909UFL tamWukcY8Wq0YgGhQlKADjOaS35AMoEUw252siXPyzdLs73JKxQFIR3oHODNuFin3wm9 XY6XXO1T4i9A09L5bKgo0bNTjQMdc+PiWAgrcDUdUsgZxBvZMigR9pACON5FOysVVh2i ynmqWX7GmRtfHQTK8zvdlm89Z1h/woyrtsJVg8WwcLcns4b47oXM+ZL8gf4QfsqWZfac t+rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=pEWezIG1ZWepTOvlO62QNhppO05lbEzejs/NiJuYAyo=; b=k6jYodm8ptIJFqVuTf3BqysksNuIFTdIhpuer6fOZ+RR3UHmyHAWt0juds6K5pbvJr WN1jHStgueQg5zTIC+cAQZcFl9C3KV7yC2pRCqHEwmJlZRbJgiY+SoLVDs6mBgSSDL2t 2p2afmePnj2eDEM7RjreA4Zzv+8Qju9o9U+w2rCa+iN2BdedVUnkfyB7tq1MG2tOBnRA pv4it5NiHcWGjCPnsPx6ntzoz3UgNFALpmLCFxCxp+0tEGzsJV/8TBurwh8cczYKtFBA NvlNCiJlhA6XpA0Q96T+lcd7ZGgQ/RMEOVrfx1SWlf6lnR717hWJHtYk2N4YBmaK2JKv 1mCg== X-Gm-Message-State: AOAM530Z4Fx5Ng5rcZRzQ4ga7SBtGGo3HYy+ZeVPq+QK6JbUHmsJP5h5 a8TuChG9puOQhxpfCuYXleutEmuc/eo= X-Google-Smtp-Source: ABdhPJyIxV8FVa6o72DnyJKrHg4JZIIaf82dxqIsjGQBRJ8s2+4u8W4/rqjL5LwUh8pi5UK0EVfIlg== X-Received: by 2002:adf:d0cf:: with SMTP id z15mr24701959wrh.213.1605005036459; Tue, 10 Nov 2020 02:43:56 -0800 (PST) Original-Received: from rltb ([2a01:e34:ecfc:a860:8488:2af3:7544:25ef]) by smtp.gmail.com with ESMTPSA id o7sm17317962wrp.23.2020.11.10.02.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 02:43:55 -0800 (PST) Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: (Jean Louis's message of "Tue, 10 Nov 2020 10:51:07 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=rpluim@gmail.com; helo=mail-wr1-x42d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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:125172 Archived-At: Jean Louis writes: > 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. > > Upon changing it, I would like programatically to save it for future. > > Should I use below function? Or maybe something else is recommended? > > (defun customize-save-variable (variable value &optional comment) > That=CA=BCs what lots of code in Emacs uses. > This way it is not working: >=20=20=20 > (require 'cus-edit) > (customize-save hyperscope-default-server "localhost") What's not working apart from the fact that customize-save doesn=CA=BCt exist? Or did you mean (customize-save-variable 'hyperscope-default-server "localhost") Robert