From: uzibalqa <uzibalqa@proton.me>
To: Drew Adams <drew.adams@oracle.com>
Cc: Marcin Borkowski <mbork@mbork.pl>,
Robert Pluim <rpluim@gmail.com>,
uzibalqa via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org>
Subject: RE: [External] : Saving variables for use between emacs sessions
Date: Fri, 16 Sep 2022 00:56:59 +0000 [thread overview]
Message-ID: <fmjBUNtqMK3uxgv2Tc7hnrl7YkVNvJ2MnkdiJp9KGXMtxKaD44AGkNuuUVwV6Ech-jnJgbDHkMeDJMt00H4wbHIpxBloOaz5Am2JFqSJUHI=@proton.me> (raw)
In-Reply-To: <SJ0PR10MB54883D48F68387699BE6CA59F3499@SJ0PR10MB5488.namprd10.prod.outlook.com>
------- Original Message -------
On Thursday, September 15th, 2022 at 5:23 PM, Drew Adams <drew.adams@oracle.com> wrote:
> > Right, I want to have a user option, but although I want to allow a user
> > 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.
> >
> > How does one let a user change a value, and how can I save it
> > automatically as well?
>
>
> Just define the option with defcustom.
>
> 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".
>
> 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 from terminal,
the values updated by the function are not reflected in `M-x customize-group`.
next prev parent reply other threads:[~2022-09-16 0:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 10:54 Saving variables for use between emacs sessions uzibalqa
2022-09-15 11:46 ` [External] : " Drew Adams
2022-09-15 12:49 ` Robert Pluim
2022-09-15 13:26 ` Marcin Borkowski
2022-09-15 14:57 ` Drew Adams
2022-09-15 16:51 ` uzibalqa
2022-09-15 17:23 ` Drew Adams
2022-09-16 0:56 ` uzibalqa [this message]
2022-09-16 2:19 ` Drew Adams
2022-09-16 2:40 ` uzibalqa
2022-09-16 7:30 ` Jean Louis
2022-09-16 8:05 ` uzibalqa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='fmjBUNtqMK3uxgv2Tc7hnrl7YkVNvJ2MnkdiJp9KGXMtxKaD44AGkNuuUVwV6Ech-jnJgbDHkMeDJMt00H4wbHIpxBloOaz5Am2JFqSJUHI=@proton.me' \
--to=uzibalqa@proton.me \
--cc=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
--cc=mbork@mbork.pl \
--cc=rpluim@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.