GNU bug report logs -
#14502
24.3; dired-load-hook should not be customizable
Previous Next
Reported by: Reuben Thomas <rrt <at> sc3d.org>
Date: Wed, 29 May 2013 13:07:01 UTC
Severity: minor
Found in version 24.3
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hello Lars.
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> So I wondered what it would take to fix this in Customize properly. But:
>
> (define-widget 'hook 'list
> "An Emacs Lisp hook."
>
> [...]
>
> :set (lambda (symbol value)
> (dolist (elt value)
> (if (fboundp elt)
> (add-hook symbol elt))))
I don't know how things were when that code was added, but currently it
has no effect, because no code exists to handle that :set
property. No widget type recognizes that property. IOW, there is a new
property defined, but there's no code to make that property do
something.
> (defun customize-set-variable (variable value &optional comment)
>
> [...]
>
> (funcall (or (get variable 'custom-set) #'set-default) variable value)
>
> (get 'gnus-load-hook 'custom-set)
> => nil
>
> So the setter is not used? Hm... Oh, it's only set if you say
>
> (defcustom ...
> :set ...)
>
> Right. So the :set in the widget is only used interactively? *tests*
> Nope, if I try to modify a hook in a Customize buffer, then it always
> overwrites the hook value.
>
> So, as usual, when trying to figure out how Customize works, it's...
> just... rather obscure.
See above. I hope it clarifies something, at least.
> But I think one (probably controversial solution) would be to add a
> `custom-set' property on all hook variables that would make it use
> `add-hook' instead of just overwriting the value. That would make
> Customize and add-hook coexist... but would also mean that you can't
> set a hook to a specific value with Customize, which will probably break
> something for somebody.
I think this solution would be good. As for the controversial part, I
think it would be possible to add some specific option that controls
whether to overwrite or not a hook when using Customize. Also, a
checkbox could toggle that option when customizing a hook interactively.
But one problem is that using defcustom for the option would complicate
things a little more than using plain defvar. For starters, every
hook would have to have a :set-after property with that option.
Best regards,
Mauro.
[Message part 2 (text/html, inline)]
This bug report was last modified 4 years and 268 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.