From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: uzibalqa Newsgroups: gmane.emacs.help Subject: RE: [External] : Saving variables for use between emacs sessions Date: Fri, 16 Sep 2022 00:56:59 +0000 Message-ID: References: <87fsgskdk4.fsf@gmail.com> <87v8po6a5u.fsf@mbork.pl> <9NtSR1Mo-D0FKDHQrU7DS26HNA_Bzp59Tgk_tXgVrNdUBd_k7tmn3TDbA-nZ2ttXKMq1cZYjgsQaGuxbY5ngGZoUg1QAwumZu3BL7Slg8z8=@proton.me> 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="21128"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Marcin Borkowski , Robert Pluim , uzibalqa via Users list for the GNU Emacs text editor To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 16 02:57:51 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 1oYzfy-0005NF-BV for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 02:57:50 +0200 Original-Received: from localhost ([::1]:41442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYzfx-0006Qq-96 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 15 Sep 2022 20:57:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYzfR-0006QZ-Aq for help-gnu-emacs@gnu.org; Thu, 15 Sep 2022 20:57:17 -0400 Original-Received: from mail-4027.protonmail.ch ([185.70.40.27]:41549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYzfN-0000eK-06 for help-gnu-emacs@gnu.org; Thu, 15 Sep 2022 20:57:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1663289828; x=1663549028; bh=M14Sibyy04yWyHqDygbybMRjOiyYJ2J9yNF8nQfWrOg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=WNEN771Rv6nmazrfcJQIJUkLclQPigHyESNl9+qIed0iRYIwkyOxyWvlCI/LKntJr X6cP1qBtkXS4VbzLV2VrjAZkM7QDoPqroAM3KWYZlZITlmeXFAb7TWyWbvaJa9ga2A ETEpZRue1HNW2VtbO7jkj03uIUAGfHgcCdilDoGKr3yT8n/i/1KSobpt6+w1inX4Ay LQVtyrhwGB7YrR+TbF2y8+f5caa6+Bol2rjJQRNhADPxP/eSJp3rZvH4qrEhiUj7Z9 JIOj18j8P0tzo2sgNmRL0BYFElpxWX1kuhSTUPquyTeOcRgBHSDeeEpSqQCtrIcFB6 QVschlZpeq7pg== In-Reply-To: Feedback-ID: 52887082:user:proton Received-SPF: pass client-ip=185.70.40.27; envelope-from=uzibalqa@proton.me; helo=mail-4027.protonmail.ch 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, 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.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:139501 Archived-At: ------- Original Message ------- On Thursday, September 15th, 2022 at 5:23 PM, Drew Adams wrote: > > Right, I want to have a user option, but although I want to allow a use= r > > to set the value, > > I also would like to set a value in an automatic way, using a function > > that does the > > necessary calculations, and stares the answer in the variable. > >=20 > > How does one let a user change a value, and how can I save it > > automatically as well? >=20 >=20 > Just define the option with defcustom. >=20 > Users can use Customize to change the > value and save that new setting to their > `custom-file' or init file. Or they can use` custom*' functions to > set and to save. Or you can use such > functions to do that for them "in an > automatic way". >=20 > Just look into what's available - it's > all there. You, yourself, can easily > check it out. I have coded as follows (defgroup tpframe-pos nil "Set position of frame." :group 'convenience) (defcustom tpfxpos 8 "X position of initial frame." :group 'tpframe-pos :type 'integer) (defcustom tpfypos 8 "Y position of initial frame." :group 'tpframe-pos :type 'integer) Then I have a function that changes the values with (setq tpfxpos nlft) and (setq tpfypos ntop) The difficulty that that after I run another the command emacs again in fro= m terminal, the values updated by the function are not reflected in `M-x customize-grou= p`.