* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
@ 2010-04-19 16:22 Drew Adams
2010-04-19 17:06 ` Drew Adams
2010-04-19 17:22 ` Stefan Monnier
0 siblings, 2 replies; 14+ messages in thread
From: Drew Adams @ 2010-04-19 16:22 UTC (permalink / raw)
To: 5974
I have `custom-file' set to a particular file, different from my .emacs
(actually, I use `_emacs' on Windows).
I just tried `C-x n p'. I thought that I had enabled it years ago, but
apparently not. I hit `y' to enable it, then `y' to save it. A message
said that the customization was being saved to my `_emacs' file. And it
was in fact saved there.
That is wrong. I have a separate `custom-file' specifically so that
customization does not mess with my init file.
In GNU Emacs 23.1.95.1 (i386-mingw-nt5.1.2600)
of 2010-04-03 on G41R2F1
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags
-Ic:/imagesupport/include'
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2010-04-19 16:22 bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file' Drew Adams
@ 2010-04-19 17:06 ` Drew Adams
2010-04-19 17:22 ` Stefan Monnier
1 sibling, 0 replies; 14+ messages in thread
From: Drew Adams @ 2010-04-19 17:06 UTC (permalink / raw)
To: 5974
> I have `custom-file' set to a particular file, different from
> my .emacs (actually, I use `_emacs' on Windows).
>
> I just tried `C-x n p'. I thought that I had enabled it years ago, but
> apparently not. I hit `y' to enable it, then `y' to save it. A message
> said that the customization was being saved to my `_emacs'
> file. And it was in fact saved there.
>
> That is wrong. I have a separate `custom-file' specifically so that
> customization does not mess with my init file.
There is no option or face that corresponds to this kind of customization, so I
guess this is not so much a bug as an enhancement request:
If a user has defined variable `custom-file', then code that enables or disables
commands should place the proper `put' sexp in the `custom-file', not in the
init file.
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2010-04-19 16:22 bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file' Drew Adams
2010-04-19 17:06 ` Drew Adams
@ 2010-04-19 17:22 ` Stefan Monnier
2016-04-27 21:53 ` Lars Ingebrigtsen
1 sibling, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2010-04-19 17:22 UTC (permalink / raw)
To: Drew Adams; +Cc: 5974
> That is wrong. I have a separate `custom-file' specifically so that
> customization does not mess with my init file.
The reason for it is that enabling disabling such commands is not done
via Custom (and indeed, I don't think you can do it from Custom
currently).
But I guess it would make sense to extend the meaning of `custom-file'
from "the things managed by Custom" to "any Emacs-generated config code".
This said, the easiest way to get this result is to make
`enable-command' use Custom somehow.
Stefan
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2010-04-19 17:22 ` Stefan Monnier
@ 2016-04-27 21:53 ` Lars Ingebrigtsen
2016-04-28 10:41 ` Nicolas Richard
0 siblings, 1 reply; 14+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-27 21:53 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 5974
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> That is wrong. I have a separate `custom-file' specifically so that
>> customization does not mess with my init file.
>
> The reason for it is that enabling disabling such commands is not done
> via Custom (and indeed, I don't think you can do it from Custom
> currently).
>
> But I guess it would make sense to extend the meaning of `custom-file'
> from "the things managed by Custom" to "any Emacs-generated config code".
> This said, the easiest way to get this result is to make
> `enable-command' use Custom somehow.
That's the code that puts
(put 'narrow-to-region 'disabled nil)
into our .emacs files, right? Yes, it would be better if that was
handled by Custom. But how? Custom works by setting (variable) values,
not adjusting symbol properties...
Hm...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2016-04-27 21:53 ` Lars Ingebrigtsen
@ 2016-04-28 10:41 ` Nicolas Richard
2016-04-28 22:57 ` Lars Ingebrigtsen
0 siblings, 1 reply; 14+ messages in thread
From: Nicolas Richard @ 2016-04-28 10:41 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Stefan Monnier, 5974
Lars Ingebrigtsen <larsi@gnus.org> writes:
> That's the code that puts
>
> (put 'narrow-to-region 'disabled nil)
>
> into our .emacs files, right? Yes, it would be better if that was
> handled by Custom. But how? Custom works by setting (variable) values,
> not adjusting symbol properties...
We could add a defcustom like
(defcustom enabled-commands nil
"List of commands to enable"
:set (lambda (sym val)
(dolist (cmd val)
(put cmd 'disabled nil))
(set-default sym val)))
(code 100% untested)
--
Nicolas Richard
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2016-04-28 10:41 ` Nicolas Richard
@ 2016-04-28 22:57 ` Lars Ingebrigtsen
2016-04-28 23:08 ` Lars Ingebrigtsen
2016-04-29 14:21 ` Nicolas Richard
0 siblings, 2 replies; 14+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-28 22:57 UTC (permalink / raw)
To: Nicolas Richard; +Cc: Stefan Monnier, 5974
Nicolas Richard <nrichard@ulb.ac.be> writes:
> Lars Ingebrigtsen <larsi@gnus.org> writes:
>> That's the code that puts
>>
>> (put 'narrow-to-region 'disabled nil)
>>
>> into our .emacs files, right? Yes, it would be better if that was
>> handled by Custom. But how? Custom works by setting (variable) values,
>> not adjusting symbol properties...
>
> We could add a defcustom like
> (defcustom enabled-commands nil
> "List of commands to enable"
> :set (lambda (sym val)
> (dolist (cmd val)
> (put cmd 'disabled nil))
> (set-default sym val)))
Hm... the `set-default' wouldn't be necessary, would it?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2016-04-28 22:57 ` Lars Ingebrigtsen
@ 2016-04-28 23:08 ` Lars Ingebrigtsen
2016-04-29 14:21 ` Nicolas Richard
1 sibling, 0 replies; 14+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-28 23:08 UTC (permalink / raw)
To: Nicolas Richard; +Cc: Stefan Monnier, 5974
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Nicolas Richard <nrichard@ulb.ac.be> writes:
>
>> Lars Ingebrigtsen <larsi@gnus.org> writes:
>>> That's the code that puts
>>>
>>> (put 'narrow-to-region 'disabled nil)
>>>
>>> into our .emacs files, right? Yes, it would be better if that was
>>> handled by Custom. But how? Custom works by setting (variable) values,
>>> not adjusting symbol properties...
>>
>> We could add a defcustom like
>> (defcustom enabled-commands nil
>> "List of commands to enable"
>> :set (lambda (sym val)
>> (dolist (cmd val)
>> (put cmd 'disabled nil))
>> (set-default sym val)))
>
> Hm... the `set-default' wouldn't be necessary, would it?
But otherwise this seems like a good idea. We do potentially have
clobbering definitions -- where there is a
(put 'narrow-to-region 'disabled nil)
in the buffer, and then it's also customised...
But I don't really think this is much of a problem in practice.
If that defcustom form works, then I'm all for changing over the
enabled-command stuff to customise.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2016-04-28 22:57 ` Lars Ingebrigtsen
2016-04-28 23:08 ` Lars Ingebrigtsen
@ 2016-04-29 14:21 ` Nicolas Richard
2016-04-29 14:30 ` Lars Ingebrigtsen
1 sibling, 1 reply; 14+ messages in thread
From: Nicolas Richard @ 2016-04-29 14:21 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Stefan Monnier, 5974
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Nicolas Richard <nrichard@ulb.ac.be> writes:
>
>> Lars Ingebrigtsen <larsi@gnus.org> writes:
>>> That's the code that puts
>>>
>>> (put 'narrow-to-region 'disabled nil)
>>>
>>> into our .emacs files, right? Yes, it would be better if that was
>>> handled by Custom. But how? Custom works by setting (variable) values,
>>> not adjusting symbol properties...
>>
>> We could add a defcustom like
>> (defcustom enabled-commands nil
>> "List of commands to enable"
>> :set (lambda (sym val)
>> (dolist (cmd val)
>> (put cmd 'disabled nil))
>> (set-default sym val)))
>
> Hm... the `set-default' wouldn't be necessary, would it?
I think it is necessary, for if you eval:
(progn
(defcustom enabled-commands nil
"List of commands to enable"
:set (lambda (sym val)
(dolist (cmd val)
(put cmd 'disabled nil))
;; (set-default sym val)
))
(customize-set-variable 'enabled-commands '(upcase-region))
(describe-variable 'enabled-commands))
you obtain "enabled-commands is void", which is confusing. It probably
also becomes impossible to keep track of which commands were enabled via
customize.
Nicolas.
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2016-04-29 14:21 ` Nicolas Richard
@ 2016-04-29 14:30 ` Lars Ingebrigtsen
2016-04-29 16:31 ` Drew Adams
0 siblings, 1 reply; 14+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-29 14:30 UTC (permalink / raw)
To: Nicolas Richard; +Cc: Stefan Monnier, 5974
Nicolas Richard <nrichard@ulb.ac.be> writes:
> It probably also becomes impossible to keep track of which commands
> were enabled via customize.
Ah, yes. That's true.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2016-04-29 14:30 ` Lars Ingebrigtsen
@ 2016-04-29 16:31 ` Drew Adams
2016-04-29 20:20 ` Nicolas Richard
0 siblings, 1 reply; 14+ messages in thread
From: Drew Adams @ 2016-04-29 16:31 UTC (permalink / raw)
To: Lars Ingebrigtsen, Nicolas Richard; +Cc: Stefan Monnier, 5974
Please. You guys have hijacked this bug report to speculate
about using Customize to handle enabling/disabling commands
Please start a new bug thread - or better yet an emacs-devel
thread - for that.
THIS bug report is about the fact that if a user has a
`custom-file' the enabling gets recorded to ~/.emacs instead.
That's just plain wrong.
Surely this bug can be fixed independently of your thoughts
about a new design/feature for letting Customize handle
enabling more generally. You can always revisit this case
after you've implemented whatever you dream up for that,
but this bug is not that enhancement.
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2016-04-29 16:31 ` Drew Adams
@ 2016-04-29 20:20 ` Nicolas Richard
2016-04-29 22:32 ` Drew Adams
0 siblings, 1 reply; 14+ messages in thread
From: Nicolas Richard @ 2016-04-29 20:20 UTC (permalink / raw)
To: Drew Adams; +Cc: Lars Ingebrigtsen, Stefan Monnier, 5974
Drew Adams <drew.adams@oracle.com> writes:
> Please. You guys have hijacked this bug report
*sigh*
> THIS bug report is about the fact that if a user has a
> `custom-file' the enabling gets recorded to ~/.emacs instead.
> That's just plain wrong.
> Surely this bug can be fixed
AFAICT there is no bug : the code is behaving as expected and as
documented. It's a request for changing the current behaviour.
Nicolas.
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2016-04-29 20:20 ` Nicolas Richard
@ 2016-04-29 22:32 ` Drew Adams
2016-04-29 22:39 ` Lars Ingebrigtsen
0 siblings, 1 reply; 14+ messages in thread
From: Drew Adams @ 2016-04-29 22:32 UTC (permalink / raw)
To: Nicolas Richard; +Cc: Lars Ingebrigtsen, Stefan Monnier, 5974
> > Surely this bug can be fixed
>
> AFAICT there is no bug : the code is behaving as expected and as
> documented. It's a request for changing the current behaviour.
OK; it's an enhancement request (as I mentioned in my last msg
before today). Mille excuses for too-quickly calling it a bug.
The point of my msg today is that it makes sense to take your
interesting side discussion elsewhere.
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2016-04-29 22:32 ` Drew Adams
@ 2016-04-29 22:39 ` Lars Ingebrigtsen
2016-04-29 23:11 ` Drew Adams
0 siblings, 1 reply; 14+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-29 22:39 UTC (permalink / raw)
To: Drew Adams; +Cc: 5974, Stefan Monnier, Nicolas Richard
Drew Adams <drew.adams@oracle.com> writes:
> The point of my msg today is that it makes sense to take your
> interesting side discussion elsewhere.
It's not a side discussion. The `put' things are not going to move to
`custom-file', because they have nothing to do with Custom.
But they might "in effect" move to `custom-file' if we change how they
are implemented.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file'
2016-04-29 22:39 ` Lars Ingebrigtsen
@ 2016-04-29 23:11 ` Drew Adams
0 siblings, 0 replies; 14+ messages in thread
From: Drew Adams @ 2016-04-29 23:11 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 5974, Stefan Monnier, Nicolas Richard
> It's not a side discussion. The `put' things are not going to move to
> `custom-file', because they have nothing to do with Custom.
Good point. I retract my objection.
> But they might "in effect" move to `custom-file' if we change how they
> are implemented.
Actually, now that you've pointed out that they have nothing to
do with Customize (options, faces), I wonder whether where they
should go.
The point of `custom-file' is, on the one hand, to keep automatically
written Lisp code from mixing with hand-coded stuff, in ~/.emacs.
On the other hand, its point is to gather in one place only stuff
that is managed by Customize.
Typically (so far), we use other files for other automatically
written Lisp code: bookmarks, desktops, package stuff, savehist,
saveplace,...
Especially since we now have an Emacs-specific default directory
for such things, a separate file seems to make sense - not
`custom-file' (since this is not managed by Customize) but something
else.
As for the suggestion that this be handled by Customize: A priori,
I'm not too hot for that idea. I think it has enough trouble with
options and faces. ;-) But maybe someone has a good reason why it
should be Customize that manages these things.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2016-04-29 23:11 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-19 16:22 bug#5974: 23.1.95; enabling disabled cmd & saving doesn't respect `custom-file' Drew Adams
2010-04-19 17:06 ` Drew Adams
2010-04-19 17:22 ` Stefan Monnier
2016-04-27 21:53 ` Lars Ingebrigtsen
2016-04-28 10:41 ` Nicolas Richard
2016-04-28 22:57 ` Lars Ingebrigtsen
2016-04-28 23:08 ` Lars Ingebrigtsen
2016-04-29 14:21 ` Nicolas Richard
2016-04-29 14:30 ` Lars Ingebrigtsen
2016-04-29 16:31 ` Drew Adams
2016-04-29 20:20 ` Nicolas Richard
2016-04-29 22:32 ` Drew Adams
2016-04-29 22:39 ` Lars Ingebrigtsen
2016-04-29 23:11 ` Drew Adams
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).