[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : Saving variables for use between emacs sessions
From: |
uzibalqa |
Subject: |
RE: [External] : Saving variables for use between emacs sessions |
Date: |
Fri, 16 Sep 2022 00:56:59 +0000 |
------- 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`.
- Saving variables for use between emacs sessions, uzibalqa, 2022/09/15
- RE: [External] : Saving variables for use between emacs sessions, Drew Adams, 2022/09/15
- Re: [External] : Saving variables for use between emacs sessions, Robert Pluim, 2022/09/15
- Re: [External] : Saving variables for use between emacs sessions, Marcin Borkowski, 2022/09/15
- RE: [External] : Saving variables for use between emacs sessions, Drew Adams, 2022/09/15
- Re: [External] : Saving variables for use between emacs sessions, uzibalqa, 2022/09/15
- RE: [External] : Saving variables for use between emacs sessions, Drew Adams, 2022/09/15
- RE: [External] : Saving variables for use between emacs sessions,
uzibalqa <=
- RE: [External] : Saving variables for use between emacs sessions, Drew Adams, 2022/09/15
- RE: [External] : Saving variables for use between emacs sessions, uzibalqa, 2022/09/15
- Re: [External] : Saving variables for use between emacs sessions, Jean Louis, 2022/09/16
- Re: [External] : Saving variables for use between emacs sessions, uzibalqa, 2022/09/16