unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Uwe Brauer <oub@mat.ucm.es>, emacs-devel@gnu.org
Subject: RE: defvar interactively, user-variable-p
Date: Sun, 18 Oct 2015 08:35:15 -0700 (PDT)	[thread overview]
Message-ID: <07bd8d82-eae6-47a1-a60f-37b490c6d58d@default> (raw)
In-Reply-To: <87wpukjp8r.fsf@mat.ucm.es>

> BTW pitty that this functionality is gone. Anyhow

Note, though, that you have commands `customize-set-variable'
and `customize-set-value', each of which does a part of what
`set-variable' does (a prefix arg to `set-variable' gives the
buffer-local behavior) - and more.

Those commands have the advantage that they not only type-check
your input (respecting the defcustom `:type') but they also
respect other defcustom keywords, such as `:set'.

`set-variable' respects `:type', but unfortunately not `:set':

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6578
http://lists.gnu.org/archive/html/emacs-devel/2010-10/msg00867.html
http://lists.gnu.org/archive/html/emacs-devel/2010-10/msg00839.html

My impression is that too few users are aware of
`customize-set-variable' and `customize-set-value'.  If the
(complete) behaviors of those commands were rolled into the
single command `set-variable' then users might take more
advantage of them.

And users who today still use `setq' in their init files
to set user options might then take to using that instead,
reducing problems due to ignoring `:type', `:set', and
`:initialize'.

I would also like to see defvar allow keywords `:type' and
`:set'.  That is, let you optionally specify the types of
allowable values and specify a setter function.

http://lists.gnu.org/archive/html/emacs-devel/2009-10/msg00668.html

Not only are defvar variables sometimes set by users, but
they can be set by other libraries.  Letting the defining
library control the allowable types would be a definite
benefit, IMO.  Use of such keywords would be optional, of
course.



      reply	other threads:[~2015-10-18 15:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-18  9:48 defvar interactively, user-variable-p Uwe Brauer
2015-10-18 10:39 ` David Kastrup
2015-10-18 12:13   ` Uwe Brauer
2015-10-18 12:25     ` David Kastrup
2015-10-18 13:59       ` Uwe Brauer
2015-10-18 11:52 ` Michael Heerdegen
2015-10-18 13:11   ` Uwe Brauer
2015-10-18 15:35     ` Drew Adams [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=07bd8d82-eae6-47a1-a60f-37b490c6d58d@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=oub@mat.ucm.es \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).