all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: 12949@debbugs.gnu.org
Subject: bug#12949: 24.3.50; request: use Customize to set local value (in addition to global/default)
Date: Tue, 20 Nov 2012 16:09:19 -0800	[thread overview]
Message-ID: <A4DB12BA5406492A9A9974BE4F1DE9C1@us.oracle.com> (raw)

Customize provides not only persistence but also (a) type-checking and
(b) a fairly easy (if less than ideal) user interface for non-Lispers.
 
It is about *setting* option values, in addition to - even independently
from - *saving* them persistently.  A user can want to set a value
temporarily for different reasons.
 
If an option is buffer-local (yes, nothing wrong with that), then
Customize sets or saves the *default* value.  That's normal.
 
But it can also be useful in some cases to use the Customize UI not to
save the default value but to set the local value for various buffers.
Why?  Simply because in some cases setting the value can be easier or
clearer using Customize than using Lisp.
 
This enhancement request is to add an item to the Customize State menu to
set the buffer-local value, for the buffer where `customize-option' (or
whatever) was invoked, to the value as edited in Customize.
 
That lets a user invoke Customize from different buffers and set their
buffer-local values using the GUI.
 
But that requires a user to repeat `M-x customize-option' in each such
buffer.
 
An alternative possibility would be to add a dropdown menu/list to let
the user choose an existing buffer (or even multiple such), to set its
local value to the edited value.
 
This could be combined with the State menu: add a `Set Local for XYZ'
menu item for each existing buffer (XYZ, in this example).  If there are
more than some small number of existing buffers then these menu items
could be placed in a submenu: Set Local Value > XZY etc.
 
When the option is buffer-local, the current menu item `Set for Current
Session' would be changed to something like `Set Default Value'.
 
Here is one example where this might be helpful:
 
Library highlight-chars.el lets you highlight any set of characters.
You can specify the characters in the set using any of these methods,
any number of times:
 
* Specify a string of chars, to include the chars in the string.
 
* Specify the start and end chars, to include the chars in the range.
 
* Specify a character class, to include the chars in the class.
 
* Specify a charset, to include its chars.
 
Now suppose you want to highlight Lao chars in Gnus buffers and
[:xdigit] in .css buffers.  In that case, you want to make the option
buffer-local.  And it would be handy to be able to use the GUI of
Customize to set the option in each buffer.
 
In this case, you could use (setq hc-other-chars '(lao)) for one and
(setq hc-other-chars '([:xdigit:])) for the other.  But to do that
you would need to know the required Lisp.
 
More complex values (and more complex options) would require more
complex Lisp sexps.
 
The point is that the Customize GUI can be leveraged for non-Lisp users
to set option values, including local values, regardless of whether
saving the values makes any sense (it does not, for a local value).

In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2012-11-05 on MS-W7-DANI
Bzr revision: 110809 lekktu@gmail.com-20121105172930-a5gn0bwi4lndchhw
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -I../../libs/libXpm-3.5.10/include -I../../libs/libXpm-3.5.10/src
 -I../../libs/libpng-1.2.37-lib/include -I../../libs/zlib-1.2.5
 -I../../libs/giflib-4.1.4-1-lib/include
 -I../../libs/jpeg-6b-4-lib/include
 -I../../libs/tiff-3.8.2-1-lib/include
 -I../../libs/libxml2-2.7.8-w32-bin/include/libxml2
 -I../../libs/gnutls-3.0.9-w32-bin/include
 -I../../libs/libiconv-1.9.2-1-lib/include'
 






             reply	other threads:[~2012-11-21  0:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21  0:09 Drew Adams [this message]
2012-11-21 13:56 ` bug#12949: 24.3.50; request: use Customize to set local value (in addition to global/default) Stefan Monnier
2012-11-21 15:14   ` Drew Adams
     [not found]   ` <<0DE9F19E0AC2498EBF4A184ECF9469AA@us.oracle.com>
2018-04-06 19:31     ` bug#12949: 24.3.50; request: use Customize to set local value (in addition toglobal/default) Drew Adams

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=A4DB12BA5406492A9A9974BE4F1DE9C1@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=12949@debbugs.gnu.org \
    /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.