gfp <[email protected]> writes: > >>>> C-h f setopt or >>>> (info "(elisp) Setting Variables") >>> >>> I am not sure why setq shouldn't be used anymore >> >> 1. ‘setq’ will *not* execute any ‘custom-set’ form that >> might be associated with the user option. But ‘setopt’ >> *will* execute any ‘custom-set’ form associate with a user >> option. Whether there exists a ‘custom-set’ form is up to >> the programmer who defined a given user option. There might >> be one or might not. The end-user is simply to use ‘setopt’ >> in order to have ‘setopt’ take this step, if any. >> >> 2. Unlike ‘setopt’, ‘setq’ will NOT emit a warning if the >> type of value provided by the user does not match the >> type of the corresponding variable declared by >> ‘defcustom’. >> > > I have got many "setq"s in my init.el file > because I copied them from the web, which refer to times before Emacs 29 > > So how can I find out, which ones to change into: setopt? > because, I guess, almost everything in my init.el file is like a custom-set >
One at a time, place point on each variable in your init file and type C-h v. Emacs will then display the "Describe variable (default [your-variable])" prompt. Press the return/enter key to accept the default. Emacs will display a description of the variable in a *Help* buffer. Scroll down in that buffer to see whether the description says that you can customize the variable. If it does, then the variable is a user option, and you should use ‘setopt’ for the variable. Otherwise, it is not a user option and you should use ‘setq’. Note that when a variable’s description in the *Help* buffer says that you can customize it, then you can use the ‘customize’ button (the text that is underlined) in the *Help* buffer or you can type the letter ‘c’. Either method will open the *Customize Option...* buffer, where you can change the value temporarily or save it for future Emacs sessions. -- The lyf so short, the craft so long to lerne. - Geoffrey Chaucer, The Parliament of Birds.
