unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Updating defcustom variables in elisp code
@ 2022-09-18 14:29 uzibalqa
  2022-09-19 10:02 ` Jean Louis
  0 siblings, 1 reply; 3+ messages in thread
From: uzibalqa @ 2022-09-18 14:29 UTC (permalink / raw)
  To: uzibalqa via Users list for the GNU Emacs text editor


Have used defcustom as follows

(defcustom px-frame-initpos (cons 8 8)
  "Position of initial frame."
  :type 'sexp
  :group 'px-frame)

Then inside some function, I want to reset the value of "px-frame-initpos".
Have been using 

(custom-declare-variable 'px-frame-initpos (cons lft top) "DESC")

Perhaps using "custom-declare-variable" is not the appropriate thing to do, as it seems 
that it is declaring the variable from scratch, needing also ":type" and ":group".  






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Updating defcustom variables in elisp code
  2022-09-18 14:29 Updating defcustom variables in elisp code uzibalqa
@ 2022-09-19 10:02 ` Jean Louis
  2022-09-19 19:14   ` uzibalqa
  0 siblings, 1 reply; 3+ messages in thread
From: Jean Louis @ 2022-09-19 10:02 UTC (permalink / raw)
  To: uzibalqa; +Cc: uzibalqa via Users list for the GNU Emacs text editor

Do this:

{M-x customize-group RET savehist RET}

Find:

Hide Savehist Additional Variables:
Repeat:
[INS] [DEL] Variable: rcd-sample
[INS]
   [ State ]: SET for current session only.
   List of additional variables to save. Hide
   Each element is a variable that will be persisted across Emacs
   sessions that use Savehist.
   
   An element may be variable name (a symbol) or a cons cell of the form
   (VAR . MAX-SIZE), which means to truncate VAR’s value to at most
   MAX-SIZE elements (if the value is a list) before saving the value.

As that can save variables.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Updating defcustom variables in elisp code
  2022-09-19 10:02 ` Jean Louis
@ 2022-09-19 19:14   ` uzibalqa
  0 siblings, 0 replies; 3+ messages in thread
From: uzibalqa @ 2022-09-19 19:14 UTC (permalink / raw)
  To: Jean Louis; +Cc: uzibalqa via Users list for the GNU Emacs text editor

------- Original Message -------
On Monday, September 19th, 2022 at 10:02 AM, Jean Louis <bugs@gnu.support> wrote:


> Do this:
> 
> {M-x customize-group RET savehist RET}
> 
> Find:
> 
> Hide Savehist Additional Variables:
> Repeat:
> [INS] [DEL] Variable: rcd-sample
> [INS]
> [ State ]: SET for current session only.
> List of additional variables to save. Hide
> Each element is a variable that will be persisted across Emacs
> sessions that use Savehist.
> 
> An element may be variable name (a symbol) or a cons cell of the form
> (VAR . MAX-SIZE), which means to truncate VAR’s value to at most
> MAX-SIZE elements (if the value is a list) before saving the value.
> 
> As that can save variables.

I did that, but although the new values get updated, the defcustom in the file  
used during init resets to the default values.

In my file I define

(defgroup tpframe nil
  "Set position of frame."
  :group 'convenience)

(defcustom frame-pos (cons 8 8)
  "Position of initial frame as (X . Y) ."
  :type 'sexp
  :group 'tpframe)







^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-19 19:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-18 14:29 Updating defcustom variables in elisp code uzibalqa
2022-09-19 10:02 ` Jean Louis
2022-09-19 19:14   ` uzibalqa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).