all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#12949: 24.3.50; request: use Customize to set local value (in addition to global/default)
@ 2012-11-21  0:09 Drew Adams
  2012-11-21 13:56 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2012-11-21  0:09 UTC (permalink / raw)
  To: 12949

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'
 






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

* bug#12949: 24.3.50; request: use Customize to set local value (in addition to global/default)
  2012-11-21  0:09 bug#12949: 24.3.50; request: use Customize to set local value (in addition to global/default) Drew Adams
@ 2012-11-21 13:56 ` Stefan Monnier
  2012-11-21 15:14   ` Drew Adams
       [not found]   ` <<0DE9F19E0AC2498EBF4A184ECF9469AA@us.oracle.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Monnier @ 2012-11-21 13:56 UTC (permalink / raw)
  To: Drew Adams; +Cc: 12949

severity 12949 wishlist
thanks

> 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.
 
Yes, adding the ability of setting buffer-local values would be nice.
Being to *save* buffer-local values would also be nice.


        Stefan





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

* bug#12949: 24.3.50; request: use Customize to set local value (in addition to global/default)
  2012-11-21 13:56 ` Stefan Monnier
@ 2012-11-21 15:14   ` Drew Adams
       [not found]   ` <<0DE9F19E0AC2498EBF4A184ECF9469AA@us.oracle.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Drew Adams @ 2012-11-21 15:14 UTC (permalink / raw)
  To: 'Stefan Monnier'; +Cc: 12949

> > 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.
>  
> Yes, adding the ability of setting buffer-local values would be nice.
> Being to *save* buffer-local values would also be nice.

Agreed.






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

* bug#12949: 24.3.50; request: use Customize to set local value (in addition toglobal/default)
       [not found]   ` <<0DE9F19E0AC2498EBF4A184ECF9469AA@us.oracle.com>
@ 2018-04-06 19:31     ` Drew Adams
  0 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2018-04-06 19:31 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 12949

> > > 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.
> >
> > Yes, adding the ability of setting buffer-local values would be nice.
> > Being to *save* buffer-local values would also be nice.
> 
> Agreed.

Emacs still needs this, IMO.  Sure wish someone would tackle it.

I guess that a library that wants to make an option _always_
be buffer local can just accompany the defcustom with
(make-variable-buffer-local 'the-option).  But the more
general behavior proposed here would be helpful.





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

end of thread, other threads:[~2018-04-06 19:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-21  0:09 bug#12949: 24.3.50; request: use Customize to set local value (in addition to global/default) Drew Adams
2012-11-21 13:56 ` 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

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.